* [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044
@ 2024-10-25 1:09 Inochi Amaoto
2024-10-25 1:09 ` [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version Inochi Amaoto
` (4 more replies)
0 siblings, 5 replies; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 1:09 UTC (permalink / raw)
To: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro
Cc: Yixun Lan, Longbin Li, Inochi Amaoto, netdev, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
The ethernet controller of SG2044 is Synopsys DesignWare IP with
custom clock. Add glue layer for it.
Since v2, these patch depends on that following patch that provides
helper function to compute rgmii clock:
https://lore.kernel.org/netdev/20241013-upstream_s32cc_gmac-v3-4-d84b5a67b930@oss.nxp.com/
Changed from v1:
1. patch 2: remove sophgo,syscon as this mac delay is resolved.
2. patch 2: apply all the properties unconditionally.
3. patch 4: remove sophgo,syscon code as this mac delay is resolved.
4. patch 4: use the helper function to compute rgmii clock.
5. patch 4: use remove instead of remove_new for the platform driver.
Inochi Amaoto (4):
dt-bindings: net: snps,dwmac: Add dwmac-5.30a version
dt-bindings: net: Add support for Sophgo SG2044 dwmac
net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string
net: stmmac: Add glue layer for Sophgo SG2044 SoC
.../devicetree/bindings/net/snps,dwmac.yaml | 4 +
.../bindings/net/sophgo,sg2044-dwmac.yaml | 124 ++++++++++++++++++
drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++
drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
.../ethernet/stmicro/stmmac/dwmac-sophgo.c | 109 +++++++++++++++
.../ethernet/stmicro/stmmac/stmmac_platform.c | 3 +-
6 files changed, 251 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
--
2.47.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version
2024-10-25 1:09 [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Inochi Amaoto
@ 2024-10-25 1:09 ` Inochi Amaoto
2024-10-27 20:35 ` Krzysztof Kozlowski
2024-10-25 1:09 ` [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Inochi Amaoto
` (3 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 1:09 UTC (permalink / raw)
To: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro
Cc: Yixun Lan, Longbin Li, Inochi Amaoto, netdev, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
Add compatible string for dwmac-5.30a IP.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 4e2ba1bf788c..3c4007cb65f8 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -31,6 +31,7 @@ select:
- snps,dwmac-4.20a
- snps,dwmac-5.10a
- snps,dwmac-5.20
+ - snps,dwmac-5.30a
- snps,dwxgmac
- snps,dwxgmac-2.10
@@ -95,6 +96,7 @@ properties:
- snps,dwmac-4.20a
- snps,dwmac-5.10a
- snps,dwmac-5.20
+ - snps,dwmac-5.30a
- snps,dwxgmac
- snps,dwxgmac-2.10
- starfive,jh7100-dwmac
@@ -627,6 +629,7 @@ allOf:
- snps,dwmac-4.20a
- snps,dwmac-5.10a
- snps,dwmac-5.20
+ - snps,dwmac-5.30a
- snps,dwxgmac
- snps,dwxgmac-2.10
- st,spear600-gmac
--
2.47.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-25 1:09 [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Inochi Amaoto
2024-10-25 1:09 ` [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version Inochi Amaoto
@ 2024-10-25 1:09 ` Inochi Amaoto
2024-10-27 20:38 ` Krzysztof Kozlowski
2024-10-25 1:09 ` [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string Inochi Amaoto
` (2 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 1:09 UTC (permalink / raw)
To: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro
Cc: Yixun Lan, Longbin Li, Inochi Amaoto, netdev, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
with some extra clock.
Add necessary compatible string for this device.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
.../devicetree/bindings/net/snps,dwmac.yaml | 1 +
.../bindings/net/sophgo,sg2044-dwmac.yaml | 124 ++++++++++++++++++
2 files changed, 125 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 3c4007cb65f8..69f6bb36970b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -99,6 +99,7 @@ properties:
- snps,dwmac-5.30a
- snps,dwxgmac
- snps,dwxgmac-2.10
+ - sophgo,sg2044-dwmac
- starfive,jh7100-dwmac
- starfive,jh7110-dwmac
diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
new file mode 100644
index 000000000000..b7e4216ea45a
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
@@ -0,0 +1,124 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sophgo SG2044 DWMAC glue layer
+
+maintainers:
+ - Inochi Amaoto <inochiama@gmail.com>
+
+select:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - sophgo,sg2044-dwmac
+ required:
+ - compatible
+
+properties:
+ compatible:
+ items:
+ - const: sophgo,sg2044-dwmac
+ - const: snps,dwmac-5.30a
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: GMAC main clock
+ - description: PTP clock
+ - description: TX clock
+
+ clock-names:
+ items:
+ - const: stmmaceth
+ - const: ptp_ref
+ - const: tx
+
+ interrupts:
+ maxItems: 1
+
+ interrupt-names:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ reset-names:
+ const: stmmaceth
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - interrupts
+ - interrupt-names
+ - resets
+ - reset-names
+
+allOf:
+ - $ref: snps,dwmac.yaml#
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ ethernet@30006000 {
+ compatible = "sophgo,sg2044-dwmac", "snps,dwmac-5.30a";
+ reg = <0x30006000 0x4000>;
+ clocks = <&clk 151>, <&clk 152>, <&clk 154>;
+ clock-names = "stmmaceth", "ptp_ref", "tx";
+ interrupt-parent = <&intc>;
+ interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ resets = <&rst 30>;
+ reset-names = "stmmaceth";
+ snps,multicast-filter-bins = <0>;
+ snps,perfect-filter-entries = <1>;
+ snps,aal;
+ snps,tso;
+ snps,txpbl = <32>;
+ snps,rxpbl = <32>;
+ snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
+ snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
+ snps,axi-config = <&gmac0_stmmac_axi_setup>;
+ status = "disabled";
+
+ gmac0_mtl_rx_setup: rx-queues-config {
+ snps,rx-queues-to-use = <8>;
+ snps,rx-sched-wsp;
+ queue0 {};
+ queue1 {};
+ queue2 {};
+ queue3 {};
+ queue4 {};
+ queue5 {};
+ queue6 {};
+ queue7 {};
+ };
+
+ gmac0_mtl_tx_setup: tx-queues-config {
+ snps,tx-queues-to-use = <8>;
+ queue0 {};
+ queue1 {};
+ queue2 {};
+ queue3 {};
+ queue4 {};
+ queue5 {};
+ queue6 {};
+ queue7 {};
+ };
+
+ gmac0_stmmac_axi_setup: stmmac-axi-config {
+ snps,blen = <16 8 4 0 0 0 0>;
+ snps,wr_osr_lmt = <1>;
+ snps,rd_osr_lmt = <2>;
+ };
+ };
--
2.47.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string
2024-10-25 1:09 [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Inochi Amaoto
2024-10-25 1:09 ` [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version Inochi Amaoto
2024-10-25 1:09 ` [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Inochi Amaoto
@ 2024-10-25 1:09 ` Inochi Amaoto
2024-10-25 14:44 ` Alexander Lobakin
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
2024-10-25 13:08 ` [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Simon Horman
4 siblings, 1 reply; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 1:09 UTC (permalink / raw)
To: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro
Cc: Yixun Lan, Longbin Li, Inochi Amaoto, netdev, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
Add "snps,dwmac-5.30a" compatible string for 5.30a version that can avoid
to define some platform data in the glue layer.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index ad868e8d195d..3c4e78b10dd6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -555,7 +555,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
of_device_is_compatible(np, "snps,dwmac-4.10a") ||
of_device_is_compatible(np, "snps,dwmac-4.20a") ||
of_device_is_compatible(np, "snps,dwmac-5.10a") ||
- of_device_is_compatible(np, "snps,dwmac-5.20")) {
+ of_device_is_compatible(np, "snps,dwmac-5.20") ||
+ of_device_is_compatible(np, "snps,dwmac-5.30a")) {
plat->has_gmac4 = 1;
plat->has_gmac = 0;
plat->pmt = 1;
--
2.47.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
2024-10-25 1:09 [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Inochi Amaoto
` (2 preceding siblings ...)
2024-10-25 1:09 ` [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string Inochi Amaoto
@ 2024-10-25 1:10 ` Inochi Amaoto
2024-10-25 14:36 ` kernel test robot
` (3 more replies)
2024-10-25 13:08 ` [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Simon Horman
4 siblings, 4 replies; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 1:10 UTC (permalink / raw)
To: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro
Cc: Yixun Lan, Longbin Li, Inochi Amaoto, netdev, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
Adds Sophgo dwmac driver support on the Sophgo SG2044 SoC.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++
drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
.../ethernet/stmicro/stmmac/dwmac-sophgo.c | 109 ++++++++++++++++++
3 files changed, 121 insertions(+)
create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 05cc07b8f48c..bc44b21c593f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -169,6 +169,17 @@ config DWMAC_SOCFPGA
for the stmmac device driver. This driver is used for
arria5 and cyclone5 FPGA SoCs.
+config DWMAC_SOPHGO
+ tristate "Sophgo dwmac support"
+ depends on OF && (ARCH_SOPHGO || COMPILE_TEST)
+ default m if ARCH_SOPHGO
+ help
+ Support for ethernet controllers on Sophgo RISC-V SoCs
+
+ This selects the Sophgo SoC specific glue layer support
+ for the stmmac device driver. This driver is used for the
+ ethernet controllers on various Sophgo SoCs.
+
config DWMAC_STARFIVE
tristate "StarFive dwmac support"
depends on OF && (ARCH_STARFIVE || COMPILE_TEST)
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index c2f0e91f6bf8..e1287b53047b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o
obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o
obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o
obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o
+obj-$(CONFIG_DWMAC_SOPHGO) += dwmac-sophgo.o
obj-$(CONFIG_DWMAC_STARFIVE) += dwmac-starfive.o
obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o
obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
new file mode 100644
index 000000000000..8f37bcf86a73
--- /dev/null
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Sophgo DWMAC platform driver
+ *
+ * Copyright (C) 2024 Inochi Amaoto <inochiama@gmail.com>
+ *
+ */
+
+#include <linux/bits.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
+#include <linux/mfd/syscon.h>
+#include <linux/phy.h>
+#include <linux/regmap.h>
+
+#include "stmmac_platform.h"
+
+struct sophgo_dwmac {
+ struct device *dev;
+ struct clk *clk_tx;
+};
+
+static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
+{
+ struct sophgo_dwmac *dwmac = priv;
+ long rate;
+ int ret;
+
+ rate = rgmii_clock(speed);
+ if (ret < 0) {
+ dev_err(dwmac->dev, "invalid speed %u\n", speed);
+ return;
+ }
+
+ ret = clk_set_rate(dwmac->clk_tx, rate);
+ if (ret)
+ dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
+}
+
+static int sophgo_sg2044_dwmac_init(struct platform_device *pdev,
+ struct plat_stmmacenet_data *plat_dat,
+ struct stmmac_resources *stmmac_res)
+{
+ struct sophgo_dwmac *dwmac;
+ int ret;
+
+ dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
+ if (!dwmac)
+ return -ENOMEM;
+
+ dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
+ if (IS_ERR(dwmac->clk_tx))
+ return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
+ "failed to get tx clock\n");
+
+ dwmac->dev = &pdev->dev;
+ plat_dat->bsp_priv = dwmac;
+ plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE;
+ plat_dat->fix_mac_speed = sophgo_dwmac_fix_mac_speed;
+ plat_dat->multicast_filter_bins = 0;
+ plat_dat->unicast_filter_entries = 1;
+
+ return 0;
+}
+
+static int sophgo_dwmac_probe(struct platform_device *pdev)
+{
+ struct plat_stmmacenet_data *plat_dat;
+ struct stmmac_resources stmmac_res;
+ int ret;
+
+ ret = stmmac_get_platform_resources(pdev, &stmmac_res);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "failed to get resources\n");
+
+ plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ if (IS_ERR(plat_dat))
+ return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat),
+ "dt configuration failed\n");
+
+ ret = sophgo_sg2044_dwmac_init(pdev, plat_dat, &stmmac_res);
+ if (ret)
+ return ret;
+
+ return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+}
+
+static const struct of_device_id sophgo_dwmac_match[] = {
+ { .compatible = "sophgo,sg2044-dwmac" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sophgo_dwmac_match);
+
+static struct platform_driver sophgo_dwmac_driver = {
+ .probe = sophgo_dwmac_probe,
+ .remove = stmmac_pltfr_remove,
+ .driver = {
+ .name = "sophgo-dwmac",
+ .pm = &stmmac_pltfr_pm_ops,
+ .of_match_table = sophgo_dwmac_match,
+ },
+};
+module_platform_driver(sophgo_dwmac_driver);
+
+MODULE_AUTHOR("Inochi Amaoto <inochiama@gmail.com>");
+MODULE_DESCRIPTION("Sophgo DWMAC platform driver");
+MODULE_LICENSE("GPL");
--
2.47.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044
2024-10-25 1:09 [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Inochi Amaoto
` (3 preceding siblings ...)
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
@ 2024-10-25 13:08 ` Simon Horman
2024-10-25 23:24 ` Inochi Amaoto
4 siblings, 1 reply; 21+ messages in thread
From: Simon Horman @ 2024-10-25 13:08 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Fri, Oct 25, 2024 at 09:09:56AM +0800, Inochi Amaoto wrote:
> The ethernet controller of SG2044 is Synopsys DesignWare IP with
> custom clock. Add glue layer for it.
>
> Since v2, these patch depends on that following patch that provides
> helper function to compute rgmii clock:
> https://lore.kernel.org/netdev/20241013-upstream_s32cc_gmac-v3-4-d84b5a67b930@oss.nxp.com/
For future reference: patchsets for Networking, which have
not-yet-in-tree dependancies should be marked as an RFC.
Our CI doesn't know how to handle these and we don't have
a mechanism to re-run it once the dependencies are present:
the patchset needs to be sent again.
Also, I'm assuming this patch-set is targeted at net-next.
If so, that should be included in the subject like this:
[PATCH net-next vX] ...
I would wait for review before posting any updated patchset.
Thanks!
...
--
pw-bot: changes-requested
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
@ 2024-10-25 14:36 ` kernel test robot
2024-10-25 14:53 ` Alexander Lobakin
` (2 subsequent siblings)
3 siblings, 0 replies; 21+ messages in thread
From: kernel test robot @ 2024-10-25 14:36 UTC (permalink / raw)
To: Inochi Amaoto, Chen Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Inochi Amaoto,
Alexandre Torgue, Jose Abreu, Maxime Coquelin, Richard Cochran,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Giuseppe Cavallaro
Cc: oe-kbuild-all, netdev, Yixun Lan, Longbin Li, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
Hi Inochi,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on sophgo/for-next sophgo/fixes net-next/main net/main linus/master v6.12-rc4 next-20241025]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Inochi-Amaoto/dt-bindings-net-snps-dwmac-Add-dwmac-5-30a-version/20241025-091315
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20241025011000.244350-5-inochiama%40gmail.com
patch subject: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
config: um-allyesconfig (https://download.01.org/0day-ci/archive/20241025/202410252215.79396yyg-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410252215.79396yyg-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410252215.79396yyg-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c: In function 'sophgo_dwmac_fix_mac_speed':
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:30:16: error: implicit declaration of function 'rgmii_clock' [-Werror=implicit-function-declaration]
30 | rate = rgmii_clock(speed);
| ^~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c: In function 'sophgo_sg2044_dwmac_init':
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:46:13: warning: unused variable 'ret' [-Wunused-variable]
46 | int ret;
| ^~~
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c: In function 'sophgo_dwmac_fix_mac_speed':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:31:12: warning: 'ret' is used uninitialized [-Wuninitialized]
31 | if (ret < 0) {
| ^
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:28:13: note: 'ret' was declared here
28 | int ret;
| ^~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for MODVERSIONS
Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
Selected by [y]:
- RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=n] || GCC_PLUGINS [=y]) && MODULES [=y]
WARNING: unmet direct dependencies detected for GET_FREE_REGION
Depends on [n]: SPARSEMEM [=n]
Selected by [y]:
- RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]
vim +/ret +31 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
23
24 static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
25 {
26 struct sophgo_dwmac *dwmac = priv;
27 long rate;
28 int ret;
29
30 rate = rgmii_clock(speed);
> 31 if (ret < 0) {
32 dev_err(dwmac->dev, "invalid speed %u\n", speed);
33 return;
34 }
35
36 ret = clk_set_rate(dwmac->clk_tx, rate);
37 if (ret)
38 dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
39 }
40
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string
2024-10-25 1:09 ` [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string Inochi Amaoto
@ 2024-10-25 14:44 ` Alexander Lobakin
2024-10-25 23:32 ` Inochi Amaoto
0 siblings, 1 reply; 21+ messages in thread
From: Alexander Lobakin @ 2024-10-25 14:44 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
From: Inochi Amaoto <inochiama@gmail.com>
Date: Fri, 25 Oct 2024 09:09:59 +0800
> Add "snps,dwmac-5.30a" compatible string for 5.30a version that can avoid
> to define some platform data in the glue layer.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index ad868e8d195d..3c4e78b10dd6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -555,7 +555,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
> of_device_is_compatible(np, "snps,dwmac-4.10a") ||
> of_device_is_compatible(np, "snps,dwmac-4.20a") ||
> of_device_is_compatible(np, "snps,dwmac-5.10a") ||
> - of_device_is_compatible(np, "snps,dwmac-5.20")) {
> + of_device_is_compatible(np, "snps,dwmac-5.20") ||
> + of_device_is_compatible(np, "snps,dwmac-5.30a")) {
Please convert this to a const char * const [] table with all these
strings + one of_device_compatible_match().
> plat->has_gmac4 = 1;
> plat->has_gmac = 0;
> plat->pmt = 1;
Thanks,
Olek
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
2024-10-25 14:36 ` kernel test robot
@ 2024-10-25 14:53 ` Alexander Lobakin
2024-10-25 23:27 ` Inochi Amaoto
2024-10-25 15:48 ` kernel test robot
2024-10-25 19:34 ` kernel test robot
3 siblings, 1 reply; 21+ messages in thread
From: Alexander Lobakin @ 2024-10-25 14:53 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
From: Inochi Amaoto <inochiama@gmail.com>
Date: Fri, 25 Oct 2024 09:10:00 +0800
> Adds Sophgo dwmac driver support on the Sophgo SG2044 SoC.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++
> drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
> .../ethernet/stmicro/stmmac/dwmac-sophgo.c | 109 ++++++++++++++++++
> 3 files changed, 121 insertions(+)
> create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
[...]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
> new file mode 100644
> index 000000000000..8f37bcf86a73
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
> @@ -0,0 +1,109 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Sophgo DWMAC platform driver
> + *
> + * Copyright (C) 2024 Inochi Amaoto <inochiama@gmail.com>
> + *
This empty line is redundant I guess?
> + */
> +
> +#include <linux/bits.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/platform_device.h>
> +#include <linux/property.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/phy.h>
> +#include <linux/regmap.h>
Here should be alphabetical order.
> +
> +#include "stmmac_platform.h"
> +
> +struct sophgo_dwmac {
> + struct device *dev;
> + struct clk *clk_tx;
> +};
> +
> +static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
> +{
> + struct sophgo_dwmac *dwmac = priv;
> + long rate;
> + int ret;
> +
> + rate = rgmii_clock(speed);
> + if (ret < 0) {
Did you mean `if (rate < 0)`?
> + dev_err(dwmac->dev, "invalid speed %u\n", speed);
> + return;
> + }
> +
> + ret = clk_set_rate(dwmac->clk_tx, rate);
> + if (ret)
> + dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
Don't you want to print the error code here?
"failed to set tx rate %lu: %pe\n", rate, ERR_PTR(ret));
> +}
> +
> +static int sophgo_sg2044_dwmac_init(struct platform_device *pdev,
> + struct plat_stmmacenet_data *plat_dat,
> + struct stmmac_resources *stmmac_res)
> +{
> + struct sophgo_dwmac *dwmac;
> + int ret;
Unused var.
> +
> + dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
> + if (!dwmac)
> + return -ENOMEM;
> +
> + dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
> + if (IS_ERR(dwmac->clk_tx))
> + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
> + "failed to get tx clock\n");
> +
> + dwmac->dev = &pdev->dev;
> + plat_dat->bsp_priv = dwmac;
> + plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE;
> + plat_dat->fix_mac_speed = sophgo_dwmac_fix_mac_speed;
> + plat_dat->multicast_filter_bins = 0;
> + plat_dat->unicast_filter_entries = 1;
> +
> + return 0;
> +}
[...]
+ see the build bot report.
Thanks,
Olek
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
2024-10-25 14:36 ` kernel test robot
2024-10-25 14:53 ` Alexander Lobakin
@ 2024-10-25 15:48 ` kernel test robot
2024-10-25 19:34 ` kernel test robot
3 siblings, 0 replies; 21+ messages in thread
From: kernel test robot @ 2024-10-25 15:48 UTC (permalink / raw)
To: Inochi Amaoto, Chen Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Inochi Amaoto,
Alexandre Torgue, Jose Abreu, Maxime Coquelin, Richard Cochran,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Giuseppe Cavallaro
Cc: oe-kbuild-all, netdev, Yixun Lan, Longbin Li, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
Hi Inochi,
kernel test robot noticed the following build errors:
[auto build test ERROR on robh/for-next]
[also build test ERROR on sophgo/for-next sophgo/fixes net-next/main net/main linus/master v6.12-rc4 next-20241025]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Inochi-Amaoto/dt-bindings-net-snps-dwmac-Add-dwmac-5-30a-version/20241025-091315
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20241025011000.244350-5-inochiama%40gmail.com
patch subject: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20241025/202410252357.pCyOX2bg-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410252357.pCyOX2bg-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410252357.pCyOX2bg-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c: In function 'sophgo_dwmac_fix_mac_speed':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:30:16: error: implicit declaration of function 'rgmii_clock' [-Wimplicit-function-declaration]
30 | rate = rgmii_clock(speed);
| ^~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c: In function 'sophgo_sg2044_dwmac_init':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:46:13: warning: unused variable 'ret' [-Wunused-variable]
46 | int ret;
| ^~~
vim +/rgmii_clock +30 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
23
24 static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
25 {
26 struct sophgo_dwmac *dwmac = priv;
27 long rate;
28 int ret;
29
> 30 rate = rgmii_clock(speed);
31 if (ret < 0) {
32 dev_err(dwmac->dev, "invalid speed %u\n", speed);
33 return;
34 }
35
36 ret = clk_set_rate(dwmac->clk_tx, rate);
37 if (ret)
38 dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
39 }
40
41 static int sophgo_sg2044_dwmac_init(struct platform_device *pdev,
42 struct plat_stmmacenet_data *plat_dat,
43 struct stmmac_resources *stmmac_res)
44 {
45 struct sophgo_dwmac *dwmac;
> 46 int ret;
47
48 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
49 if (!dwmac)
50 return -ENOMEM;
51
52 dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
53 if (IS_ERR(dwmac->clk_tx))
54 return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
55 "failed to get tx clock\n");
56
57 dwmac->dev = &pdev->dev;
58 plat_dat->bsp_priv = dwmac;
59 plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE;
60 plat_dat->fix_mac_speed = sophgo_dwmac_fix_mac_speed;
61 plat_dat->multicast_filter_bins = 0;
62 plat_dat->unicast_filter_entries = 1;
63
64 return 0;
65 }
66
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
` (2 preceding siblings ...)
2024-10-25 15:48 ` kernel test robot
@ 2024-10-25 19:34 ` kernel test robot
3 siblings, 0 replies; 21+ messages in thread
From: kernel test robot @ 2024-10-25 19:34 UTC (permalink / raw)
To: Inochi Amaoto, Chen Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Inochi Amaoto,
Alexandre Torgue, Jose Abreu, Maxime Coquelin, Richard Cochran,
Paul Walmsley, Palmer Dabbelt, Albert Ou, Giuseppe Cavallaro
Cc: llvm, oe-kbuild-all, netdev, Yixun Lan, Longbin Li, devicetree,
linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv
Hi Inochi,
kernel test robot noticed the following build errors:
[auto build test ERROR on robh/for-next]
[also build test ERROR on sophgo/for-next sophgo/fixes net-next/main net/main linus/master v6.12-rc4 next-20241025]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Inochi-Amaoto/dt-bindings-net-snps-dwmac-Add-dwmac-5-30a-version/20241025-091315
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20241025011000.244350-5-inochiama%40gmail.com
patch subject: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241026/202410260337.pPIMKkX6-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 5886454669c3c9026f7f27eab13509dd0241f2d6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241026/202410260337.pPIMKkX6-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410260337.pPIMKkX6-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:11:
In file included from include/linux/platform_device.h:13:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/s390/include/asm/elf.h:181:
In file included from arch/s390/include/asm/mmu_context.h:11:
In file included from arch/s390/include/asm/pgalloc.h:18:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:14:
In file included from include/linux/phy.h:16:
In file included from include/linux/ethtool.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:28:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:93:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
548 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
| ^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
| ^
In file included from drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:14:
In file included from include/linux/phy.h:16:
In file included from include/linux/ethtool.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:28:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:93:
include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
| ^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
| ^
In file included from drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:14:
In file included from include/linux/phy.h:16:
In file included from include/linux/ethtool.h:18:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:28:
In file included from include/linux/dma-mapping.h:11:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:93:
include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
585 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
693 | readsb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
701 | readsw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
709 | readsl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
718 | writesb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
727 | writesw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
736 | writesl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
>> drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:30:9: error: call to undeclared function 'rgmii_clock'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
30 | rate = rgmii_clock(speed);
| ^
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c:46:6: warning: unused variable 'ret' [-Wunused-variable]
46 | int ret;
| ^~~
17 warnings and 1 error generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for MODVERSIONS
Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
Selected by [y]:
- RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=y] || GCC_PLUGINS [=n]) && MODULES [=y]
vim +/rgmii_clock +30 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
23
24 static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
25 {
26 struct sophgo_dwmac *dwmac = priv;
27 long rate;
28 int ret;
29
> 30 rate = rgmii_clock(speed);
31 if (ret < 0) {
32 dev_err(dwmac->dev, "invalid speed %u\n", speed);
33 return;
34 }
35
36 ret = clk_set_rate(dwmac->clk_tx, rate);
37 if (ret)
38 dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
39 }
40
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044
2024-10-25 13:08 ` [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Simon Horman
@ 2024-10-25 23:24 ` Inochi Amaoto
0 siblings, 0 replies; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 23:24 UTC (permalink / raw)
To: Simon Horman, Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Fri, Oct 25, 2024 at 02:08:17PM +0100, Simon Horman wrote:
> On Fri, Oct 25, 2024 at 09:09:56AM +0800, Inochi Amaoto wrote:
> > The ethernet controller of SG2044 is Synopsys DesignWare IP with
> > custom clock. Add glue layer for it.
> >
> > Since v2, these patch depends on that following patch that provides
> > helper function to compute rgmii clock:
> > https://lore.kernel.org/netdev/20241013-upstream_s32cc_gmac-v3-4-d84b5a67b930@oss.nxp.com/
>
> For future reference: patchsets for Networking, which have
> not-yet-in-tree dependancies should be marked as an RFC.
> Our CI doesn't know how to handle these and we don't have
> a mechanism to re-run it once the dependencies are present:
> the patchset needs to be sent again.
>
> Also, I'm assuming this patch-set is targeted at net-next.
> If so, that should be included in the subject like this:
>
> [PATCH net-next vX] ...
>
> I would wait for review before posting any updated patchset.
>
> Thanks!
>
Thanks for your explanation. I apologize for missing these
rules. I will change it to the right title when sumbiting the
next patch.
Regards,
Inochi
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
2024-10-25 14:53 ` Alexander Lobakin
@ 2024-10-25 23:27 ` Inochi Amaoto
0 siblings, 0 replies; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 23:27 UTC (permalink / raw)
To: Alexander Lobakin, Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Fri, Oct 25, 2024 at 04:53:07PM +0200, Alexander Lobakin wrote:
> From: Inochi Amaoto <inochiama@gmail.com>
> Date: Fri, 25 Oct 2024 09:10:00 +0800
>
> > Adds Sophgo dwmac driver support on the Sophgo SG2044 SoC.
> >
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> > drivers/net/ethernet/stmicro/stmmac/Kconfig | 11 ++
> > drivers/net/ethernet/stmicro/stmmac/Makefile | 1 +
> > .../ethernet/stmicro/stmmac/dwmac-sophgo.c | 109 ++++++++++++++++++
> > 3 files changed, 121 insertions(+)
> > create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
>
> [...]
>
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
> > new file mode 100644
> > index 000000000000..8f37bcf86a73
> > --- /dev/null
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
> > @@ -0,0 +1,109 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Sophgo DWMAC platform driver
> > + *
> > + * Copyright (C) 2024 Inochi Amaoto <inochiama@gmail.com>
> > + *
>
> This empty line is redundant I guess?
>
> > + */
> > +
> > +#include <linux/bits.h>
> > +#include <linux/mod_devicetable.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/property.h>
> > +#include <linux/mfd/syscon.h>
> > +#include <linux/phy.h>
> > +#include <linux/regmap.h>
>
> Here should be alphabetical order.
>
Thanks, I forgot to reorder it when adding new include.
> > +
> > +#include "stmmac_platform.h"
> > +
> > +struct sophgo_dwmac {
> > + struct device *dev;
> > + struct clk *clk_tx;
> > +};
> > +
> > +static void sophgo_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
> > +{
> > + struct sophgo_dwmac *dwmac = priv;
> > + long rate;
> > + int ret;
> > +
> > + rate = rgmii_clock(speed);
> > + if (ret < 0) {
>
> Did you mean `if (rate < 0)`?
>
Yeah, it seems I forgot to modify it.
> > + dev_err(dwmac->dev, "invalid speed %u\n", speed);
> > + return;
> > + }
> > +
> > + ret = clk_set_rate(dwmac->clk_tx, rate);
> > + if (ret)
> > + dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
>
> Don't you want to print the error code here?
>
> "failed to set tx rate %lu: %pe\n", rate, ERR_PTR(ret));
>
Thanks, it is more clear now.
> > +}
> > +
> > +static int sophgo_sg2044_dwmac_init(struct platform_device *pdev,
> > + struct plat_stmmacenet_data *plat_dat,
> > + struct stmmac_resources *stmmac_res)
> > +{
> > + struct sophgo_dwmac *dwmac;
> > + int ret;
>
> Unused var.
>
> > +
> > + dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
> > + if (!dwmac)
> > + return -ENOMEM;
> > +
> > + dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
> > + if (IS_ERR(dwmac->clk_tx))
> > + return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
> > + "failed to get tx clock\n");
> > +
> > + dwmac->dev = &pdev->dev;
> > + plat_dat->bsp_priv = dwmac;
> > + plat_dat->flags |= STMMAC_FLAG_SPH_DISABLE;
> > + plat_dat->fix_mac_speed = sophgo_dwmac_fix_mac_speed;
> > + plat_dat->multicast_filter_bins = 0;
> > + plat_dat->unicast_filter_entries = 1;
> > +
> > + return 0;
> > +}
>
> [...]
>
> + see the build bot report.
>
> Thanks,
> Olek
Thanks, I will fix it.
Regards,
Inochi
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string
2024-10-25 14:44 ` Alexander Lobakin
@ 2024-10-25 23:32 ` Inochi Amaoto
0 siblings, 0 replies; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-25 23:32 UTC (permalink / raw)
To: Alexander Lobakin, Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Fri, Oct 25, 2024 at 04:44:55PM +0200, Alexander Lobakin wrote:
> From: Inochi Amaoto <inochiama@gmail.com>
> Date: Fri, 25 Oct 2024 09:09:59 +0800
>
> > Add "snps,dwmac-5.30a" compatible string for 5.30a version that can avoid
> > to define some platform data in the glue layer.
> >
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> > drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > index ad868e8d195d..3c4e78b10dd6 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> > @@ -555,7 +555,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
> > of_device_is_compatible(np, "snps,dwmac-4.10a") ||
> > of_device_is_compatible(np, "snps,dwmac-4.20a") ||
> > of_device_is_compatible(np, "snps,dwmac-5.10a") ||
> > - of_device_is_compatible(np, "snps,dwmac-5.20")) {
> > + of_device_is_compatible(np, "snps,dwmac-5.20") ||
> > + of_device_is_compatible(np, "snps,dwmac-5.30a")) {
>
> Please convert this to a const char * const [] table with all these
> strings + one of_device_compatible_match().
>
I will, this make the check more clear, thanks.
Regards,
Inochi
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version
2024-10-25 1:09 ` [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version Inochi Amaoto
@ 2024-10-27 20:35 ` Krzysztof Kozlowski
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-27 20:35 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Fri, Oct 25, 2024 at 09:09:57AM +0800, Inochi Amaoto wrote:
> Add compatible string for dwmac-5.30a IP.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
> Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 4e2ba1bf788c..3c4007cb65f8 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -31,6 +31,7 @@ select:
> - snps,dwmac-4.20a
> - snps,dwmac-5.10a
> - snps,dwmac-5.20
> + - snps,dwmac-5.30a
Same as for Enclustra patchset... this is incomplete approach. These are
just fallbacks, visible by "contains" keyword and you should come with
proper specific compatible. Look how other compatibles are arranged.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-25 1:09 ` [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Inochi Amaoto
@ 2024-10-27 20:38 ` Krzysztof Kozlowski
2024-10-27 23:32 ` Inochi Amaoto
0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-27 20:38 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Fri, Oct 25, 2024 at 09:09:58AM +0800, Inochi Amaoto wrote:
> The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> with some extra clock.
>
> Add necessary compatible string for this device.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
This should be squashed with a corrected previous patch (why do you need
to select snps,dwmac-5.30a?), so we clearly see which the fallback and
specific compatibles being added.
> .../devicetree/bindings/net/snps,dwmac.yaml | 1 +
> .../bindings/net/sophgo,sg2044-dwmac.yaml | 124 ++++++++++++++++++
> 2 files changed, 125 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-27 20:38 ` Krzysztof Kozlowski
@ 2024-10-27 23:32 ` Inochi Amaoto
2024-10-28 7:06 ` Krzysztof Kozlowski
0 siblings, 1 reply; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-27 23:32 UTC (permalink / raw)
To: Krzysztof Kozlowski, Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Sun, Oct 27, 2024 at 09:38:00PM +0100, Krzysztof Kozlowski wrote:
> On Fri, Oct 25, 2024 at 09:09:58AM +0800, Inochi Amaoto wrote:
> > The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> > with some extra clock.
> >
> > Add necessary compatible string for this device.
> >
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
>
> This should be squashed with a corrected previous patch
Good, I will.
> (why do you need to select snps,dwmac-5.30a?),
The is because the driver use the fallback versioned compatible
string to set up some common arguments. (This is what the patch
3 does). It is also better to have a accurate fallback compatible
if we already know what it is.
Regards,
Inochi
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-27 23:32 ` Inochi Amaoto
@ 2024-10-28 7:06 ` Krzysztof Kozlowski
2024-10-28 7:16 ` Inochi Amaoto
0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-28 7:06 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On 28/10/2024 00:32, Inochi Amaoto wrote:
> On Sun, Oct 27, 2024 at 09:38:00PM +0100, Krzysztof Kozlowski wrote:
>> On Fri, Oct 25, 2024 at 09:09:58AM +0800, Inochi Amaoto wrote:
>>> The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
>>> with some extra clock.
>>>
>>> Add necessary compatible string for this device.
>>>
>>> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
>>> ---
>>
>> This should be squashed with a corrected previous patch
>
> Good, I will.
>
>> (why do you need to select snps,dwmac-5.30a?),
>
> The is because the driver use the fallback versioned compatible
> string to set up some common arguments. (This is what the patch
Nope. Driver never relies on schema doing select. That's just incorrect.
> 3 does). It is also better to have a accurate fallback compatible
> if we already know what it is.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-28 7:06 ` Krzysztof Kozlowski
@ 2024-10-28 7:16 ` Inochi Amaoto
2024-10-29 13:27 ` Krzysztof Kozlowski
0 siblings, 1 reply; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-28 7:16 UTC (permalink / raw)
To: Krzysztof Kozlowski, Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Mon, Oct 28, 2024 at 08:06:25AM +0100, Krzysztof Kozlowski wrote:
> On 28/10/2024 00:32, Inochi Amaoto wrote:
> > On Sun, Oct 27, 2024 at 09:38:00PM +0100, Krzysztof Kozlowski wrote:
> >> On Fri, Oct 25, 2024 at 09:09:58AM +0800, Inochi Amaoto wrote:
> >>> The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> >>> with some extra clock.
> >>>
> >>> Add necessary compatible string for this device.
> >>>
> >>> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> >>> ---
> >>
> >> This should be squashed with a corrected previous patch
> >
> > Good, I will.
> >
> >> (why do you need to select snps,dwmac-5.30a?),
> >
> > The is because the driver use the fallback versioned compatible
> > string to set up some common arguments. (This is what the patch
>
> Nope. Driver never relies on schema doing select. That's just incorrect.
>
Yeah, I make a mistake on understanding you. For me, I just followed
what others do. But there is a comment before this select.
"""
Select every compatible, including the deprecated ones. This way, we
will be able to report a warning when we have that compatible, since
we will validate the node thanks to the select, but won't report it
as a valid value in the compatible property description
"""
By reading this, I think there may be some historical reason? Maybe
someone can explain this.
Regards,
Inochi
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-28 7:16 ` Inochi Amaoto
@ 2024-10-29 13:27 ` Krzysztof Kozlowski
2024-10-30 0:43 ` Inochi Amaoto
0 siblings, 1 reply; 21+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-29 13:27 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On 28/10/2024 08:16, Inochi Amaoto wrote:
> On Mon, Oct 28, 2024 at 08:06:25AM +0100, Krzysztof Kozlowski wrote:
>> On 28/10/2024 00:32, Inochi Amaoto wrote:
>>> On Sun, Oct 27, 2024 at 09:38:00PM +0100, Krzysztof Kozlowski wrote:
>>>> On Fri, Oct 25, 2024 at 09:09:58AM +0800, Inochi Amaoto wrote:
>>>>> The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
>>>>> with some extra clock.
>>>>>
>>>>> Add necessary compatible string for this device.
>>>>>
>>>>> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
>>>>> ---
>>>>
>>>> This should be squashed with a corrected previous patch
>>>
>>> Good, I will.
>>>
>>>> (why do you need to select snps,dwmac-5.30a?),
>>>
>>> The is because the driver use the fallback versioned compatible
>>> string to set up some common arguments. (This is what the patch
>>
>> Nope. Driver never relies on schema doing select. That's just incorrect.
>>
>
> Yeah, I make a mistake on understanding you. For me, I just followed
> what others do. But there is a comment before this select.
>
> """
> Select every compatible, including the deprecated ones. This way, we
> will be able to report a warning when we have that compatible, since
> we will validate the node thanks to the select, but won't report it
> as a valid value in the compatible property description
> """
>
> By reading this, I think there may be some historical reason? Maybe
> someone can explain this.
I think this is left-over from older times before all specific
compatibles were added here and in their bindings. This binding has been
waiting for some cleanup for a while now, so this is fine.
I still think the patches should be merged, though.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
2024-10-29 13:27 ` Krzysztof Kozlowski
@ 2024-10-30 0:43 ` Inochi Amaoto
0 siblings, 0 replies; 21+ messages in thread
From: Inochi Amaoto @ 2024-10-30 0:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Inochi Amaoto
Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Giuseppe Cavallaro, Yixun Lan, Longbin Li, netdev,
devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
linux-riscv
On Tue, Oct 29, 2024 at 02:27:20PM +0100, Krzysztof Kozlowski wrote:
> On 28/10/2024 08:16, Inochi Amaoto wrote:
> > On Mon, Oct 28, 2024 at 08:06:25AM +0100, Krzysztof Kozlowski wrote:
> >> On 28/10/2024 00:32, Inochi Amaoto wrote:
> >>> On Sun, Oct 27, 2024 at 09:38:00PM +0100, Krzysztof Kozlowski wrote:
> >>>> On Fri, Oct 25, 2024 at 09:09:58AM +0800, Inochi Amaoto wrote:
> >>>>> The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> >>>>> with some extra clock.
> >>>>>
> >>>>> Add necessary compatible string for this device.
> >>>>>
> >>>>> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> >>>>> ---
> >>>>
> >>>> This should be squashed with a corrected previous patch
> >>>
> >>> Good, I will.
> >>>
> >>>> (why do you need to select snps,dwmac-5.30a?),
> >>>
> >>> The is because the driver use the fallback versioned compatible
> >>> string to set up some common arguments. (This is what the patch
> >>
> >> Nope. Driver never relies on schema doing select. That's just incorrect.
> >>
> >
> > Yeah, I make a mistake on understanding you. For me, I just followed
> > what others do. But there is a comment before this select.
> >
> > """
> > Select every compatible, including the deprecated ones. This way, we
> > will be able to report a warning when we have that compatible, since
> > we will validate the node thanks to the select, but won't report it
> > as a valid value in the compatible property description
> > """
> >
> > By reading this, I think there may be some historical reason? Maybe
> > someone can explain this.
>
> I think this is left-over from older times before all specific
> compatibles were added here and in their bindings. This binding has been
> waiting for some cleanup for a while now, so this is fine.
>
> I still think the patches should be merged, though.
>
> Best regards,
> Krzysztof
>
Thanks, I will squash this patch in the next version
Regards,
Inochi
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2024-10-30 0:43 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 1:09 [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Inochi Amaoto
2024-10-25 1:09 ` [PATCH v2 1/4] dt-bindings: net: snps,dwmac: Add dwmac-5.30a version Inochi Amaoto
2024-10-27 20:35 ` Krzysztof Kozlowski
2024-10-25 1:09 ` [PATCH v2 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Inochi Amaoto
2024-10-27 20:38 ` Krzysztof Kozlowski
2024-10-27 23:32 ` Inochi Amaoto
2024-10-28 7:06 ` Krzysztof Kozlowski
2024-10-28 7:16 ` Inochi Amaoto
2024-10-29 13:27 ` Krzysztof Kozlowski
2024-10-30 0:43 ` Inochi Amaoto
2024-10-25 1:09 ` [PATCH v2 3/4] net: stmmac: platform: Add snps,dwmac-5.30a IP compatible string Inochi Amaoto
2024-10-25 14:44 ` Alexander Lobakin
2024-10-25 23:32 ` Inochi Amaoto
2024-10-25 1:10 ` [PATCH v2 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Inochi Amaoto
2024-10-25 14:36 ` kernel test robot
2024-10-25 14:53 ` Alexander Lobakin
2024-10-25 23:27 ` Inochi Amaoto
2024-10-25 15:48 ` kernel test robot
2024-10-25 19:34 ` kernel test robot
2024-10-25 13:08 ` [PATCH v2 0/4] riscv: sophgo: Add ethernet support for SG2044 Simon Horman
2024-10-25 23:24 ` Inochi Amaoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).