From patchwork Thu Feb 16 00:39:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 20445 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 282F2D4A4; Wed, 15 Feb 2017 20:06:34 +0100 (CET) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0088.outbound.protection.outlook.com [104.47.32.88]) by dpdk.org (Postfix) with ESMTP id 9E9C52BA4 for ; Wed, 15 Feb 2017 20:06:01 +0100 (CET) Received: from BN6PR03CA0065.namprd03.prod.outlook.com (10.173.137.27) by BN1PR0301MB0721.namprd03.prod.outlook.com (10.160.78.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 19:05:59 +0000 Received: from BY2FFO11FD006.protection.gbl (2a01:111:f400:7c0c::195) by BN6PR03CA0065.outlook.office365.com (2603:10b6:404:4c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Wed, 15 Feb 2017 19:05:58 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none;caviumnetworks.com; dmarc=fail action=none header.from=nxp.com; caviumnetworks.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 BY2FFO11FD006.mail.protection.outlook.com (10.1.14.127) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Wed, 15 Feb 2017 19:05:58 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1FJ5fLY020023; Wed, 15 Feb 2017 12:05:55 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Thu, 16 Feb 2017 06:09:03 +0530 Message-ID: <1487205586-6785-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> References: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131316591583794254; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39840400002)(39410400002)(39380400002)(39860400002)(39400400002)(39850400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(68736007)(54906002)(189998001)(33646002)(4326007)(8656002)(48376002)(575784001)(77096006)(356003)(47776003)(106466001)(2351001)(86362001)(8676002)(305945005)(50466002)(5660300001)(38730400002)(105606002)(53936002)(110136004)(5003940100001)(50226002)(36756003)(92566002)(8936002)(104016004)(6916009)(81166006)(626004)(6666003)(50986999)(2950100002)(97736004)(389900002)(76176999)(85426001)(2906002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0721; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD006; 1:+vP9T3UT8nz5MsB7Qr6T//CjBEuilWgjie6mwMWxUI+FFfhLYoltCQe7u9Y1LNJQhrqtM9pcrPX5C7fJzEHXcObDyb2WaAz9vZd1ESTp3sDw7wG1in7j6rPsssbzs1yWFcuEl1SPAVOYS75Ey7KvaYsmleoPN6HN3hYLly2Dc4MUG+mqqBNhb7P4aanIhS9SmRRWsA97jpqhojWixWO7R7YjoVrEidbDXLuxTugZwgsSyC/vHm3Km6x007ToWGEQOlHhDcGxeWItHDu5/Z/ckKqa7Rco3JcRZxHFf+rfatoj42Ozt+pfqGUioVZzFHg0wql3YRNkbPsRYOP9OzesMwtD02FniT3R6X4ZaPOGxDBxyG56DJcvvwOmwGqUd82230rnCnfGbIVyt5W4/b5nB+XsaJ4hkYaXduUk3OEHFYuaRakg3hd4ROOTt8FYIfEabvK1VEacNQ5xgOOJeJo1OxCgplleotJ/0e8Kd9TKC53CZpO6vtmdKI2YiE785y5NXSMgZWY50ZwN9VywmHPCXq4jYxwGLM8RXfkjv0pwo3Lc+OoZgJAAqGnLMxqd2wzOjwUcqaeTwz57TmBkCVVos4askD9j3fpJIksbn8/1n6lwEa1Yq0EorCfHvOwn9Iwm0sdHAaCqAFUG8EQNBiiF4A== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 42cd18d7-0d95-41b8-944e-08d455d5acee X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0721; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0721; 3:RgVzGFjNVrKITl7C8woUr0I2NyBkn8iXaAkkOYxINlnn6t3sDjMao/myO6YFUlADC6+wFLMLrziZMGC/ojppCYaybjUd2j6k9YGbPeD0GRPruPm5GugMCnWerZnQW4vM3UT2ZtOResbdy+yJaaTfj53XxsxoWtmHTWwulgSWb2D1BJ6U8AhEfXAus3V/j4BlMijN6ByVuO/zNGrdlIIwxWIohkft0DSBcRh+KDfIzbp0kxCC/NZmeMvRKzTl1wH3InNiDfqOby6ijhlELTt3+x94Wg4qFvNboiLclzLTKzqMIB+QIFIiif0xigCnCTEoPwvATJxXZVBL08AAW9UjA24oLjHQ++J+RNlNUwNRKJ/L9j15Y1/kWm1/mliSHVs/; 25:D3z+CPlj0pVy5ZyRmh+WSfMK9l2ZSe9yxhSMebZn8/eUmmebGMJM1J6zsXfNPtxgiX0AuL/vxhv/Gh+aFYFrzJYriqVMk7zHdaiQdoD73lfCo61v942nlks5gvrVG/tUKm5MTrYxDg77v473UH0Zq3sdEbRgWNdSi+6uxNzsm04xhLKOdZGL2aNQy2b115UF6OZShW6XMTAm6lHoDEQxXjvvY+CZzM+rgROLjI23EFX2OOobDKrBGSYNLEF9n73Ct92jk9CKMf27BcVnSUEpfHhvB9vBqgSZpSMmvmXzfPPmyCdhPTK3jEE9Kqp/hCPd0qB+afIVeXwYx4z+gKtT9HphkmvM0RT9zVwMVTh953DID4DZZFdcp4jZmKGpy0sVZeqPwhRc5sVQdUoeIBPaVfO9u67renwV6EngJAv827x6rucAoingiuQZ16UIBDJ1eUHCT03mNcgPHZLrH4Qisw== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0721; 31:KtLpiL5/Bsq2FHfaNYoLc33p1SUHS4+STk2uhuenW3ct3U/jgc4Xpr/dUIMKz3gpGwHaijS7XwaPkXTpNkbegJYRuNx6W2H7qISXjj14wWk6mzyRXRzzTfHrcYmGpjWAQWljCc4ItyJFO0HRTkY0mrAP6wYwmr0xJjotd9xj2BtNRBpu8H3VEZ7Ah6XQXbKGMetEz9gqoAnMIAwU8ZblhR7CyOlnU55kvVh0Hx8JPLKozc6GGIyo/zxCZLH8AbN2rGjyxp+IStWdDkCGSAImfQ== 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)(13017025)(13018025)(13023025)(13015025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123556025)(20161123561025)(20161123559025)(20161123563025); SRVR:BN1PR0301MB0721; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0721; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0721; 4:8/ZLboriXmVg7qC1O+qFpE3LnknxJ3YUBnRiuflBCBxeJodcpaE3um3RbLwqBi6ujQclI1+nfblDrngAelVxfHHuiAXeONdRnzOIBRsuRRbqZwsVCA2evffQ6ycXWThlfqYY9/sWrUF0IZaf4Be04GF4MNFGuF/XxquZFufRpMAVsweDL0jNIxVeFHCHXP8uNLc2Ps27x+INDCNNKXiUj1ZLT3X7oygORCRumL05fO7fa4Vs3BiH1NeE7gtibxzLgckKbqB/M4+C9NkXTQc0H9elER2wIy/PyamWBt6BJwqzilCv9al9dgALIX94LwpMVZTiXCZiKVsVAZZEa8iJQFc9TLHlA4QSQmB8yHItVbna15z6kFPbTTFWaU6XvboQxTgf8WECvDEcmr/Nr7moTBqv2gbs2xTnwENGWOHkTEBR8TiSV9WW5IYzErNQDPhoCAC2gk3VqyHyMcjxpodIrPA3MDZ1jFLLl5cGXDxjD/UErb2aPjEbhOVuved/pv5gqkC2zV19DbdbztYDNR+m64WtwefS+NfTczpBHhc38hbKmHzHvLFob2nvvmhBpDlPFHsj8CsAR/XO5CyQVExMrJHy/tqvSOpsfDoELrZ5QK0wvnyMOQSguM5MIgP9k2fRBC9gSEs+jk85GWEzFh5A+qSnF9q9/E2mSCK1kj6uHb7JIYAH+UScxyH/297niugMr0S2IlAEJUHVVIaPeG8gBN5qGAhAH4rnDs1XzXkhGIqb66/Iyuigd0gktVePasMj X-Forefront-PRVS: 021975AE46 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0721; 23:KueSwlSJ116XikWhGuaPQX+SpX9s984ize8VB1A?= a9f1qZjY/t4qyEoE9rg02zC27AEbusTvBT3w0tKl/Uctm1KFVwtz/vEaVRGFRVP2CUdQG7tSirMBwlcSGQFVdIoWPIRYge32qsUieI+n+CMhb2A05JqArZT/HFSvGIyvnZ3loGrgmw83aFVBHJj7hQx5b8v+4cGWUGngKSiDzK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9bjQ0gZvoZqI5XuWjZ7HbGcdqcOZqBvkW+kvhGpKUoqUxa0A6CItj5lccva9W7mWLZzOEv2tBoG5OXA6MQh5EHS8FL4dXN+dw3BEtaynpFfx+B7mhgkyWLcPzlJ7gnyUlqJe2Z13sHv8OOxDrrh8Brr/NXxn5pcnpiScTfZeOkBhU6ooEbC745+COXkfPp71ZLImf2AICvfBg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 19:05:58.1922 (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: BN1PR0301MB0721 Subject: [dpdk-dev] [PATCHv7 04/47] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The fslmc bus driver is a rte_bus driver which scans the fsl-mc bus for NXP DPAA2 SoCs. Signed-off-by: Hemant Agrawal --- MAINTAINERS | 1 + config/common_base | 5 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 8 +- drivers/Makefile | 1 + drivers/bus/Makefile | 36 +++++++ drivers/bus/fslmc/Makefile | 52 ++++++++++ drivers/bus/fslmc/fslmc_bus.c | 125 +++++++++++++++++++++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 7 ++ drivers/bus/fslmc/rte_fslmc.h | 148 ++++++++++++++++++++++++++++ drivers/common/Makefile | 4 + drivers/common/dpaa2/Makefile | 4 + drivers/common/dpaa2/qbman/Makefile | 4 + 12 files changed, 394 insertions(+), 1 deletion(-) 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_bus_fslmc_version.map create mode 100644 drivers/bus/fslmc/rte_fslmc.h diff --git a/MAINTAINERS b/MAINTAINERS index 7ec5683..c151546 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -358,6 +358,7 @@ F: doc/guides/nics/nfp.rst NXP dpaa2 M: Hemant Agrawal +F: drivers/bus/fslmc/ F: drivers/common/dpaa2/ QLogic bnx2x diff --git a/config/common_base b/config/common_base index 71a4fcb..d162228 100644 --- a/config/common_base +++ b/config/common_base @@ -287,6 +287,11 @@ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_DRIVER=n CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=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 66df54c..365ae5a 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -1,6 +1,7 @@ # BSD LICENSE # -# Copyright(c) 2016 Freescale Semiconductor, Inc. All rights reserved. +# Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. +# 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 @@ -40,3 +41,8 @@ CONFIG_RTE_ARCH_ARM_TUNE="cortex-a57+fp+simd" # CONFIG_RTE_MAX_LCORE=8 CONFIG_RTE_MAX_NUMA_NODES=1 + +# +# 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..5a0fd61 --- /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_bus_fslmc.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +# versioning export map +EXPORT_MAP := rte_bus_fslmc_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_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map new file mode 100644 index 0000000..4d525ba --- /dev/null +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -0,0 +1,7 @@ +DPDK_17.02 { + global: + rte_fslmc_driver_register; + rte_fslmc_driver_unregister; + + local: *; +}; 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/common/Makefile b/drivers/common/Makefile index e5bfecb..cba1134 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -31,6 +31,10 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) +endif + DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_COMMON) += dpaa2 include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/common/dpaa2/Makefile b/drivers/common/dpaa2/Makefile index 4960ebe..9681729 100644 --- a/drivers/common/dpaa2/Makefile +++ b/drivers/common/dpaa2/Makefile @@ -31,6 +31,10 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) +endif + DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_COMMON) += qbman include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/common/dpaa2/qbman/Makefile b/drivers/common/dpaa2/qbman/Makefile index 5e64d23..7ac1ba7 100644 --- a/drivers/common/dpaa2/qbman/Makefile +++ b/drivers/common/dpaa2/qbman/Makefile @@ -36,6 +36,10 @@ include $(RTE_SDK)/mk/rte.vars.mk # LIB = librte_common_dpaa2_qbman.a +ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y) +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_FSLMC_BUS) +endif + CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS)