From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0055.outbound.protection.outlook.com [104.47.34.55]) by dpdk.org (Postfix) with ESMTP id 172FBF8C0 for ; Thu, 19 Jan 2017 14:24:34 +0100 (CET) Received: from BLUPR0301CA0039.namprd03.prod.outlook.com (10.162.113.177) by MWHPR03MB2477.namprd03.prod.outlook.com (10.169.200.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 19 Jan 2017 13:24:32 +0000 Received: from BL2FFO11OLC007.protection.gbl (2a01:111:f400:7c09::137) by BLUPR0301CA0039.outlook.office365.com (2a01:111:e400:5259::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 19 Jan 2017 13:24:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) 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.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 BL2FFO11OLC007.mail.protection.outlook.com (10.173.160.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 13:24:30 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0JDO4eg015351; Thu, 19 Jan 2017 06:24:26 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Thu, 19 Jan 2017 18:53:31 +0530 Message-ID: <1484832240-2048-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293058720456385; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(7916002)(336005)(39860400002)(39450400003)(39410400002)(39380400002)(39400400002)(39850400002)(39840400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(50466002)(54906002)(8656002)(48376002)(5003940100001)(33646002)(8936002)(8676002)(81156014)(81166006)(50226002)(104016004)(68736007)(86362001)(50986999)(76176999)(189998001)(53936002)(97736004)(38730400001)(77096006)(85426001)(92566002)(36756003)(110136003)(6666003)(4326007)(6916009)(2950100002)(2906002)(2351001)(47776003)(626004)(5660300001)(105606002)(356003)(305945005)(106466001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2477; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC007; 1:H5FDfPGAFDW9LPrgIoEzZAkASUvDz4OBTO0+NU8GZBmnJNWyvwj2PsL1ii3LFdlNze/KaJ4QqAdfby/7OOjDlG2B9SW+TN1DGpdCowdBXYOnbPQUT0IaGQ/hUtJATYqvKzksT5GSoA3cnQILsbW1nLmfVVLBcPhAvZt3gPvyeUs70SBFC8XAGYmZGd3fnYk7xFNUpRT7M/W1TiINq+CbU9m/LfSavn68rIL7pWtACCNmvZ0ZNZZ78C7GNsH8VU1tbjrL2mH278+9RBLj4iwO8i6pMdpq1GZ/mtihSfednNB8GfcTEIt6rghfZbs4U8GEk7iZ2n5pnXU81OwdjUX9o30tgePtjrQWLlFfm7DW7jusLdJPrISi9lUqMh/1rW048NF5M4qaXeB5Kgf/efMQ2IUkK0yh7vnfJztCMwO6LefHnxnmjW68I3+MBfzic/wYVCxGN1Y8n5dGnMINNpENggGTcaa6JaU91Rj0A4DppVwSaNEdqgpz9jCB0bwMmhSS9QCu8wglt5BcDuOP0mLzLcStAxLfB/ah14ds+g+Sn/STCqJdRP7UircWvWyhh4nS+UZyuLlZz8R9O2fg09VbNSRN6TYuNDogItw2Hh5iK8LbvOf7wT/ctDA1Qobu06yiPm3IaVW8BV89BGKXxMyk0iyn7tNBmffL1V18ZUTnVYIoUcBla0VQmnKkqeVY6rYSoO+UE16DiQCyRfoXDqOAiq9d0l+Bgj7ekCvYQuH6B9Weo8ZY1O/CdIOs63O4kw8b MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 24e2760d-21e6-4658-d3d1-08d4406e80e5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 3:F01pVp3f3oB64/wwc2pSfmxM4EAAZZGXBp4xBrYEb4kGpQdCu1a69v5XL5B1uUUcRTBQkwVgRbHYCiS+LLdjgVFs8Cs3HHdRNinqmioDTmFITuwLLR77Pvoa/66x/RUXU71oOvPG0I3uNURraWkZA+r7DinMyynPeT9Yw2XNX0srpi9p0//OtoVYYDYyJkAl85Lt46cF4j7ANNy9nG+dCoC2K2Q2wzbDj2DsA2Go/4xglcwuBJbesIEM7zkOhiMIT7HxYf39VOyfWubx/c77y0uFUPIIxBlThjKPA17H47Yn3jxr2VVCeQ+1YcBm08vlexg+Vi8z+rctSChrPGRzGFYSviiP8oxvkMpDnpC9Tt79m6NnhwaIsbuZbwLV+ZbZ; 25:23xR/wA34wrk9KyIf/smizdRsKalJ7U9VlDfb4/66hidnPbdUDCd3r4abwEsNAJdqsl2OHz0L4OKzMKcijdkOxVOf61xTFQE0vyidHknVqDDTvMHM+2S58Olubbw2lQ+HGoKQWNqFQyApjvNz5o+3cwsGAFxDv/fr3Vcn2VnIiqSnRNe3Ot3sXUpmiaJCyjDk4YbYI8YdgYLHg0nOGXnWSshP4BPTYwczhnwSLUbmm8sykN10PJY78PkGg35AB/cbhYmEh/Pax5Mm1vWeGclN7fNRJAz5fuEVXs6QttNy7/yrzVU6e2p3Ae7E+mKVtKIdnWuCw2e0jR7JOli/S9vOFEvXokytYL3Ya8IQc3wYb3li9hHiOJXPMeoibRB6KmcnkisU+g7zFLvr5gygKVJsKG1sZCBSfmpDKIKqgplLBSMyAdBma8P/qWu1fLpwPVcVAoj92f8PzBTHr9lnCa4rA== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 31:PL3ocwoGGrVhl+0B/3zgfcpcDotG1gZGrKcntbEIK4U7qK44rCvtjtTHryN3x/uMyXEuIJ7S+JetfgU/EKvZSRYXHpEhw39laUf0dEb7tvqMHP6qUYCUxa3aoFU6ghIsKIuM1Yt26t7e9m9UsMXiGCMdijvPmnV3PnKsmpqT2RT0Nk+KhkBoY7YJY2uU8iJ5Ne7VcAfB5yPe+EuDEL77uW8rc2nLxBNymRnHWwzk5vKzZeRs4LPOC9ysjeHgwPj+A0+pgIQr1X1ru3YNynt1xLshZphpSFM9N0SfdQjAX3c= 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)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:MWHPR03MB2477; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 4:+zrpjyoJWDRXxJ31+37EssNoIETz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lI2S824PY7FsKWEgVt3Rtu+3SjiWdyDGELMr8x0rQvAjt7kf48TiTGf+I8rGOKK2p6JEvisVaMk1cE/mC4s2/nfp52zEn+8LGSmtQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 7:U6fRIVXuXDVKTWLIl7mcv+H4bZyV9S95SU8oc6AqDkqA2Vzbat44YaHa0BrxvY17emAziqgdmQKQb6Phfr2M0qErxXoVM0JG4Td3jXRAX61tj2SB/APtNa/UlmKn7Pva8/9VD+TojF+I/eeeK7HuNrZqNg37LzDd6JXyE4fDPBP+qj9W2evUTvE30Fn2J0rUZRJ+ZWmgq5dBaEEV9xuuO3s43jLEuj5zHnClJSGoWRmJYt5kPHx1iQfCv0FMJ9hrcc5OSFy/yRVhyT6vKbDNJ1lLolSiCztaNzECMROQrFB87PICms+QqQiA3HN1rY2EFhK9dogNW7UXyoTypTmnW6/Fh/AUQxFy4Zo8ebtew06+L9XxqYhc/PoG59shRVeMLbO1hVumZj2VeUAVMvT8bWWnNabu1Zknhos04qbEESwyJH1eZJLip70uBdeNmBiU/zxTxXXoYytiPUyf63oAMg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 13:24:30.3920 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2477 Subject: [dpdk-dev] [PATCHv5 04/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, 19 Jan 2017 13:24:34 -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 | 125 +++++++++++++++++++++ drivers/bus/fslmc/rte_fslmc.h | 148 +++++++++++++++++++++++++ drivers/bus/fslmc/rte_pmd_fslmcbus_version.map | 7 ++ 8 files changed, 380 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 a64fd8b..e6b4d60 100644 --- a/config/common_base +++ b/config/common_base @@ -291,6 +291,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..8a4f519 --- /dev/null +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -0,0 +1,125 @@ +/*- + * 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) + +struct rte_fslmc_bus rte_fslmc_bus; + +static int +rte_fslmc_scan(void) +{ + return 0; +} + +static int +rte_fslmc_match(struct rte_dpaa2_driver *dpaa2_drv, + struct rte_dpaa2_device *dpaa2_dev) +{ + if (dpaa2_drv->drv_type == dpaa2_dev->dev_type) + return 0; + + return 1; +} + +static int +rte_fslmc_probe(void) +{ + int ret = -1; + struct rte_dpaa2_device *dev; + struct rte_dpaa2_driver *drv; + + TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) { + TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) { + ret = rte_fslmc_match(drv, dev); + if (ret) + continue; + + if (!drv->probe) + continue; + + ret = drv->probe(drv, dev); + if (ret) + FSLMC_BUS_LOG(ERR, "Unable to probe.\n"); + break; + } + } + return ret; +} + +/*register a fslmc bus based dpaa2 driver */ +void +rte_fslmc_driver_register(struct rte_dpaa2_driver *driver) +{ + RTE_VERIFY(driver); + + TAILQ_INSERT_TAIL(&rte_fslmc_bus.driver_list, driver, next); + /* Update Bus references */ + driver->fslmc_bus = &rte_fslmc_bus; +} + +/*un-register a fslmc bus based dpaa2 driver */ +void +rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver) +{ + struct rte_fslmc_bus *fslmc_bus; + + fslmc_bus = driver->fslmc_bus; + + TAILQ_REMOVE(&fslmc_bus->driver_list, driver, next); + /* Update Bus references */ + driver->fslmc_bus = NULL; +} + +struct rte_fslmc_bus rte_fslmc_bus = { + .bus = { + .scan = rte_fslmc_scan, + .probe = rte_fslmc_probe, + }, + .device_list = TAILQ_HEAD_INITIALIZER(rte_fslmc_bus.device_list), + .driver_list = TAILQ_HEAD_INITIALIZER(rte_fslmc_bus.driver_list), +}; + +RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus); diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h new file mode 100644 index 0000000..040ab95 --- /dev/null +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -0,0 +1,148 @@ +/*- + * 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 +#include + +/** Name of FSLMC Bus */ +#define FSLMC_BUS_NAME "FSLMC" + +struct rte_dpaa2_driver; + +/* DPAA2 Device and Driver lists for FSLMC bus */ +TAILQ_HEAD(rte_fslmc_device_list, rte_dpaa2_device); +TAILQ_HEAD(rte_fslmc_driver_list, rte_dpaa2_driver); + +extern struct rte_fslmc_bus rte_fslmc_bus; + +/** + * 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 */ +}; + +typedef int (*rte_dpaa2_probe_t)(struct rte_dpaa2_driver *dpaa2_drv, + struct rte_dpaa2_device *dpaa2_dev); +typedef int (*rte_dpaa2_remove_t)(struct rte_dpaa2_device *dpaa2_dev); + +/** + * 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. */ + struct rte_fslmc_bus *fslmc_bus; /**< FSLMC bus reference */ + uint32_t drv_flags; /**< Flags for controlling device.*/ + uint16_t drv_type; /**< Driver Type */ + rte_dpaa2_probe_t probe; + rte_dpaa2_remove_t remove; +}; + +/* + * FSLMC bus + */ +struct rte_fslmc_bus { + struct rte_bus bus; /**< Generic Bus object */ + struct rte_fslmc_device_list device_list; + /**< FSLMC DPAA2 Device list */ + struct rte_fslmc_driver_list driver_list; + /**< FSLMC DPAA2 Driver list */ + int device_count; + /**< Optional: Count of devices on bus */ +}; + +/** + * 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: *; +}; -- 1.9.1