net: ethernet: qualcomm: ppe: Add IPQ5332 support
Subsystems (6)
v2 cover net: ethernet: qualcomm: ppe: Add IPQ5332 support
IPQ5332 uses the same PPE architecture as IPQ9574, but has two front panel ports, a 200 MHz PPE clock, and different interconnect, buffer and scheduler settings. This series adds support for it.
Patch 1 moves the IPQ9574 settings into per-SoC match data and a hardware configuration structure, renames the shared regmap configuration, and makes the reserved scheduler resource lookup independent of the port count. Patch 2 adds the IPQ5332 binding with per-SoC interconnect, clock, EDMA reset, interrupt and port-count constraints. Patch 3 adds the driver configuration and documents the port and UNIPHY counts.
The multicast admission control and port validation fixes for the shared PPE code are submitted separately to net. This three-patch series is based directly on net-next and can be applied independently.
The IPQ5332 values come from the PPE initialization in Qualcomm's QSDK 14.0.1595.1665, qca-ssdk revision 48484d531927b070b996685f1570aff3bccb9c32 (src/init/ssdk_hppe.c, src/init/ssdk_appe.c and src/adpt/hppe/adpt_hppe_qm.c).
IPQ5332 requires the GCC IM sleep clock in addition to the four PPE clocks, two EDMA resets instead of one, and 49 EDMA interrupts instead of 65. These differences are constrained without changing the existing IPQ9574 layouts.
Tested on the Ubiquiti UniFi 7 Pro XGS access point, using the EDMA driver from OpenWrt, which is not yet upstream. The device has a single Ethernet port, connected to PPE port 1. The second front panel port and its configuration are untested from my side.
Changes since v1:
- Split the two fixes for existing IPQ9574 support into a net series.
- Apply the IPQ5332 port-count limit to both container and port naming forms, using reg to constrain the port IDs.
- Drop the clock-provider provenance paragraph and links from the binding commit message and add Krzysztof Kozlowski's Reviewed-by.
- Clarify that the shared parent and rate apply to the NSSCC PPE clocks; the GCC sleep clock has a separate parent.
Previous posting:
https://lore.kernel.org/netdev/[email protected]/
Thanks,
Til
Til Kaiser (3):
net: ethernet: qualcomm: ppe: Select hardware configuration by SoC
dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5332 support
net: ethernet: qualcomm: ppe: Add IPQ5332 support
.../bindings/net/qcom,ipq9574-ppe.yaml | 92 ++++++++- .../ethernet/qualcomm/ppe/ppe.rst | 9 +- drivers/net/ethernet/qualcomm/ppe/ppe.c | 87 ++++++-- .../net/ethernet/qualcomm/ppe/ppe_config.c | 185 ++++++++++++++++-- .../net/ethernet/qualcomm/ppe/ppe_config.h | 35 +++- 5 files changed, 362 insertions(+), 46 deletions(-)
base-commit: 6b3e73774815910a39d8ca75b9ad7df963f61d50
Signature · 1 line
2.56.0
PATCH v2 1/3 net: ethernet: qualcomm: ppe: Select hardware configuration by SoC
The PPE driver hardcodes IPQ9574 parameters: the PPE clock rate, interconnect paths, port count, buffer limits and scheduler arbitration tables. Other SoCs with the same PPE architecture need different values.
Move these into per-SoC platform match data, and collect the buffer manager (BM), queue manager (QM) and scheduler tables in a new struct ppe_soc_config that is passed to the hardware initialization code. The IPQ9574 values are unchanged; no functional change intended.
The IPQ9574 scheduler resource table has nine entries, with the reserved pool at index 8. Select that final entry for port ID num_ports, preserving the IPQ9574 lookup while allowing a smaller port count on other SoCs.
Rename regmap_config_ipq9574 to ppe_reg_config for the shared PPE register layout.
--- drivers/net/ethernet/qualcomm/ppe/ppe.c | 48 ++++++++++----- .../net/ethernet/qualcomm/ppe/ppe_config.c | 58 +++++++++++++------ .../net/ethernet/qualcomm/ppe/ppe_config.h | 34 ++++++++++- 3 files changed, 106 insertions(+), 34 deletions(-)
drivers/net/ethernet/qualcomm/ppe/ppe.c +33 -15
@@ -11,6 +11,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h>
@@ -18,13 +19,15 @@#include "ppe_config.h" #include "ppe_debugfs.h" -#define PPE_PORT_MAX 8 -#define PPE_CLK_RATE 353000000 +struct ppe_plat_data { +const struct ppe_soc_config *soc_cfg; +const struct icc_bulk_data *icc_data; +unsigned long ppe_clk_rate; +unsigned int num_icc, num_ports; +}; -/* 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[] = { +/* IPQ9574 interconnect paths. Zero bandwidths use the PPE clock rate. */ +static const struct icc_bulk_data ipq9574_icc_data[] = { { .name ="ppe" , .avg_bw =0 ,
@@ -62,6 +65,15 @@ static const struct icc_bulk_data ppe_icc_data[] = { }, }; +static const struct ppe_plat_data ipq9574_ppe_data = { + .soc_cfg = &ipq9574_soc_config, + .icc_data = ipq9574_icc_data, + .ppe_clk_rate =353000000 , + .num_icc =ARRAY_SIZE (ipq9574_icc_data), + .num_ports =8 , +}; + +/* PPE register access ranges. */ static const struct regmap_range ppe_readable_ranges[] = {regmap_reg_range (0x0 ,0x1ff ),/* Global */ regmap_reg_range (0x400 ,0x5ff ),/* LPI CSR */
@@ -99,7 +111,7 @@ static const struct regmap_access_table ppe_reg_table = { .n_yes_ranges = ARRAY_SIZE(ppe_readable_ranges), }; -static const struct regmap_config regmap_config_ipq9574 = { +static const struct regmap_config ppe_reg_config = { .reg_bits =32 , .reg_stride =4 , .val_bits =32 ,
@@ -108,7 +120,8 @@ static const struct regmap_config regmap_config_ipq9574 = { .max_register = 0xbef800, }; -static int ppe_clock_init_and_reset (struct ppe_device *ppe_dev) +static int ppe_clock_init_and_reset (struct ppe_device *ppe_dev, +const struct icc_bulk_data *ppe_icc_data) {unsigned long ppe_rate = ppe_dev->clk_rate;struct device *dev = ppe_dev->dev;
@@ -172,12 +185,17 @@ static int ppe_clock_init_and_reset(struct ppe_device *ppe_dev)static int qcom_ppe_probe (struct platform_device *pdev) { +const struct ppe_plat_data *plat_data;struct device *dev = &pdev->dev;struct ppe_device *ppe_dev;void __iomem *base;int ret, num_icc; - num_icc =ARRAY_SIZE (ppe_icc_data); + plat_data =device_get_match_data (dev); +if (!plat_data) +return -EINVAL ; + + num_icc = plat_data->num_icc; ppe_dev =devm_kzalloc (dev,struct_size (ppe_dev, icc_paths, num_icc),GFP_KERNEL );if (!ppe_dev)
@@ -187,20 +205,20 @@ 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, &ppe_reg_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->clk_rate = plat_data->ppe_clk_rate; + ppe_dev->num_ports = plat_data->num_ports; ppe_dev->num_icc_paths = num_icc; - ret =ppe_clock_init_and_reset (ppe_dev); + ret =ppe_clock_init_and_reset (ppe_dev, plat_data->icc_data);if (ret)return dev_err_probe (dev, ret,"PPE clock config failed\n" ); - ret =ppe_hw_config (ppe_dev); + ret =ppe_hw_config (ppe_dev, plat_data->soc_cfg);if (ret)return dev_err_probe (dev, ret,"PPE HW config failed\n" );
@@ -219,7 +237,7 @@ static void qcom_ppe_remove(struct platform_device *pdev) }static const struct of_device_id qcom_ppe_of_match[] = { - { .compatible ="qcom,ipq9574-ppe" }, + { .compatible ="qcom,ipq9574-ppe" , .data = &ipq9574_ppe_data }, {} };MODULE_DEVICE_TABLE (of, qcom_ppe_of_match);
drivers/net/ethernet/qualcomm/ppe/ppe_config.c +40 -18
139 lines not on this page · raw message
drivers/net/ethernet/qualcomm/ppe/ppe_config.h +33 -1
@@ -287,7 +287,39 @@ struct ppe_rss_hash_cfg {u8 hash_fin_outer[PPE_RSS_HASH_TUPLES ]; }; -int ppe_hw_config (struct ppe_device *ppe_dev); +/** +* struct ppe_soc_config - SoC-specific PPE hardware configuration. +* @bm_group_config: Buffer Management (BM) group configuration. +* @bm_port_config: Pointer to the BM port configuration array. +* @bm_port_config_cnt: Number of entries in the BM port configuration array. +* @qm_group_config: Queue Management (QM) group configuration. +* @qm_queue_config: Pointer to the QM queue configuration array. +* @qm_queue_config_cnt: Number of entries in the QM queue configuration array. +* @sch_bm_config: Pointer to the BM scheduler arbitration array. +* @sch_bm_config_cnt: Number of entries in the BM scheduler arbitration array. +* @sch_qm_config: Pointer to the QM scheduler arbitration array. +* @sch_qm_config_cnt: Number of entries in the QM scheduler arbitration array. +*/ +struct ppe_soc_config { +int bm_group_config; +const struct ppe_bm_port_config *bm_port_config; +unsigned int bm_port_config_cnt; + +int qm_group_config; +const struct ppe_qm_queue_config *qm_queue_config; +unsigned int qm_queue_config_cnt; + +const struct ppe_scheduler_bm_config *sch_bm_config; +unsigned int sch_bm_config_cnt; + +const struct ppe_scheduler_qm_config *sch_qm_config; +unsigned int sch_qm_config_cnt; +}; + +extern const struct ppe_soc_config ipq9574_soc_config; + +int ppe_hw_config (struct ppe_device *ppe_dev, +const struct ppe_soc_config *soc_cfg);int ppe_queue_scheduler_set (struct ppe_device *ppe_dev,int node_id,bool flow_level,int port,struct ppe_scheduler_cfg scheduler_cfg);
Signature · 1 line
2.56.0
PATCH v2 2/3 dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5332 support
In reply to Til KaiserIPQ5332 uses the same PPE architecture as IPQ9574, but has two front panel ports instead of six and four interconnect paths instead of seven.
Add the qcom,ipq5332-ppe compatible and constrain the interconnects and port nodes per SoC: IPQ5332 takes four interconnects and only port IDs 1 and 2, while IPQ9574 keeps seven interconnects. Apply the port-count limit to both container and port naming forms.
The PPE core, EDMA and MAC clock functions are shared, but IPQ5332 also needs the GCC IM sleep clock. The PPE core uses one reset and each MAC uses three resets on both SoCs. IPQ5332 EDMA needs separate system and configuration resets; IPQ9574 uses one combined reset. Constrain the clock and reset counts accordingly. Keep EDMA resets positional, with the system reset first and the configuration reset second on IPQ5332, consistent with the existing unnamed IPQ9574 reset.
IPQ5332 EDMA has 24 TX/completion rings, 16 RX descriptor rings and eight RX fill rings, so the full EDMA interrupt set comprises 49 interrupts. Constrain the interrupt counts and ring names per SoC as well.
The ring limits come from QSDK 14.0.1595.1665,
qca-nss-dp hal/soc_ops/ipq53xx/nss_ipq53xx.h.
--- .../bindings/net/qcom,ipq9574-ppe.yaml | 92 +++++++++++++++++-- 1 file changed, 84 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml +84 -8
@@ -28,11 +28,15 @@ description: | supporting various modes such as SGMII/QSGMII/PSGMII/USXGMII/10G-BASER. There are 3 UNIPHY (PCS) instances supported on the IPQ9574. - Ethernet DMA is used to transmit and receive packets between the six Ethernet + IPQ5332 uses the same PPE architecture with two front panel ports and two + UNIPHY (PCS) instances. Its Ethernet datapath has a CPU port (port0) and + two GMAC/XGMAC ports (port1 and port2). + + Ethernet DMA is used to transmit and receive packets between the Ethernet ports and ARM host CPU. - The follow diagram shows the PPE hardware block along with its connectivity - to the external hardware blocks such clock hardware blocks (CMNPLL, GCC, + The following diagram shows the IPQ9574 PPE hardware block and its + connectivity to external clock hardware blocks (CMNPLL, GCC, NSS clock controller) and Ethernet PCS/PHY blocks. For depicting the PHY connectivity, one 4x1 Gbps PHY (QCA8075) and two 10 GBps PHYs are used as an example.
@@ -77,24 +81,29 @@ description: | properties: compatible: enum: + - qcom,ipq5332-ppe - qcom,ipq9574-ppe reg: maxItems: 1 clocks: + minItems: 4 items: - description: PPE core clock - description: PPE APB (Advanced Peripheral Bus) clock - description: PPE IPE (Ingress Process Engine) clock - description: PPE BM, QM and scheduler clock + - description: PPE sleep clock from GCC clock-names: + minItems: 4 items: - const: ppe - const: apb - const: ipe - const: btq + - const: sleep resets: maxItems: 1
@@ -105,6 +114,7 @@ properties: description: PPE switch miscellaneous interrupt interconnects: + minItems: 4 items: - description: Bus interconnect path leading to PPE switch core function - description: Bus interconnect path leading to PPE register access
@@ -115,6 +125,7 @@ properties: - description: Bus interconnect path leading to enhanced memory NOC from NSS NOC interconnect-names: + minItems: 4 items: - const: ppe - const: ppe_cfg
@@ -130,7 +141,9 @@ properties: description: EDMA (Ethernet DMA) is used to transmit packets between PPE and ARM host CPU. There are 32 TX descriptor rings, 32 TX completion rings, - 24 RX descriptor rings and 8 RX fill rings supported. + 24 RX descriptor rings and 8 RX fill rings supported on IPQ9574. + IPQ5332 supports 24 TX descriptor rings, 24 TX completion rings, + 16 RX descriptor rings and 8 RX fill rings. properties: clocks:
@@ -144,15 +157,18 @@ properties: - const: apb resets: - maxItems: 1 - description: EDMA reset + minItems: 1 + items: + - description: + EDMA system reset. On IPQ9574 this also resets the configuration. + - description: EDMA configuration reset interrupts: - minItems: 65 + minItems: 49 maxItems: 65 interrupt-names: - minItems: 65 + minItems: 49 maxItems: 65 items: oneOf:
@@ -165,6 +181,7 @@ properties: Interrupts "rxfill_[0-7]" are the Ethernet DMA RX fill ring interrupts. Interrupts "rxdesc_[0-23]" are the Ethernet DMA RX Descriptor ring interrupts. Interrupt "misc" is the Ethernet DMA miscellaneous error interrupt. + On IPQ5332, only "txcmpl_[0-23]" and "rxdesc_[0-15]" are supported. required: - clocks
@@ -229,6 +246,65 @@ required: allOf: - $ref: ethernet-switch.yaml + - if: + properties: + compatible: + contains: + const: qcom,ipq5332-ppe + then: + properties: + clocks: + minItems: 5 + clock-names: + minItems: 5 + interconnects: + maxItems: 4 + interconnect-names: + maxItems: 4 + ethernet-dma: + properties: + resets: + minItems: 2 + interrupts: + maxItems: 49 + interrupt-names: + maxItems: 49 + items: + oneOf: + - pattern: '^txcmpl_(1?[0-9]|2[0-3])$' + - pattern: '^rxfill_[0-7]$' + - pattern: '^rxdesc_([0-9]|1[0-5])$' + - const: misc + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9a-f]+$": + properties: + reg: + maximum: 2 + - if: + properties: + compatible: + contains: + const: qcom,ipq9574-ppe + then: + properties: + clocks: + maxItems: 4 + clock-names: + maxItems: 4 + interconnects: + minItems: 7 + interconnect-names: + minItems: 7 + ethernet-dma: + properties: + resets: + maxItems: 1 + interrupts: + minItems: 65 + interrupt-names: + minItems: 65 unevaluatedProperties: false
Signature · 1 line
2.56.0
[email protected]
AI reviewRe: [PATCH net-next v2 2/3] dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5332 support
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).
- [Medium] The IPQ5332 port conditional in Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml (allOf[1]…
--
dt-bindings: net: qcom,ipq9574-ppe: Add IPQ5332 support
This adds the qcom,ipq5332-ppe compatible to the IPQ9574 PPE binding. It also adds per-SoC conditional blocks that constrain clocks, interconnects, EDMA resets, interrupts and ring names. IPQ5332 port nodes are meant to be limited to port IDs 1 and 2.
Quoted 4 lines
Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml +0
-0
[ ... ]
Quoted 10 lines
Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml +6
-0@@ -229,6 +246,65 @@ required: allOf: - $ref: ethernet-switch.yaml + - if: + properties: + compatible: + contains: + const: qcom,ipq5332-ppe + then:
[ ... ]
Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml required: · line 284
Quoted 7 lines
Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml +7
-0+ patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9a-f]+$": + properties: + reg: + maximum: 2
[Severity: Medium]
The commit message says:
IPQ5332 takes four interconnects and only port IDs 1 and 2 ... Apply the port-count limit to both container and port naming forms.
Does this block reject port ID 0? It only sets maximum: 2. The only lower bound in the file is in the base ethernet-ports schema:
ethernet-ports:
patternProperties:
"^ethernet-port@[1-6]+$":
...
properties:
reg:
minimum: 1
maximum: 6That pattern does not match ethernet-port@0. It also does not apply to a container named ports. Nodes like these are matched only by the generic '^(ethernet-)?port@[0-9a-f]+$' pattern in ethernet-switch.yaml, which is just type: object.
With compatible = "qcom,ipq5332-ppe", would both of these pass dt_binding_check?
ethernet-ports {
ethernet-port@0 {
reg = <0>;
};
};
ports {
port@0 {
reg = <0>;
};
};If so, the accepted set is {0, 1, 2}, not {1, 2}. Port 0 is the CPU port according to the updated description.
These nodes also skip the per-MAC clocks, clock-names, resets and reset-names. Those are only required under "^ethernet-port@[1-6]+$". The ports/port@ spelling already skipped them on IPQ9574, but this block now applies per-SoC port constraints to that form as well.
Would adding minimum: 1 next to maximum: 2 here fix this? A shared lower bound in the base schema that covers both naming forms would also work.
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016152449.934312-1-mail%40tk154.de
PATCH v2 3/3 net: ethernet: qualcomm: ppe: Add IPQ5332 support
In reply to Til KaiserIPQ5332 shares the IPQ9574 PPE architecture, but has only two front panel ports and uses a different clock rate, interconnect paths, buffer limits and scheduler arbitration.
Add match data for qcom,ipq5332-ppe: a 200 MHz PPE clock, four interconnect paths and three PPE ports (the CPU port and two front panel ports), together with its BM and QM limits and thresholds and its scheduler arbitration tables. The values come from Qualcomm's QSDK 14.0.1595.1665 qca-ssdk revision 48484d531927b070b996685f1570aff3bccb9c32:src/init/ssdk_hppe.c and ssdk_appe.c, and src/adpt/hppe/adpt_hppe_qm.c.
Reuse the IPQ9574 scheduler resources for ports 0 (CPU), 1 and 2. The queue, flow and DRR node ranges for ports 1 and 2 match the IPQ5332 port_scheduler_resource definitions in QSDK ipq5332.dtsi. The CPU flow and DRR node ranges also match; retain the IPQ9574 CPU and reserved queue partition. QSDK assigns CPU unicast queues 0-95 and multicast queues 256-263, while this driver uses 0-63 and 256-271. The reserved pool is selected from the final resource-table entry using port ID 3 on IPQ5332.
QSDK uses the same block base addresses and HPPE register offsets for the common PPE blocks on IPQ5332 and IPQ9574, so retain the existing regmap ranges and offsets for those blocks.
Clarify that the shared parent and rate apply to the NSSCC PPE clocks; the optional GCC sleep clock has a separate parent. Document the IPQ5332 port and UNIPHY counts and add it to the list of supported SoCs.
--- .../ethernet/qualcomm/ppe/ppe.rst | 9 +- drivers/net/ethernet/qualcomm/ppe/ppe.c | 39 +++++- .../net/ethernet/qualcomm/ppe/ppe_config.c | 127 ++++++++++++++++++ .../net/ethernet/qualcomm/ppe/ppe_config.h | 1 + 4 files changed, 172 insertions(+), 4 deletions(-)
Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst +8 -1
@@ -96,6 +96,10 @@ The port wrapper provides connections from the 6 GMAC/XGMACS to UNIPHY (PCS) sup various modes such as SGMII/QSGMII/PSGMII/USXGMII/10G-BASER. There are 3 UNIPHY (PCS) instances supported on the IPQ9574. +IPQ5332 uses the same PPE architecture with two front panel ports and two UNIPHY +(PCS) instances. Its Ethernet datapath has a CPU port (port0) and two GMAC/XGMAC +ports (port1 and port2). + Ethernet DMA is used to transmit and receive packets between the Ethernet subsystem and ARM host CPU.
@@ -118,6 +122,8 @@ PPE driver: through the UNIPHY PCS block. Each MAC block includes the GMAC and XGMAC blocks and the switch port can select to use GMAC or XMAC through a MUX selection according to the external PHY's capability. + IPQ5332 has two MACs (MAC0 and MAC1), connected to switch ports port1 and + port2 through two UNIPHY instances. - EDMA (Ethernet DMA) The Ethernet DMA is used to transmit and receive Ethernet packets between the PPE ports and the ARM cores.
@@ -164,8 +170,9 @@ CPU code counters and queue counters. PPE Driver Supported SoCs ========================= -The PPE driver supports the following IPQ SoC: +The PPE driver supports the following IPQ SoCs: +- IPQ5332 - IPQ9574
drivers/net/ethernet/qualcomm/ppe/ppe.c +36 -3
@@ -26,6 +26,30 @@ struct ppe_plat_data {unsigned int num_icc, num_ports; }; +/* IPQ5332 interconnect paths. Zero bandwidths use the PPE clock rate. */ +static const struct icc_bulk_data ipq5332_icc_data[] = { + { + .name ="ppe" , + .avg_bw =0 , + .peak_bw =0 , + }, + { + .name ="ppe_cfg" , + .avg_bw =0 , + .peak_bw =0 , + }, + { + .name ="qos_gen" , + .avg_bw =6000 , + .peak_bw =6000 , + }, + { + .name ="timeout_ref" , + .avg_bw =6000 , + .peak_bw =6000 , + }, +}; +/* IPQ9574 interconnect paths. Zero bandwidths use the PPE clock rate. */ static const struct icc_bulk_data ipq9574_icc_data[] = { {
@@ -65,6 +89,14 @@ static const struct icc_bulk_data ipq9574_icc_data[] = { }, }; +static const struct ppe_plat_data ipq5332_ppe_data = { + .soc_cfg = &ipq5332_soc_config, + .icc_data = ipq5332_icc_data, + .ppe_clk_rate =200000000 , + .num_icc =ARRAY_SIZE (ipq5332_icc_data), + .num_ports =3 , +}; +static const struct ppe_plat_data ipq9574_ppe_data = { .soc_cfg = &ipq9574_soc_config, .icc_data = ipq9574_icc_data,
@@ -152,9 +184,9 @@ static int ppe_clock_init_and_reset(struct ppe_device *ppe_dev,if (ret)return ret; -/* The PPE clocks have a common parent clock. Setting the clock -* rate of "ppe" ensures the clock rate of all PPE clocks is -* configured to the same rate. +/* The NSSCC PPE clocks (ppe, apb, ipe and btq) share a parent. +* Setting the "ppe" rate also sets the rate of the other NSSCC +* PPE clocks. The optional GCC sleep clock has a separate parent. */ clk =devm_clk_get (dev,"ppe" );if (IS_ERR (clk))
@@ -237,6 +269,7 @@ static void qcom_ppe_remove(struct platform_device *pdev) }static const struct of_device_id qcom_ppe_of_match[] = { + { .compatible ="qcom,ipq5332-ppe" , .data = &ipq5332_ppe_data }, { .compatible ="qcom,ipq9574-ppe" , .data = &ipq9574_ppe_data }, {} };
drivers/net/ethernet/qualcomm/ppe/ppe_config.c +127 -0
175 lines not on this page · raw message
drivers/net/ethernet/qualcomm/ppe/ppe_config.h +1 -0
@@ -316,6 +316,7 @@ struct ppe_soc_config {unsigned int sch_qm_config_cnt; }; +extern const struct ppe_soc_config ipq5332_soc_config;extern const struct ppe_soc_config ipq9574_soc_config; int ppe_hw_config(struct ppe_device *ppe_dev,
Signature · 1 line
2.56.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] net: qualcomm: ppe: out-of-bounds register write for multicast queue config --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net: qualcomm: ppe: out-of-bounds register write for multicast queue config --
commit 685879ecd74a6118d193f93282001e1b28945b42
Author: Til Kaiser <[email protected]>
net: ethernet: qualcomm: ppe: Add IPQ5332 support
IPQ5332 shares the IPQ9574 PPE architecture, but has only two front panel ports and uses a different clock rate, interconnect paths, buffer limits and scheduler arbitration.
Quoted 4 lines
drivers/net/ethernet/qualcomm/ppe/ppe_config.c +0
-0
[ ... ]
Quoted 10 lines
drivers/net/ethernet/qualcomm/ppe/ppe_config.c +6
-0@@ -264,6 +298,30 @@ static const struct ppe_qm_queue_config ipq9574_ppe_qm_queue_config[] = { }, }; +/* IPQ5332 unicast and multicast queue thresholds. */ +static const struct ppe_qm_queue_config ipq5332_ppe_qm_queue_config[] = { + { +/* QM settings for unicast queues 0 to 255. */ + .queue_start =0 , + .queue_end =255 ,
drivers/net/ethernet/qualcomm/ppe/ppe_config.c static const struct ppe_qm_queue_config ipq9574_ppe_qm_queue_config[] = { · line 316
Quoted 10 lines
drivers/net/ethernet/qualcomm/ppe/ppe_config.c +10
-0+ .prealloc_buf = 0, + .ceil = 300, + .weight = 7, + .resume_offset = 18, + .dynamic = true, + }, + { +/* QM settings for multicast queues 256 to 299. */ + .queue_start = 256, + .queue_end = 299,
[Severity: High]
Does ppe_config_qm() calculate the multicast queue register address correctly when queue_id is >= 256?
In ppe_config_qm(), the code calculates the address like this:
} else {
reg = PPE_AC_MULTICAST_QUEUE_CFG_TBL_ADDR +
PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * queue_id;Since queue_id ranges from 256 to 299 for multicast queues, and is not offset by 256 (PPE_AC_UNICAST_QUEUE_CFG_TBL_ENTRIES) before multiplication, does this result in an out-of-bounds address calculation?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Quoted 7 lines · On 10/17/26 5:25 PM, [email protected] wrote:
[Severity: High]
Doesppe_config_qm()calculate the multicast queue register address correctly whenqueue_idis >= 256?In
ppe_config_qm(), the code calculates the address like this:
Quoted 8 lines
} else { reg = PPE_AC_MULTICAST_QUEUE_CFG_TBL_ADDR + PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * queue_id;Since
queue_idranges from 256 to 299 for multicast queues, and is not offset by 256 (PPE_AC_UNICAST_QUEUE_CFG_TBL_ENTRIES) before multiplication, does this result in an out-of-bounds address calculation?
This is the pre-existing issue you identified in v1, affecting IPQ9574 as well. I submitted the fix separately to net:
https://lore.kernel.org/all/[email protected]/
I could also mention this in the commit message or add the link to the net series in the cover letter.
Paolo Abeni
maintainerQuoted 17 lines · Til Kaiser
Quoted 7 lines · On 10/17/26 5:25 PM, [email protected] wrote:
[Severity: High]
Doesppe_config_qm()calculate the multicast queue register address correctly whenqueue_idis >= 256?In
ppe_config_qm(), the code calculates the address like this:Quoted 8 lines
} else { reg = PPE_AC_MULTICAST_QUEUE_CFG_TBL_ADDR + PPE_AC_MULTICAST_QUEUE_CFG_TBL_INC * queue_id;Since
queue_idranges from 256 to 299 for multicast queues, and is not offset by 256 (PPE_AC_UNICAST_QUEUE_CFG_TBL_ENTRIES) before multiplication, does this result in an out-of-bounds address calculation?
Quoted 6 lines
This is the pre-existing issue you identified in v1, affecting IPQ9574 as well. I submitted the fix separately to net:
https://lore.kernel.org/all/[email protected]/I could also mention this in the commit message or add the link to the net series in the cover letter.
Please note that you could/should ignore reports from the global sashiko instance, and look at the nipa ones (clashiko)
The feedback from the global sashiko instance is incorporated and validated by other models (which already discarded the above concern).
This series does not apply cleanly to net-next anymore. You need to rebase and repost. Please note that the repost MUST wait for the end of the merge window.
/P