From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EE130A09E4; Sat, 24 Apr 2021 12:38:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1587941119; Sat, 24 Apr 2021 12:38:36 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150079.outbound.protection.outlook.com [40.107.15.79]) by mails.dpdk.org (Postfix) with ESMTP id 989C841118 for ; Sat, 24 Apr 2021 12:38:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJOttwsdt/ZVsLpCG6aYdFaFMMWDQDdSeBSAcSPmicGyrNLtMDJU+Q06xhDVP29xOE5/KJ0/sIk+SyfmS+jC8eiFjPGNCUqSlKZTfPeHR9aJWrSuzVH0leV057iMrJ+hq6m5aDmhw3yQBtnA3lb31htkb6Tc2vhayPBPAKBNDAtQPwbuJZd+BI0MOZg2UDskfPQe+GiaHNRpI3N9j/mfVn3iwxhA5JAQty5eKSOjIbLwTLVIpV0u4FOo6c4DLYBX6bGbEwR6Ehc4xk9iv9DC1Grrb+koiuu58cVlw8aYlB04RT8vErigqWA4XqhK/TAQ9sRDcZ3fCEHjuzxrbp6qBA== 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:X-MS-Exchange-SenderADCheck; bh=dfei0Hai+zj/RlnPcgcnDxiMOlC79FIOJpE1bEGEncM=; b=PRtYbMwQEuEavsw8q0q3KMSLTNH/YWjV6hXkBZZjhhp2mMZbThRUF69dIsT83CVi54DEjAU06E5pIQSg22arSKCTWkzaThpa00ziSVp1ouSmJNdv5OCovBLdcieoahgMlA8egi2eFwakQH6qQkp1PefLr801A9SiTNOeee9uYSKzCyrAwh8DtU8RffZprZRi6EPWzU9ud8Ah/wOiMnELjeiv/vLJTDT7q4R2v2rqpLRJCmwhpOe8KVzKMLCXfCyN1a1SRJFq8Jp5HYSpAISOm6Rr9l1CkYSMl6pfcIpLkywq7CY/qoTFI0Nfskp1uf7zQkWPimnSYLhsJpQdC4xo/w== 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=dfei0Hai+zj/RlnPcgcnDxiMOlC79FIOJpE1bEGEncM=; b=J7Nq9u+a2pveI/G+llouP/xhqjxPJ5Kus4BFYxVgjif3wsYk2XMSqTQUJWIV/QVzoVqk4Sq/fokq79I6veVcJakvW8+D+jaIAuYrgraPAhDRlb3MRibrm/vYLyXbsuk5NxKSVQXCe0Hi/IAK7vQTh2ShcJ/thNtetSaDGO70YEA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR0402MB3895.eurprd04.prod.outlook.com (2603:10a6:209:1a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.25; Sat, 24 Apr 2021 10:38:31 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%6]) with mapi id 15.20.4065.023; Sat, 24 Apr 2021 10:38:31 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, Hemant Agrawal , Nipun Gupta Date: Sat, 24 Apr 2021 16:06:54 +0530 Message-Id: <20210424103700.8098-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210424103700.8098-1-hemant.agrawal@nxp.com> References: <20210413051715.26430-2-hemant.agrawal@nxp.com> <20210424103700.8098-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR04CA0088.apcprd04.prod.outlook.com (2603:1096:202:15::32) To AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by HK2PR04CA0088.apcprd04.prod.outlook.com (2603:1096:202:15::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Sat, 24 Apr 2021 10:38:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a98805e-b3ad-4003-4131-08d9070d1ad5 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3895: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oc8OerHXSWWYF9AhzEbHqPIAApOZaycTQRpsoyd8Ja9D3Aixdsqp8K2R4gdlyKKHxDbhZKH12BqcpjKqBkfDgi3sw0YfoTnVWltznyo1Lx1r/SApZSPd2FEeBusEP9Fceo2vu4RcmNfvcJjosN47FyqBbR3HEL5TeXJ9CcNwhU13Fn8t8WFZRvGQASM4l/RyrrxirV2+UJQ/tFLln7j/7J8QpK86URKl5qHrBPnrTtnsNQSkU1O4i08eNYL0w3mhOjsjUXy0p0mqmltXqeFRjQmOkuxdcPXcoMLqygU5GN0bMXz8x8vQvyd962RJefriBQf+N7lrBQQyTdlO8lQlwp0CrI07W2HfMIlH4nK4KqIfgkb/SIkWHPQKHMT7KNpvEU1LDdkCLstaGwDkTxT6DPx0gBH51ZybHc4DtQxSXD5BrVNXB2dQ3TYLMYdstONtEljRMe5iBvRJA7j7sXZpxcVAdkvcAJsbwCqYPTwAjQirv8OQ8+WbljAUEmVerWgVbwqla04J5L8e5vT7GYfFp+wJQOvmzwWpr9ZW13BVfoicV5EpCwHbafIzv4rzhOaSdMyw9eIOpD7fmCRlsx7Bp59ponkL7yrtXRU02Kg3tqrfmEqfY9JdafeteDSDGIOtnBM74OAc1LU171Fgm3DjeFRqNb8P9un9W9rgHj3Tdb0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(376002)(366004)(346002)(8936002)(5660300002)(316002)(1076003)(54906003)(8676002)(6512007)(86362001)(478600001)(38100700002)(2906002)(956004)(2616005)(38350700002)(36756003)(6666004)(186003)(83380400001)(26005)(4326008)(16526019)(6506007)(52116002)(6486002)(44832011)(66476007)(66556008)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?81grALZfOxyFrWYA8Z0edMlMuQsiqgnXxs+/n4kbjRVAipBFhTYBJARMcmpD?= =?us-ascii?Q?gjdbg6hRwnQCAtJolXFcgOxDoldDvQWuuw8FtLvld14SrSjRaijTpcxZgMVn?= =?us-ascii?Q?OMcSqiojZ2UiQSbkVf0BJ8ajICQivyB2bn7TLFBuyY/YNcU5fFGdJPbtEUeC?= =?us-ascii?Q?vX5Z5xPZQA8HZkCKtitQQ4Fj4h/64DjXgLmo8taPX/7KnQPD+D6FaYP54cJR?= =?us-ascii?Q?CF0YQzpP4Dew9RzuLAEh2LNWbJBH28YUct7TJInTUkUc9gSAzHlshECoIG0S?= =?us-ascii?Q?Uh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VpDuXiiZJAlT?= =?us-ascii?Q?JDqHaXrzNESxjN7mG6yPsO144OCHO+Qf6BChoaTjk/t47NdbEFJ94JVeHcoa?= =?us-ascii?Q?2HviOQ2/1jOogXtZOJAukaTme5q/+igcUfC32jnsYMMvft2fGbMZ6+Q1Xgeh?= =?us-ascii?Q?2S/UiJ+Dq0XAOcW7orFcDKM7?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a98805e-b3ad-4003-4131-08d9070d1ad5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2021 10:38:31.8087 (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: mP1iLW+lTyXLuxqf4Nx+mVddVadl4dixMPFvo+/9jjlhbugnejgCnyr2sob7LK0tPujejHhLrZ+cJxwKhWZguA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3895 Subject: [dpdk-dev] [PATCH v4 2/8] 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" 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 --- 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 + 5 files changed, 145 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 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 c98ebd9024..fbc9c7e9ab 100644 --- a/drivers/baseband/meson.build +++ b/drivers/baseband/meson.build @@ -11,4 +11,5 @@ drivers = [ 'fpga_lte_fec', 'null', 'turbo_sw', + 'la12xx', ] -- 2.17.1