summaryrefslogtreecommitdiffstats
path: root/drivers/soc/fsl/qbman/qman_priv.h
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@nxp.com>2016-11-16 16:40:30 +0200
committerScott Wood <oss@buserror.net>2016-11-23 21:01:25 -0600
commit18058822768f4665e2132ddd1cb413a9033edf09 (patch)
tree64f89bcf17829fab7540e4f493f075274faa3e85 /drivers/soc/fsl/qbman/qman_priv.h
parent496bfa11de2e6805b63168d45c2f92edbeae54e2 (diff)
downloadtalos-obmc-linux-18058822768f4665e2132ddd1cb413a9033edf09.tar.gz
talos-obmc-linux-18058822768f4665e2132ddd1cb413a9033edf09.zip
soc/qman: Handle endianness of h/w descriptors
The hardware descriptors have big endian (BE) format. Provide proper endianness handling for the remaining descriptor fields, to ensure they are correctly accessed by non-BE CPUs too. Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'drivers/soc/fsl/qbman/qman_priv.h')
-rw-r--r--drivers/soc/fsl/qbman/qman_priv.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
index 5606d74c21d4..53685b59718e 100644
--- a/drivers/soc/fsl/qbman/qman_priv.h
+++ b/drivers/soc/fsl/qbman/qman_priv.h
@@ -73,20 +73,20 @@ struct qm_mcr_querycgr {
struct __qm_mc_cgr cgr; /* CGR fields */
u8 __reserved2[6];
u8 i_bcnt_hi; /* high 8-bits of 40-bit "Instant" */
- u32 i_bcnt_lo; /* low 32-bits of 40-bit */
+ __be32 i_bcnt_lo; /* low 32-bits of 40-bit */
u8 __reserved3[3];
u8 a_bcnt_hi; /* high 8-bits of 40-bit "Average" */
- u32 a_bcnt_lo; /* low 32-bits of 40-bit */
- u32 cscn_targ_swp[4];
+ __be32 a_bcnt_lo; /* low 32-bits of 40-bit */
+ __be32 cscn_targ_swp[4];
} __packed;
static inline u64 qm_mcr_querycgr_i_get64(const struct qm_mcr_querycgr *q)
{
- return ((u64)q->i_bcnt_hi << 32) | (u64)q->i_bcnt_lo;
+ return ((u64)q->i_bcnt_hi << 32) | be32_to_cpu(q->i_bcnt_lo);
}
static inline u64 qm_mcr_querycgr_a_get64(const struct qm_mcr_querycgr *q)
{
- return ((u64)q->a_bcnt_hi << 32) | (u64)q->a_bcnt_lo;
+ return ((u64)q->a_bcnt_hi << 32) | be32_to_cpu(q->a_bcnt_lo);
}
/* "Query FQ Non-Programmable Fields" */
OpenPOWER on IntegriCloud