From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40048.outbound.protection.outlook.com [40.107.4.48]) by dpdk.org (Postfix) with ESMTP id 6C6E15F1F for ; Wed, 14 Mar 2018 08:58:06 +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=To8CPbx0zPrhJRiP/hS3GfrkUqDoIpo6VimzlVgrTkU=; b=yNMU8jzSAvYzbbIuTfp3mo3iJsfD+5zPDTDJIBEuRiVRYRf82YLjcxe/Y4/ZYarq6xXiyY+szEzIkdRF8CJ7VjQGtrs9NhXaYGPtWo6ZJAQLSs78S7VVyZr7DxUmRDTfBg8KUZQBwTuwPbkXGSvMGuiijwq9afJ04Qejz3eivdw= 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 AM2PR04MB0754.eurprd04.prod.outlook.com (2a01:111:e400:8411::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 14 Mar 2018 07:58:04 +0000 From: Hemant Agrawal To: dev@dpdk.org, bruce.richardson@intel.com Cc: thomas@monjalon.net Date: Wed, 14 Mar 2018 13:26:01 +0530 Message-Id: <1521014166-3201-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521014166-3201-1-git-send-email-hemant.agrawal@nxp.com> References: <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> <1521014166-3201-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: BM1PR0101CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::18) To AM2PR04MB0754.eurprd04.prod.outlook.com (2a01:111:e400:8411::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 68743594-b1bd-4320-4122-08d589815171 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0754; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0754; 3:EHW/3XmlRHUUAKvZQf5F0uAQ5w9mE4esVSprvYiyujrLsOkH2+i3+Q/qwGHmVgCi93mwWfE3UvQvWJuFRToM78wmvI909p1AP5yL2t2Ynpw31JpPhjBZcgVD3z2ddLkcLt3K002SyUFlQapvFQww05gc3YqgZQkyd/9z5E45sdbxZ5YI45sWX4VNMVmLDT9cZZizM7dnX9IN3lyI5AshdaA/zPloP74tGEkg5OcEc5kl6I90I/bExCVK+WJKYMNx; 25:uzEK+m4YPAXbJtqdQcJrHLQakjqAKJezr5XMmcXQ+Pixx0tEs2iZyyJxxaVRV9mvMX4s06plxjEhuTvInHMXKI+ULz3LzsRwjzaIGZYega7I9QrKRnUc3P2vJkV7Pxu8Fd9gbvbJMfPV7ex8NO+v7Stwd6QHkhBNWaXslXs9QKOuVEatRA4T+EB9MqqGwJVUMHBZS4qRaW3HM/4L1nUoOUCWGO1IGBIFs1iChHi3v4n4ILz9s4ugFcPuQLT2VK6fGr/U8JzbmtI9OR7a3mX5fnUfoANFRnJ8VbdKgvM1K4vgX/eTyO0lnGTrTZWraMeDzpvqwpBgLcDeuigmFnasvA==; 31:zVe8Zq4uSx+ICad2JinukYOJQdD+L6xoRIxvA+voxWHpk1zNS7ni852oIL2IlMsD6OQCRFYE0/rOJCgqUnSYBlYtG1brJUyhBWN/6HwMzbU4LaQkjbGCd6jZTCAFLTt/32RPcmxxO0KT8hvq6OGgmRS9cMvim+Sx6ck9thKDuGchxiXeGCn+Bb0PEepDdA6NHWCt/MlqqnP4wQRW5fkfE/Q2pAasBaIroa6PIe5B9UA= X-MS-TrafficTypeDiagnostic: AM2PR04MB0754: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0754; 20:D1tMi6nQb5cC40YeAhijTxg5Fre46QTB+WMGJ+cu++fnOzsPS3I2btT5zrl3i3deYXlJZrknoCxcGxxmpKbqPOS9pP93zybEUVid4w+ALw+fSUThfwTIEM312LvDJc7tlz7lNJJB/MXR+7nxohWL2mzJ0pasXf3dw74eaAZhkfP21SC2AdpB1tnCGhKkoXlyytpPf/0yHFAt1gscQp9b5V53ZOpB75RxnuKqR3GZoyVmWe9z+p2Gopf3wowINfK42FXy30+GCUBNclABBKmut2rYaW6uqcWRtx6+KEAlHVRgK7KG97JCke0Lds4Pt65bmZV+ityscQYa6fuDPxt47dWGMrywWFrWtDDULhj1P2h6REb9g3aGpK6613xhJ0gEYr657ZLPTrRFbqOXg4gdzRJA1LJXpNzT6qnylSeeEjLwqxKnIuQNq4RVcHHVvrVkDLy1DcxPtGxREAkrE33IwuLbK+tlGhLA5GmgUFpSKc+5cPMSBf61Y8bKmd5GaGph; 4:pkjKFQ2zsfIgOuLxU9hGwGRIIlXGyUJySxX3AtoSWHCpbVRdmKiRCbke7B5cbq+L2zByo1RHK+qfmlsL2rNzTy0w/Wy91c58/vwjzr/w5kN173dLUpykU6KXEr83FSQUVXCT2DM7RD2oV6TqcLybyeDJqbHnOQMX4UK8YL5JHfV8Y0A1c9IN1nnlI54puh4qMMTKOv87TWLGaH9lo9xd7Ee/HpzZFuYCGk5zn71Oz5ibo4CRk/MyoFx+RFFaRXhiMbH4bubnrc08JqIMHrTjJr8tvU+t4Ssvqu7wygPDybzqghcBTHNS8vFYTjBnrh0Y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501244)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM2PR04MB0754; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0754; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(376002)(39860400002)(346002)(39380400002)(396003)(366004)(199004)(189003)(316002)(4326008)(16526019)(47776003)(6506007)(66066001)(186003)(52116002)(86362001)(386003)(55236004)(48376002)(2906002)(97736004)(68736007)(26005)(5660300001)(25786009)(105586002)(76176011)(51416003)(6512007)(50466002)(5009440100003)(6666003)(36756003)(16586007)(81166006)(6486002)(8936002)(106356001)(305945005)(7736002)(50226002)(6116002)(53936002)(81156014)(8676002)(2950100002)(3846002)(478600001)(110426004)(473944003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0754; 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; AM2PR04MB0754; 23:WdgBBaqzinY8vuwADkM+tpUh/4qsY4ccNSa+4pKJK?= =?us-ascii?Q?L9wHrIzW+cTeJWX01Lhccjl+Zwlij3tpSbbYi2VvYJAXHTIPa9b1g97HohYC?= =?us-ascii?Q?S9M7xO7jiJQiJWa1p58GU3df4RlZx/wMNU7PuOp99cNSbYTNv1ebMdv7ZbYI?= =?us-ascii?Q?+SYaIH5Zxs4dTdNH10oEDtSXNivXPK0pLXj5Hq+6xHKrd2mI+gdluGUJMAdl?= =?us-ascii?Q?vc+M9Eco8sTydHsIVMDNg9YFQhztNihr7WW5aQTcnoGOpj2lDcNYAlAZ3rq6?= =?us-ascii?Q?kOkDqGtJ78ECgwige69pNnObyTfVpz3Duero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q9gdnqBFyTi81nOholocwfeTtC+EdLWy1MdElM3T6Yxta5W4gMxd58kiSlmMJyZhAQkB4AeL+UEAWFlyQcFkBtHWxPdAQdp5tqRfFebe+c22LO6vPRGtRuirp+NcJJdfo+3OEOq+HaVXKsmRqp7fwNFfPO+gVs8tinz8iTEjoVy1Q9n0xrXZu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 07:58:04.5455 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68743594-b1bd-4320-4122-08d589815171 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0754 Subject: [dpdk-dev] [PATCH v3 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: Wed, 14 Mar 2018 07:58:06 -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..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