From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0060.outbound.protection.outlook.com [104.47.41.60]) by dpdk.org (Postfix) with ESMTP id B9579F96C for ; Mon, 19 Dec 2016 16:20:51 +0100 (CET) Received: from BN6PR03CA0020.namprd03.prod.outlook.com (10.168.230.158) by DM2PR0301MB0752.namprd03.prod.outlook.com (10.160.97.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Mon, 19 Dec 2016 15:20:50 +0000 Received: from BL2FFO11FD033.protection.gbl (2a01:111:f400:7c09::187) by BN6PR03CA0020.outlook.office365.com (2603:10b6:404:23::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Mon, 19 Dec 2016 15:20:49 +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 BL2FFO11FD033.mail.protection.outlook.com (10.173.161.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 15:20:49 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFKMhU029110; Mon, 19 Dec 2016 08:20:44 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Tue, 20 Dec 2016 02:23:44 +0530 Message-ID: <1482180853-18823-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266344495834066; (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)(39450400003)(39860400002)(39850400002)(39840400002)(39400400002)(39410400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50986999)(76176999)(2351001)(68736007)(106466001)(47776003)(36756003)(50466002)(97736004)(2906002)(48376002)(110136003)(189998001)(33646002)(356003)(2950100002)(104016004)(8666005)(5660300001)(6916009)(5003940100001)(85426001)(8936002)(8676002)(50226002)(626004)(81156014)(38730400001)(81166006)(4326007)(92566002)(305945005)(69596002)(77096006)(105606002)(86362001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0752; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD033; 1:I5xGLVkJgng1PTioBmqJPTuhrLpRUqf3aethPTWmc8oLlcPH8c5vd/rzrk06YjolKmr9vSAmd9/Mi3ZMN6yoacAgwHWKL0VHT6DeJkYsd2eqSN+IKsDkDEQTULw6Yir0aHHxsIA86nPStFC+L6AIUMPXi/xzvLlPDVHOHHk8qdB8Uz7Rw8mdpl0+M4LZe4Rck/lTLvXrdouH/LxXEsHAMmV0+eDpI2+ZEkDP4l/ITNQqvk+CR8eGYVQLwFA6ui4oddxkUAGs4qYAe5Mja3pg3sOeQZv52EfDm7p+Ez7DgenrR/XYnGQxaC1ArjNXUePvVTKqEnR7WCU/ZP8OFBZrPwpzEistuNVHLXoiUIPl7OYlJVjCyqBSOaf4hefbiSprEosHhA9oqhoy4ZIbur2q75FAxiFj1l18/qkPvRM8dNfcSgKuLpBYXBK2dKtxrMholC2w2cQgCFdUjHcddKhfw4siJ76aOPfH3OzN1M37Bb1F428nArhxjt3O83QNl++CwpddQOuw+z8/wMM3TGaXhiB+mznHDzsB6wKp1pOpE8Kwtz8A04f3n8gvas854Pu1FpIr0FeEEVbh/R1p3Fv+nu2frlPMCABWCeN1Auu08zu//BbZgOZnUIhOc2GMLhMuvlABm5sfx6u8CL/q5SHD8dqwbqo56N0tCS2tKxltpyOg8XKmBt640e/n+8YNLYu/z1Aa5mWdqRu2JaTNYcbl/8kCDh3T59uOMdmgXxQkV1st8wBJQAz7NQTdlo8I+tCtsy/Tn0bneEzX9uRbQgtzsQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 60827d6b-1bc1-4426-0271-08d428229d18 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0752; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 3:O58Cyv2euiViawrZpYTlJhyxUSqvrg3zo74v10eSo6mcZs0BpLqJBz0tzd1YmkV2ZFOh27Xl/vqJua6uKkDEfzEuXl4fq5sno6khGBglZgNATteXI9jt5xqKNRB36eXUwodwFY7hqwfrUTOZ1nCmZ+rBQ68cohBoShdqgXkx+at2cMYWIi4Y5y4S+JNlvGG5sX7ZDyKvrUaWTyaxRFt+sk1h1jzqx3beQkBYoouBupbQc81D28WwkSPNyY594Nen5lReVwFiClLOi3MIYK1rXbLILiG/+UNGFWhESSO7tCDg3YF0QPnBTOPB3Zp++fyYWamgatGQln2UCJvYT3UNeNd8xxwCK0jd4KsmZqxFIIz36MqfXPbZih2HD2k7Dzh1; 25:ImnbhC7ZPCISY+9B0kh0TxsY0Pf/Fr2VFoAAvisDVJTRArzocHmwJhgBqxoxbJsUu01+6F2CtFD8jX1az+Vs/c7XAOXcvHY822BJBiMn1T//PEz7pioWKMX/jp6dTMVhOjZgTjkY9KN8fpPjffON9IO4f27YBHfPJikkXEvWq9ujw2LQ94beJNakhtx65J7eKMGDEuYRuzFzcbdllqvcuqPkbUFTkljIhFESITEKqXpkak5e/8pa7gWT+L1MU0S73Ajw6pwsXDSvS4hrgU97vsO6UY0k2sUjNQ1MTSIpzOxOVCHm5XRxaNm8dY9Wz5y76ZUrJVyx7a6FPq6o9Ay1b7AoUdGSRQdnKrmhJtWtmxB9qnB7H6bNOsnzF2wtudvPWEwD2oB3wShzUQWUlbrPz3bnig0PKcxOVx79Qy3X5HsziijeMWXe/zzcnsZj0xI0HJTnIVbR1u3S9OHH+pvoHw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 31:EejZxcJTdjfEjLU8mw1eOh/PUCJvqWJ083OFYyuLdfUUh2kWuX3quyA5JFkQqvomVNEr+/CbBlzsUeAH2T0J/Ij+1y1MQtze6pHG8gH5Z1aPK761Q4PxlyPvyD+QDD7LpzGTP+1hdTv35FLf5/ziBnIfX7T8ixfAv9mgJsmrh1gwZ7xLtH2OXCFv9fchKpLfcgN1+9vCPq7dZBNqvmLaPiLw8p9U9PaCNIIAILh6yWeGuncIJjy6xjXcYf3Difhx1UHl5XNymwxvxKtJdkIzcw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13024025)(13017025)(13015025)(13023025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123563025)(20161123565025)(20161123559025)(20161123561025); SRVR:DM2PR0301MB0752; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0752; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 4:brEpGGy9PNKeFlMU7daVKdGAYGX2xFZYv7/78pUPZFT1NRZuBOrhEdsf5XK2o8PZI/JO0BzCK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SPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0752; 7:sOsL3GOFeCMQVHHA7TLm0I755/cOJ0nfvKl/ezR2iD+49fV6AuNUyQqIIgRISmvZk6XTCvfwhvPSRFLmgnm4Ln0quECcNrrBXNgcY/kRFAlvtfzsggRRzzBeXVdLRj396CxBEmz94xr7d0yrm9Fg/hoXQZ3zwRovCym9N8G9impWGcgRl3A3JmABeuqXXDWJB5H3s9z6p+HeTlf4fy9zCpHlLUgQ8Zdfvfl89/C503TsWAkHQoZkpsx882BfqdjkWhL3gdzaeo0zdc+H5ZTL/iU/3C/ke8OD6CTAF/qXjeY+fW6lEeix4M5kbCjJTGhFqytFN4CY57QvTZEOB7IzfGZrCTZt9SCybdSVhYlCcDMY6efFps71FDneKrNW/icOkyPE8fnWEdKv+ftS8fN0NzPt2Q/kFDxzVdPZZBSLjdwkZqGDOfwkVA3D1GAZwjz2TPLM64UuKZAFUcfTgHg6hw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:20:49.3494 (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: DM2PR0301MB0752 Subject: [dpdk-dev] [PATCHv2 05/34] 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: Mon, 19 Dec 2016 15:20:52 -0000 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 | 116 +++++++++++++++++++++++++ drivers/bus/fslmc/rte_pmd_fslmcbus_version.map | 7 ++ 8 files changed, 319 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..be5e9ce --- /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-y += 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..cbf7600 --- /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_get_bus("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..d891933 --- /dev/null +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -0,0 +1,116 @@ +/*- + * 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 */ + struct rte_eth_dev *eth_dev; /**< ethernet 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..773884f --- /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: *; +}; -- 1.9.1