From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0077.outbound.protection.outlook.com [104.47.2.77]) by dpdk.org (Postfix) with ESMTP id 0BD335B3A for ; Thu, 1 Mar 2018 08:35:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=R3kl7+RrA6nHHRVWDDkrvpFcgPguwq4jMgmI6xgwWQo=; b=GVsR5iRtR3oKcb/6nePXuh+pex/u94rEQ9/gurM0fyXJfE3PmeRcshrLVHCC9/ySF4Ul5OhuUku4jPxolicXKAilE7WFUcRbMOuGvHoSBjXUMhC9I0if0lc6WC6hgT3rufhHydR1eiMyz+VcbsLc16Vr43/1Bxw6SasFF4Deqag= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0753.eurprd04.prod.outlook.com (2a01:111:e400:8411::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 1 Mar 2018 07:35:00 +0000 From: Hemant Agrawal To: dev@dpdk.org, bruce.richardson@intel.com Cc: thomas@monjalon.net Date: Thu, 1 Mar 2018 13:03:12 +0530 Message-Id: <1519889597-5805-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> References: <1519752352-15442-1-git-send-email-hemant.agrawal@nxp.com> <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0043.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::29) To AM2PR04MB0753.eurprd04.prod.outlook.com (2a01:111:e400:8411::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0cc737ef-8fd8-451a-95d4-08d57f46f161 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM2PR04MB0753; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0753; 3:pdkZGc01+S5lVlSEPj+h8GBHVl9eyeFJM81/In5am5xR4P68rVQtarIvPFjR59lEjyj87T38PLa94DGKicSfUIBTJ9tEgTGmO3WdQckMZq4Ej1oK8urdMMtyZ+0uGqwCu42bqe8tcW7IU6B8cXuiM2lykbgk5GtgX8xuLx4JDMD7y6hoAalXfS337NRTH+ggSwhveEnw/WEyugRzb887HQ7sB87lpWjFYuUOtUx1Un5zxf0OOs+EM6AxWE7mYEVx; 25:/S6glVWXzdDi3JkipDYTxydna8NGbY1m6y6b6hLceIC8j9EWhQAuA4ugZpf+t/Nl1UG6ML996nj8rL9IoBAr1o5SuOir2k/AdUglnATCEzmksIOxjC+prbAAz98Q15HBTXTHhzOxF2mcCIC5MkZXDLV4Un5eKH9ED56a67XbP1WxFdxLX+zzb++yK/soXiNCbcSVNsjjp9vz8nbnuxvRt7N1XydheyaLsBdNK0yWj2Ul3fUjfXbVe3quN9LrMOe5R/YrXnGn7ci05yxW8FFnA68i4qkUuwrqjFcbvPCx3BVDWeiT5fPl/LTzaV8upk8Lo/Wx8rIaMrK/MhniVOGgWA==; 31:YwZCU7Q5DY3IgSQkTV1D4eJoxlO0CHAEFn74PGbYoylMKvWH4+FSddYEfHilIlJfHLlWSlGnbEBTmtSCmO9+s2QUaeFUZkXM+DThtyMuGP1+2Szno1+4xOkeTErEF0T8YCKlkKw5LCFV8b5O3PeAu+rNsI9qwPd8hbc49r6qBJ7BMOXXcMypuHSxQSqzcPOYlMOwvhLUWXaWcy43ptlW81S5Joy1a9UUTZUZHXIYImc= X-MS-TrafficTypeDiagnostic: AM2PR04MB0753: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0753; 20:VdR4oMDtMghdDf/t45/jZgHP0I/V5t08NlOUnLj9gf0UQ+E78g5mccgahQz/Quksz8hISLrcWZtPa2ABkPB35I6JP7f3iZ3Q96LmVBmojEovkoEPKtc7mOWqf1wG+wgvc1C6EKG7ZVCqPSPUvweInZIi8HKbgkRjDrGuGOEILUsgKYL33C0lQ2vhWgrbuPKhzNRpAgIOFaAZtkXlT1ukem1aH0AaHKeUeSEw77xNCzB6L1CFEr5ufBRnOnMHdSdQiNPw3Sof3+u4NxHJ/ACkoWqeeaA5Qx9Q7RaVGljq3LvmsIVYU0u41RVkUGMy2Qwn9A82BB9nCrc11TqNV6MZZh3pyTGQKEAQLjD8f+D2hrcETD2cPHx9JpPCiIl5ypy9JG8lsefPEGEBfH/h9StxJZSsJokdtA4O2II121tPpNlNFWT84Eof2Pw5xDmSH/zUHqx5sSaQjOuW89iMFqpb1paBrR+ledugFQ0/Up+GJB5XOxGA74k2pNQRb2J9ZGd7; 4:jFQi9HXHIL/S70uDhjjAYSZEl/J1L0rZjaYb7Ad48pXgzF93Tt8tN5cy0vCanSgAe7TcCL3TBg86lWDtGhgAyiNT5z5aM0sU0EmAE6chwf4kckKGU7SOYH86FvO4xCWnrbDyN2xQTuhS+9dBHcVrfPCzsQJsk/iF2r78TfhIAfmyMjHa3vEauzbYk0+SOnM3QRDIwRh4auUvE8+WrP0fyf3AjdHFGv/iBYGJBD1xeOtGgFjKueF3PF8IGtusss2cK0WeKVdSoZX1ey1HFTugK+JORriT2fweTOvgCW3JTD/3uTA5En9CMtikEPTEHI8x X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501224)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:AM2PR04MB0753; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0753; X-Forefront-PRVS: 05986C03E0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(39380400002)(366004)(346002)(39860400002)(199004)(189003)(7736002)(8676002)(26005)(16526019)(386003)(55236004)(106356001)(81166006)(50226002)(47776003)(81156014)(6506007)(66066001)(8936002)(16586007)(316002)(2906002)(4326008)(25786009)(6116002)(5660300001)(3846002)(186003)(86362001)(305945005)(6512007)(2950100002)(6666003)(97736004)(50466002)(48376002)(478600001)(5009440100003)(52116002)(36756003)(53936002)(68736007)(76176011)(51416003)(6486002)(105586002)(110426004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0753; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0753; 23:2/CTF07dwBmihVoDStWpLatQ+SNCv2z/BTdNF/uxC?= =?us-ascii?Q?oW+A/dJBW+rPoZMoKpt6XJvUubhGiJuLrmqZUdERBFmZeJNIf8K9M0cwrIqX?= =?us-ascii?Q?MSJEEcBTAiMXharVU+Hfu/XRCjEltWJnSTsRGnvY4RGhFXl5lgle+dV1Vabn?= =?us-ascii?Q?51rQ7jxlEuk9J2Ef/OeNRRhnhCcsX1uWS0sSkh0SJ+i/k4GYKFn/dBuHNAEv?= =?us-ascii?Q?a9G7jy67+QIBAgHmeq8kc/nH+tpiIP4av/a5SSh+rWrXmicYdHubw5P/xjF6?= =?us-ascii?Q?EZ3vPj7YxYgBimZxxk980GRWeDX3gT6ufiwwGZ/XMzyOTfNsTQr7zaTzzxH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ft-Exchange-Diagnostics: 1; AM2PR04MB0753; 6:FOe2Y2SbhQsyZ03YVntZS+dmaONl+ftVQeM1HJ4zkXK1Y4BPTB6B9tjQfVoMqCjcf2PreNNpbypmd2PyB8a1HPSSggCHzu/WM4K7Eeo5D2GMZWD9BakbvVjHbXu+jxyZq0fOeMCPf0BykMo/BVDTm51dWs0zWYWEHNO6XtubSfYke6Nk54L2Cs3wrBua5pEYQiB2RbYW2l+iH8ywZ+RPdPTIbRoABmCpxnuOQbICJC0EXjUD4LFpG8jxJAFKAJKYLsmdFj0TckOFKoz6tzCRNc83dfDfQ7bnC6eRjr+Qq89n/WTAvNfROIbp5/B8r1CKQiUIs9jjkdMoCRXNXcPwsYp/thuCEx8KPi/ipg8CI8Q=; 5:6uAa7JoIzaq8Peme/P6Ug1Oppw62h/cPdHEn/0BDCnGlUnfb0qj7jd4CaFnZaFgD9Mbs1HO8r/J1uUoUh224t4MDYK1/7yLYJrzRg3Fc3dgimECfmkxp6YdpwKYYkpMEHINgsZmjfWZjy7A/0wM1EHHfWqUBm/Vaf5FqEf/pbw8=; 24:GMlTPX0nvybR98ZkKZBO/7CUSHjwen51qyzIfUyiduz5khS7ZjWxFycIbb2/FGO5m7ADofiujm90Bck6PFV1h36AIpOMG8Qrte/tBz3R36E=; 7:nnQmHEhascCJ+jIcWTj55lIVG4ZAObIsHG180MZ0JRZLAJRT67FSa0kSIKat+nHtQIJFw4kdsjmFyrLL8gzfOxN05mLCW47PWGcHTNpwWPWuR9Yk8gdIQQM8A0zwgOBRCO2A4giL6d8T7x0qlVnoNrzsBEWD6fl1nTTBYdpqijsZaAWj3wG90qdSYBKjvEVjdeg7+C0GdDbTLel1AIArruUVSNwz2RTqx65ykucfA+CQiO2bAKsRoyVTrGeocknq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2018 07:35:00.9123 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0cc737ef-8fd8-451a-95d4-08d57f46f161 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0753 Subject: [dpdk-dev] [PATCH v2 05/10] bus/fslmc: add 32 bit functional support for ARM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 07:35:04 -0000 This patch adds the functional logic to make the dpaa2 drivers work on 32bit machine. Signed-off-by: Hemant Agrawal --- 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..0b460c4 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; +#ifndef 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, 2, 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