From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org, bruce.richardson@intel.com
Cc: thomas@monjalon.net
Subject: [dpdk-dev] [PATCH v3 05/10] bus/fslmc: add 32 bit functional support for ARM
Date: Wed, 14 Mar 2018 13:26:01 +0530 [thread overview]
Message-ID: <1521014166-3201-6-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1521014166-3201-1-git-send-email-hemant.agrawal@nxp.com>
This patch adds the functional logic to make the dpaa2 drivers
work on 32bit machine.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/fslmc/qbman/qbman_sys.h | 30 ++++++++++++++++++++++++++++--
drivers/bus/fslmc/qbman/qbman_sys_decl.h | 9 +++++++++
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h
index 846788e..2bd33ea 100644
--- a/drivers/bus/fslmc/qbman/qbman_sys.h
+++ b/drivers/bus/fslmc/qbman/qbman_sys.h
@@ -20,6 +20,9 @@
#include "qbman_sys_decl.h"
+#define CENA_WRITE_ENABLE 0
+#define CINH_WRITE_ENABLE 1
+
/* Debugging assists */
static inline void __hexdump(unsigned long start, unsigned long end,
unsigned long p, size_t sz, const unsigned char *c)
@@ -178,7 +181,11 @@ static inline void *qbman_cena_write_start_wo_shadow(struct qbman_swp_sys *s,
s->addr_cena, s->idx, offset);
#endif
QBMAN_BUG_ON(offset & 63);
+#ifdef RTE_ARCH_64
return (s->addr_cena + offset);
+#else
+ return (s->addr_cinh + offset);
+#endif
}
static inline void qbman_cena_write_complete(struct qbman_swp_sys *s,
@@ -191,11 +198,19 @@ static inline void qbman_cena_write_complete(struct qbman_swp_sys *s,
s->addr_cena, s->idx, offset, shadow);
hexdump(cmd, 64);
#endif
+#ifdef RTE_ARCH_64
for (loop = 15; loop >= 1; loop--)
__raw_writel(shadow[loop], s->addr_cena +
offset + loop * 4);
lwsync();
__raw_writel(shadow[0], s->addr_cena + offset);
+#else
+ for (loop = 15; loop >= 1; loop--)
+ __raw_writel(shadow[loop], s->addr_cinh +
+ offset + loop * 4);
+ lwsync();
+ __raw_writel(shadow[0], s->addr_cinh + offset);
+#endif
dcbf(s->addr_cena + offset);
}
@@ -224,9 +239,15 @@ static inline void *qbman_cena_read(struct qbman_swp_sys *s, uint32_t offset)
s->addr_cena, s->idx, offset, shadow);
#endif
+#ifdef RTE_ARCH_64
for (loop = 0; loop < 16; loop++)
shadow[loop] = __raw_readl(s->addr_cena + offset
+ loop * 4);
+#else
+ for (loop = 0; loop < 16; loop++)
+ shadow[loop] = __raw_readl(s->addr_cinh + offset
+ + loop * 4);
+#endif
#ifdef QBMAN_CENA_TRACE
hexdump(shadow, 64);
#endif
@@ -313,6 +334,11 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s,
uint8_t dqrr_size)
{
uint32_t reg;
+#ifdef RTE_ARCH_64
+ uint8_t wn = CENA_WRITE_ENABLE;
+#else
+ uint8_t wn = CINH_WRITE_ENABLE;
+#endif
s->addr_cena = d->cena_bar;
s->addr_cinh = d->cinh_bar;
@@ -333,10 +359,10 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s,
QBMAN_BUG_ON(reg);
#endif
if (s->eqcr_mode == qman_eqcr_vb_array)
- reg = qbman_set_swp_cfg(dqrr_size, 0, 0, 3, 2, 3, 1, 1, 1, 1,
+ reg = qbman_set_swp_cfg(dqrr_size, wn, 0, 3, 2, 3, 1, 1, 1, 1,
1, 1);
else
- reg = qbman_set_swp_cfg(dqrr_size, 0, 1, 3, 2, 2, 1, 1, 1, 1,
+ reg = qbman_set_swp_cfg(dqrr_size, wn, 1, 3, 2, 2, 1, 1, 1, 1,
1, 1);
qbman_cinh_write(s, QBMAN_CINH_SWP_CFG, reg);
reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG);
diff --git a/drivers/bus/fslmc/qbman/qbman_sys_decl.h b/drivers/bus/fslmc/qbman/qbman_sys_decl.h
index f82bb18..5640b04 100644
--- a/drivers/bus/fslmc/qbman/qbman_sys_decl.h
+++ b/drivers/bus/fslmc/qbman/qbman_sys_decl.h
@@ -15,6 +15,7 @@
/****************/
/* arch assists */
/****************/
+#if defined(RTE_ARCH_ARM64)
#define dcbz(p) { asm volatile("dc zva, %0" : : "r" (p) : "memory"); }
#define lwsync() { asm volatile("dmb st" : : : "memory"); }
#define dcbf(p) { asm volatile("dc cvac, %0" : : "r"(p) : "memory"); }
@@ -28,3 +29,11 @@ static inline void prefetch_for_store(void *p)
{
asm volatile("prfm pstl1keep, [%0, #0]" : : "r" (p));
}
+#elif defined(RTE_ARCH_ARM)
+#define dcbz(p) memset(p, 0, 64)
+#define lwsync() { asm volatile("dmb st" : : : "memory"); }
+#define dcbf(p) RTE_SET_USED(p)
+#define dccivac(p) RTE_SET_USED(p)
+#define prefetch_for_load(p) { asm volatile ("pld [%0]" : : "r" (p)); }
+#define prefetch_for_store(p) { asm volatile ("pld [%0]" : : "r" (p)); }
+#endif
--
2.7.4
next prev parent reply other threads:[~2018-03-14 7:58 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 17:25 [dpdk-dev] [PATCH 0/7] meson build support for dpaaX Hemant Agrawal
2018-02-27 17:25 ` [dpdk-dev] [PATCH 1/7] event/dpaa: fix include header Hemant Agrawal
2018-02-27 17:25 ` [dpdk-dev] [PATCH 2/7] dpaa: prepare for 32 bit compilation Hemant Agrawal
2018-02-27 17:25 ` [dpdk-dev] [PATCH 3/7] dpaa2: " Hemant Agrawal
2018-02-27 17:25 ` [dpdk-dev] [PATCH 4/7] bus/fslmc: add 32 bit functional support for ARM Hemant Agrawal
2018-02-27 17:25 ` [dpdk-dev] [PATCH 5/7] bus/dpaa: enabling dpaa compilation for other platforms Hemant Agrawal
2018-02-27 17:25 ` [dpdk-dev] [PATCH 6/7] bus/fslmc: enabling dpaa2 " Hemant Agrawal
2018-02-28 14:45 ` Bruce Richardson
2018-02-28 16:02 ` Hemant Agrawal
2018-02-28 16:33 ` Richardson, Bruce
2018-02-27 17:25 ` [dpdk-dev] [PATCH 7/7] build: add meson support for dpaaX platforms Hemant Agrawal
2018-02-28 14:44 ` Bruce Richardson
2018-03-01 6:10 ` Hemant Agrawal
2018-03-01 14:15 ` Thomas Monjalon
2018-03-09 16:49 ` Thomas Monjalon
2018-03-09 17:42 ` Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 00/10] meson build support for dpaaX Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 01/10] event/dpaa: fix include header Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 02/10] bus/dpaa: fix the BE compilation issue Hemant Agrawal
2018-03-01 12:22 ` Shreyansh Jain
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 03/10] dpaa: prepare for 32 bit compilation Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 04/10] dpaa2: " Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 05/10] bus/fslmc: add 32 bit functional support for ARM Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 06/10] bus/dpaa: enabling dpaa compilation for other platforms Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 07/10] bus/fslmc: enabling dpaa2 " Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 08/10] config: add dpaaX build support in common linuxapp Hemant Agrawal
2018-03-09 17:11 ` Thomas Monjalon
2018-03-09 17:22 ` Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 09/10] build: add meson support for dpaaX platforms Hemant Agrawal
2018-03-01 7:33 ` [dpdk-dev] [PATCH v2 10/10] build: add meson cross compile config for dpaaX Hemant Agrawal
2018-03-14 7:55 ` [dpdk-dev] [PATCH v3 00/10] meson build support " Hemant Agrawal
2018-03-14 7:55 ` [dpdk-dev] [PATCH v3 01/10] event/dpaa: fix include header Hemant Agrawal
2018-03-14 7:55 ` [dpdk-dev] [PATCH v3 02/10] bus/dpaa: fix the BE compilation issue Hemant Agrawal
2018-03-14 7:55 ` [dpdk-dev] [PATCH v3 03/10] dpaa: prepare for 32 bit compilation Hemant Agrawal
2018-03-14 7:56 ` [dpdk-dev] [PATCH v3 04/10] dpaa2: " Hemant Agrawal
2018-03-14 7:56 ` Hemant Agrawal [this message]
2018-03-14 7:56 ` [dpdk-dev] [PATCH v3 06/10] bus/dpaa: enabling dpaa compilation for other platforms Hemant Agrawal
2018-03-14 7:56 ` [dpdk-dev] [PATCH v3 07/10] bus/fslmc: enabling dpaa2 " Hemant Agrawal
2018-03-14 7:56 ` [dpdk-dev] [PATCH v3 08/10] config: add dpaaX build support in common linuxapp Hemant Agrawal
2018-03-14 7:56 ` [dpdk-dev] [PATCH v3 09/10] build: add meson support for dpaaX platforms Hemant Agrawal
2018-03-14 7:56 ` [dpdk-dev] [PATCH v3 10/10] build: add meson cross compile config for dpaaX Hemant Agrawal
2018-03-14 9:08 ` [dpdk-dev] [PATCH v3 00/10] meson build support " Bruce Richardson
2018-03-14 9:12 ` Hemant Agrawal
2018-03-15 17:10 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521014166-3201-6-git-send-email-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).