From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0078.outbound.protection.outlook.com [104.47.37.78]) by dpdk.org (Postfix) with ESMTP id 669B19B61 for ; Fri, 26 May 2017 08:52:03 +0200 (CEST) Received: from BN6PR03CA0035.namprd03.prod.outlook.com (2603:10b6:404:10c::21) by BL2PR03MB163.namprd03.prod.outlook.com (2a01:111:e400:c0d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 26 May 2017 06:52:00 +0000 Received: from BL2FFO11FD017.protection.gbl (2a01:111:f400:7c09::169) by BN6PR03CA0035.outlook.office365.com (2603:10b6:404:10c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Fri, 26 May 2017 06:52:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD017.mail.protection.outlook.com (10.173.161.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Fri, 26 May 2017 06:52:00 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v4Q6pQMh014894; Thu, 25 May 2017 23:51:59 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 26 May 2017 12:21:23 +0530 Message-ID: <1495781485-2236-19-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495781485-2236-1-git-send-email-hemant.agrawal@nxp.com> References: <1495445969-29199-1-git-send-email-hemant.agrawal@nxp.com> <1495781485-2236-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131402551209449637; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39450400003)(39840400002)(39380400002)(39850400002)(39410400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(104016004)(33646002)(498600001)(81156014)(5003940100001)(50466002)(8936002)(48376002)(50226002)(81166006)(106466001)(105606002)(8676002)(356003)(2351001)(5660300001)(36756003)(305945005)(8656002)(2906002)(47776003)(69596002)(2950100002)(77096006)(6916009)(6666003)(86362001)(38730400002)(53936002)(76176999)(50986999)(189998001)(54906002)(110136004)(4326008)(85426001)(560934005)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB163; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD017; 1:JftDn9ADepIrNURfdk2B6fjNfx70nD7y1ZGyzdJAV+T3rG032fgNEdQQAEQ6YMcOmJ7DzbaVA/k2gpN4+Bcc5+w2bEa+SB3WZPvK3BXsliH+qIWYfiMeJkRiuAqQLOI6q0MQLU42VZxqJbnSG5cUWb7mbo5T5IkVR/+LJmhFhUHcoW+LLT4oW1JFnJS+GJPgGNlLu6E907mWvpMZoCIqLmYlcqkSGRD8d9GQ86VOSxLKNJKjOck9cc4sVkOi9f8hWrErjCQ0MtJuQZECDxgJTFEt6K6F46NbrFeGinD2biA2ti2P8zbJyTnLdu3GcF3hUs3pbtzf/9vrxAJXMGTqMJ8STHbx5wTzJasC1ZJb68P9joeeHHtTUMDvJvb5o6NKx3kUhrMWJwj0gOdomYvDANxNV1FSgCv5wqX/VUT0kN8zXLeEBLIwH3jJmKB0hWPkrGA/hkFR+HJjXJMqvFJFGuxyVfVy55jhKNFzFXjcbFqKHmmmkSZ7YCuTkNgkaaJeYwA5u8TX2ijNFnS9E6vsvXE3pgAidTz38q8DuAYsnsBEQ5shnL19j9g84KJ+d/yn2XB3DJ8GheytkGJ5ai/+7pGD14/bQBQLcKmIrql+KIiNubV9lAqt5Qa0F+M1rNJiCscYnauuToM5pTTK5Y6UbUnldKn7X/M4swsOivBfEiGPSY0LX74sidBJvnywdkYY7OB/bX2XQf3H8dRQxUtEig== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL2PR03MB163: X-MS-Office365-Filtering-Correlation-Id: 69432cba-02cb-4dde-f744-08d4a403b5df X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BL2PR03MB163; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB163; 3:cRIBmGaQgQCKjwKmDu25Q97tRjim3cYsu43lDnGWhXwrGgPxG6TMhKjxnJZtL2iEI7xhdXsf912n/YUxreeXSEAWcskAKEorrbH50P0np+r0t7mzG0vffnug9XoWJ/sV8lc++VBTy8t984sUum+k1GyUt7omG4Wr6j6wXl2Q/9rWNReAMuYdQN/u4Jux/mHvt0+3xcZx+X47BWbe0nVdtJ9KQ4c3i3Qt9dGiGTsws5EfAXdTW7kfqK3SFvdOHGEeJ6im9Rg1KEKdAF776H0SEIJeLQD9SIeKhutDhtF0VZC/xyfSYL22gMRvCBU9L2ox6mBj2AHFkxbJPWYtgyxj4IvaRobWj4ZIm91hXpThlN+4QPC6Wkv+7JJ9ufuzOyP+RMMIPIMpU4uthxN3H4DHpIJuktX4Fr/jkamWbZx2oATIxM/PaMjjBhq7UaDXRNL4; 25:IDYFiJ4D/UoNO0TQF+/s1wMl52XNuNvEr56fuMdNso26ZNg1xaswBOofjBhwzqEte4ch22SIA6p4hz7X9BaG1c3uRGH6LDgNC48rB5149UMVloMV+1R3GM2d+uqHZLxEuRAryevC5NaOgSxs1KVorW7vkNCGTI2Pdp4YwI/sCtt1KfFgGbTUUhmdwTo2lPeZq0B4olM5xQKoyAteypQhyeMSnwPSvNWzH4iptqN4qU3cmBYdINOGpiOnCQusr0ceFhmK8bQZMKyQoQr0S2fcPBQwy/cHBQ2X872rIx5DnfMbhPeE2HiewxH06tlY3EhvaGdYAH3bz2HlMb4KnREa1YKfl5yNyx7Ery7Vg6RGOPYnGwwhnVo+rziPdh2hRR/PCnc7TKlaYXP9MtUTWtKQSQ6hAxsCYUGo2E3mY4NeC9kPcGp0YX1IEiFAHBtYmxyBoFmZmiiOz3ZpMOzIz1tpBNCfz3fWZd3lXR1XbzagxN0= X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB163; 31:Kck97rPyVrl8G+93RN8E9T6wDC/z7WRAQ+EvMjkZyJXzTIuyolcFvVS0onyUM5TWEyfFTUiiUQrAREQRoSzwfTbNEgO1t2qraYIouOGL89PdoGdLF479k57h4J0MlCzLcxJ5ksRxzogcJGKvpc1sE85uFkMu6cbWjGb0CmSw3IQfBYyhH8VbEs7JaPnMhkLg77BVBAqsyFVSvHnt4Ed1+akPZVU7YxQszSVfYIDYGr3eZIgPPOfDv1HeVeVMaTDyMCQptDXs+33dtn4lfzeG+Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025); SRVR:BL2PR03MB163; BCL:0; PCL:0; RULEID:(400006); SRVR:BL2PR03MB163; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB163; 4:3EQIW+92ibsrINifCg6VY1y6eO1/lkIcrYU8ewJ+Wgfdc87vQ7/QrihVvo8CePSkvtfzYBRFgeb0Mn+2A+WIwaceAYDX/2G8YL171i2yztLTkmMcNZEtRUKhBAHxO5dXHIB6GydwDz2ttfyEHd8EYM6eRoHt4srQ7NoYIiISJdH9RpY910zjoW4HeGBwckH+N5zgI+RlJCTltm7ffgviWT4pVzGipMevaRy2HJ0ZhWP79Q9GplzZ1xoZ5tRuiwikseN953N+DfAmBUvjpcLFTcT+Sjb2T6xnI6cTBqCzEVu+r2OOutxynkK2CuI6bO9BTUDxfVChtgxAvt1sbxuAZDJM4cti78r+E/FlORE0rzytmSkjVccMO3187hi5YxrhX3FjIvlPnUMCGdM/jF39PFub1FaGsr86z3kayArMN+U2byhvcyA077nL+jbujKKRTnILAaciEhJ8kyOz8ilxfot5NXHmmBlXV6/qc69lLZFlXxg1SazVSQQbXl3IGYgFkLC2OHDwmoGLyCO6Pz4y1/6JhcMkYUhDqotIzbCr4wl+opNDHhTv/yIrmSbRL1oYUMp98iDKjO48DONF15FUwSmO3v0+f7NIV2TcFPusf8T6958v6/GiClduqFY+BJ9IojfuqjvyisYEANE63onwEmhPyM0BII+pYLJ814rUO+n7g9W7F/gNcj8HS5gy1iayF+fOFaU/c3QA4O1Gbi2j0FvEa1JaFzCSZ/dYNUQvpmX+fpi+erhcsYzjd2WT1LVxDpseZBOsboafKvOpkOimKeSUrT3Ot5sI2HS6tULrlZAEzrdCfAtuZENO5H+kvnPPu6XFJgoPF42ZUJENGQ8x9v25O2mXfntGD58JdI6EyhlRyXadOCnAsSarTfNT0zMk1J9tAY8216no/jIOuiK/f+Vxd9TYn63vwXJBzrB4u8bCLpXR4EfUFMflWuW2d3VE X-Forefront-PRVS: 031996B7EF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB163; 23:FEyuep+PntkCtX6WT60ag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i7xDCbJUj/L6wZM23IjG7Ro5tZDw==; 5:d+h7Fjn6RnuYS4WLEcUc8zmIJ7UL9K5/6M/AjHvSN0RTlTbGreTC6EDtnxFokyLT4KhVQS6WB3X46Na7oXq81qH2Z4xyhcw9q4eagakVwwegDrKgU2wcTYlmKtjQxxd9yo0qBzzBkGq6XevH8t+g/FBWqlao9L4knEE/wE9NRgQNvvSkFMGi/Y8W1YkYIeIU; 24:1EchpcY5FA4aYrBp4whVklULPhy+Tdd/SuXnH9Hu77k7eBw5nZuWvza3p4GjvBejlpDgVyqcefCtB0GztIogO5wIBkAir8mOs3nw+8jlmn0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB163; 7:znr38q2niFnjK2wLu4Jd2HEZUrfAxAFTjYe/pHCP+BmDIfwUZ0Z56fN5ebdaVVjSEuT2zpbr4obN8Pk3XIeia65bcL8CoEVd6y45/u1JkYCpzGf7L2m8iPawrwH/9A36WOW+g2ytim4s0uBzIIqP/wysKwira9ZsGeeL9TX0bbXN+rMY/6kUkvA/Cvm9YxrKBVJDR9Ff8m/4KGPnCd+t91jx5uhYrXuclv2vMkVj0jraDx0En/74ieHxvDLD0d2vXHFlLxsBMC+2UJFxiGU9x2zrXSNWMZNgZf9fYtZHGkVXiD6sjuASTh5z31/r3W/3bT/fs1SLynwz+qZyzvFL7A== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2017 06:52:00.7109 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB163 Subject: [dpdk-dev] [PATCH v4 18/20] bus/fslmc: add support to detect soc version 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, 26 May 2017 06:52:04 -0000 This is required to configure the stashing destination based on the cluster size. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/Makefile | 1 + drivers/bus/fslmc/mc/dpmng.c | 81 +++++++++++++++++++++++ drivers/bus/fslmc/mc/fsl_dpmng.h | 99 +++++++++++++++++++++++++++++ drivers/bus/fslmc/mc/fsl_dpmng_cmd.h | 54 ++++++++++++++++ drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 19 +++++- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 ++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 2 + 7 files changed, 258 insertions(+), 2 deletions(-) create mode 100644 drivers/bus/fslmc/mc/dpmng.c create mode 100644 drivers/bus/fslmc/mc/fsl_dpmng.h create mode 100644 drivers/bus/fslmc/mc/fsl_dpmng_cmd.h diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index 973d279..7d9f4b6 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -63,6 +63,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ qbman/qbman_portal.c SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ + mc/dpmng.c \ mc/dpbp.c \ mc/dpio.c \ mc/mc_sys.c diff --git a/drivers/bus/fslmc/mc/dpmng.c b/drivers/bus/fslmc/mc/dpmng.c new file mode 100644 index 0000000..7fe1787 --- /dev/null +++ b/drivers/bus/fslmc/mc/dpmng.c @@ -0,0 +1,81 @@ +/* Copyright 2013-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include +#include + +int mc_get_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + struct mc_version *mc_ver_info) +{ + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION, + cmd_flags, + 0); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + DPMNG_RSP_GET_VERSION(cmd, mc_ver_info); + + return 0; +} + +int mc_get_soc_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + struct mc_soc_version *mc_platform_info) +{ + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_SOC_VERSION, + cmd_flags, + 0); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + DPMNG_RSP_GET_SOC_VERSION(cmd, mc_platform_info); + + return 0; +} diff --git a/drivers/bus/fslmc/mc/fsl_dpmng.h b/drivers/bus/fslmc/mc/fsl_dpmng.h new file mode 100644 index 0000000..7dbc825 --- /dev/null +++ b/drivers/bus/fslmc/mc/fsl_dpmng.h @@ -0,0 +1,99 @@ +/* Copyright 2013-2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __FSL_DPMNG_H +#define __FSL_DPMNG_H + +/* Management Complex General API + * Contains general API for the Management Complex firmware + */ + +struct fsl_mc_io; + +/** + * Management Complex firmware version information + */ +#define MC_VER_MAJOR 10 +#define MC_VER_MINOR 1 + +/** + * struct mc_versoin + * @major: Major version number: incremented on API compatibility changes + * @minor: Minor version number: incremented on API additions (that are + * backward compatible); reset when major version is incremented + * @revision: Internal revision number: incremented on implementation changes + * and/or bug fixes that have no impact on API + */ +struct mc_version { + uint32_t major; + uint32_t minor; + uint32_t revision; +}; + +/** + * struct mc_platform + * @svr: system version (content of platform SVR register) + * @pvr: processor version (content of platform PVR register) + */ +struct mc_soc_version { + uint32_t svr; + uint32_t pvr; +}; + +/** + * mc_get_version() - Retrieves the Management Complex firmware + * version information + * @mc_io: Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @mc_ver_info: Returned version information structure + * + * Return: '0' on Success; Error code otherwise. + */ +int mc_get_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + struct mc_version *mc_ver_info); + +/** + * mc_get_soc_version() - Retrieves the Management Complex firmware + * version information + * @mc_io: Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @mc_platform_info: Returned version information structure. The structure + * contains the values of SVR and PVR registers. Please consult platform + * specific reference manual for detailed information. + * + * Return: '0' on Success; Error code otherwise. + */ +int mc_get_soc_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + struct mc_soc_version *mc_platform_info); + +#endif /* __FSL_DPMNG_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h b/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h new file mode 100644 index 0000000..e5ebc11 --- /dev/null +++ b/drivers/bus/fslmc/mc/fsl_dpmng_cmd.h @@ -0,0 +1,54 @@ +/* Copyright 2013-2016 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __FSL_DPMNG_CMD_H +#define __FSL_DPMNG_CMD_H + +/* Command IDs */ +#define DPMNG_CMDID_GET_VERSION 0x8311 +#define DPMNG_CMDID_GET_SOC_VERSION 0x8321 + +/* cmd, param, offset, width, type, arg_name */ +#define DPMNG_RSP_GET_VERSION(cmd, mc_ver_info) \ +do { \ + MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mc_ver_info->revision); \ + MC_RSP_OP(cmd, 0, 32, 32, uint32_t, mc_ver_info->major); \ + MC_RSP_OP(cmd, 1, 0, 32, uint32_t, mc_ver_info->minor); \ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPMNG_RSP_GET_SOC_VERSION(cmd, mc_soc_version) \ +do { \ + MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mc_soc_version->svr); \ + MC_RSP_OP(cmd, 0, 32, 32, uint32_t, mc_soc_version->pvr); \ +} while (0) + +#endif /* __FSL_DPMNG_CMD_H */ diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 62c03a2..668d987 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -61,6 +61,7 @@ #include #include "dpaa2_hw_pvt.h" #include "dpaa2_hw_dpio.h" +#include #define NUM_HOST_CPUS RTE_MAX_LCORE @@ -179,6 +180,22 @@ { int sdest; int cpu_id, 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"); + } + first_time = 1; + } /* Set the Stashing Destination */ cpu_id = rte_lcore_id(); @@ -191,8 +208,6 @@ } /* Set the STASH Destination depending on Current CPU ID. * Valid values of SDEST are 4,5,6,7. Where, - * CPU 0-1 will have SDEST 4 - * CPU 2-3 will have SDEST 5.....and so on. */ sdest = dpaa2_core_cluster_sdest(cpu_id); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index b83ddd9..a2d3bd0 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -46,6 +46,10 @@ #define lower_32_bits(x) ((uint32_t)(x)) #define upper_32_bits(x) ((uint32_t)(((x) >> 16) >> 16)) +#define SVR_LS1080A 0x87030000 +#define SVR_LS2080A 0x87010000 +#define SVR_LS2088A 0x87090000 + #ifndef ETH_VLAN_HLEN #define ETH_VLAN_HLEN 4 /** < Vlan Header Length */ #endif diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index a4bb343..43f3354 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -53,6 +53,8 @@ DPDK_17.05 { DPDK_17.08 { global: + mc_get_soc_version; + mc_get_version; qbman_result_SCN_state_in_mem; rte_global_active_dqs_list; -- 1.9.1