[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230317080942.183514-1-yanchao.yang@mediatek.com>
Date: Fri, 17 Mar 2023 16:09:32 +0800
From: Yanchao Yang <yanchao.yang@...iatek.com>
To: Loic Poulain <loic.poulain@...aro.org>,
Sergey Ryazanov <ryazanov.s.a@...il.com>,
Johannes Berg <johannes@...solutions.net>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev ML <netdev@...r.kernel.org>,
kernel ML <linux-kernel@...r.kernel.org>
CC: Intel experts <linuxwwan@...el.com>,
Chetan <m.chetan.kumar@...el.com>,
MTK ML <linux-mediatek@...ts.infradead.org>,
Liang Lu <liang.lu@...iatek.com>,
Haijun Liu <haijun.liu@...iatek.com>,
Hua Yang <hua.yang@...iatek.com>,
Ting Wang <ting.wang@...iatek.com>,
Felix Chen <felix.chen@...iatek.com>,
Mingliang Xu <mingliang.xu@...iatek.com>,
Min Dong <min.dong@...iatek.com>,
Aiden Wang <aiden.wang@...iatek.com>,
Guohao Zhang <guohao.zhang@...iatek.com>,
Chris Feng <chris.feng@...iatek.com>,
Yanchao Yang <yanchao.yang@...iatek.com>,
Lambert Wang <lambert.wang@...iatek.com>,
Mingchuang Qiao <mingchuang.qiao@...iatek.com>,
Xiayu Zhang <xiayu.zhang@...iatek.com>,
Haozhe Chang <haozhe.chang@...iatek.com>
Subject: [PATCH net-next v4 00/10] net: wwan: tmi: PCIe driver for MediaTek M.2 modem
TMI(T-series Modem Interface) is the PCIe host device driver for MediaTek's
modem. The driver uses the WWAN framework infrastructure to create the
following control ports and network interfaces for data transactions.
* /dev/wwan0at0 - Interface that supports AT commands.
* /dev/wwan0mbim0 - Interface conforming to the MBIM protocol.
* wwan0-X - Primary network interface for IP traffic.
The main blocks in the TMI driver are:
* HW layer - Abstracts the hardware bus operations for the device, and
provides generic interfaces for the transaction layer to get the device's
information and control the device's behavior. It includes:
* PCIe - Implements probe, removal and interrupt handling.
* MHCCIF (Modem Host Cross-Core Interface) - Provides interrupt channels
for bidirectional event notification such as handshake and port enumeration.
* Transaction layer - Implements data transactions for the control plane
and the data plane. It includes:
* DPMAIF (Data Plane Modem AP Interface) - Controls the hardware that
provides uplink and downlink queues for the data path. The data exchange
takes place using circular buffers to share data buffer addresses and
metadata to describe the packets.
* CLDMA (Cross Layer DMA) - Manages the hardware used by the port layer
to send control messages to the device using MediaTek's CCCI (Cross-Core
Communication Interface) protocol.
* TX Services - Dispatch packets from the port layer to the device.
* RX Services - Dispatch packets to the port layer when receiving packets
from the device.
* Port layer - Provides control plane and data plane interfaces to userspace.
It includes:
* Control Plane - Provides device node interfaces for controlling data
transactions.
* Data Plane - Provides network link interfaces wwanX (0, 1, 2...) for IP
data transactions.
* Core logic - Contains the core logic to keep the device working.
It includes:
* FSM (Finite State Machine) - Monitors the state of the device, and
notifies each module when the state changes.
The compilation of the TMI driver is enabled by the CONFIG_MTK_TMI config
option which depends on CONFIG_WWAN.
List of contributors:
Min Dong <min.dong@...iatek.com>
Ting Wang <ting.wang@...iatek.com>
Hua Yang <hua.yang@...iatek.com>
Mingliang Xu <mingliang.xu@...iatek.com>
Felix Chen <felix.chen@...iatek.com>
Aiden Wang <aiden.wang@...iatek.com>
Guohao Zhang <guohao.zhang@...iatek.com>
Chris Feng <chris.feng@...iatek.com>
Yanchao Yang <yanchao.yang@...iatek.com>
Michael Cai <michael.cai@...iatek.com>
Lambert Wang <lambert.wang@...iatek.com>
Mingchuang Qiao <mingchuang.qiao@...iatek.com>
Xiayu Zhang <xiayu.zhang@...iatek.com>
Haozhe Chang <haozhe.chang@...iatek.com>
V4:
- Refine the naming of labels paired with goto statements.
- Avoid defensive programming, and remove some redundant input parameter checks.
- Remove include path declaration from the module Makefile.
V3:
- Remove exception handling and power management modules, and reduce data plane's features, etc.
V2:
- Remove wrapper function, use kernel interfaces instead, ex, dma_map_single, dma_pool_zalloc, ...
- Refine comments to meet kerneldoc format specification.
- Use interfaces in bitfield.h to perform bitmask related operations.
- Remove unused functions from patch-1.
- Remove patch2 (net: wwan: tmi: Add buffer management).
Yanchao Yang (10):
net: wwan: tmi: Add PCIe core
net: wwan: tmi: Add control plane transaction layer
net: wwan: tmi: Add control DMA interface
net: wwan: tmi: Add control port
net: wwan: tmi: Add FSM thread
net: wwan: tmi: Add AT & MBIM WWAN ports
net: wwan: tmi: Introduce data plane hardware interface
net: wwan: tmi: Add data plane transaction layer
net: wwan: tmi: Introduce WWAN interface
net: wwan: tmi: Add maintainers and documentation
.../networking/device_drivers/wwan/index.rst | 1 +
.../networking/device_drivers/wwan/tmi.rst | 48 +
MAINTAINERS | 11 +
drivers/net/wwan/Kconfig | 14 +
drivers/net/wwan/Makefile | 1 +
drivers/net/wwan/mediatek/Makefile | 18 +
drivers/net/wwan/mediatek/mtk_cldma.c | 280 ++
drivers/net/wwan/mediatek/mtk_cldma.h | 160 +
drivers/net/wwan/mediatek/mtk_common.h | 30 +
drivers/net/wwan/mediatek/mtk_ctrl_plane.c | 418 +++
drivers/net/wwan/mediatek/mtk_ctrl_plane.h | 111 +
drivers/net/wwan/mediatek/mtk_data_plane.h | 101 +
drivers/net/wwan/mediatek/mtk_dev.c | 50 +
drivers/net/wwan/mediatek/mtk_dev.h | 217 ++
drivers/net/wwan/mediatek/mtk_dpmaif.c | 2864 +++++++++++++++++
drivers/net/wwan/mediatek/mtk_dpmaif_drv.h | 201 ++
drivers/net/wwan/mediatek/mtk_fsm.c | 844 +++++
drivers/net/wwan/mediatek/mtk_fsm.h | 145 +
drivers/net/wwan/mediatek/mtk_port.c | 1066 ++++++
drivers/net/wwan/mediatek/mtk_port.h | 231 ++
drivers/net/wwan/mediatek/mtk_port_io.c | 547 ++++
drivers/net/wwan/mediatek/mtk_port_io.h | 45 +
drivers/net/wwan/mediatek/mtk_wwan.c | 511 +++
.../wwan/mediatek/pcie/mtk_cldma_drv_t800.c | 930 ++++++
.../wwan/mediatek/pcie/mtk_cldma_drv_t800.h | 22 +
.../wwan/mediatek/pcie/mtk_dpmaif_drv_t800.c | 1545 +++++++++
.../wwan/mediatek/pcie/mtk_dpmaif_reg_t800.h | 319 ++
drivers/net/wwan/mediatek/pcie/mtk_pci.c | 982 ++++++
drivers/net/wwan/mediatek/pcie/mtk_pci.h | 144 +
drivers/net/wwan/mediatek/pcie/mtk_reg.h | 80 +
30 files changed, 11936 insertions(+)
create mode 100644 Documentation/networking/device_drivers/wwan/tmi.rst
create mode 100644 drivers/net/wwan/mediatek/Makefile
create mode 100644 drivers/net/wwan/mediatek/mtk_cldma.c
create mode 100644 drivers/net/wwan/mediatek/mtk_cldma.h
create mode 100644 drivers/net/wwan/mediatek/mtk_common.h
create mode 100644 drivers/net/wwan/mediatek/mtk_ctrl_plane.c
create mode 100644 drivers/net/wwan/mediatek/mtk_ctrl_plane.h
create mode 100644 drivers/net/wwan/mediatek/mtk_data_plane.h
create mode 100644 drivers/net/wwan/mediatek/mtk_dev.c
create mode 100644 drivers/net/wwan/mediatek/mtk_dev.h
create mode 100644 drivers/net/wwan/mediatek/mtk_dpmaif.c
create mode 100644 drivers/net/wwan/mediatek/mtk_dpmaif_drv.h
create mode 100644 drivers/net/wwan/mediatek/mtk_fsm.c
create mode 100644 drivers/net/wwan/mediatek/mtk_fsm.h
create mode 100644 drivers/net/wwan/mediatek/mtk_port.c
create mode 100644 drivers/net/wwan/mediatek/mtk_port.h
create mode 100644 drivers/net/wwan/mediatek/mtk_port_io.c
create mode 100644 drivers/net/wwan/mediatek/mtk_port_io.h
create mode 100644 drivers/net/wwan/mediatek/mtk_wwan.c
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_cldma_drv_t800.c
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_cldma_drv_t800.h
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_dpmaif_drv_t800.c
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_dpmaif_reg_t800.h
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_pci.c
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_pci.h
create mode 100644 drivers/net/wwan/mediatek/pcie/mtk_reg.h
--
2.32.0
Powered by blists - more mailing lists