From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0053.outbound.protection.outlook.com [104.47.40.53]) by dpdk.org (Postfix) with ESMTP id 9F6541B159 for ; Fri, 8 Dec 2017 06:22:37 +0100 (CET) Received: from BN6PR03CA0082.namprd03.prod.outlook.com (2603:10b6:405:6f::20) by SN2PR03MB2367.namprd03.prod.outlook.com (2603:10b6:804:e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Fri, 8 Dec 2017 05:22:36 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::108) by BN6PR03CA0082.outlook.office365.com (2603:10b6:405:6f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Fri, 8 Dec 2017 05:22:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Fri, 8 Dec 2017 05:22:32 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vB85MKGc013022; Thu, 7 Dec 2017 22:22:33 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Dec 2017 10:51:18 +0530 Message-ID: <1512710487-32388-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com> References: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131571841529841863; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(346002)(376002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(47776003)(2351001)(6916009)(6666003)(2950100002)(48376002)(77096006)(105606002)(4326008)(50466002)(2906002)(106466001)(305945005)(5660300001)(86362001)(356003)(76176011)(51416003)(8676002)(53936002)(81166006)(36756003)(33646002)(8656006)(85426001)(16586007)(104016004)(97736004)(296002)(68736007)(316002)(50226002)(498600001)(8936002)(54906003)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2367; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD003; 1:cs8/M+FAFSWggALHke+IGVscMWjeps0dmRV3qAQ3TDq4OVG5Of1M2Kg9F3xV5pazrAWKCaX7UZI0FlHZmftzPk0tsr5J7Q5US4fFyC5AzrxRtRp+QZPAjE98LNK8y3Io MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c05dba3-623d-4b8f-88c7-08d53dfbaf4b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2367; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2367; 3:m8L05jBPP5HrIv+ab7mVA3SvM/+t/SDqgOml+Q+yQF1yYuuNTfC2zHs3oX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cNvwPFzeORLr3UaWdjZlPAt2EZwjks1U8qb1G1fUZtAz0e+uH1mZqVLyMoRRxkwzMuudPXL2nUEWjIVvuviOFxQPYL7mKGtKw0Qin+6aIracJPD+MWIfamhr8FS4D8y3P+LUWt1zO+QoGum7CQqENS1x6rrCk3uyNnjX67SJA8x3Y2qMUASsDNnFwWrn5ZHD18KgczayhddIpzAwq530QI43fzxXnEpC4ZdRkQEpDG8qs5FrbruyiT5RU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231022)(10201501046)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(201703131430075)(201703131520075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123565025)(201708071742011); SRVR:SN2PR03MB2367; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2367; X-Forefront-PRVS: 0515208626 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2367; 23:dMVKok07zQ+WSBitiN7PDBCMdFGWRzG0cNCYUu9ze?= =?us-ascii?Q?40d3k92ipBpxHsn49QKcPgzi6SfpQf0wvTbDe1haS8+ap+3b8m42IwK8K5lh?= =?us-ascii?Q?tnXfZV17bNvKYWY6126aVknBqq8Cf2a6F6Ibm7pggmEvWsFT0IchW6MiHE1C?= =?us-ascii?Q?GfXF3RXWrXqwTqxXLenJYoostrwK2gd4+u36oZyfBrmFEdrmyN48C2ylchja?= =?us-ascii?Q?ZagwViasJVQ+cQIbIqikhWlzN+Xz4/HIsNRziUvOmcxgvEWhrA/3nFEDYcgz?= =?us-ascii?Q?wwotN0tPpGpMhZ7n8wgUUJyWSsIMjkzjrVn0QYJwGvRVU7PoPjYPkrq3ckIa?= =?us-ascii?Q?9/jgjMouyaVDc6mKY0iTD5WTmYv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UhAYAb06BRm63AaoKPyX0nJkkqAySs9ZHhp5fecVT5Dxsn8zjmEFhMS7pwZxzkuCQFUaZpTFtYyyh/baHmAXFDnPWYpUrDTlqu3I9bCuCYnHSEnGtuEnzpiN4ETnGFJ/JWBWjX87s71bncmGGaQD5idArUEFSwToGs/FTQHQwKaaXX9kG/oIy8a4zJYkiTPGhdY7fGVp0vGu528FpJIK8JllnTC5puI644F54iL6Ipc6/tRHJZGrVMMBa5TJ+G+sNNNWFVvKYdrAxuVsFTWPuD3E=; 5:OKRlI7KGaxJG7kN66D4zPPbsIu99mSuO+Rn5CafjHqiO+3z+VaErqo4hCDdzpgYDEgSTuf3kT0KDixOlgUSmCHcsmKp+B41JPr/s8PiudJKjqljztFNQlH4TKom7qJSaOi62uMkW5pgnaPk1Fs8nN6QQg4iREoGyLM75e4tHZ20=; 24:t/H1FAjjLMY6Etjh6v9jYhZMrBmw/VVVE0WfNRh8DxO+mnkjW0cEyDov+PcQcMoYPjbKnS14XSNECiFseskkEjHMGsyvVR61Em9gYDecu/c=; 7:NjfpuRlwv+g/jmLilTQM3Be4YpcnVRLyZIG1xbdAOarXy0PtM5959qJwLbdQzwl2SXpHqorTMADx/W9N7TGCvZKNC/psmuhAJ36yjEqXdcbRWslYbdwzh3/5bGR0tn8cYop6bePCUUbUuESuucIcnxNkZtrwtOEFbZVA1Y++8nIMONZTebOFBeekpU7rVnycS0qCj7gr1fiLYHfKFmzauo6mjp4lA5Z8uHHBpjisKCKMetIBbicfdAlaXqQP7Kud SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 05:22:32.7969 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c05dba3-623d-4b8f-88c7-08d53dfbaf4b X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2367 Subject: [dpdk-dev] [PATCH 05/14] bus/fslmc: expose platform soc value register 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: Fri, 08 Dec 2017 05:22:38 -0000 This patch expose the dpaa2 soc platform family type. This is required to make some soc variant specific decision during configuration and runtime. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 42 +++++++++++++++-------------- drivers/bus/fslmc/portal/dpaa2_hw_dpio.h | 3 +++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 17 ++++++------ 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index f00070f..a98991a 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -76,6 +76,9 @@ static struct dpio_dev_list dpio_dev_list = TAILQ_HEAD_INITIALIZER(dpio_dev_list); /*!< DPIO device list */ static uint32_t io_space_count; +/* Variable to store DPAA2 platform type */ +uint32_t dpaa2_svr_family; + /*Stashing Macros default for LS208x*/ static int dpaa2_core_cluster_base = 0x04; static int dpaa2_cluster_sz = 2; @@ -265,26 +268,6 @@ static int dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id) { int sdest, ret; - static int first_time; - - /* find the SoC type for the first time */ - if (!first_time) { - struct mc_soc_version mc_plat_info = {0}; - - if (mc_get_soc_version(dpio_dev->dpio, - CMD_PRI_LOW, &mc_plat_info)) { - PMD_INIT_LOG(ERR, "\tmc_get_soc_version failed\n"); - } else if ((mc_plat_info.svr & 0xffff0000) == SVR_LS1080A) { - dpaa2_core_cluster_base = 0x02; - dpaa2_cluster_sz = 4; - PMD_INIT_LOG(DEBUG, "\tLS108x (A53) Platform Detected"); - } else if ((mc_plat_info.svr & 0xffff0000) == SVR_LX2160A) { - dpaa2_core_cluster_base = 0x00; - dpaa2_cluster_sz = 2; - PMD_INIT_LOG(DEBUG, "\tLX2160 Platform Detected"); - } - first_time = 1; - } /* Set the Stashing Destination */ if (cpu_id < 0) { @@ -499,6 +482,25 @@ dpaa2_create_dpio_device(int vdev_fd, rte_free(dpio_dev); } + /* find the SoC type for the first time */ + if (!dpaa2_svr_family) { + struct mc_soc_version mc_plat_info = {0}; + + if (mc_get_soc_version(dpio_dev->dpio, + CMD_PRI_LOW, &mc_plat_info)) { + PMD_INIT_LOG(ERR, "\tmc_get_soc_version failed\n"); + } else if ((mc_plat_info.svr & 0xffff0000) == SVR_LS1080A) { + dpaa2_core_cluster_base = 0x02; + dpaa2_cluster_sz = 4; + PMD_INIT_LOG(DEBUG, "\tLS108x (A53) Platform Detected"); + } else if ((mc_plat_info.svr & 0xffff0000) == SVR_LX2160A) { + dpaa2_core_cluster_base = 0x00; + dpaa2_cluster_sz = 2; + PMD_INIT_LOG(DEBUG, "\tLX2160 Platform Detected"); + } + dpaa2_svr_family = (mc_plat_info.svr & 0xffff0000); + } + TAILQ_INSERT_TAIL(&dpio_dev_list, dpio_dev, next); RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpio.%d]\n", object_id); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h index e845340..a3240b2 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.h @@ -54,6 +54,9 @@ RTE_DECLARE_PER_LCORE(struct dpaa2_io_portal_t, _dpaa2_io); #define DPAA2_PER_LCORE_SEC_DPIO RTE_PER_LCORE(_dpaa2_io).sec_dpio_dev #define DPAA2_PER_LCORE_SEC_PORTAL DPAA2_PER_LCORE_SEC_DPIO->sw_portal +/* Variable to store DPAA2 platform type */ +extern uint32_t dpaa2_svr_family; + extern struct dpaa2_io_portal_t dpaa2_io_portal[RTE_MAX_LCORE]; struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id); diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index a1e30d6..f266d6d 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -93,6 +93,7 @@ DPDK_17.11 { DPDK_18.02 { global: + dpaa2_svr_family; dpaa2_virt_mode; } DPDK_17.11; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 1cd302d..577bd8f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -418,7 +418,6 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, { struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; - struct mc_soc_version mc_plat_info = {0}; struct dpaa2_queue *dpaa2_q; struct dpni_queue cfg; uint8_t options = 0; @@ -450,18 +449,20 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, /*if ls2088 or rev2 device, enable the stashing */ - if (mc_get_soc_version(dpni, CMD_PRI_LOW, &mc_plat_info)) - PMD_INIT_LOG(ERR, "\tmc_get_soc_version failed\n"); - - if ((mc_plat_info.svr & 0xffff0000) != SVR_LS2080A) { + if ((dpaa2_svr_family & 0xffff0000) != SVR_LS2080A) { options |= DPNI_QUEUE_OPT_FLC; cfg.flc.stash_control = true; cfg.flc.value &= 0xFFFFFFFFFFFFFFC0; /* 00 00 00 - last 6 bit represent annotation, context stashing, - * data stashing setting 01 01 00 (0x14) to enable - * 1 line data, 1 line annotation + * data stashing setting 01 01 00 (0x14) + * (in following order ->DS AS CS) + * to enable 1 line data, 1 line annotation. + * For LX2, this setting should be 01 00 00 (0x10) */ - cfg.flc.value |= 0x14; + if ((dpaa2_svr_family & 0xffff0000) == SVR_LX2160A) + cfg.flc.value |= 0x10; + else + cfg.flc.value |= 0x14; } ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_RX, dpaa2_q->tc_index, flow_id, options, &cfg); -- 2.7.4