From patchwork Tue Apr 13 05:17:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 420178 Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp2314466jaj; Mon, 12 Apr 2021 22:18:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6J+5Z+xRpgFDiSWHOSmUjTAds99elyon/NcLDDE/nnMkbh/jeRHoN4wnlSkt/O1zUBzBA X-Received: by 2002:adf:fecd:: with SMTP id q13mr19694856wrs.7.1618291115123; Mon, 12 Apr 2021 22:18:35 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id j4si5069481wrb.100.2021.04.12.22.18.34; Mon, 12 Apr 2021 22:18:35 -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=lwrZ1FFA; 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 61AAC160B11; Tue, 13 Apr 2021 07:18:34 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130041.outbound.protection.outlook.com [40.107.13.41]) by mails.dpdk.org (Postfix) with ESMTP id 80D8A160B0F for ; Tue, 13 Apr 2021 07:18:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eH8MmxtpaBhdfZE/HPEKpDpei2vFX5OUPvKJc+YEZUQUK6TjjNvrFWKuhbrzwNJNGIxzAV/GpvN38qd3JHuH33drm6KgXacyutYtXtScKGDtAA8rFF9BNR4roFOZ+dW7YP3n8NCkWk3ZAK1wWSZEgiE+OZL0U4Hal2wgiJ0j5x4wVsoZlHZmf2xXe07r3FxUFol/WLxkEFYfWpcY424nUTxXJA7dUN0eEvGLp+voviycDi41JNYk1+scyhUCghIwU30gHMGllpIoXVJ10H6TwJHkaXthTlDYhtNrig0FDSqFDHKXB+16grvwLGTrW44aQKnh581wERdxn6knqqWf4A== 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=2ArbjHTsMZPUo5actbW79ES61qJ1YaTGcdX/6xr0fQc=; b=klDLKp5k2NPR9w88At7plezp0+GQOeWSTh/BkHFoa99ZlH2AfV4Z9OffPz1WAKLH2UkKI0PDB80xOvTL/JJS9toeb26JqLIBLiJGUyM8dNiC6a0mKqoJfTCxJIDFZwHWC7naXWBBbNZ6Cm8n4L3vBI/nU5cgEKaYGayOOnFQWpBk+Xqls/GN7GlLGu+Aj3n74IJBP3ee2Lv8FGaOskqF7H3MtBroCj095HKrOZBkEtkSihaWrKxVFhNNXvi2MkRtud8nBqzg+UtVUO62yjplVVuYI3Mjkcgn+JOavAiBJaaOxyBi8HBnEWdMwXtMiiv7CzBG4dZT7O5cN0AhFEbEqg== 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=2ArbjHTsMZPUo5actbW79ES61qJ1YaTGcdX/6xr0fQc=; b=lwrZ1FFAZUI9uYCJ61SbdVgvh3sgxGc2PzObcKYKc7JW/5w36i3kWQce5/cIGjxK/bvrEJrjqeCtkJ3h6MxzkYmIOI8KSVyCtc0P2gaCsbuz5zVK8h7WcsJxvMitfuhZpbCz1R0Z6ZFxmCt4YqsyPYnRAZlGc2ibmtuWkClYds0= 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 AM5PR04MB3250.eurprd04.prod.outlook.com (2603:10a6:206:b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr 2021 05:18:32 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%7]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 05:18:32 +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: Tue, 13 Apr 2021 10:47:08 +0530 Message-Id: <20210413051715.26430-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210413051715.26430-1-hemant.agrawal@nxp.com> References: <20210410170252.4587-1-hemant.agrawal@nxp.com> <20210413051715.26430-1-hemant.agrawal@nxp.com> X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR03CA0059.apcprd03.prod.outlook.com (2603:1096:202:17::29) 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 HK2PR03CA0059.apcprd03.prod.outlook.com (2603:1096:202:17::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.6 via Frontend Transport; Tue, 13 Apr 2021 05:18:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aca3a405-3854-436d-dc14-08d8fe3b9494 X-MS-TrafficTypeDiagnostic: AM5PR04MB3250: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J7UpY/1PGJYiXhYBio+ZGSlkN3Xpv+T0epgYGfA9TpohIy2gjNVNXGtG+CVwAI9WBNO1zTHmgeeEmuo1BHtzlmLWXFJx0BxokopjGNsNMcd/Don6HCxhAnIo///n4zGR7xnmwx0pmztCIYNw625obEbGRbFJE9xEVv0X3BuoMulUANvtTMwNtyh4FVT0s2OcyuY0nyaGipDBux6O54kHOobQJ0vKgrsviMT+f1siyTK58ktEULywMG1yw8gAChhl9kZlZzH/Wti29vJZJPr+Rd4DYiXZCw8KzTqTwRuohm1kv/mpRv0WapL1Qs7OgGmwoSF/FlLbz1Ee/TR74FszKhHzRrjnG+Q4UYloimsxdwt7+bMTxiZH7H66tizIcSkEz0/GEYr/HlaXN28rVsUTwxRB957zaay1LZg4hG1Y+m24Bih8F1shTsG/U3qUM/F9Y2pYOj46mSN35wC8edcOFTEGZgJSoASyipq0OZ1pJBx8w1y4c026ntO2qxjmNWc4lmz1t7I8/85EcE2FOuho8uq6RLlS45yM6+xcK2NJpL6Yb5q+EfXl6MZgXQzgf97Q0HakgrZ7CpH/DRiIrwOT2k2iWmwNKP6H1jnlRmmxYtJKYnzXXV/W27azElALYTp27Tf6ibkE7Ivqrz/PalYk9ylylcb3whCOXZAkDMO3+OQ= 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)(346002)(396003)(39860400002)(366004)(136003)(376002)(83380400001)(16526019)(186003)(26005)(54906003)(38350700002)(38100700002)(316002)(66556008)(66946007)(66476007)(6512007)(2616005)(956004)(478600001)(4326008)(44832011)(36756003)(6486002)(6506007)(5660300002)(2906002)(52116002)(1076003)(86362001)(8936002)(6666004)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: BfvzwvOJbxMKxzAbumdPEHSPi534Ee7Za9saEZRlnfOGQqG5uLjgxNS61Jqu2k08EArsUS2xvL3ovikzfx7MBf7qx8QCrPQ0QOwiUSoSF+uObUQSy6fsdTwVZ3g5jnqp/s9JqnZMs0aay0eLC/O6feZUYj6X7inai+kp6XPKzPOb9FBnqvrJNbCqUZgvusp/AS2EkZtz6G2s/iggOmgyZvDtkKb3fpKSAoXR0Xr4OEzdChoA3WPMu1cHwCPRkKKDRik6kHwvXgQUEoJaL7l6XZe/8x7SSByO2MGeJ3KVSRC5hHueI8afmJkEgwomxB+rCnqVbPno1Wd46sDgkbCgNg9HcK7C2hMyG5/G1iY09AtQuqudnXCqlhdK4hF3VHYX4NxIqHalHyhP5mWDGZ3u4peLNwmuCtR9azAd2TlpHOELl5gCV84GvFwkpLH6YVuyUeAP7s9g8UUAIJSVx0t99QcJftYPeA5HuvmpxW951vDRBxhYr0d6rxX70+2lYmudUmWCgQ9f8rMUwhHF2k0JAqsUn3+ddG4PQvzk5tr3S63f1Lu3+8f8XwHqW9L3Hh5HtzyXBX3T7ola3ooxPfmtcX+1JDM/XmhOKp71y4u0HfPCMR8z6BO2ZGarms701Lp/447EIrTq4++o2y3Leyrd84CxkYOQTt7t20+6xYWw+7ckmz5HpUKB/R697n0EuCZs6hdL36QN7XYEQiE1tShmTfcHJoVU6t18HMUwoARLAOPHoErroyUDmQCuRmLjNy5wt2o8VGOebMRCTMhoQk6Yp5OkO4BvgSfkAwk2QrPSj3+imi76NQN44SfYUdHF8zy4sZ8ht/WDWGfuSnpyglaYI6yg+lW5LYwr/5duPQ6F9ECMeHtps5ODZ325HF6frLo+GmkZ6PJge/K83s/CijGakuP1EcJFeh7pOjMNknssjK55W4OqQmea6jCcUc2NwXu6k+oihJOefzW0gjeROIPTjEHEyuBDd6yngaOReI/eVf+UhTUIt5GHyiez9WgDA36BBEUuZrQaqfLvGttNYsYcJ8Ue0M+ptlDRpEncMNEOfc8+U41YJRNtLQNTcbWwGlBFh1eDPHklr3licMLoZ6FLYwJV24dMYLq1Q0rlXQZ4SyWhgM02XA7l0HExt2Gg3iYybgAok2kqTeS2dKrwJS6tP+Z2g6XAM3R2PCNJdeqH1qCWllizQqqn6bKwFDmVlRhOoCTktQVD/tLZwWyoHZrVqhGGt1APeYI9Wkc7o019q0Bw4VHCwwVJZXh2Et6bFMjcLgoBwEKkyQzw0+CQS0K+2QMao/JojPOG29Qt9VqFRduQdFjT5Pd0TsTB1ax5eHrx X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aca3a405-3854-436d-dc14-08d8fe3b9494 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2021 05:18:32.4603 (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: d30uKhme3wUEbDIoy+uaPDcIdQUs+U5W92+HmuV35efkPg/6GBJXa+MAL9gLS7++CWOcfRpefc+jU8hgUYFt+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR04MB3250 Subject: [dpdk-dev] [PATCH v3 1/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 | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 157 insertions(+), 1 deletion(-) 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/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..71613a5bac --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define BBDEV_LA12XX_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, "bbdev_la12xx: " \ + fmt "\n", ##args) + +#define BBDEV_LA12XX_PMD_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, bbdev_la12xx_logtype, "bbdev_la12xx: %s(): "\ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE() BBDEV_LA12XX_PMD_DEBUG(">>") + +#define BBDEV_LA12XX_PMD_CRIT(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(CRIT, fmt, ## args) +#define BBDEV_LA12XX_PMD_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_ERR(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(ERR, fmt, ## args) +#define BBDEV_LA12XX_PMD_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define BBDEV_LA12XX_PMD_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#define BBDEV_LA12XX_PMD_DP_DEBUG(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(DEBUG, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(WARNING, 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 920e3b02ee..ba5b2e570a 100644 --- a/drivers/baseband/meson.build +++ b/drivers/baseband/meson.build @@ -5,4 +5,4 @@ if is_windows subdir_done() endif -drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100'] +drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100', 'la12xx']