From patchwork Sun Sep 12 12:15:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509485 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2954968jai; Sun, 12 Sep 2021 05:15:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKCVk/te6iIelFGy+Yz5NV0AuictT2oFFoCIkn83NyClkDMMWBxQ8S2xRLZjwtBgVH9ZWb X-Received: by 2002:adf:a197:: with SMTP id u23mr7198496wru.253.1631448953976; Sun, 12 Sep 2021 05:15:53 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id s12si1369145wrr.362.2021.09.12.05.15.53; Sun, 12 Sep 2021 05:15:53 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=pV7FGWhV; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79498410F6; Sun, 12 Sep 2021 14:15:42 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2084.outbound.protection.outlook.com [40.107.21.84]) by mails.dpdk.org (Postfix) with ESMTP id 266F9410E7 for ; Sun, 12 Sep 2021 14:15:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gm6n6HPfkbGcQOvMkAyrEtARWH0e6eZjJ/EIn3nx1BaXjKd8HeGfVFrP/qFnLkRtuvC6YGkzFY/QkjOOoChfRbNkJ48EnQznotlCWkpA3vDGkAi7Ck6QISuGllaxJ0VBUOyNQrTXPLTy8Cb2NjpZ25YMfkJVgg2USvt69D/zOR3Qz4KvufGoaK5X8JHtoMruAsVuHxv/AePWBjK1pfyXERMFF4FURxms07U2OM5s3HdbBW5zqvG2WQH7puBG9D8pu+mqChSdzqsnYy3ZZs5s/h7MCCnNh6TomdDABlqNLijbKFICObzivrF24C3M8sx1H6bVy39kDwYieXPzSGHm+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KuZsJK4nC72f3vMwQwkHFcev2JfIfcp3N/uzpLQJ7Vk=; b=VGpBmWIZIL3A6EK20XayUHd9MMcxNoYJ+gAY8u5cd8cQnbtlRJBvmETbz2ARRB0W4Q9RzBQt09KH0agHehFPP161Iw3MJ4h/9gwlFIJOz66gBC0lKNYnFgGXT0RgLQ0BAVfyVMflhonVkvoD+u9rgfYQpLeN+vtVjU/ZI9nZyf6XZhECNa+scHXAnt1xWizCxAm9OOe81U4PSOkibGZ9k0H7PXlsT0Q76Zse8Nt1RWeKpBWNfKJI8l2VkSeZeOz6cPVxH1VNaaweVJgfPv4Ez61i4RXfb+wGwogDcg6w2H9bbFBe2s/1DN53By4FJoy3KlEc0bsYFveNMCHCI3tHUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KuZsJK4nC72f3vMwQwkHFcev2JfIfcp3N/uzpLQJ7Vk=; b=pV7FGWhVfAbwUdJMfA0v3wpMWqSDlg1DSmiQerH9q3Vz5vrDr+yNZ5HI7fs5LVBXkuQLwgeTM1+l9gELehDjVpqslq/0lo4VdtNxqtKLQ6naXXwPuxlqtFTnhxO1VP9qtltaQaR16Ks4a/4VLybAcQUAGiqsAzjl2Ie00eYQxFA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:40 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:40 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:03 +0530 Message-Id: <20210912121510.22699-3-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 955e290d-c5c5-4333-91f7-08d975e7093d X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qy4dz0wmE0I5ouitrGwngjbAghPVdFjcRmUQ9lkS7QhtlQCtaGrKfCq3AjoWt52ILmkpNvbKAMKoldApSGc3c5I3cUdCAXj1cUBT5CHdsl8Ls3pCU8cvg4MKB1ct+U3x9u4vVTP97K4Z9jILVziGXkpxsYMydkxtVVKgSetN75zCod9R2qHV9sIWHxSl8lnXyOJAY5cMJXrmd7sXomQlFg6RM22gXoW+ykcpk0gbUpdTb1yriwWj5EXiS6pFZZNAn7RrXlzhqHYdiUtSGMhrQJjhOa75yOlrcGD+TDVzXyIllyJ5YnvPjYSfoX5d2S5EuXqPCqNUG0Xk+0wciyBSKsZwSdUHv3HDeRjln/mDHQBF+QATifLtPzizum+F9o0xASiRG2FjjKoN4GWUcGsr+wQ3ODtjKb9AaMAv8MwdlQnbnVkZYBP2aYOo5hX6d+nwMfYTfp/gCECXQWLuZN41omy6RqgJeKYxAV7NeanEP6GXho6vcLdBlRfdu35C0AwoO07p3FICzU8sEpCBj1OwPjndEkBoN4kPOQGEk0/FFY467s3BrI4OCn5gBan0S+XCnUjyc7nuT1hg8n0GMZoM7TbHefag3owlKWx/imU7mZga424xl/u+rV9lY2C9qYKARIJinhHY3SynXoRWRXUbXO7k7uatAL14AD7DwojCsteC6enINiu9C4573RO8JxEYgkx+wVUN6xWZICNXCP/H8lBw5c+NuR4c1CxeFh4rLUJtMH5+tDIJp249sKPDzT/B X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xTjoDaLKWRgaN5W7PotSr1lgkljVSSblw8c+WTuK7MPw3q4VqJKDi9FGycSTP2/7TW7jUtJNuIV3fP9V8vqzm99D8RYNa5kS/e0BvKNlNeX+d5CEohJ1F501GNLl6mDmieiqOWaPDPLeRdpEKMT6g4A13zoPYUo1vCpOELBfY/6oDdDFC0266MdUXG+2xbdmHx1iK0VLV4DTxT8pWEN0Y8EBZC+95E4GOr/DbsHJ2nqYKIB2ht9KKeRT7kPL3AicOKg740ZzUJkaogKgwOcHTThPWOc7SO4YrF1JAkrJLqRqNXxXAf1zOzDQzM9pWBCfstRkQdksJfbNkQXysNlCmuzgptsFnzdYJvIBwgUpQS3AeF+D6q4AjMrDFs+b8maF2NJy6cUaxMLXUTLhOafJJRgjvaTUFS4sblvxyC0GSG0poA7bq2cDGPomkIYtuS9zjZYwwZwK4zfqEGFVf27eS+7gjr9sXT3f7ODFpKp3pAidDlmUNe/lnAzElegI4P64SOOqDDInnZDJ2L/a6KWsMHfGPe5xshQkqAOs98DcWnnhe0dozn7GRc5yPsW+PniklE0zbP0ipd0Sb1OuPcv9+1itzK0Pbb2sTZUT4BUnjepBMfuTfn7Vkv08eLU+7BsaT9Uamer3hcXD2XgWjI6T/gIE/ptdWy7ZBmkTkowBRCe26p7B7GAvGVwngQG7b4cFAtfXthZE7QLNsbt2MV17OQZ65M03kVBjj27dVz8CNaURhMp8B18m2fc+3NvmJhuifO7XGYcj/G1Q7wtmQvISce19pyeJ/7ZLlxuBNCDg6CyT9R5kgffItgls8FO6SGvi6pp7QBsUNnwccZWvBmk4XTG308W5FpCqDyEKrLkXhkEkUCBvIr7mSftrQjF5RKLVlnG+5xRv/uDralVNwMWac4Qex1PNiLT7r5ra14+XMgg2YE50FnPs70Ulwbi1RgYnLF1Tey9SUlY1QqbwlJSCjj5vvm3ZLatU/drc7CpSXOygmU0Y3Rvouuz47T0DMs4ZudrWESqWGZ5qV8eIDeaWGl9uBBpU/BEAVCqyaOxJevLqYGRAaniS3DkoaCAr+No3oknUEdWFl94YjjnZClZbf9T7nWDoJjEt3MRb10uMO7RqLaYoMKv7UFhjqJc578G7akk1TSA9CJXHweiRHCkRf/Ox8H7mYnCVbYkyV1Z6dZ/1LcRUfj2kLJ8a3ra5WXTssuWIzpc1Duxq4YOcrmLcaje4FEqYgGWcJ/zz4PzW4eI++0Ndbo0YeGEQGoOX+Tp7/4JTCryJhYel8P9zGeH9ECMcmCgzCB0jE3dpqfUeYd+3XRqi2EhvUqsxv56r4Kjn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 955e290d-c5c5-4333-91f7-08d975e7093d X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:40.3845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mXRiIRM4v7hcbgkb3KbzLfWOeRSsVbhlbEe6v3Ue6rcoYDdaDfMW+krqtnWRRPS5sH20u+bGuznG6ZUF0Xkt4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 2/9] baseband: introduce NXP LA12xx driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Hemant Agrawal This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 109 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 26 +++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 1 + 6 files changed, 154 insertions(+) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map -- 2.17.1 diff --git a/MAINTAINERS b/MAINTAINERS index 266f5ac1da..a63e672c9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1288,6 +1288,15 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers +---------------- + +NXP LA12xx driver +M: Hemant Agrawal +M: Nipun Gupta +F: drivers/baseband/la12xx/ + + Rawdev Drivers -------------- diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c new file mode 100644 index 0000000000..7050b17728 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DRIVER_NAME baseband_la12xx + +RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); + +/* private data structure */ +struct bbdev_la12xx_private { + unsigned int max_nb_queues; /**< Max number of queues */ +}; +/* Create device */ +static int +la12xx_bbdev_create(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name = rte_vdev_device_name(vdev); + + PMD_INIT_FUNC_TRACE(); + + bbdev = rte_bbdev_allocate(name); + if (bbdev == NULL) + return -ENODEV; + + bbdev->data->dev_private = rte_zmalloc(name, + sizeof(struct bbdev_la12xx_private), + RTE_CACHE_LINE_SIZE); + if (bbdev->data->dev_private == NULL) { + rte_bbdev_release(bbdev); + return -ENOMEM; + } + + bbdev->dev_ops = NULL; + bbdev->device = &vdev->device; + bbdev->data->socket_id = 0; + bbdev->intr_handle = NULL; + + /* register rx/tx burst functions for data path */ + bbdev->dequeue_enc_ops = NULL; + bbdev->dequeue_dec_ops = NULL; + bbdev->enqueue_enc_ops = NULL; + bbdev->enqueue_dec_ops = NULL; + + return 0; +} + +/* Initialise device */ +static int +la12xx_bbdev_probe(struct rte_vdev_device *vdev) +{ + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + return la12xx_bbdev_create(vdev); +} + +/* Uninitialise device */ +static int +la12xx_bbdev_remove(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + bbdev = rte_bbdev_get_named_dev(name); + if (bbdev == NULL) + return -EINVAL; + + rte_free(bbdev->data->dev_private); + + return rte_bbdev_release(bbdev); +} + +static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { + .probe = la12xx_bbdev_probe, + .remove = la12xx_bbdev_remove +}; + +RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file mode 100644 index 0000000000..9dfa1cc458 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define rte_bbdev_log(level, fmt, ...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \ + ##__VA_ARGS__) + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +#define rte_bbdev_log_debug(fmt, ...) \ + rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \ + ##__VA_ARGS__) +#else +#define rte_bbdev_log_debug(fmt, ...) +#endif + +#define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>") + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define rte_bbdev_dp_log(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */ diff --git a/drivers/baseband/la12xx/meson.build b/drivers/baseband/la12xx/meson.build new file mode 100644 index 0000000000..7a017dcffa --- /dev/null +++ b/drivers/baseband/la12xx/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c') diff --git a/drivers/baseband/la12xx/version.map b/drivers/baseband/la12xx/version.map new file mode 100644 index 0000000000..4a76d1d52d --- /dev/null +++ b/drivers/baseband/la12xx/version.map @@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +}; diff --git a/drivers/baseband/meson.build b/drivers/baseband/meson.build index 5ee61d5323..ccd1eebc3b 100644 --- a/drivers/baseband/meson.build +++ b/drivers/baseband/meson.build @@ -11,6 +11,7 @@ drivers = [ 'fpga_lte_fec', 'null', 'turbo_sw', + 'la12xx', ] log_prefix = 'pmd.bb'