From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0059.outbound.protection.outlook.com [104.47.33.59]) by dpdk.org (Postfix) with ESMTP id 5A8855592 for ; Thu, 29 Dec 2016 06:14:34 +0100 (CET) Received: from CY1PR03CA0026.namprd03.prod.outlook.com (10.174.128.36) by CY4PR03MB2471.namprd03.prod.outlook.com (10.168.165.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Thu, 29 Dec 2016 05:14:33 +0000 Received: from BL2FFO11FD017.protection.gbl (2a01:111:f400:7c09::123) by CY1PR03CA0026.outlook.office365.com (2603:10b6:600::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Thu, 29 Dec 2016 05:14:33 +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;nxp.com; dkim=none (message not signed) header.d=none; 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.789.10 via Frontend Transport; Thu, 29 Dec 2016 05:14:32 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBT5DOHl010218; Wed, 28 Dec 2016 22:14:29 -0700 From: Shreyansh Jain To: CC: , , , , , Hemant Agrawal Date: Thu, 29 Dec 2016 10:46:24 +0530 Message-ID: <1482988612-6638-6-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> References: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131274620727120637; (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)(7916002)(336005)(39860400002)(39450400003)(39840400002)(39410400002)(39380400002)(39400400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(2351001)(69596002)(2906002)(50986999)(4326007)(105606002)(86362001)(48376002)(50466002)(77096006)(5003940100001)(106466001)(68736007)(104016004)(6916009)(6666003)(97736004)(189998001)(81166006)(38730400001)(110136003)(5660300001)(2950100002)(76176999)(47776003)(81156014)(8936002)(85426001)(36756003)(33646002)(8676002)(50226002)(356003)(8656002)(305945005)(92566002)(626004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2471; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD017; 1:Dyn/TvcwNmkWzOtytTsLacA+M5pxKnqwe2WtkO1CCL4JFabCrHmsXhjF5UQbgkm0HJZGNgIdWNgYsCNUDuw3NO0C21n+i0XQlTZPo+TEV4RvpheZn7ZqtWVwuR7GIncAaj+hWf94ui3wc/NWVdkH3rC6eWKNWAjLHTrVHRwvVERP07pTWyfbl/IYVRp2b4wPwdsRIcCHWN7h92rEr5d8M3yjoPD8thr6eyOSoIcBV5IVsWemN2vggK8IqpIrqhOvwbmM009riALjDbZnf+056iRHrV3c5xHTHSJQwzdWJVOnS39aQ9AupHruW5WUo3pHMIGBNAXkckvDcck4IHxF0muDKnNnv4se2K0H9Tz6gtm/ZkDBoux3Pp0GnKomu0bvRzuI7Y7+6oNfO3lMA4tpYfKkRjKmK7spnLcVWa7qeTErrQebiLwAudABgwqgnYXY0Wlqw1zAkVPN4lpII3a7v7yDAnLKZZo0sHII6z4Rd8FMf6Plis+RAc25eksS26DbevoCqfrVzrsI8gaSO8BDvisePsqyU/xHt5r6wf+BSpL3QlnJFg/jF1W0+J7zn+6XMEccnJIiDAcg4mZAwY6FhY2Nse5vfA9QIDuaHHS3WqMKtzyY9l42XqZwFOPIhKhWVAUZWCEprMG52np5EVL18SIqJ4TehVgPKWOp5MJtQF4XLPf99KO21VNJTGZ+K/b28mJL39MWdxGAv3EOBBK04Cu//zsKs4YedE4b1rB4XoNBiDpIjwQ/1GoiBRRQ7f4qiJ0c1AxHAfq4HypBQqW7ZQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 279a4b19-f918-4753-719c-08d42fa992eb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2471; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2471; 3:qFREVdArHwphLzovU6ohMrglZheIN+ON62McgpIHoeoMDuMI6SnRE78E8Dn8XYLazO3Nwfc7t7jqEsdRRBXFmBKtthuu9Nb7jz87aen+DkPryNvmGs+VL5pP5zw6wI2bwUY24w9mHTwLV6/LfdwhKwFTKcIpnc9Y3ZxYWw8mbnqYfqP7bKPOH0HTlzsHHU2GvaiIg+V5JfmnSfB2axP7kLTUeBd8xPLJFHQ+F4yAVuH+qkvwx2wVClQXSzHt6Jmu798u4nalGnT1BhtABaZqiyqoORy11g0IENjde4q7y06UA6W18Z42wLYERkG+jmZ3A/oAYQAec39VkzsqX1JEWLWpxDRr2gMk+Iw9hRbntnU= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2471; 25:f535ceBGzOWwTxHUdjmvTV1GfinLR92dTFXp+SmGYHgZOug+cFr7Nuvz1ih4o0Mn8Ic8OpcNkf6jCik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117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13024025)(13023025)(13015025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:CY4PR03MB2471; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2471; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2471; 4:WfreDkureTmDiGoGJdAkYwUmrpF50O0OQitI/NmlHwptxBdn+173QPayzv7o6q5fdSEWeDwCFE4mgdbBAYRwvusSSxUCLMy0mV61+buhEWs0IZ58ek2nprm7wgSAyUlt7b+bcz22V3JWfLoQIJ87ZLE6uYvZqP7lRxfQ2Urfqxf4iEBVAhu8daxq/51kc8f8HlBPGplUmlHivZdhB09H3HjxuL6Vlm2ARkliKq6LqM9kEpGlkbULx9ctMQgYvH79eDpxsxA/dFeWCB0hZ+e9k8oexMaVvo3QvdcF9formO1h49GKs3tQyG0u3hdioEdpnUs4CEc3EMZoELk+cy+kArtdhhkMSWycYH21/naRC/hsql0k77yTvnbWvsRltq/SaM6MWQ0YjO7H/WwFRaebSZXHsZWRUj/lEacLItaxWgkjJYnIcNWWWx0Q5yx0MGj3M/xDp+ZPaqarH+LiSlx/Czu2VVLwLzudKpLmw4rMNWprYsl9x72LbcSbO4ZtJE6Fw7X8Oftior/3rcQwq7H/HwjqTD2GTfsFQKTjheSqMzhsbiMLNKyweZPd1Gbo37ZureujJv3HxeK/upBYahZ9iy7TshrKaJMZ2bSeDKxqor5M/g6BH8ZzRyzIZsMdGBl462X3+Ky4CUThpydFjKnd8hB3ncQWn7HA0bSAnBJY7r+NQqOG55fC7qLTrCCcCGwnlgsarCzZemEtRShENypIKFfi1316NyaWyffgdkKDZ3gLhUXtf+W/7lhdTOy5scKc X-Forefront-PRVS: 01713B2841 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2471; 23:yklc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rJsVXoWHAfw13HJIpNPwjLIg9/+hOiyWW0Ee98D65imAD6dFpy5zqroF4I0+X5p+EzSaJf0IP0i7J+SJmBWGkPhEwETExtE+douJACTz1BQunaTkOhWCVrdsiRc8n+Gm6pyxEiThbacW; 24:qH/Jihz78MkGV98PxYJJAG9cDIafJ39N8w3HQ0u9zDnjzBXxjRar6pe9DboqVW9U5V4MivWQqJHH8Af0/0O5ImrltkwPw9zQvkE51rsjFGs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2471; 7:bZcsVZ4tHzgYAivPYBv6vkeFdB4t1SZ7pju3NHhTZyNZMUJigYHv4MxQG2g9nUFM4/u/dSoH9nrvt8DBh131NLz+6ucMlQirkcr5hAMPa7Bnd0qjLegOwk2hiHHixilVssySNF4aw2JmrlDaNGa4aQg43Tf0n9sirXFvrj5xR1f7B5kmqLegOr4xUxubem1OFpLkUppcRKa5xm+w4YoKUf/MdGdCZgrlLSMD1Em2s81UiYdMSvsDhsZLAZiAhVSMloGHx9oaElDprpaCGKglZDWvay8oDi5CXMcWjBQvvy6Nx5UfYonLznI1SR6NJOERrYgT4xCDDe39V4h1YoZcXukKUgrOgZrwxmwktELjdNUQr7WiQG0SoKixQb/eyWmhlKu/zUQG8MRorDEo2HHb5bvLDtCsFEgRgfiDvogrS6Bc47cdq/TiEn0cBr0cvYiU+9lvVua1jRjwdXYGX4XIqw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2016 05:14:32.4624 (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: CY4PR03MB2471 Subject: [dpdk-dev] [PATCH v3 05/33] bus/fslmc: introducing fsl-mc bus driver 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, 29 Dec 2016 05:14:35 -0000 From: Hemant Agrawal The fslmc bus driver is a rte_bus driver which scans the fsl-mc bus for NXP DPAA2 SoCs. Signed-off-by: Hemant Agrawal --- config/common_base | 6 ++ config/defconfig_arm64-dpaa2-linuxapp-gcc | 5 ++ drivers/Makefile | 1 + drivers/bus/Makefile | 36 ++++++++ drivers/bus/fslmc/Makefile | 52 +++++++++++ drivers/bus/fslmc/fslmc_bus.c | 96 ++++++++++++++++++++ drivers/bus/fslmc/rte_fslmc.h | 119 +++++++++++++++++++++++++ drivers/bus/fslmc/rte_pmd_fslmcbus_version.map | 7 ++ 8 files changed, 322 insertions(+) create mode 100644 drivers/bus/Makefile create mode 100644 drivers/bus/fslmc/Makefile create mode 100644 drivers/bus/fslmc/fslmc_bus.c create mode 100644 drivers/bus/fslmc/rte_fslmc.h create mode 100644 drivers/bus/fslmc/rte_pmd_fslmcbus_version.map diff --git a/config/common_base b/config/common_base index 68cd51a..45386cc 100644 --- a/config/common_base +++ b/config/common_base @@ -276,6 +276,12 @@ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n # Compile Support Libraries for NXP DPAA2 # CONFIG_RTE_LIBRTE_DPAA2_COMMON=n + +# +# Compile NXP DPAA2 FSL-MC Bus +# +CONFIG_RTE_LIBRTE_FSLMC_BUS=n + # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index c57c340..800e22b 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -46,3 +46,8 @@ CONFIG_RTE_MAX_NUMA_NODES=1 # Compile Support Libraries for DPAA2 # CONFIG_RTE_LIBRTE_DPAA2_COMMON=y + +# +# Compile NXP DPAA2 FSL-MC Bus +# +CONFIG_RTE_LIBRTE_FSLMC_BUS=y diff --git a/drivers/Makefile b/drivers/Makefile index d5580f6..bdae63b 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-y += common +DIRS-y += bus DIRS-y += net DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile new file mode 100644 index 0000000..60e9764 --- /dev/null +++ b/drivers/bus/Makefile @@ -0,0 +1,36 @@ +# BSD LICENSE +# +# Copyright(c) 2016 NXP. All rights reserved. +# All rights reserved. +# +# 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 NXP nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# 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 +# OWNER 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 $(RTE_SDK)/mk/rte.vars.mk + +DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc + +include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile new file mode 100644 index 0000000..c4f22ed --- /dev/null +++ b/drivers/bus/fslmc/Makefile @@ -0,0 +1,52 @@ +# BSD LICENSE +# +# Copyright (c) 2016 NXP. All rights reserved. +# +# 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 NXP nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# 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 +# OWNER 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 $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_fslmcbus.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +# versioning export map +EXPORT_MAP := rte_pmd_fslmcbus_version.map + +# library version +LIBABIVER := 1 + +SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_bus.c + +# library dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += lib/librte_eal + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c new file mode 100644 index 0000000..5d01b7c --- /dev/null +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -0,0 +1,96 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016 NXP. All rights reserved. + * + * 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 NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 + * OWNER 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 +#include +#include +#include +#include +#include + +#include "rte_fslmc.h" + +#define FSLMC_BUS_LOG(level, fmt, args...) \ + RTE_LOG(level, EAL, "%s(): " fmt "\n", __func__, ##args) + +static +int rte_fslmc_scan(struct rte_bus *bus_d __rte_unused) +{ + return 0; +} + +static +int rte_fslmc_match(struct rte_driver *drv __rte_unused, + struct rte_device *dev __rte_unused) +{ + return 0; +} + +struct rte_bus fslmc_bus = { + .scan = rte_fslmc_scan, + .match = rte_fslmc_match, +}; + +/*register a fslmc bus based dpaa2 driver */ +void +rte_fslmc_driver_register(struct rte_dpaa2_driver *driver) +{ + struct rte_bus *bus; + + bus = rte_eal_bus_get("fslmc"); + if (!bus) { + FSLMC_BUS_LOG(ERR, "fslmc bus not registered\n"); + return; + } + + rte_eal_bus_add_driver(bus, &driver->driver); +} + +void +rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver) +{ + struct rte_bus *bus; + + bus = driver->driver.bus; + if (!bus) { + FSLMC_BUS_LOG(ERR, "Unable to find bus for device\n"); + return; + } + + rte_eal_bus_remove_driver(&driver->driver); +} + +RTE_REGISTER_BUS(fslmc, fslmc_bus); diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h new file mode 100644 index 0000000..bc1525f --- /dev/null +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -0,0 +1,119 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016 NXP. All rights reserved. + * + * 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 NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 + * OWNER 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 _RTE_FSLMC_H_ +#define _RTE_FSLMC_H_ + +/** + * @file + * + * RTE FSLMC Bus Interface + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +struct rte_dpaa2_driver; +/** + * A structure describing a DPAA2 device. + */ +struct rte_dpaa2_device { + TAILQ_ENTRY(rte_dpaa2_device) next; /**< Next probed DPAA2 device. */ + struct rte_device device; /**< Inherit core device */ + union { + struct rte_eth_dev *eth_dev; /**< ethernet device */ + struct rte_cryptodev *cryptodev; /**< Crypto Device */ + }; + uint16_t dev_type; /**< Device Type */ + uint16_t object_id; /**< DPAA2 Object ID */ + struct rte_intr_handle intr_handle; /**< Interrupt handle */ + struct rte_dpaa2_driver *driver; /**< Associated driver */ +}; + +/** + * A structure describing a DPAA2 driver. + */ +struct rte_dpaa2_driver { + TAILQ_ENTRY(rte_dpaa2_driver) next; /**< Next in list. */ + struct rte_driver driver; /**< Inherit core driver. */ + uint32_t drv_flags; /**< Flags for controlling device.*/ + uint16_t drv_type; /**< Driver Type */ +}; + +/** + * Register a DPAA2 driver. + * + * @param driver + * A pointer to a rte_dpaa2_driver structure describing the driver + * to be registered. + */ +void rte_fslmc_driver_register(struct rte_dpaa2_driver *driver); + +/** + * Unregister a DPAA2 driver. + * + * @param driver + * A pointer to a rte_dpaa2_driver structure describing the driver + * to be unregistered. + */ +void rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver); + +/** Helper for DPAA2 device registration from driver (eth, crypto) instance */ +#define RTE_PMD_REGISTER_DPAA2(nm, dpaa2_drv) \ +RTE_INIT(dpaa2initfn_ ##nm); \ +static void dpaa2initfn_ ##nm(void) \ +{\ + (dpaa2_drv).driver.name = RTE_STR(nm);\ + rte_fslmc_driver_register(&dpaa2_drv); \ +} \ +RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_FSLMC_H_ */ diff --git a/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map b/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map new file mode 100644 index 0000000..4d525ba --- /dev/null +++ b/drivers/bus/fslmc/rte_pmd_fslmcbus_version.map @@ -0,0 +1,7 @@ +DPDK_17.02 { + global: + rte_fslmc_driver_register; + rte_fslmc_driver_unregister; + + local: *; +}; -- 2.7.4