* [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC
@ 2026-10-08 14:51 Luo Jie
2026-10-08 14:51 ` [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb Luo Jie
` (12 more replies)
0 siblings, 13 replies; 21+ messages in thread
From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman,
Jonathan Corbet, Shuah Khan, Randy Dunlap
Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc,
quic_kkumarcs, quic_linchen, Luo Jie
This series adds support in the PPE driver for the IPQ5424 SoC.
IPQ5424 integrates the same PPE switch core as IPQ9574, but with a few
differences:
1.) It has 3 Ethernet ports plus 1 EDMA FIFO, instead of IPQ9574's 6 ports,
1 EDMA FIFO and 1 EIP FIFO.
2.) The PPE clock runs at 375 MHz instead of IPQ9574's 353 MHz.
3.) It requires a different, smaller set of interconnect paths.
4.) It uses different BM (buffer management), QM (queue management) and
scheduler configurations.
The first two patches are fixes, independent of the IPQ5424 support:
- Split the EDMA reset in the devicetree binding into the separate system
and APB resets.
- Fix the multicast queue configuration table index, which is out of range
for every multicast queue on both IPQ9574 and IPQ5424.
The remaining patches add the IPQ5424 support:
- Add IPQ5424 to the devicetree binding.
- Document IPQ5424 as a supported SoC.
- Add the IPQ5424 platform data for the clock rate, port count, register
space and interconnect paths.
- Add the IPQ5424 BM buffer configuration.
- Add the IPQ5424 QM configuration.
- Add the IPQ5424 scheduler resource configuration.
- Add the IPQ5424 scheduler configuration.
- Add the IPQ5424 service code configuration.
- Add the IPQ5424 counters for debugfs.
Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
Luo Jie (11):
dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb
net: ethernet: qualcomm: ppe: Fix multicast queue config table index
dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support
docs: networking: Document IPQ5424 as a supported SoC
net: ethernet: qualcomm: ppe: Add platform support for IPQ5424
net: ethernet: qualcomm: ppe: Add IPQ5424 BM buffer configuration
net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration
net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler resource configuration
net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler configuration
net: ethernet: qualcomm: ppe: Add IPQ5424 service code configuration
net: ethernet: qualcomm: ppe: Add IPQ5424 counter debugfs support
.../devicetree/bindings/net/qcom,ipq9574-ppe.yaml | 103 ++++-
.../device_drivers/ethernet/qualcomm/ppe/ppe.rst | 8 +
drivers/net/ethernet/qualcomm/ppe/ppe.c | 137 +++++-
drivers/net/ethernet/qualcomm/ppe/ppe.h | 15 +
drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 467 +++++++++++++++++++--
drivers/net/ethernet/qualcomm/ppe/ppe_config.h | 4 +
drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c | 14 +-
drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 83 +++-
8 files changed, 742 insertions(+), 89 deletions(-)
---
base-commit: 8df0638138d3e0344fd1fb36cf2d1ca1cf5028f0
change-id: 20261008-qcom_ipq5424_ppe-70b0ed41bf1e
Best regards,
--
Luo Jie <jie.luo@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 21+ messages in thread* [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 19:49 ` Rob Herring (Arm) 2026-10-08 14:51 ` [PATCH net-next 02/11] net: ethernet: qualcomm: ppe: Fix multicast queue config table index Luo Jie ` (11 subsequent siblings) 12 siblings, 1 reply; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie The EDMA reset is described in the binding as a single reset, but the hardware has two separate EDMA resets, the system reset and the APB reset. The reset used in the example is a combined reset that covers both of them. Describe the EDMA resets as two separate entries named "sys" and "apb", in the same way as the EDMA clocks, and update the example accordingly. The EDMA driver has not been merged upstream yet, and no in-tree device tree uses the ethernet-dma node, so there is no existing user of this binding and it is safe to update it without breaking the ABI. Fixes: 1898fc572118 ("dt-bindings: net: Add PPE for Qualcomm IPQ9574 SoC") Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- .../devicetree/bindings/net/qcom,ipq9574-ppe.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml b/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml index 6d0b21a10732..c899f4b56945 100644 --- a/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml @@ -144,8 +144,14 @@ properties: - const: apb resets: - maxItems: 1 - description: EDMA reset + items: + - description: EDMA system reset + - description: EDMA APB reset + + reset-names: + items: + - const: sys + - const: apb interrupts: minItems: 65 @@ -170,6 +176,7 @@ properties: - clocks - clock-names - resets + - reset-names - interrupts - interrupt-names @@ -273,7 +280,10 @@ examples: <&nsscc NSS_CC_PPE_EDMA_CFG_CLK>; clock-names = "sys", "apb"; - resets = <&nsscc EDMA_HW_RESET>; + resets = <&nsscc PPE_EDMA_ARES>, + <&nsscc PPE_EDMA_CFG_ARES>; + reset-names = "sys", + "apb"; interrupts = <GIC_SPI 363 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 364 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 365 IRQ_TYPE_LEVEL_HIGH>, -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb 2026-10-08 14:51 ` [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb Luo Jie @ 2026-10-08 19:49 ` Rob Herring (Arm) 0 siblings, 0 replies; 21+ messages in thread From: Rob Herring (Arm) @ 2026-10-08 19:49 UTC (permalink / raw) To: Luo Jie Cc: Paolo Abeni, Lei Wei, Andrew Lunn, Eric Dumazet, Jakub Kicinski, linux-arm-msm, netdev, Conor Dooley, quic_kkumarcs, Shuah Khan, Krzysztof Kozlowski, David S. Miller, Jonathan Corbet, linux-kernel, linux-doc, Suruchi Agarwal, devicetree, Simon Horman, quic_linchen, Pavithra R, Randy Dunlap On Thu, 08 Oct 2026 07:51:33 -0700, Luo Jie wrote: > The EDMA reset is described in the binding as a single reset, but the > hardware has two separate EDMA resets, the system reset and the APB reset. > The reset used in the example is a combined reset that covers both of them. > > Describe the EDMA resets as two separate entries named "sys" and "apb", in > the same way as the EDMA clocks, and update the example accordingly. > > The EDMA driver has not been merged upstream yet, and no in-tree device > tree uses the ethernet-dma node, so there is no existing user of this > binding and it is safe to update it without breaking the ABI. > > Fixes: 1898fc572118 ("dt-bindings: net: Add PPE for Qualcomm IPQ9574 SoC") > Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> > --- > .../devicetree/bindings/net/qcom,ipq9574-ppe.yaml | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > Reviewed-by: Rob Herring (Arm) <robh@kernel.org> ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH net-next 02/11] net: ethernet: qualcomm: ppe: Fix multicast queue config table index 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie 2026-10-08 14:51 ` [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-09 14:52 ` sashiko-bot 2026-10-08 14:51 ` [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support Luo Jie ` (10 subsequent siblings) 12 siblings, 1 reply; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie PPE queues 0-255 are unicast queues and queues from 256 onwards are multicast queues. The multicast queue configuration table has its own index, starting from 0 for the first multicast queue. The driver uses the absolute queue ID as the index of this table, which is out of range for every multicast queue. As a result, the multicast queue thresholds are never configured, and unrelated QM registers are written instead. Fix it by converting the queue ID to the index of the multicast queue configuration table. Fixes: 806268dc7efd ("net: ethernet: qualcomm: Initialize PPE queue management for IPQ9574") Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c index 125b73be92b1..8a553902ffad 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -1530,8 +1530,13 @@ static int ppe_config_qm(struct ppe_device *ppe_dev) if (ret) goto qm_config_fail; } else { + /* The multicast queue table is indexed from 0 for + * the first multicast queue, which follows the + * unicast queues. + */ reg = PPE_AC_MULTICAST_QUEUE_CFG_TBL_ADDR + - PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * queue_id; + PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * + (queue_id - PPE_AC_UNICAST_QUEUE_CFG_TBL_ENTRIES); ret = regmap_bulk_read(ppe_dev->regmap, reg, multicast_queue_cfg, -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 02/11] net: ethernet: qualcomm: ppe: Fix multicast queue config table index 2026-10-08 14:51 ` [PATCH net-next 02/11] net: ethernet: qualcomm: ppe: Fix multicast queue config table index Luo Jie @ 2026-10-09 14:52 ` sashiko-bot 0 siblings, 0 replies; 21+ messages in thread From: sashiko-bot @ 2026-10-09 14:52 UTC (permalink / raw) To: Luo Jie; +Cc: devicetree, conor+dt, robh Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] net: ethernet: qualcomm: out-of-bounds regmap access due to incorrect multicast_queue_cfg size -- commit e63c30c06634bbba4d742f77aae5726bcf70fb62 Author: Luo Jie <jie.luo@oss.qualcomm.com> net: ethernet: qualcomm: ppe: Fix multicast queue config table index PPE queues 0-255 are unicast queues and queues from 256 onwards are multicast queues. The multicast queue configuration table has its own index, starting from 0 for the first multicast queue. The driver previously used the absolute queue ID as the index, which was out of range. This commit fixes it by converting the queue ID to the correct multicast table index. > diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c > index 125b73be92b13..8a553902ffad1 100644 > --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c > +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c > @@ -1530,8 +1530,13 @@ static int ppe_config_qm(struct ppe_device *ppe_dev) > if (ret) > goto qm_config_fail; > } else { > + /* The multicast queue table is indexed from 0 for > + * the first multicast queue, which follows the > + * unicast queues. > + */ > reg = PPE_AC_MULTICAST_QUEUE_CFG_TBL_ADDR + > - PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * queue_id; > + PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * > + (queue_id - PPE_AC_UNICAST_QUEUE_CFG_TBL_ENTRIES); > > ret = regmap_bulk_read(ppe_dev->regmap, reg, > multicast_queue_cfg, > ARRAY_SIZE(multicast_queue_cfg)); [Severity: Medium] In ppe_config_qm(), multicast_queue_cfg is declared as a 5-element array: u32 multicast_queue_cfg[5]; This means ARRAY_SIZE(multicast_queue_cfg) evaluates to 5 words (20 bytes). However, the hardware table entry increment (PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC) is only 4 words (16 bytes). Since this patch changes the index to correctly target the multicast queue configuration table, does this regmap_bulk_read() over-read by 1 word into the next queue's entry? Additionally, a few lines later, regmap_bulk_write() also writes 5 words: ret = regmap_bulk_write(ppe_dev->regmap, reg, multicast_queue_cfg, ARRAY_SIZE(multicast_queue_cfg)); For the final queue in the loop, wouldn't writing 20 bytes overflow the 16-byte boundary and write 4 bytes past the end of the entire multicast queue configuration table? Can this out-of-bounds register access trigger a bus error or system abort on the SoC? -- Sashiko AI review · https://sashiko.dev/#/patchset/20261008-qcom_ipq5424_ppe-v1-0-16caf43e44ee@oss.qualcomm.com?part=2 ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie 2026-10-08 14:51 ` [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb Luo Jie 2026-10-08 14:51 ` [PATCH net-next 02/11] net: ethernet: qualcomm: ppe: Fix multicast queue config table index Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 20:08 ` Rob Herring (Arm) 2026-10-09 14:52 ` sashiko-bot 2026-10-08 14:51 ` [PATCH net-next 04/11] docs: networking: Document IPQ5424 as a supported SoC Luo Jie ` (9 subsequent siblings) 12 siblings, 2 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie IPQ5424 integrates the same PPE switch core as IPQ9574, but requires a different, smaller set of interconnect paths, and has only 3 front panel ports plus the EDMA FIFO interface, without the EIP FIFO. Add the IPQ5424 compatible, describe the interconnect paths of each SoC, and limit the Ethernet ports of IPQ5424 to ports 1-3. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- .../devicetree/bindings/net/qcom,ipq9574-ppe.yaml | 87 +++++++++++++++++----- 1 file changed, 70 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml b/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml index c899f4b56945..e5d218fc5d82 100644 --- a/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml @@ -74,9 +74,14 @@ description: | +------->| QCA8075 PHY | | PHY4 | | PHY5 | (clock) +-------------------------------------+ +-------+ +-------+ + The IPQ5424 PPE reuses the same switch core, but wires up only 3 + front panel ports (GMAC0-2) and the single EDMA FIFO interface; it + has no EIP FIFO and no ports 4-6. + properties: compatible: enum: + - qcom,ipq5424-ppe - qcom,ipq9574-ppe reg: @@ -105,24 +110,16 @@ properties: description: PPE switch miscellaneous interrupt interconnects: - items: - - description: Bus interconnect path leading to PPE switch core function - - description: Bus interconnect path leading to PPE register access - - description: Bus interconnect path leading to QoS generation - - description: Bus interconnect path leading to timeout reference - - description: Bus interconnect path leading to NSS NOC from memory NOC - - description: Bus interconnect path leading to memory NOC from NSS NOC - - description: Bus interconnect path leading to enhanced memory NOC from NSS NOC + minItems: 5 + maxItems: 7 + description: + The number of interconnect paths depends on compatible, 5 paths for + qcom,ipq5424-ppe and 7 paths for qcom,ipq9574-ppe, enumerated in the + allOf conditionals below. interconnect-names: - items: - - const: ppe - - const: ppe_cfg - - const: qos_gen - - const: timeout_ref - - const: nssnoc_memnoc - - const: memnoc_nssnoc - - const: memnoc_nssnoc_1 + minItems: 5 + maxItems: 7 ethernet-dma: type: object @@ -182,7 +179,7 @@ properties: ethernet-ports: patternProperties: - "^ethernet-port@[1-6]+$": + "^ethernet-port@[1-6]$": type: object unevaluatedProperties: false $ref: ethernet-switch-port.yaml# @@ -236,6 +233,62 @@ required: allOf: - $ref: ethernet-switch.yaml + - if: + properties: + compatible: + contains: + const: qcom,ipq9574-ppe + then: + properties: + interconnects: + items: + - description: Bus interconnect path leading to PPE switch core function + - description: Bus interconnect path leading to PPE register access + - description: Bus interconnect path leading to QoS generation + - description: Bus interconnect path leading to timeout reference + - description: Bus interconnect path leading to NSS NOC from memory NOC + - description: Bus interconnect path leading to memory NOC from NSS NOC + - description: Bus interconnect path leading to enhanced memory NOC from NSS NOC + + interconnect-names: + items: + - const: ppe + - const: ppe_cfg + - const: qos_gen + - const: timeout_ref + - const: nssnoc_memnoc + - const: memnoc_nssnoc + - const: memnoc_nssnoc_1 + - if: + properties: + compatible: + contains: + const: qcom,ipq5424-ppe + then: + properties: + interconnects: + items: + - description: Bus interconnect path leading to PPE switch core function + - description: Bus interconnect path leading to PPE register access + - description: Bus interconnect path leading to CE AXI + - description: Bus interconnect path leading to CE APB + - description: Bus interconnect path leading to NSS CSR access + + interconnect-names: + items: + - const: ppe + - const: ppe_cfg + - const: nssnoc_ce_axi + - const: nssnoc_ce_apb + - const: nssnoc_nss_csr + + ethernet-ports: + patternProperties: + "^ethernet-port@[1-3]$": + properties: + reg: + maximum: 3 + "^ethernet-port@[4-6]$": false unevaluatedProperties: false -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support 2026-10-08 14:51 ` [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support Luo Jie @ 2026-10-08 20:08 ` Rob Herring (Arm) 2026-10-09 14:52 ` sashiko-bot 1 sibling, 0 replies; 21+ messages in thread From: Rob Herring (Arm) @ 2026-10-08 20:08 UTC (permalink / raw) To: Luo Jie Cc: Pavithra R, Paolo Abeni, Shuah Khan, Eric Dumazet, linux-arm-msm, linux-kernel, Conor Dooley, Jonathan Corbet, David S. Miller, linux-doc, Andrew Lunn, Randy Dunlap, Suruchi Agarwal, Jakub Kicinski, quic_kkumarcs, devicetree, quic_linchen, Krzysztof Kozlowski, Lei Wei, Simon Horman, netdev On Thu, 08 Oct 2026 07:51:35 -0700, Luo Jie wrote: > IPQ5424 integrates the same PPE switch core as IPQ9574, but requires a > different, smaller set of interconnect paths, and has only 3 front panel > ports plus the EDMA FIFO interface, without the EIP FIFO. > > Add the IPQ5424 compatible, describe the interconnect paths of each SoC, > and limit the Ethernet ports of IPQ5424 to ports 1-3. > > Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> > --- > .../devicetree/bindings/net/qcom,ipq9574-ppe.yaml | 87 +++++++++++++++++----- > 1 file changed, 70 insertions(+), 17 deletions(-) > Reviewed-by: Rob Herring (Arm) <robh@kernel.org> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support 2026-10-08 14:51 ` [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support Luo Jie 2026-10-08 20:08 ` Rob Herring (Arm) @ 2026-10-09 14:52 ` sashiko-bot 1 sibling, 0 replies; 21+ messages in thread From: sashiko-bot @ 2026-10-09 14:52 UTC (permalink / raw) To: Luo Jie; +Cc: conor+dt, devicetree, robh Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] dt-bindings: missing minItems/maxItems in conditionals allows incorrect array lengths - [Low] dt-bindings: incomplete ethernet-ports restriction allows out-of-bounds ports -- commit dead4fe7fe0227c2a98000bdee56dfba287669d7 Author: Luo Jie <jie.luo@oss.qualcomm.com> dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support This commit adds the IPQ5424 compatible to the IPQ9574 PPE binding. It describes the interconnect paths for each SoC and limits the Ethernet ports for IPQ5424 to ports 1-3. > diff --git a/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml b/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml > --- a/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml > +++ b/Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml [ ... ] > @@ -236,6 +233,62 @@ required: > > allOf: > - $ref: ethernet-switch.yaml > + - if: > + properties: > + compatible: > + contains: > + const: qcom,ipq9574-ppe > + then: > + properties: > + interconnects: > + items: > + - description: Bus interconnect path leading to PPE switch core function > + - description: Bus interconnect path leading to PPE register access > + - description: Bus interconnect path leading to QoS generation > + - description: Bus interconnect path leading to timeout reference > + - description: Bus interconnect path leading to NSS NOC from memory NOC > + - description: Bus interconnect path leading to memory NOC from NSS NOC > + - description: Bus interconnect path leading to enhanced memory NOC from NSS NOC [Severity: Medium] Does this array need explicit minItems and maxItems to strictly enforce the length? According to standard JSON Schema rules, an items array inside a conditional block validates the matching indices but does not enforce the array length unless minItems and maxItems are explicitly declared. Since the global schema allows minItems: 5, could an incomplete IPQ9574 node with only 5 interconnects falsely pass validation here? > + > + interconnect-names: > + items: > + - const: ppe > + - const: ppe_cfg > + - const: qos_gen > + - const: timeout_ref > + - const: nssnoc_memnoc > + - const: memnoc_nssnoc > + - const: memnoc_nssnoc_1 > + - if: > + properties: > + compatible: > + contains: > + const: qcom,ipq5424-ppe > + then: > + properties: > + interconnects: > + items: > + - description: Bus interconnect path leading to PPE switch core function > + - description: Bus interconnect path leading to PPE register access > + - description: Bus interconnect path leading to CE AXI > + - description: Bus interconnect path leading to CE APB > + - description: Bus interconnect path leading to NSS CSR access [Severity: Medium] Similarly, should minItems and maxItems be explicitly set to 5 here? Without these limits, an IPQ5424 node could declare 7 interconnects and pass because it satisfies the global maxItems: 7 constraint, leaving the trailing 2 elements unchecked. > + > + interconnect-names: > + items: > + - const: ppe > + - const: ppe_cfg > + - const: nssnoc_ce_axi > + - const: nssnoc_ce_apb > + - const: nssnoc_nss_csr > + > + ethernet-ports: > + patternProperties: > + "^ethernet-port@[1-3]$": > + properties: > + reg: > + maximum: 3 > + "^ethernet-port@[4-6]$": false [Severity: Low] Does this workaround fully restrict the out-of-bounds ports for IPQ5424? The top-level ethernet-ports container lacks an unevaluatedProperties: false constraint. Because ethernet-switch.yaml (included via allOf) dynamically matches any port matching ^(ethernet-)?port@[0-9a-f]+$ as a generic object, out-of-bounds nodes like ethernet-port@7 would pass ethernet-switch.yaml's checks. Since this block explicitly sets ^ethernet-port@[4-6]$: false but does not cap the container itself, will ports 7 and above silently pass schema validation? -- Sashiko AI review · https://sashiko.dev/#/patchset/20261008-qcom_ipq5424_ppe-v1-0-16caf43e44ee@oss.qualcomm.com?part=3 ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH net-next 04/11] docs: networking: Document IPQ5424 as a supported SoC 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (2 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:51 ` [PATCH net-next 05/11] net: ethernet: qualcomm: ppe: Add platform support for IPQ5424 Luo Jie ` (8 subsequent siblings) 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie Update the qualcomm PPE driver documentation to list IPQ5424 among the supported SoCs, and describe the per-SoC PPE hardware differences. The IPQ5424 PPE reuses the same switch core as IPQ9574, but runs at a clock rate of 375 MHz and supports only 3 front panel ports along with the EDMA FIFO port for host CPU communication. The EIP FIFO port is not available on IPQ5424. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- .../networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst b/Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst index 4ab299a28969..04c48cec66d5 100644 --- a/Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst +++ b/Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst @@ -167,6 +167,14 @@ PPE Driver Supported SoCs The PPE driver supports the following IPQ SoC: - IPQ9574 + The PPE runs at a clock rate of 353 MHz. The switch core has 6 front panel + ports (port1 to port6) and two FIFO interfaces: the EDMA FIFO (port0) for + the host CPU communication and the EIP FIFO (port7) for the EIP engine. +- IPQ5424 + The PPE reuses the same switch core as IPQ9574 and runs at a clock rate of + 375 MHz. It supports 3 front panel ports (port1 to port3) with MAC0 to MAC2, + and only the EDMA FIFO interface (port0) for the host CPU communication. The + EIP FIFO and port4 to port6 are not available. Enabling the Driver -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH net-next 05/11] net: ethernet: qualcomm: ppe: Add platform support for IPQ5424 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (3 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 04/11] docs: networking: Document IPQ5424 as a supported SoC Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:51 ` [PATCH net-next 06/11] net: ethernet: qualcomm: ppe: Add IPQ5424 BM buffer configuration Luo Jie ` (7 subsequent siblings) 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie IPQ5424 integrates the same PPE switch core as IPQ9574, but has only 3 Ethernet ports plus the EDMA FIFO, without the EIP FIFO. The PPE clock runs at 375 MHz instead of IPQ9574's 353 MHz, and IPQ5424 requires a different, smaller set of interconnect paths. The register space of the unavailable MAC3 to MAC5 must also not be accessed on IPQ5424. Add the platform data per SoC to describe these differences, and add the IPQ5424 compatible. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe.c | 132 ++++++++++++++++++++++++++++---- 1 file changed, 116 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c index 3c301e609d3e..f71b673b6f97 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -18,13 +18,34 @@ #include "ppe_config.h" #include "ppe_debugfs.h" -#define PPE_PORT_MAX 8 -#define PPE_CLK_RATE 353000000 +#define IPQ9574_PPE_CLK_RATE 353000000 +#define IPQ5424_PPE_CLK_RATE 375000000 + +/* 6 physical ports, 1 EDMA FIFO and 1 EIP FIFO. */ +#define IPQ9574_PPE_PORT_MAX 8 +/* 3 physical ports and 1 EDMA FIFO. */ +#define IPQ5424_PPE_PORT_MAX 4 + +/** + * struct ppe_of_data - PPE private data of IPQ SoC + * @ppe_rate: PPE clock rate + * @num_ports: Number of PPE ports + * @regmap_config: Regmap configuration + * @icc_paths: Interconnect paths per PPE type + * @num_icc_paths: Number of ICC paths + */ +struct ppe_of_data { + unsigned long ppe_rate; + int num_ports; + const struct regmap_config *regmap_config; + const struct icc_bulk_data *icc_paths; + int num_icc_paths; +}; /* ICC clocks for enabling PPE device. The avg_bw and peak_bw with value 0 * will be updated by the clock rate of PPE. */ -static const struct icc_bulk_data ppe_icc_data[] = { +static const struct icc_bulk_data ipq9574_ppe_icc_data[] = { { .name = "ppe", .avg_bw = 0, @@ -62,6 +83,34 @@ static const struct icc_bulk_data ppe_icc_data[] = { }, }; +static const struct icc_bulk_data ipq5424_ppe_icc_data[] = { + { + .name = "ppe", + .avg_bw = 0, + .peak_bw = 0, + }, + { + .name = "ppe_cfg", + .avg_bw = 0, + .peak_bw = 0, + }, + { + .name = "nssnoc_ce_axi", + .avg_bw = 0, + .peak_bw = 0, + }, + { + .name = "nssnoc_ce_apb", + .avg_bw = 0, + .peak_bw = 0, + }, + { + .name = "nssnoc_nss_csr", + .avg_bw = 100000, + .peak_bw = 100000, + }, +}; + static const struct regmap_range ppe_readable_ranges[] = { regmap_reg_range(0x0, 0x1ff), /* Global */ regmap_reg_range(0x400, 0x5ff), /* LPI CSR */ @@ -108,7 +157,36 @@ static const struct regmap_config regmap_config_ipq9574 = { .max_register = 0xbef800, }; -static int ppe_clock_init_and_reset(struct ppe_device *ppe_dev) +/* For IPQ5424, there are only three Ethernet ports, the register space of + * GMAC/XGMAC 3-5 is unavailable. + */ +static const struct regmap_range ppe_reserved_ranges_ipq5424[] = { + regmap_reg_range(0x1600, 0x17ff), /* GMAC3 */ + regmap_reg_range(0x1800, 0x19ff), /* GMAC4 */ + regmap_reg_range(0x1a00, 0x1bff), /* GMAC5 */ + regmap_reg_range(0x50c000, 0x50ffff), /* XGMAC3 */ + regmap_reg_range(0x510000, 0x513fff), /* XGMAC4 */ + regmap_reg_range(0x514000, 0x517fff), /* XGMAC5 */ +}; + +static const struct regmap_access_table ppe_reg_table_ipq5424 = { + .yes_ranges = ppe_readable_ranges, + .n_yes_ranges = ARRAY_SIZE(ppe_readable_ranges), + .no_ranges = ppe_reserved_ranges_ipq5424, + .n_no_ranges = ARRAY_SIZE(ppe_reserved_ranges_ipq5424), +}; + +static const struct regmap_config regmap_config_ipq5424 = { + .reg_bits = 32, + .reg_stride = 4, + .val_bits = 32, + .rd_table = &ppe_reg_table_ipq5424, + .wr_table = &ppe_reg_table_ipq5424, + .max_register = 0xbef800, +}; + +static int ppe_clock_init_and_reset(struct ppe_device *ppe_dev, + const struct ppe_of_data *data) { unsigned long ppe_rate = ppe_dev->clk_rate; struct device *dev = ppe_dev->dev; @@ -118,15 +196,15 @@ static int ppe_clock_init_and_reset(struct ppe_device *ppe_dev) int ret, i; for (i = 0; i < ppe_dev->num_icc_paths; i++) { - ppe_dev->icc_paths[i].name = ppe_icc_data[i].name; - ppe_dev->icc_paths[i].avg_bw = ppe_icc_data[i].avg_bw ? : + ppe_dev->icc_paths[i].name = data->icc_paths[i].name; + ppe_dev->icc_paths[i].avg_bw = data->icc_paths[i].avg_bw ? : Bps_to_icc(ppe_rate); /* PPE does not have an explicit peak bandwidth requirement, * so set the peak bandwidth to be equal to the average * bandwidth. */ - ppe_dev->icc_paths[i].peak_bw = ppe_icc_data[i].peak_bw ? : + ppe_dev->icc_paths[i].peak_bw = data->icc_paths[i].peak_bw ? : Bps_to_icc(ppe_rate); } @@ -173,12 +251,17 @@ static int ppe_clock_init_and_reset(struct ppe_device *ppe_dev) static int qcom_ppe_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + const struct ppe_of_data *data; struct ppe_device *ppe_dev; void __iomem *base; - int ret, num_icc; + int ret; + + data = of_device_get_match_data(dev); + if (!data) + return dev_err_probe(dev, -EINVAL, "PPE no match data provided\n"); - num_icc = ARRAY_SIZE(ppe_icc_data); - ppe_dev = devm_kzalloc(dev, struct_size(ppe_dev, icc_paths, num_icc), + ppe_dev = devm_kzalloc(dev, + struct_size(ppe_dev, icc_paths, data->num_icc_paths), GFP_KERNEL); if (!ppe_dev) return -ENOMEM; @@ -187,16 +270,16 @@ static int qcom_ppe_probe(struct platform_device *pdev) if (IS_ERR(base)) return dev_err_probe(dev, PTR_ERR(base), "PPE ioremap failed\n"); - ppe_dev->regmap = devm_regmap_init_mmio(dev, base, ®map_config_ipq9574); + ppe_dev->regmap = devm_regmap_init_mmio(dev, base, data->regmap_config); if (IS_ERR(ppe_dev->regmap)) return dev_err_probe(dev, PTR_ERR(ppe_dev->regmap), "PPE initialize regmap failed\n"); ppe_dev->dev = dev; - ppe_dev->clk_rate = PPE_CLK_RATE; - ppe_dev->num_ports = PPE_PORT_MAX; - ppe_dev->num_icc_paths = num_icc; + ppe_dev->clk_rate = data->ppe_rate; + ppe_dev->num_ports = data->num_ports; + ppe_dev->num_icc_paths = data->num_icc_paths; - ret = ppe_clock_init_and_reset(ppe_dev); + ret = ppe_clock_init_and_reset(ppe_dev, data); if (ret) return dev_err_probe(dev, ret, "PPE clock config failed\n"); @@ -218,8 +301,25 @@ static void qcom_ppe_remove(struct platform_device *pdev) ppe_debugfs_teardown(ppe_dev); } +static const struct ppe_of_data ipq9574_data = { + .ppe_rate = IPQ9574_PPE_CLK_RATE, + .num_ports = IPQ9574_PPE_PORT_MAX, + .regmap_config = ®map_config_ipq9574, + .icc_paths = ipq9574_ppe_icc_data, + .num_icc_paths = ARRAY_SIZE(ipq9574_ppe_icc_data), +}; + +static const struct ppe_of_data ipq5424_data = { + .ppe_rate = IPQ5424_PPE_CLK_RATE, + .num_ports = IPQ5424_PPE_PORT_MAX, + .regmap_config = ®map_config_ipq5424, + .icc_paths = ipq5424_ppe_icc_data, + .num_icc_paths = ARRAY_SIZE(ipq5424_ppe_icc_data), +}; + static const struct of_device_id qcom_ppe_of_match[] = { - { .compatible = "qcom,ipq9574-ppe" }, + { .compatible = "qcom,ipq9574-ppe", .data = &ipq9574_data }, + { .compatible = "qcom,ipq5424-ppe", .data = &ipq5424_data }, {} }; MODULE_DEVICE_TABLE(of, qcom_ppe_of_match); -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH net-next 06/11] net: ethernet: qualcomm: ppe: Add IPQ5424 BM buffer configuration 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (4 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 05/11] net: ethernet: qualcomm: ppe: Add platform support for IPQ5424 Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:51 ` [PATCH net-next 07/11] net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration Luo Jie ` (6 subsequent siblings) 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie IPQ5424 has fewer PPE ports than IPQ9574, so it requires a different buffer configuration per port, and more buffers are left for the shared buffer pool. IPQ5424 also has more BM ports than IPQ9574, 19 versus 15, so some BM register tables have more entries on IPQ5424, and some of them are located at different addresses. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe.c | 5 ++ drivers/net/ethernet/qualcomm/ppe/ppe.h | 15 ++++ drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 96 ++++++++++++++++++++++---- drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 35 +++++++--- 4 files changed, 131 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c index f71b673b6f97..b144fd818998 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -28,6 +28,7 @@ /** * struct ppe_of_data - PPE private data of IPQ SoC + * @type: PPE type value * @ppe_rate: PPE clock rate * @num_ports: Number of PPE ports * @regmap_config: Regmap configuration @@ -35,6 +36,7 @@ * @num_icc_paths: Number of ICC paths */ struct ppe_of_data { + enum ppe_type type; unsigned long ppe_rate; int num_ports; const struct regmap_config *regmap_config; @@ -275,6 +277,7 @@ static int qcom_ppe_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(ppe_dev->regmap), "PPE initialize regmap failed\n"); ppe_dev->dev = dev; + ppe_dev->type = data->type; ppe_dev->clk_rate = data->ppe_rate; ppe_dev->num_ports = data->num_ports; ppe_dev->num_icc_paths = data->num_icc_paths; @@ -302,6 +305,7 @@ static void qcom_ppe_remove(struct platform_device *pdev) } static const struct ppe_of_data ipq9574_data = { + .type = IPQ9574_PPE, .ppe_rate = IPQ9574_PPE_CLK_RATE, .num_ports = IPQ9574_PPE_PORT_MAX, .regmap_config = ®map_config_ipq9574, @@ -310,6 +314,7 @@ static const struct ppe_of_data ipq9574_data = { }; static const struct ppe_of_data ipq5424_data = { + .type = IPQ5424_PPE, .ppe_rate = IPQ5424_PPE_CLK_RATE, .num_ports = IPQ5424_PPE_PORT_MAX, .regmap_config = ®map_config_ipq5424, diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.h b/drivers/net/ethernet/qualcomm/ppe/ppe.h index 27458f0bc206..33b876d2e079 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.h @@ -13,10 +13,24 @@ struct device; struct regmap; struct dentry; +/** + * enum ppe_type - PPE device type. + * @IPQ9574_PPE: PPE device of IPQ9574. + * @IPQ5424_PPE: PPE device of IPQ5424. + * + * PPE type is used to identify the PPE device of the different + * IPQ platform. + */ +enum ppe_type { + IPQ9574_PPE, + IPQ5424_PPE, +}; + /** * struct ppe_device - PPE device private data. * @dev: PPE device structure. * @regmap: PPE register map. + * @type: Different PPE type on various IPQ SoC. * @clk_rate: PPE clock rate. * @num_ports: Number of PPE ports. * @debugfs_root: Debugfs root entry. @@ -30,6 +44,7 @@ struct dentry; struct ppe_device { struct device *dev; struct regmap *regmap; + enum ppe_type type; unsigned long clk_rate; unsigned int num_ports; struct dentry *debugfs_root; diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c index 8a553902ffad..3afa57119323 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -230,6 +230,56 @@ static const struct ppe_bm_port_config ipq9574_ppe_bm_port_config[] = { }, }; +/* IPQ5424 has fewer PPE physical ports (3) than IPQ9574 (6), so fewer + * buffers need to be reserved for per-port purposes. Out of the same + * 2048 total, the rest assigned to the general 'group0' pool is + * correspondingly larger here, 1650 versus IPQ9574's 1550. + */ +static const int ipq5424_ppe_bm_group_config = 1650; + +/* The buffer configurations per PPE port on IPQ5424. There are 19 BM + * ports supported by PPE. BM port (0-15) is for EDMA port 0, and BM + * port (16-18) is for the 3 PPE physical ports. + */ +static const struct ppe_bm_port_config ipq5424_ppe_bm_port_config[] = { + { + /* Buffer configuration for the BM port ID 0 of EDMA. */ + .port_id_start = 0, + .port_id_end = 0, + .pre_alloc = 0, + .in_fly_buf = 100, + .ceil = 1146, + .weight = 7, + .resume_offset = 8, + .resume_ceil = 0, + .dynamic = true, + }, + { + /* Buffer configuration for the BM port ID 1-15 of EDMA. */ + .port_id_start = 1, + .port_id_end = 15, + .pre_alloc = 0, + .in_fly_buf = 100, + .ceil = 250, + .weight = 4, + .resume_offset = 36, + .resume_ceil = 0, + .dynamic = true, + }, + { + /* Buffer configuration for the BM port ID 16-18 of PPE ports. */ + .port_id_start = 16, + .port_id_end = 18, + .pre_alloc = 0, + .in_fly_buf = 128, + .ceil = 250, + .weight = 4, + .resume_offset = 36, + .resume_ceil = 0, + .dynamic = true, + }, +}; + /* QM fetches the packet from PPE buffer management for transmitting the * packet out. The QM group configuration limits the total number of buffers * enqueued by all PPE hardware queues. @@ -1413,7 +1463,7 @@ static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, /* Assign the default group ID 0 to the BM port. */ val = FIELD_PREP(PPE_BM_PORT_GROUP_ID_SHARED_GROUP_ID, 0); - reg = PPE_BM_PORT_GROUP_ID_ADDR + PPE_BM_PORT_GROUP_ID_INC * bm_port_id; + reg = PPE_BM_PORT_GROUP_ID_ADDR(ppe_dev) + PPE_BM_PORT_GROUP_ID_INC * bm_port_id; ret = regmap_update_bits(ppe_dev->regmap, reg, PPE_BM_PORT_GROUP_ID_SHARED_GROUP_ID, val); @@ -1431,25 +1481,38 @@ static int ppe_config_bm(struct ppe_device *ppe_dev) { const struct ppe_bm_port_config *port_cfg; unsigned int i, bm_port_id, port_cfg_cnt; - u32 reg, val; + u32 reg, val, group_cfg; int ret; + switch (ppe_dev->type) { + case IPQ9574_PPE: + port_cfg = ipq9574_ppe_bm_port_config; + port_cfg_cnt = ARRAY_SIZE(ipq9574_ppe_bm_port_config); + group_cfg = ipq9574_ppe_bm_group_config; + break; + case IPQ5424_PPE: + port_cfg = ipq5424_ppe_bm_port_config; + port_cfg_cnt = ARRAY_SIZE(ipq5424_ppe_bm_port_config); + group_cfg = ipq5424_ppe_bm_group_config; + break; + default: + dev_err(ppe_dev->dev, "Invalid PPE type %d\n", ppe_dev->type); + return -EINVAL; + } + + reg = PPE_BM_SHARED_GROUP_CFG_ADDR(ppe_dev); + /* Configure the allocated buffer number only for group 0. * The buffer number of group 1-3 is already cleared to 0 * after PPE reset during the probe of PPE driver. */ - reg = PPE_BM_SHARED_GROUP_CFG_ADDR; - val = FIELD_PREP(PPE_BM_SHARED_GROUP_CFG_SHARED_LIMIT, - ipq9574_ppe_bm_group_config); + val = FIELD_PREP(PPE_BM_SHARED_GROUP_CFG_SHARED_LIMIT, group_cfg); ret = regmap_update_bits(ppe_dev->regmap, reg, PPE_BM_SHARED_GROUP_CFG_SHARED_LIMIT, val); if (ret) goto bm_config_fail; - /* Configure buffer thresholds for the BM ports. */ - port_cfg = ipq9574_ppe_bm_port_config; - port_cfg_cnt = ARRAY_SIZE(ipq9574_ppe_bm_port_config); for (i = 0; i < port_cfg_cnt; i++) { for (bm_port_id = port_cfg[i].port_id_start; bm_port_id <= port_cfg[i].port_id_end; bm_port_id++) { @@ -1472,12 +1535,23 @@ static int ppe_config_bm(struct ppe_device *ppe_dev) */ static int ppe_config_qm(struct ppe_device *ppe_dev) { + int ret, i, group_buffer_cfg, queue_id, queue_cfg_count; const struct ppe_qm_queue_config *queue_cfg; - int ret, i, queue_id, queue_cfg_count; u32 reg, multicast_queue_cfg[5]; u32 unicast_queue_cfg[4]; u32 group_cfg[3]; + switch (ppe_dev->type) { + case IPQ9574_PPE: + group_buffer_cfg = ipq9574_ppe_qm_group_config; + queue_cfg = ipq9574_ppe_qm_queue_config; + queue_cfg_count = ARRAY_SIZE(ipq9574_ppe_qm_queue_config); + break; + default: + dev_err(ppe_dev->dev, "Invalid PPE type %d\n", ppe_dev->type); + return -EINVAL; + } + /* Assign the buffer number to the group 0 by default. */ reg = PPE_AC_GRP_CFG_TBL_ADDR; ret = regmap_bulk_read(ppe_dev->regmap, reg, @@ -1485,15 +1559,13 @@ static int ppe_config_qm(struct ppe_device *ppe_dev) if (ret) goto qm_config_fail; - PPE_AC_GRP_SET_BUF_LIMIT(group_cfg, ipq9574_ppe_qm_group_config); + PPE_AC_GRP_SET_BUF_LIMIT(group_cfg, group_buffer_cfg); ret = regmap_bulk_write(ppe_dev->regmap, reg, group_cfg, ARRAY_SIZE(group_cfg)); if (ret) goto qm_config_fail; - queue_cfg = ipq9574_ppe_qm_queue_config; - queue_cfg_count = ARRAY_SIZE(ipq9574_ppe_qm_queue_config); for (i = 0; i < queue_cfg_count; i++) { queue_id = queue_cfg[i].queue_start; diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h index 746dfbb5a682..441e8e04a80b 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -386,17 +386,32 @@ #define PPE_PSCH_SCH_CFG_TBL_DES_SECOND_PORT_EN BIT(16) #define PPE_PSCH_SCH_CFG_TBL_DES_SECOND_PORT GENMASK(20, 17) -/* There are 15 BM ports and 4 BM groups supported by PPE. - * BM port (0-7) is for EDMA port 0, BM port (8-13) is for - * PPE physical port 1-6 and BM port 14 is for EIP port. +/* There are 15 BM ports on IPQ9574 and 19 BM ports on IPQ5424, and + * 4 BM groups supported by PPE. On IPQ9574, BM port (0-7) is for EDMA + * port 0, BM port (8-13) is for PPE physical port 1-6 and BM port 14 + * is for EIP port. On IPQ5424, BM port (0-15) is for EDMA port 0 and + * BM port (16-18) is for PPE physical port 1-3. + * + * The per-BM-port tables PPE_BM_PORT_FC_MODE and PPE_BM_PORT_FC_CFG_TBL + * are at the same address on both SoCs, IPQ5424 only has more entries. */ +#define PPE_BM_PORT_IPQ9574_ENTRIES 15 +#define PPE_BM_PORT_IPQ5424_ENTRIES 19 +#define PPE_BM_PORT_ENTRIES(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_PORT_IPQ5424_ENTRIES : \ + PPE_BM_PORT_IPQ9574_ENTRIES) + #define PPE_BM_PORT_FC_MODE_ADDR 0x600100 -#define PPE_BM_PORT_FC_MODE_ENTRIES 15 +#define PPE_BM_PORT_FC_MODE_ENTRIES(ppe_dev) PPE_BM_PORT_ENTRIES(ppe_dev) #define PPE_BM_PORT_FC_MODE_INC 0x4 #define PPE_BM_PORT_FC_MODE_EN BIT(0) -#define PPE_BM_PORT_GROUP_ID_ADDR 0x600180 -#define PPE_BM_PORT_GROUP_ID_ENTRIES 15 +#define PPE_BM_PORT_GROUP_ID_IPQ9574_ADDR 0x600180 +#define PPE_BM_PORT_GROUP_ID_IPQ5424_ADDR 0x6001c0 +#define PPE_BM_PORT_GROUP_ID_ADDR(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_PORT_GROUP_ID_IPQ5424_ADDR : \ + PPE_BM_PORT_GROUP_ID_IPQ9574_ADDR) +#define PPE_BM_PORT_GROUP_ID_ENTRIES(ppe_dev) PPE_BM_PORT_ENTRIES(ppe_dev) #define PPE_BM_PORT_GROUP_ID_INC 0x4 #define PPE_BM_PORT_GROUP_ID_SHARED_GROUP_ID GENMASK(1, 0) @@ -412,13 +427,17 @@ #define PPE_BM_REACT_CNT_TBL_INC 0x4 #define PPE_BM_REACT_CNT_VAL GENMASK(8, 0) -#define PPE_BM_SHARED_GROUP_CFG_ADDR 0x600290 +#define PPE_BM_SHARED_GROUP_CFG_IPQ9574_ADDR 0x600290 +#define PPE_BM_SHARED_GROUP_CFG_IPQ5424_ADDR 0x6002f0 +#define PPE_BM_SHARED_GROUP_CFG_ADDR(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_SHARED_GROUP_CFG_IPQ5424_ADDR : \ + PPE_BM_SHARED_GROUP_CFG_IPQ9574_ADDR) #define PPE_BM_SHARED_GROUP_CFG_ENTRIES 4 #define PPE_BM_SHARED_GROUP_CFG_INC 0x4 #define PPE_BM_SHARED_GROUP_CFG_SHARED_LIMIT GENMASK(10, 0) #define PPE_BM_PORT_FC_CFG_TBL_ADDR 0x601000 -#define PPE_BM_PORT_FC_CFG_TBL_ENTRIES 15 +#define PPE_BM_PORT_FC_CFG_TBL_ENTRIES(ppe_dev) PPE_BM_PORT_ENTRIES(ppe_dev) #define PPE_BM_PORT_FC_CFG_TBL_INC 0x10 #define PPE_BM_PORT_FC_W0_REACT_LIMIT GENMASK(8, 0) #define PPE_BM_PORT_FC_W0_RESUME_THRESHOLD GENMASK(17, 9) -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH net-next 07/11] net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (5 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 06/11] net: ethernet: qualcomm: ppe: Add IPQ5424 BM buffer configuration Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-09 14:52 ` sashiko-bot 2026-10-08 14:51 ` [PATCH net-next 08/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler resource configuration Luo Jie ` (5 subsequent siblings) 12 siblings, 1 reply; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie Multicast queues are dedicated per PPE port. IPQ5424 has only 3 physical PPE ports, versus IPQ9574's 6 PPE ports, so multicast queues 284 to 299 are not available on IPQ5424, and 2010 buffers are assigned to the shared group0 buffer pool, instead of IPQ9574's 2000. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c index 3afa57119323..dec8eed77253 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -314,6 +314,37 @@ static const struct ppe_qm_queue_config ipq9574_ppe_qm_queue_config[] = { }, }; +/* Multicast queues are dedicated per PPE port. IPQ5424 has only 3 physical + * PPE ports, versus IPQ9574's 6 PPE ports, so multicast queues 284 to 299 + * are not available on IPQ5424, and the buffer pool assigned to the general + * 'group0' is larger here, 2010 versus IPQ9574's 2000. + */ +static const int ipq5424_ppe_qm_group_config = 2010; + +/* Default QM settings for unicast and multicast queues for IPQ5424. */ +static const struct ppe_qm_queue_config ipq5424_ppe_qm_queue_config[] = { + { + /* QM settings for unicast queues 0 to 255. */ + .queue_start = 0, + .queue_end = 255, + .prealloc_buf = 0, + .ceil = 1200, + .weight = 7, + .resume_offset = 36, + .dynamic = true, + }, + { + /* QM settings for multicast queues 256 to 283. */ + .queue_start = 256, + .queue_end = 283, + .prealloc_buf = 0, + .ceil = 250, + .weight = 0, + .resume_offset = 36, + .dynamic = false, + }, +}; + /* PPE scheduler configuration for BM includes multiple entries. Each entry * indicates the primary port to be assigned the buffers for the ingress or * to release the buffers for the egress. Backup port ID will be used when @@ -1547,6 +1578,11 @@ static int ppe_config_qm(struct ppe_device *ppe_dev) queue_cfg = ipq9574_ppe_qm_queue_config; queue_cfg_count = ARRAY_SIZE(ipq9574_ppe_qm_queue_config); break; + case IPQ5424_PPE: + group_buffer_cfg = ipq5424_ppe_qm_group_config; + queue_cfg = ipq5424_ppe_qm_queue_config; + queue_cfg_count = ARRAY_SIZE(ipq5424_ppe_qm_queue_config); + break; default: dev_err(ppe_dev->dev, "Invalid PPE type %d\n", ppe_dev->type); return -EINVAL; -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 07/11] net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration 2026-10-08 14:51 ` [PATCH net-next 07/11] net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration Luo Jie @ 2026-10-09 14:52 ` sashiko-bot 0 siblings, 0 replies; 21+ messages in thread From: sashiko-bot @ 2026-10-09 14:52 UTC (permalink / raw) To: Luo Jie; +Cc: conor+dt, devicetree, robh Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] ppe: debugfs queue counter iteration reads nonexistent queues on IPQ5424 causing bus errors -- commit 4fb437e4b3cf979efa2cd54481de8f5ac5e4963f Author: Luo Jie <jie.luo@oss.qualcomm.com> net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration This commit adds the Quality of Service (QM) configuration for the IPQ5424 PPE. It configures the unicast and multicast queues, noting that IPQ5424 has fewer PPE ports and thus lacks multicast queues 284 to 299. > diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c > index 3afa571193238..dec8eed772539 100644 > --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c > +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c > @@ -314,6 +314,37 @@ static const struct ppe_qm_queue_config ipq9574_ppe_qm_queue_config[] = { > }, > }; > > +/* Multicast queues are dedicated per PPE port. IPQ5424 has only 3 physical > + * PPE ports, versus IPQ9574's 6 PPE ports, so multicast queues 284 to 299 > + * are not available on IPQ5424, and the buffer pool assigned to the general > + * 'group0' is larger here, 2010 versus IPQ9574's 2000. > + */ [Severity: High] Since multicast queues 284 to 299 are not available on IPQ5424, will reading or writing the debugfs counters for these queues cause a bus error? In drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c:ppe_queue_counter_get(), the code loops up to PPE_QUEUE_TX_COUNTER_TBL_ENTRIES (300): for (i = 0; i < PPE_QUEUE_TX_COUNTER_TBL_ENTRIES; i++) { ... } else { int mq_offset = i - PPE_AC_UNICAST_QUEUE_CFG_TBL_ENTRIES; ... if (mq_offset < PPE_P0_MULTICAST_QUEUE_NUM) { reg = PPE_CPU_PORT_MULTICAST_FORCE_DROP_CNT_TBL_ADDR(mq_offset); } else { mq_offset -= PPE_P0_MULTICAST_QUEUE_NUM; reg = PPE_P1_MULTICAST_DROP_CNT_TBL_ADDR; reg += (mq_offset / PPE_MULTICAST_QUEUE_NUM) * PPE_MULTICAST_QUEUE_PORT_ADDR_INC; For queues 284-299, this calculates an MMIO address for non-existent logical ports 4, 5, and 6 on IPQ5424. Does this lead to an unmapped register access and a kernel panic when a user reads the 'qm' debugfs file? A similar unconditional loop occurs in ppe_packet_counter_write() up to queue 299: case PPE_CNT_QM: for (i = 0; i < PPE_QUEUE_TX_COUNTER_TBL_ENTRIES; i++) { Could this also trigger a panic when writing to the 'qm' debugfs file? -- Sashiko AI review · https://sashiko.dev/#/patchset/20261008-qcom_ipq5424_ppe-v1-0-16caf43e44ee@oss.qualcomm.com?part=7 ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH net-next 08/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler resource configuration 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (6 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 07/11] net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:51 ` [PATCH net-next 09/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler configuration Luo Jie ` (4 subsequent siblings) 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie The PPE scheduler resources, such as queues and scheduler nodes, are assigned per PPE port, followed by one reserved resource entry. IPQ5424 has fewer PPE ports than IPQ9574, so its reserved resource is located at a different position. Add the dedicated scheduler resource configuration for IPQ5424. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 84 ++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c index dec8eed77253..87d55f7b7975 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -814,7 +814,7 @@ static const struct ppe_scheduler_port_config ppe_port_sch_config[] = { /* The scheduler resource is applied to each PPE port, The resource * includes the unicast & multicast queues, flow nodes and DRR nodes. */ -static const struct ppe_port_schedule_resource ppe_scheduler_res[] = { +static const struct ppe_port_schedule_resource ipq9574_ppe_scheduler_res[] = { { .ucastq_start = 0, .ucastq_end = 63, .mcastq_start = 256, @@ -916,6 +916,64 @@ static const struct ppe_port_schedule_resource ppe_scheduler_res[] = { }, }; +static const struct ppe_port_schedule_resource ipq5424_ppe_scheduler_res[] = { + { .ucastq_start = 0, + .ucastq_end = 63, + .mcastq_start = 256, + .mcastq_end = 271, + .flow_id_start = 0, + .flow_id_end = 0, + .l0node_start = 0, + .l0node_end = 7, + .l1node_start = 0, + .l1node_end = 0, + }, + { .ucastq_start = 144, + .ucastq_end = 159, + .mcastq_start = 272, + .mcastq_end = 275, + .flow_id_start = 36, + .flow_id_end = 39, + .l0node_start = 48, + .l0node_end = 63, + .l1node_start = 8, + .l1node_end = 11, + }, + { .ucastq_start = 160, + .ucastq_end = 175, + .mcastq_start = 276, + .mcastq_end = 279, + .flow_id_start = 40, + .flow_id_end = 43, + .l0node_start = 64, + .l0node_end = 79, + .l1node_start = 12, + .l1node_end = 15, + }, + { .ucastq_start = 176, + .ucastq_end = 191, + .mcastq_start = 280, + .mcastq_end = 283, + .flow_id_start = 44, + .flow_id_end = 47, + .l0node_start = 80, + .l0node_end = 95, + .l1node_start = 16, + .l1node_end = 19, + }, + { .ucastq_start = 64, + .ucastq_end = 143, + .mcastq_start = 0, + .mcastq_end = 0, + .flow_id_start = 1, + .flow_id_end = 35, + .l0node_start = 8, + .l0node_end = 47, + .l1node_start = 1, + .l1node_end = 7, + }, +}; + /* Set the PPE queue level scheduler configuration. */ static int ppe_scheduler_l0_queue_map_set(struct ppe_device *ppe_dev, int node_id, int port, @@ -1153,15 +1211,31 @@ int ppe_port_resource_get(struct ppe_device *ppe_dev, int port, enum ppe_resource_type type, int *res_start, int *res_end) { + const struct ppe_port_schedule_resource *scheduler_res; struct ppe_port_schedule_resource res; + unsigned int scheduler_res_len; + + switch (ppe_dev->type) { + case IPQ9574_PPE: + scheduler_res = ipq9574_ppe_scheduler_res; + scheduler_res_len = ARRAY_SIZE(ipq9574_ppe_scheduler_res); + break; + case IPQ5424_PPE: + scheduler_res = ipq5424_ppe_scheduler_res; + scheduler_res_len = ARRAY_SIZE(ipq5424_ppe_scheduler_res); + break; + default: + dev_err(ppe_dev->dev, "Invalid PPE type %d\n", ppe_dev->type); + return -EINVAL; + } - /* The reserved resource with the maximum port ID of PPE is - * also allowed to be acquired. + /* The reserved resource, stored at the last entry of the + * scheduler resource table, is also allowed to be acquired. */ - if (port > ppe_dev->num_ports) + if (port >= scheduler_res_len) return -EINVAL; - res = ppe_scheduler_res[port]; + res = scheduler_res[port]; switch (type) { case PPE_RES_UCAST: *res_start = res.ucastq_start; -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH net-next 09/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler configuration 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (7 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 08/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler resource configuration Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:51 ` [PATCH net-next 10/11] net: ethernet: qualcomm: ppe: Add IPQ5424 service code configuration Luo Jie ` (3 subsequent siblings) 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie The PPE scheduler arbitrates the access to the BM and QM among the PPE ports. IPQ5424 has a different port topology than IPQ9574, so it requires its own BM and QM scheduler configuration. Add the BM and QM scheduler configuration tables for IPQ5424. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 231 +++++++++++++++++++++++-- 1 file changed, 221 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c index 87d55f7b7975..83e1f2d30258 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -520,6 +520,205 @@ static const struct ppe_scheduler_qm_config ipq9574_ppe_sch_qm_config[] = { {0x98, 6, 5, true, 2}, }; +static const struct ppe_scheduler_bm_config ipq5424_ppe_sch_bm_config[] = { + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 1}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, false, 0}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 2}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 1, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 3}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 3}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 1, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 1}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, false, 0}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 3}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 2, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 3}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 1, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 1}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, false, 0}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 3}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 2, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 1}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 3, true, 2}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 1, false, 0}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 3}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 3, false, 0}, + {true, PPE_SCH_EGRESS, 1, true, 2}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 3, false, 0}, + {true, PPE_SCH_INGRESS, 2, false, 0}, + {true, PPE_SCH_EGRESS, 0, false, 0}, + {true, PPE_SCH_INGRESS, 1, false, 0}, + {true, PPE_SCH_EGRESS, 2, true, 3}, + {true, PPE_SCH_INGRESS, 0, false, 0}, + {true, PPE_SCH_EGRESS, 1, false, 0}, +}; + +/* ensch_port_bmp is left as 0 for every entry here, unlike + * ipq9574_ppe_sch_qm_config[] above. This is expected for IPQ5424, + * not an omission. + */ +static const struct ppe_scheduler_qm_config ipq5424_ppe_sch_qm_config[] = { + {0x0, 3, 2, false, 0}, + {0x0, 1, 3, false, 0}, + {0x0, 0, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 3, 1, true, 0}, + {0x0, 3, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 3, 1, true, 0}, + {0x0, 3, 2, false, 0}, + {0x0, 1, 3, false, 0}, + {0x0, 0, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 3, 1, true, 0}, + {0x0, 3, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 0, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 3, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 3, 2, true, 0}, + {0x0, 3, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 1, 3, false, 0}, + {0x0, 0, 1, false, 0}, + {0x0, 3, 2, true, 0}, + {0x0, 3, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 0, 2, false, 0}, + {0x0, 3, 1, false, 0}, + {0x0, 2, 0, false, 0}, + {0x0, 1, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 0, 2, false, 0}, + {0x0, 3, 0, false, 0}, + {0x0, 3, 1, false, 0}, + {0x0, 2, 3, false, 0}, + {0x0, 0, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 3, 2, true, 0}, + {0x0, 3, 1, false, 0}, + {0x0, 2, 3, false, 0}, + {0x0, 0, 2, false, 0}, + {0x0, 1, 0, false, 0}, + {0x0, 2, 1, false, 0}, + {0x0, 0, 2, false, 0}, + {0x0, 3, 0, false, 0}, +}; + static const struct ppe_scheduler_port_config ppe_port_sch_config[] = { { .port = 0, @@ -1817,14 +2016,29 @@ static int ppe_config_scheduler(struct ppe_device *ppe_dev) const struct ppe_scheduler_port_config *port_cfg; const struct ppe_scheduler_qm_config *qm_cfg; const struct ppe_scheduler_bm_config *bm_cfg; - int ret, i, count; + int ret, i, bm_count, qm_count, count; u32 val, reg; - count = ARRAY_SIZE(ipq9574_ppe_sch_bm_config); - bm_cfg = ipq9574_ppe_sch_bm_config; + switch (ppe_dev->type) { + case IPQ9574_PPE: + bm_cfg = ipq9574_ppe_sch_bm_config; + bm_count = ARRAY_SIZE(ipq9574_ppe_sch_bm_config); + qm_cfg = ipq9574_ppe_sch_qm_config; + qm_count = ARRAY_SIZE(ipq9574_ppe_sch_qm_config); + break; + case IPQ5424_PPE: + bm_cfg = ipq5424_ppe_sch_bm_config; + bm_count = ARRAY_SIZE(ipq5424_ppe_sch_bm_config); + qm_cfg = ipq5424_ppe_sch_qm_config; + qm_count = ARRAY_SIZE(ipq5424_ppe_sch_qm_config); + break; + default: + dev_err(ppe_dev->dev, "Invalid PPE type %d\n", ppe_dev->type); + return -EINVAL; + } /* Configure the depth of BM scheduler entries. */ - val = FIELD_PREP(PPE_BM_SCH_CTRL_SCH_DEPTH, count); + val = FIELD_PREP(PPE_BM_SCH_CTRL_SCH_DEPTH, bm_count); val |= FIELD_PREP(PPE_BM_SCH_CTRL_SCH_OFFSET, 0); val |= FIELD_PREP(PPE_BM_SCH_CTRL_SCH_EN, 1); @@ -1836,7 +2050,7 @@ static int ppe_config_scheduler(struct ppe_device *ppe_dev) * egress port, the second port takes effect when the specified port * is in the inactive state. */ - for (i = 0; i < count; i++) { + for (i = 0; i < bm_count; i++) { val = FIELD_PREP(PPE_BM_SCH_CFG_TBL_VALID, bm_cfg[i].valid); val |= FIELD_PREP(PPE_BM_SCH_CFG_TBL_DIR, bm_cfg[i].dir); val |= FIELD_PREP(PPE_BM_SCH_CFG_TBL_PORT_NUM, bm_cfg[i].port); @@ -1851,11 +2065,8 @@ static int ppe_config_scheduler(struct ppe_device *ppe_dev) goto sch_config_fail; } - count = ARRAY_SIZE(ipq9574_ppe_sch_qm_config); - qm_cfg = ipq9574_ppe_sch_qm_config; - /* Configure the depth of QM scheduler entries. */ - val = FIELD_PREP(PPE_PSCH_SCH_DEPTH_CFG_SCH_DEPTH, count); + val = FIELD_PREP(PPE_PSCH_SCH_DEPTH_CFG_SCH_DEPTH, qm_count); ret = regmap_write(ppe_dev->regmap, PPE_PSCH_SCH_DEPTH_CFG_ADDR, val); if (ret) goto sch_config_fail; @@ -1864,7 +2075,7 @@ static int ppe_config_scheduler(struct ppe_device *ppe_dev) * port, the second port takes effect when the specified dequeue * port is in the inactive port. */ - for (i = 0; i < count; i++) { + for (i = 0; i < qm_count; i++) { val = FIELD_PREP(PPE_PSCH_SCH_CFG_TBL_ENS_PORT_BITMAP, qm_cfg[i].ensch_port_bmp); val |= FIELD_PREP(PPE_PSCH_SCH_CFG_TBL_ENS_PORT, -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH net-next 10/11] net: ethernet: qualcomm: ppe: Add IPQ5424 service code configuration 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (8 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 09/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler configuration Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:51 ` [PATCH net-next 11/11] net: ethernet: qualcomm: ppe: Add IPQ5424 counter debugfs support Luo Jie ` (2 subsequent siblings) 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie The entries of the L2 service code table are 0x20 apart on IPQ5424, instead of 0x10 on IPQ9574. Each IPQ5424 entry also has a second word holding the extended egress bypass bitmap, which adds the bypass of the source MAC multicast drop, L2 flooding and tunnel exception counter control. Add the L2 service code table stride and the extended egress bypass bitmap for IPQ5424. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 13 ++++++++++--- drivers/net/ethernet/qualcomm/ppe/ppe_config.h | 4 ++++ drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 12 +++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c index 83e1f2d30258..94885240166b 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -1476,7 +1476,7 @@ int ppe_port_resource_get(struct ppe_device *ppe_dev, int port, */ int ppe_sc_config_set(struct ppe_device *ppe_dev, int sc, struct ppe_sc_cfg cfg) { - u32 val, reg, servcode_val[2] = {}; + u32 val, reg, servcode_val[2] = {}, in_l2_val[2] = {}; unsigned long bitmap_value; int ret; @@ -1490,9 +1490,16 @@ int ppe_sc_config_set(struct ppe_device *ppe_dev, int sc, struct ppe_sc_cfg cfg) test_bit(PPE_SC_BYPASS_COUNTER_RX, cfg.bitmaps.counter)); val |= FIELD_PREP(PPE_IN_L2_SERVICE_TBL_TX_CNT_EN, test_bit(PPE_SC_BYPASS_COUNTER_TX, cfg.bitmaps.counter)); - reg = PPE_IN_L2_SERVICE_TBL_ADDR + PPE_IN_L2_SERVICE_TBL_INC * sc; + reg = PPE_IN_L2_SERVICE_TBL_ADDR + PPE_IN_L2_SERVICE_TBL_INC(ppe_dev) * sc; - ret = regmap_write(ppe_dev->regmap, reg, val); + in_l2_val[0] = val; + + bitmap_value = bitmap_read(cfg.bitmaps.egress, PPE_SC_BYPASS_EGRESS_SMAC_MC_DROP, + PPE_SC_BYPASS_EGRESS_SIZE - PPE_SC_BYPASS_EGRESS_SMAC_MC_DROP); + in_l2_val[1] = FIELD_PREP(PPE_IN_L2_SERVICE_TBL_W1_BYPASS_BITMAP_EXT, bitmap_value); + + ret = regmap_bulk_write(ppe_dev->regmap, reg, in_l2_val, + PPE_IN_L2_SERVICE_TBL_WORDS(ppe_dev)); if (ret) return ret; diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h index 60493e51e0a4..e7cdab9d963a 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -163,6 +163,10 @@ enum ppe_sc_egress_type { PPE_SC_BYPASS_EGRESS_FAKE_MAC_DROP = 21, PPE_SC_BYPASS_EGRESS_TUNL_CONTEXT = 22, PPE_SC_BYPASS_EGRESS_FLOW_POLICER = 23, + /* Values 24-26 are only supported by IPQ5424. */ + PPE_SC_BYPASS_EGRESS_SMAC_MC_DROP = 24, + PPE_SC_BYPASS_EGRESS_L2_FLOODING = 25, + PPE_SC_BYPASS_EGRESS_TUNNEL_EXP_CNT_CTRL = 26, /* This must be last as it determines the size of the BITMAP. */ PPE_SC_BYPASS_EGRESS_SIZE, }; diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h index 441e8e04a80b..089aa34b7732 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -223,13 +223,23 @@ /* PPE service code configuration for destination port and counter. */ #define PPE_IN_L2_SERVICE_TBL_ADDR 0x66000 #define PPE_IN_L2_SERVICE_TBL_ENTRIES 256 -#define PPE_IN_L2_SERVICE_TBL_INC 0x10 +#define PPE_IN_L2_SERVICE_TBL_IPQ9574_INC 0x10 +#define PPE_IN_L2_SERVICE_TBL_IPQ5424_INC 0x20 +#define PPE_IN_L2_SERVICE_TBL_INC(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_IN_L2_SERVICE_TBL_IPQ5424_INC : \ + PPE_IN_L2_SERVICE_TBL_IPQ9574_INC) +#define PPE_IN_L2_SERVICE_TBL_IPQ9574_WORDS 1 +#define PPE_IN_L2_SERVICE_TBL_IPQ5424_WORDS 2 +#define PPE_IN_L2_SERVICE_TBL_WORDS(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_IN_L2_SERVICE_TBL_IPQ5424_WORDS : \ + PPE_IN_L2_SERVICE_TBL_IPQ9574_WORDS) #define PPE_IN_L2_SERVICE_TBL_DST_PORT_ID_VALID BIT(0) #define PPE_IN_L2_SERVICE_TBL_DST_PORT_ID GENMASK(4, 1) #define PPE_IN_L2_SERVICE_TBL_DST_DIRECTION BIT(5) #define PPE_IN_L2_SERVICE_TBL_DST_BYPASS_BITMAP GENMASK(29, 6) #define PPE_IN_L2_SERVICE_TBL_RX_CNT_EN BIT(30) #define PPE_IN_L2_SERVICE_TBL_TX_CNT_EN BIT(31) +#define PPE_IN_L2_SERVICE_TBL_W1_BYPASS_BITMAP_EXT GENMASK(7, 0) /* L2 Port configurations */ #define PPE_L2_VP_PORT_TBL_ADDR 0x98000 -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH net-next 11/11] net: ethernet: qualcomm: ppe: Add IPQ5424 counter debugfs support 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (9 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 10/11] net: ethernet: qualcomm: ppe: Add IPQ5424 service code configuration Luo Jie @ 2026-10-08 14:51 ` Luo Jie 2026-10-08 14:54 ` [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC netdev-bot+sinfo 2026-10-08 19:07 ` Andrew Lunn 12 siblings, 0 replies; 21+ messages in thread From: Luo Jie @ 2026-10-08 14:51 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap Cc: netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen, Luo Jie IPQ5424 has more BM ports than IPQ9574, so the BM used, reacted and overflow-drop counter tables have more entries on IPQ5424, and the used and reacted counter tables are located at different addresses. The BM silent-drop counter table on the other hand has only 4 entries on IPQ5424, versus 8 on IPQ9574. Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com> --- drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c | 14 +++++----- drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 36 ++++++++++++++++++++----- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c index fd959a76ff43..8d5a6fad8337 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c @@ -201,7 +201,7 @@ static int ppe_bm_counter_get(struct ppe_device *ppe_dev, struct seq_file *seq) seq_printf(seq, "%-24s", "BM SILENT_DROP:"); tag = 0; - for (i = 0; i < PPE_DROP_CNT_TBL_ENTRIES; i++) { + for (i = 0; i < PPE_DROP_CNT_TBL_ENTRIES(ppe_dev); i++) { reg = PPE_DROP_CNT_TBL_ADDR + i * PPE_DROP_CNT_TBL_INC; ret = ppe_pkt_cnt_get(ppe_dev, reg, PPE_PKT_CNT_SIZE_1WORD, &pkt_cnt, NULL); @@ -225,7 +225,7 @@ static int ppe_bm_counter_get(struct ppe_device *ppe_dev, struct seq_file *seq) */ seq_printf(seq, "%-24s", "BM OVERFLOW_DROP:"); tag = 0; - for (i = 0; i < PPE_DROP_STAT_TBL_ENTRIES; i++) { + for (i = 0; i < PPE_DROP_STAT_TBL_ENTRIES(ppe_dev); i++) { reg = PPE_DROP_STAT_TBL_ADDR + PPE_DROP_STAT_TBL_INC * i; ret = ppe_pkt_cnt_get(ppe_dev, reg, PPE_PKT_CNT_SIZE_3WORD, @@ -248,8 +248,8 @@ static int ppe_bm_counter_get(struct ppe_device *ppe_dev, struct seq_file *seq) /* The number of currently occupied buffers, that can't be flushed. */ seq_printf(seq, "%-24s", "BM USED/REACT:"); tag = 0; - for (i = 0; i < PPE_BM_USED_CNT_TBL_ENTRIES; i++) { - reg = PPE_BM_USED_CNT_TBL_ADDR + i * PPE_BM_USED_CNT_TBL_INC; + for (i = 0; i < PPE_BM_USED_CNT_TBL_ENTRIES(ppe_dev); i++) { + reg = PPE_BM_USED_CNT_TBL_ADDR(ppe_dev) + i * PPE_BM_USED_CNT_TBL_INC; ret = regmap_read(ppe_dev->regmap, reg, &val); if (ret) { dev_err(ppe_dev->dev, "CNT ERROR %d\n", ret); @@ -261,7 +261,7 @@ static int ppe_bm_counter_get(struct ppe_device *ppe_dev, struct seq_file *seq) */ pkt_cnt = FIELD_GET(PPE_BM_USED_CNT_VAL, val); - reg = PPE_BM_REACT_CNT_TBL_ADDR + i * PPE_BM_REACT_CNT_TBL_INC; + reg = PPE_BM_REACT_CNT_TBL_ADDR(ppe_dev) + i * PPE_BM_REACT_CNT_TBL_INC; ret = regmap_read(ppe_dev->regmap, reg, &val); if (ret) { dev_err(ppe_dev->dev, "CNT ERROR %d\n", ret); @@ -723,12 +723,12 @@ static ssize_t ppe_packet_counter_write(struct file *file, switch (entry->counter_type) { case PPE_CNT_BM: - for (i = 0; i < PPE_DROP_CNT_TBL_ENTRIES; i++) { + for (i = 0; i < PPE_DROP_CNT_TBL_ENTRIES(ppe_dev); i++) { reg = PPE_DROP_CNT_TBL_ADDR + i * PPE_DROP_CNT_TBL_INC; ppe_tbl_pkt_cnt_clear(ppe_dev, reg, PPE_PKT_CNT_SIZE_1WORD); } - for (i = 0; i < PPE_DROP_STAT_TBL_ENTRIES; i++) { + for (i = 0; i < PPE_DROP_STAT_TBL_ENTRIES(ppe_dev); i++) { reg = PPE_DROP_STAT_TBL_ADDR + PPE_DROP_STAT_TBL_INC * i; ppe_tbl_pkt_cnt_clear(ppe_dev, reg, PPE_PKT_CNT_SIZE_3WORD); } diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h index 089aa34b7732..d08ab02bdf79 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -18,12 +18,20 @@ /* PPE drop counters. */ #define PPE_DROP_CNT_TBL_ADDR 0xb024 -#define PPE_DROP_CNT_TBL_ENTRIES 8 +#define PPE_DROP_CNT_TBL_IPQ9574_ENTRIES 8 +#define PPE_DROP_CNT_TBL_IPQ5424_ENTRIES 4 +#define PPE_DROP_CNT_TBL_ENTRIES(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_DROP_CNT_TBL_IPQ5424_ENTRIES : \ + PPE_DROP_CNT_TBL_IPQ9574_ENTRIES) #define PPE_DROP_CNT_TBL_INC 4 /* BM port drop counters. */ #define PPE_DROP_STAT_TBL_ADDR 0xe000 -#define PPE_DROP_STAT_TBL_ENTRIES 30 +#define PPE_DROP_STAT_TBL_IPQ9574_ENTRIES 30 +#define PPE_DROP_STAT_TBL_IPQ5424_ENTRIES 38 +#define PPE_DROP_STAT_TBL_ENTRIES(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_DROP_STAT_TBL_IPQ5424_ENTRIES : \ + PPE_DROP_STAT_TBL_IPQ9574_ENTRIES) #define PPE_DROP_STAT_TBL_INC 0x10 /* Egress VLAN counters. */ @@ -426,14 +434,30 @@ #define PPE_BM_PORT_GROUP_ID_SHARED_GROUP_ID GENMASK(1, 0) /* Counters for PPE buffers used for packets cached. */ -#define PPE_BM_USED_CNT_TBL_ADDR 0x6001c0 -#define PPE_BM_USED_CNT_TBL_ENTRIES 15 +#define PPE_BM_USED_CNT_TBL_IPQ9574_ADDR 0x6001c0 +#define PPE_BM_USED_CNT_TBL_IPQ5424_ADDR 0x600220 +#define PPE_BM_USED_CNT_TBL_ADDR(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_USED_CNT_TBL_IPQ5424_ADDR : \ + PPE_BM_USED_CNT_TBL_IPQ9574_ADDR) +#define PPE_BM_USED_CNT_TBL_IPQ9574_ENTRIES 15 +#define PPE_BM_USED_CNT_TBL_IPQ5424_ENTRIES 19 +#define PPE_BM_USED_CNT_TBL_ENTRIES(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_USED_CNT_TBL_IPQ5424_ENTRIES : \ + PPE_BM_USED_CNT_TBL_IPQ9574_ENTRIES) #define PPE_BM_USED_CNT_TBL_INC 0x4 #define PPE_BM_USED_CNT_VAL GENMASK(10, 0) /* Counters for PPE buffers used for packets received after pause frame sent. */ -#define PPE_BM_REACT_CNT_TBL_ADDR 0x600240 -#define PPE_BM_REACT_CNT_TBL_ENTRIES 15 +#define PPE_BM_REACT_CNT_TBL_IPQ9574_ADDR 0x600240 +#define PPE_BM_REACT_CNT_TBL_IPQ5424_ADDR 0x600280 +#define PPE_BM_REACT_CNT_TBL_ADDR(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_REACT_CNT_TBL_IPQ5424_ADDR : \ + PPE_BM_REACT_CNT_TBL_IPQ9574_ADDR) +#define PPE_BM_REACT_CNT_TBL_IPQ9574_ENTRIES 15 +#define PPE_BM_REACT_CNT_TBL_IPQ5424_ENTRIES 19 +#define PPE_BM_REACT_CNT_TBL_ENTRIES(ppe_dev) \ + ((ppe_dev)->type == IPQ5424_PPE ? PPE_BM_REACT_CNT_TBL_IPQ5424_ENTRIES : \ + PPE_BM_REACT_CNT_TBL_IPQ9574_ENTRIES) #define PPE_BM_REACT_CNT_TBL_INC 0x4 #define PPE_BM_REACT_CNT_VAL GENMASK(8, 0) -- 2.43.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (10 preceding siblings ...) 2026-10-08 14:51 ` [PATCH net-next 11/11] net: ethernet: qualcomm: ppe: Add IPQ5424 counter debugfs support Luo Jie @ 2026-10-08 14:54 ` netdev-bot+sinfo 2026-10-09 3:42 ` Jie Luo 2026-10-08 19:07 ` Andrew Lunn 12 siblings, 1 reply; 21+ messages in thread From: netdev-bot+sinfo @ 2026-10-08 14:54 UTC (permalink / raw) To: Luo Jie Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap, netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages. - What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then. The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC 2026-10-08 14:54 ` [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC netdev-bot+sinfo @ 2026-10-09 3:42 ` Jie Luo 0 siblings, 0 replies; 21+ messages in thread From: Jie Luo @ 2026-10-09 3:42 UTC (permalink / raw) To: netdev-bot+sinfo Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap, netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen On 10/8/2026 10:54 PM, netdev-bot+sinfo@kernel.org wrote: > Hi! > > This is an automated message. This series looks like a fix, but its > commit messages seem to be missing some information: > > - How the issue was discovered, e.g. hit in production, hit during > development, syzbot report, manual code inspection, LLM or static > analysis tool scan. > > - Whether the issue was actually triggered, or is only theoretical > (e.g. found by code inspection). If it was triggered please include > the symptoms, like the stack trace or error messages. > > - What hardware the change was tested on. For driver fixes please > mention the device (and if relevant firmware version) used for > testing, or say that the change was not tested on real hardware. > > Please do not repost the series just to address the above. Instead, > reply to this email with the missing information, so that reviewers > can take it into account. If the series needs another revision for > other reasons, please include the information in the commit messages > then. > > The evaluation is done by an LLM so it may be wrong, if you think > that is the case please reply and explain. Both issues are theoretical. Neither was hit in production or reported by users. Patch 1 (dt-bindings: Split EDMA reset into sys and apb): [found by manual code inspection while developing the IPQ524 PPE driver]. EDMA driver is not upstream yet, and no in-tree device tree uses the ethernet-dma node, so the issue cannot be triggered today. Patch 2 (ppe: Fix multicast queue config table index): found by the code inspection. It was not seen as a crash or an error message; [the multicast queue thresholds are left unconfigured without any visible failure]. The series was tested on the Qualcomm IPQ9574 RDP433 and IPQ5424 RDP466 boards. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie ` (11 preceding siblings ...) 2026-10-08 14:54 ` [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC netdev-bot+sinfo @ 2026-10-08 19:07 ` Andrew Lunn 2026-10-09 3:31 ` Jie Luo 12 siblings, 1 reply; 21+ messages in thread From: Andrew Lunn @ 2026-10-08 19:07 UTC (permalink / raw) To: Luo Jie Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap, netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen > The first two patches are fixes, independent of the IPQ5424 support: > - Split the EDMA reset in the devicetree binding into the separate system > and APB resets. > - Fix the multicast queue configuration table index, which is out of range > for every multicast queue on both IPQ9574 and IPQ5424. Since you posted these to net-next, i assume they are theoretical problems, not something which bothers people? Please drop the Fixes: tag. Andrew --- pw-bot: cr ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC 2026-10-08 19:07 ` Andrew Lunn @ 2026-10-09 3:31 ` Jie Luo 0 siblings, 0 replies; 21+ messages in thread From: Jie Luo @ 2026-10-09 3:31 UTC (permalink / raw) To: Andrew Lunn Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lei Wei, Suruchi Agarwal, Pavithra R, Simon Horman, Jonathan Corbet, Shuah Khan, Randy Dunlap, netdev, linux-arm-msm, devicetree, linux-kernel, linux-doc, quic_kkumarcs, quic_linchen On 10/9/2026 3:07 AM, Andrew Lunn wrote: >> The first two patches are fixes, independent of the IPQ5424 support: >> - Split the EDMA reset in the devicetree binding into the separate system >> and APB resets. >> - Fix the multicast queue configuration table index, which is out of range >> for every multicast queue on both IPQ9574 and IPQ5424. > > Since you posted these to net-next, i assume they are theoretical > problems, not something which bothers people? Please drop the Fixes: > tag. > > Andrew > > --- > pw-bot: cr Yes, neither issue has been reported by users. The EDMA binding has no in-tree user yet, and the multicast queue issue was found by code review. I will drop the Fixes: tags in v2. Thanks. ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2026-10-09 14:52 UTC | newest] Thread overview: 21+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-10-08 14:51 [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC Luo Jie 2026-10-08 14:51 ` [PATCH net-next 01/11] dt-bindings: net: qcom,ipq9574-ppe: Split EDMA reset into sys and apb Luo Jie 2026-10-08 19:49 ` Rob Herring (Arm) 2026-10-08 14:51 ` [PATCH net-next 02/11] net: ethernet: qualcomm: ppe: Fix multicast queue config table index Luo Jie 2026-10-09 14:52 ` sashiko-bot 2026-10-08 14:51 ` [PATCH net-next 03/11] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5424 PPE support Luo Jie 2026-10-08 20:08 ` Rob Herring (Arm) 2026-10-09 14:52 ` sashiko-bot 2026-10-08 14:51 ` [PATCH net-next 04/11] docs: networking: Document IPQ5424 as a supported SoC Luo Jie 2026-10-08 14:51 ` [PATCH net-next 05/11] net: ethernet: qualcomm: ppe: Add platform support for IPQ5424 Luo Jie 2026-10-08 14:51 ` [PATCH net-next 06/11] net: ethernet: qualcomm: ppe: Add IPQ5424 BM buffer configuration Luo Jie 2026-10-08 14:51 ` [PATCH net-next 07/11] net: ethernet: qualcomm: ppe: Add IPQ5424 QM configuration Luo Jie 2026-10-09 14:52 ` sashiko-bot 2026-10-08 14:51 ` [PATCH net-next 08/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler resource configuration Luo Jie 2026-10-08 14:51 ` [PATCH net-next 09/11] net: ethernet: qualcomm: ppe: Add IPQ5424 scheduler configuration Luo Jie 2026-10-08 14:51 ` [PATCH net-next 10/11] net: ethernet: qualcomm: ppe: Add IPQ5424 service code configuration Luo Jie 2026-10-08 14:51 ` [PATCH net-next 11/11] net: ethernet: qualcomm: ppe: Add IPQ5424 counter debugfs support Luo Jie 2026-10-08 14:54 ` [PATCH net-next 00/11] net: ethernet: qualcomm: ppe: Add support for IPQ5424 SoC netdev-bot+sinfo 2026-10-09 3:42 ` Jie Luo 2026-10-08 19:07 ` Andrew Lunn 2026-10-09 3:31 ` Jie Luo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox