Skip to content

Commit ae76e8d

Browse files
author
Paolo Abeni
committed
Merge branch 'add-ppe-driver-for-qualcomm-ipq9574-soc'
Luo Jie says: ==================== Add PPE driver for Qualcomm IPQ9574 SoC The PPE (packet process engine) hardware block is available in Qualcomm IPQ chipsets that support PPE architecture, such as IPQ9574 and IPQ5332. The PPE in the IPQ9574 SoC includes six Ethernet ports (6 GMAC and 6 XGMAC), which are used to connect with external PHY devices by PCS. The PPE also includes packet processing offload capabilities for various networking functions such as route and bridge flows, VLANs, different tunnel protocols and VPN. It also includes an L2 switch function for bridging packets among the 6 Ethernet ports and the CPU port. The CPU port enables packet transfer between the Ethernet ports and the ARM cores in the SoC, using the Ethernet DMA. This patch series is the first part of a three part series that will together enable Ethernet function for IPQ9574 SoC. While support is initially being added for IPQ9574 SoC, the driver will be easily extendable to enable Ethernet support for other IPQ SoC such as IPQ5332. The driver can also be extended later for adding support for L2/L3 network offload features that the PPE can support. The functionality to be enabled by each of the three series (to be posted sequentially) is as below: Part 1: The PPE patch series (this series), which enables the platform driver, probe and initialization/configuration of different PPE hardware blocks. Part 2: The PPE MAC patch series, which enables the phylink operations for the PPE Ethernet ports. Part 3: The PPE EDMA patch series, which enables the Rx/Tx Ethernet DMA and netdevice driver for the 6 PPE Ethernet ports. A more detailed description of the functions enabled by part 1 is below: 1. Initialize PPE device hardware functions such as buffer management, queue management, scheduler and clocks in order to bring up PPE device. 2. Enable platform driver and probe functions 3. Register debugfs file to provide access to various PPE packet counters. These statistics are recorded by the various hardware process counters, such as port RX/TX, CPU code and hardware queue counters. 4. A detailed introduction of PPE along with the PPE hardware diagram in the first two patches (dt-bindings and documentation). Below is a reference to an earlier RFC discussion with the community about enabling Ethernet driver support for Qualcomm IPQ9574 SoC. This writeup can help provide a higher level architectural view of various other drivers that support the PPE such as clock and PCS drivers. Topic: RFC: Advice on adding support for Qualcomm IPQ9574 SoC Ethernet. https://lore.kernel.org/linux-arm-msm/[email protected]/ Signed-off-by: Luo Jie <[email protected]> ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents d051b1f + ad5cef7 commit ae76e8d

File tree

14 files changed

+4842
-0
lines changed

14 files changed

+4842
-0
lines changed

Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml

Lines changed: 533 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/networking/device_drivers/ethernet/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Contents:
5050
neterion/s2io
5151
netronome/nfp
5252
pensando/ionic
53+
qualcomm/ppe/ppe
5354
smsc/smc9
5455
stmicro/stmmac
5556
ti/cpsw
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
===============================================
4+
PPE Ethernet Driver for Qualcomm IPQ SoC Family
5+
===============================================
6+
7+
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
8+
9+
Author: Lei Wei <[email protected]>
10+
11+
12+
Contents
13+
========
14+
15+
- `PPE Overview`_
16+
- `PPE Driver Overview`_
17+
- `PPE Driver Supported SoCs`_
18+
- `Enabling the Driver`_
19+
- `Debugging`_
20+
21+
22+
PPE Overview
23+
============
24+
25+
IPQ (Qualcomm Internet Processor) SoC (System-on-Chip) series is Qualcomm's series of
26+
networking SoC for Wi-Fi access points. The PPE (Packet Process Engine) is the Ethernet
27+
packet process engine in the IPQ SoC.
28+
29+
Below is a simplified hardware diagram of IPQ9574 SoC which includes the PPE engine and
30+
other blocks which are in the SoC but outside the PPE engine. These blocks work together
31+
to enable the Ethernet for the IPQ SoC::
32+
33+
+------+ +------+ +------+ +------+ +------+ +------+ start +-------+
34+
|netdev| |netdev| |netdev| |netdev| |netdev| |netdev|<------|PHYLINK|
35+
+------+ +------+ +------+ +------+ +------+ +------+ stop +-+-+-+-+
36+
| | | ^
37+
+-------+ +-------------------------+--------+----------------------+ | | |
38+
| GCC | | | EDMA | | | | |
39+
+---+---+ | PPE +---+----+ | | | |
40+
| clk | | | | | |
41+
+-------->| +-----------------------+------+-----+---------------+ | | | |
42+
| | Switch Core |Port0 | |Port7(EIP FIFO)| | | | |
43+
| | +---+--+ +------+--------+ | | | |
44+
| | | | | | | | |
45+
+-------+ | | +------+---------------+----+ | | | | |
46+
|CMN PLL| | | +---+ +---+ +----+ | +--------+ | | | | | |
47+
+---+---+ | | |BM | |QM | |SCH | | | L2/L3 | ....... | | | | | |
48+
| | | | +---+ +---+ +----+ | +--------+ | | | | | |
49+
| | | | +------+--------------------+ | | | | |
50+
| | | | | | | | | |
51+
| v | | +-----+-+-----+-+-----+-+-+---+--+-----+-+-----+ | | | | |
52+
| +------+ | | |Port1| |Port2| |Port3| |Port4| |Port5| |Port6| | | | | |
53+
| |NSSCC | | | +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ | | mac| | |
54+
| +-+-+--+ | | |MAC0 | |MAC1 | |MAC2 | |MAC3 | |MAC4 | |MAC5 | | |<---+ | |
55+
| ^ | |clk | | +-----+-+-----+-+-----+-+-----+--+-----+-+-----+ | | ops | |
56+
| | | +------>| +----|------|-------|-------|---------|--------|-----+ | | |
57+
| | | +---------------------------------------------------------+ | |
58+
| | | | | | | | | | |
59+
| | | MII clk | QSGMII USXGMII USXGMII | |
60+
| | +--------------->| | | | | | | |
61+
| | +-------------------------+ +---------+ +---------+ | |
62+
| |125/312.5MHz clk| (PCS0) | | (PCS1) | | (PCS2) | pcs ops | |
63+
| +----------------+ UNIPHY0 | | UNIPHY1 | | UNIPHY2 |<--------+ |
64+
+----------------->| | | | | | |
65+
| 31.25MHz ref clk +-------------------------+ +---------+ +---------+ |
66+
| | | | | | | |
67+
| +-----------------------------------------------------+ |
68+
|25/50MHz ref clk| +-------------------------+ +------+ +------+ | link |
69+
+--------------->| | QUAD PHY | | PHY4 | | PHY5 | |---------+
70+
| +-------------------------+ +------+ +------+ | change
71+
| |
72+
| MDIO bus |
73+
+-----------------------------------------------------+
74+
75+
The CMN (Common) PLL, NSSCC (Networking Sub System Clock Controller) and GCC (Global
76+
Clock Controller) blocks are in the SoC and act as clock providers.
77+
78+
The UNIPHY block is in the SoC and provides the PCS (Physical Coding Sublayer) and
79+
XPCS (10-Gigabit Physical Coding Sublayer) functions to support different interface
80+
modes between the PPE MAC and the external PHY.
81+
82+
This documentation focuses on the descriptions of PPE engine and the PPE driver.
83+
84+
The Ethernet functionality in the PPE (Packet Process Engine) is comprised of three
85+
components: the switch core, port wrapper and Ethernet DMA.
86+
87+
The Switch core in the IPQ9574 PPE has maximum of 6 front panel ports and two FIFO
88+
interfaces. One of the two FIFO interfaces is used for Ethernet port to host CPU
89+
communication using Ethernet DMA. The other one is used to communicate to the EIP
90+
engine which is used for IPsec offload. On the IPQ9574, the PPE includes 6 GMAC/XGMACs
91+
that can be connected with external Ethernet PHY. Switch core also includes BM (Buffer
92+
Management), QM (Queue Management) and SCH (Scheduler) modules for supporting the
93+
packet processing.
94+
95+
The port wrapper provides connections from the 6 GMAC/XGMACS to UNIPHY (PCS) supporting
96+
various modes such as SGMII/QSGMII/PSGMII/USXGMII/10G-BASER. There are 3 UNIPHY (PCS)
97+
instances supported on the IPQ9574.
98+
99+
Ethernet DMA is used to transmit and receive packets between the Ethernet subsystem
100+
and ARM host CPU.
101+
102+
The following lists the main blocks in the PPE engine which will be driven by this
103+
PPE driver:
104+
105+
- BM
106+
BM is the hardware buffer manager for the PPE switch ports.
107+
- QM
108+
Queue Manager for managing the egress hardware queues of the PPE switch ports.
109+
- SCH
110+
The scheduler which manages the hardware traffic scheduling for the PPE switch ports.
111+
- L2
112+
The L2 block performs the packet bridging in the switch core. The bridge domain is
113+
represented by the VSI (Virtual Switch Instance) domain in PPE. FDB learning can be
114+
enabled based on the VSI domain and bridge forwarding occurs within the VSI domain.
115+
- MAC
116+
The PPE in the IPQ9574 supports up to six MACs (MAC0 to MAC5) which are corresponding
117+
to six switch ports (port1 to port6). The MAC block is connected with external PHY
118+
through the UNIPHY PCS block. Each MAC block includes the GMAC and XGMAC blocks and
119+
the switch port can select to use GMAC or XMAC through a MUX selection according to
120+
the external PHY's capability.
121+
- EDMA (Ethernet DMA)
122+
The Ethernet DMA is used to transmit and receive Ethernet packets between the PPE
123+
ports and the ARM cores.
124+
125+
The received packet on a PPE MAC port can be forwarded to another PPE MAC port. It can
126+
be also forwarded to internal switch port0 so that the packet can be delivered to the
127+
ARM cores using the Ethernet DMA (EDMA) engine. The Ethernet DMA driver will deliver the
128+
packet to the corresponding 'netdevice' interface.
129+
130+
The software instantiations of the PPE MAC (netdevice), PCS and external PHYs interact
131+
with the Linux PHYLINK framework to manage the connectivity between the PPE ports and
132+
the connected PHYs, and the port link states. This is also illustrated in above diagram.
133+
134+
135+
PPE Driver Overview
136+
===================
137+
PPE driver is Ethernet driver for the Qualcomm IPQ SoC. It is a single platform driver
138+
which includes the PPE part and Ethernet DMA part. The PPE part initializes and drives the
139+
various blocks in PPE switch core such as BM/QM/L2 blocks and the PPE MACs. The EDMA part
140+
drives the Ethernet DMA for packet transfer between PPE ports and ARM cores, and enables
141+
the netdevice driver for the PPE ports.
142+
143+
The PPE driver files in drivers/net/ethernet/qualcomm/ppe/ are listed as below:
144+
145+
- Makefile
146+
- ppe.c
147+
- ppe.h
148+
- ppe_config.c
149+
- ppe_config.h
150+
- ppe_debugfs.c
151+
- ppe_debugfs.h
152+
- ppe_regs.h
153+
154+
The ppe.c file contains the main PPE platform driver and undertakes the initialization of
155+
PPE switch core blocks such as QM, BM and L2. The configuration APIs for these hardware
156+
blocks are provided in the ppe_config.c file.
157+
158+
The ppe.h defines the PPE device data structure which will be used by PPE driver functions.
159+
160+
The ppe_debugfs.c enables the PPE statistics counters such as PPE port Rx and Tx counters,
161+
CPU code counters and queue counters.
162+
163+
164+
PPE Driver Supported SoCs
165+
=========================
166+
167+
The PPE driver supports the following IPQ SoC:
168+
169+
- IPQ9574
170+
171+
172+
Enabling the Driver
173+
===================
174+
175+
The driver is located in the menu structure at::
176+
177+
-> Device Drivers
178+
-> Network device support (NETDEVICES [=y])
179+
-> Ethernet driver support
180+
-> Qualcomm devices
181+
-> Qualcomm Technologies, Inc. PPE Ethernet support
182+
183+
If the driver is built as a module, the module will be called qcom-ppe.
184+
185+
The PPE driver functionally depends on the CMN PLL and NSSCC clock controller drivers.
186+
Please make sure the dependent modules are installed before installing the PPE driver
187+
module.
188+
189+
190+
Debugging
191+
=========
192+
193+
The PPE hardware counters can be accessed using debugfs interface from the
194+
``/sys/kernel/debug/ppe/`` directory.

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20836,6 +20836,14 @@ S: Maintained
2083620836
F: Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
2083720837
F: drivers/power/supply/qcom_smbx.c
2083820838

20839+
QUALCOMM PPE DRIVER
20840+
M: Luo Jie <[email protected]>
20841+
20842+
S: Supported
20843+
F: Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml
20844+
F: Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst
20845+
F: drivers/net/ethernet/qualcomm/ppe/
20846+
2083920847
QUALCOMM QSEECOM DRIVER
2084020848
M: Maximilian Luz <[email protected]>
2084120849

drivers/net/ethernet/qualcomm/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ config QCOM_EMAC
6060
low power, Receive-Side Scaling (RSS), and IEEE 1588-2008
6161
Precision Clock Synchronization Protocol.
6262

63+
config QCOM_PPE
64+
tristate "Qualcomm Technologies, Inc. PPE Ethernet support"
65+
depends on HAS_IOMEM && OF
66+
depends on COMMON_CLK
67+
select REGMAP_MMIO
68+
help
69+
This driver supports the Qualcomm Technologies, Inc. packet
70+
process engine (PPE) available with IPQ SoC. The PPE includes
71+
the Ethernet MACs, Ethernet DMA (EDMA) and switch core that
72+
supports L3 flow offload, L2 switch function, RSS and tunnel
73+
offload.
74+
75+
To compile this driver as a module, choose M here. The module
76+
will be called qcom-ppe.
77+
6378
source "drivers/net/ethernet/qualcomm/rmnet/Kconfig"
6479

6580
endif # NET_VENDOR_QUALCOMM

drivers/net/ethernet/qualcomm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ qcauart-objs := qca_uart.o
1111

1212
obj-y += emac/
1313

14+
obj-$(CONFIG_QCOM_PPE) += ppe/
1415
obj-$(CONFIG_RMNET) += rmnet/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
#
3+
# Makefile for the device driver of PPE (Packet Process Engine) in IPQ SoC
4+
#
5+
6+
obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o
7+
qcom-ppe-objs := ppe.o ppe_config.o ppe_debugfs.o

0 commit comments

Comments
 (0)