baseband/la12xx: introduce NXP LA12xx driver

This patch introduce the baseband device drivers for NXP's
LA1200 series software defined baseband modem.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
This commit is contained in:
Nipun Gupta 2021-10-17 12:23:25 +05:30 committed by Akhil Goyal
parent ab4e19097b
commit f218a1f920
8 changed files with 228 additions and 0 deletions

View File

@ -1296,6 +1296,16 @@ F: drivers/event/opdl/
F: doc/guides/eventdevs/opdl.rst
Baseband Drivers
----------------
NXP LA12xx
M: Nipun Gupta <nipun.gupta@nxp.com>
M: Hemant Agrawal <hemant.agrawal@nxp.com>
F: drivers/baseband/la12xx/
F: doc/guides/bbdevs/la12xx.rst
Rawdev Drivers
--------------

View File

@ -14,3 +14,4 @@ Baseband Device Drivers
fpga_lte_fec
fpga_5gnr_fec
acc100
la12xx

View File

@ -0,0 +1,71 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright 2021 NXP
NXP LA12xx Poll Mode Driver
===========================
The BBDEV LA12xx poll mode driver (PMD) supports an implementation for
offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless
acceleration function, using PCI based LA12xx Software defined radio.
More information can be found at `NXP Official Website
<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-access-la1200-programmable-baseband-processor:LA1200>`_.
Features
--------
LA12xx PMD supports the following features:
- Maximum of 8 LDPC decode (UL) queues
- Maximum of 8 LDPC encode (DL) queues
- PCIe Gen-3 x8 Interface
Installation
------------
Section 3 of the DPDK manual provides instructions on installing and compiling DPDK.
DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual.
Initialization
--------------
The device can be listed on the host console with:
Use the following lspci command to get the multiple LA12xx processor ids. The
device ID of the LA12xx baseband processor is "1c30".
.. code-block:: console
sudo lspci -nn
...
0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] (
rev 10)
...
0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] (
rev 10)
Prerequisites
-------------
Currently supported by DPDK:
- NXP LA1224 BSP **1.0+**.
- NXP LA1224 PCIe Modem card connected to ARM host.
- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup the basic DPDK environment.
Enabling logs
-------------
For enabling logs, use the following EAL parameter:
.. code-block:: console
./your_bbdev_application <EAL args> --log-level=la12xx:<level>
Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be
enabled which are lower than logging ``level``.

View File

@ -0,0 +1,108 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2020-2021 NXP
*/
#include <string.h>
#include <rte_common.h>
#include <rte_bus_vdev.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_kvargs.h>
#include <rte_bbdev.h>
#include <rte_bbdev_pmd.h>
#include <bbdev_la12xx_pmd_logs.h>
#define DRIVER_NAME baseband_la12xx
/* 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);
RTE_LOG_REGISTER_DEFAULT(bbdev_la12xx_logtype, NOTICE);

View File

@ -0,0 +1,28 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2020 NXP
*/
#ifndef _BBDEV_LA12XX_PMD_LOGS_H_
#define _BBDEV_LA12XX_PMD_LOGS_H_
extern int bbdev_la12xx_logtype;
#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_ */

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020-2021 NXP
deps += ['bbdev', 'bus_vdev', 'ring']
sources = files('bbdev_la12xx.c')

View File

@ -0,0 +1,3 @@
DPDK_22 {
local: *;
};

View File

@ -9,6 +9,7 @@ drivers = [
'acc100',
'fpga_5gnr_fec',
'fpga_lte_fec',
'la12xx',
'null',
'turbo_sw',
]