net: enetc: add initial netc-lib driver to support NTMP
authorWei Fang <wei.fang@nxp.com>
Tue, 6 May 2025 08:07:22 +0000 (16:07 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 May 2025 02:43:51 +0000 (19:43 -0700)
commit4701073c3debd16d7f534f3eb808bd9b50601c0c
tree8e220bb605f968c18aee82a9a8051f7d9a7a08c7
parentd97e2634fbdcd238a51bc363267df0139c17f4da
net: enetc: add initial netc-lib driver to support NTMP

Some NETC functionality is controlled using control messages sent to the
hardware using BD ring interface with 32B descriptor similar to transmit
BD ring used on ENETC. This BD ring interface is referred to as command
BD ring. It is used to configure functionality where the underlying
resources may be shared between different entities or being too large to
configure using direct registers. Therefore, a messaging protocol called
NETC Table Management Protocol (NTMP) is provided for exchanging
configuration and management information between the software and the
hardware using the command BD ring interface.

For the management protocol of LS1028A has been retroactively named NTMP
1.0, and its implementation is in enetc_cbdr.c and enetc_qos.c. However,
NTMP of i.MX95 has been upgraded to version 2.0, which is incompatible
with LS1028A, because the message formats have been changed. Therefore,
add the netc-lib driver to support NTMP 2.0 to operate various tables.
Note that, only MAC address filter table and RSS table are supported at
the moment. More tables will be supported in subsequent patches.

It is worth mentioning that the purpose of the netc-lib driver is to
provide some NTMP-based generic interfaces for ENETC and NETC Switch
drivers. Currently, it only supports the configurations of some tables.
Interfaces such as tc flower and debugfs will be added in the future.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250506080735.3444381-2-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
MAINTAINERS
drivers/net/ethernet/freescale/enetc/Kconfig
drivers/net/ethernet/freescale/enetc/Makefile
drivers/net/ethernet/freescale/enetc/ntmp.c [new file with mode: 0644]
drivers/net/ethernet/freescale/enetc/ntmp_private.h [new file with mode: 0644]
include/linux/fsl/ntmp.h [new file with mode: 0644]