arm64: dts: qcom: enable ethernet on sa8775p-ride
Subsystems (5)
v2 cover arm64: dts: qcom: enable ethernet on sa8775p-ride
From: Bartosz Golaszewski <[email protected]>
Bjorn,
Now that all other bits and pieces are in next, I'm resending the reviewed DTS patches for pick up. This enables one of the 1Gb ethernet ports on sa8775p-ride.
Bartosz Golaszewski (5):
arm64: dts: qcom: sa8775p: add the SGMII PHY node
arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface
arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY
arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0
arm64: dts: qcom: sa8775p-ride: enable ethernet0
arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 109 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 42 +++++++++ 2 files changed, 151 insertions(+)
Signature · 1 line
2.39.2
PATCH RESEND v2 1/5 arm64: dts: qcom: sa8775p: add the SGMII PHY node
From: Bartosz Golaszewski <[email protected]>
Add the internal SGMII/SerDes PHY node for sa8775p platforms.
--- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +9 -0
@@ -1837,6 +1837,15 @@ adreno_smmu: iommu@3da0000 { <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>; }; + serdes0: phy@8901000 { + compatible = "qcom,sa8775p-dwmac-sgmii-phy"; + reg = <0x0 0x08901000 0x0 0xe10>; + clocks = <&gcc GCC_SGMI_CLKREF_EN>; + clock-names = "sgmi_ref"; + #phy-cells = <0>; + status = "disabled"; + }; + pdc: interrupt-controller@b220000 { compatible = "qcom,sa8775p-pdc", "qcom,pdc"; reg = <0x0 0x0b220000 0x0 0x30000>,
Signature · 1 line
2.39.2
PATCH RESEND v2 2/5 arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Add the node for the first ethernet interface on sa8775p platforms.
--- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +33 -0
@@ -2315,6 +2315,39 @@ cpufreq_hw: cpufreq@18591000 { #freq-domain-cells = <1>; }; + + ethernet0: ethernet@23040000 { + compatible = "qcom,sa8775p-ethqos"; + reg = <0x0 0x23040000 0x0 0x10000>, + <0x0 0x23056000 0x0 0x100>; + reg-names = "stmmaceth", "rgmii"; + + interrupts = <GIC_SPI 946 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "macirq"; + + clocks = <&gcc GCC_EMAC0_AXI_CLK>, + <&gcc GCC_EMAC0_SLV_AHB_CLK>, + <&gcc GCC_EMAC0_PTP_CLK>, + <&gcc GCC_EMAC0_PHY_AUX_CLK>; + clock-names = "stmmaceth", + "pclk", + "ptp_ref", + "phyaux"; + + power-domains = <&gcc EMAC0_GDSC>; + + phys = <&serdes0>; + phy-names = "serdes"; + + iommus = <&apps_smmu 0x120 0xf>; + + snps,tso; + snps,pbl = <32>; + rx-fifo-depth = <16384>; + tx-fifo-depth = <16384>; + + status = "disabled"; + }; }; arch_timer: timer {
Signature · 1 line
2.39.2
PATCH RESEND v2 3/5 arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Enable the internal PHY on sa8775p-ride.
--- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p-ride.dts +5 -0
@@ -355,6 +355,11 @@ &qupv3_id_2 { status = "okay"; }; +&serdes0 { + phy-supply = <&vreg_l5a>; + status = "okay"; +}; + &sleep_clk { clock-frequency = <32764>; };
Signature · 1 line
2.39.2
PATCH RESEND v2 4/5 arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Add the MDC and MDIO pin functions for ethernet0 on sa8775p-ride.
--- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p-ride.dts +16 -0
@@ -371,6 +371,22 @@ &spi16 { }; &tlmm { + ethernet0_default: ethernet0-default-state { + ethernet0_mdc: ethernet0-mdc-pins { + pins = "gpio8"; + function = "emac0_mdc"; + drive-strength = <16>; + bias-pull-up; + }; + + ethernet0_mdio: ethernet0-mdio-pins { + pins = "gpio9"; + function = "emac0_mdio"; + drive-strength = <16>; + bias-pull-up; + }; + }; + qup_uart10_default: qup-uart10-state { pins = "gpio46", "gpio47"; function = "qup1_se3";
Signature · 1 line
2.39.2
PATCH RESEND v2 5/5 arm64: dts: qcom: sa8775p-ride: enable ethernet0
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Enable the first 1Gb ethernet port on sa8775p-ride development board.
--- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+)
arch/arm64/boot/dts/qcom/sa8775p-ride.dts +88 -0
@@ -261,6 +261,94 @@ vreg_l8e: ldo8 { }; }; +ðernet0 { + phy-mode = "sgmii"; + phy-handle = <&sgmii_phy>; + + pinctrl-0 = <ðernet0_default>; + pinctrl-names = "default"; + + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,ps-speed = <1000>; + + status = "okay"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + reset-gpios = <&pmm8654au_2_gpios 8 GPIO_ACTIVE_LOW>; + reset-delay-us = <11000>; + reset-post-delay-us = <70000>; + + sgmii_phy: phy@8 { + reg = <0x8>; + device_type = "ethernet-phy"; + }; + }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <4>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + snps,route-up; + snps,priority = <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x3>; + snps,priority = <0xc>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <4>; + snps,tx-sched-sp; + + queue0 { + snps,dcb-algorithm; + }; + + queue1 { + snps,dcb-algorithm; + }; + + queue2 { + snps,avb-algorithm; + snps,send_slope = <0x1000>; + snps,idle_slope = <0x1000>; + snps,high_credit = <0x3e800>; + snps,low_credit = <0xffc18000>; + }; + + queue3 { + snps,avb-algorithm; + snps,send_slope = <0x1000>; + snps,idle_slope = <0x1000>; + snps,high_credit = <0x3e800>; + snps,low_credit = <0xffc18000>; + }; + }; +}; + &i2c11 { clock-frequency = <400000>; pinctrl-0 = <&qup_i2c11_default>;
Signature · 1 line
2.39.2
Quoted 15 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Bjorn,
Now that all other bits and pieces are in next, I'm resending the reviewed DTS patches for pick up. This enables one of the 1Gb ethernet ports on sa8775p-ride.
Bartosz Golaszewski (5):
arm64: dts: qcom: sa8775p: add the SGMII PHY node
arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface
arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY
arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0
arm64: dts: qcom: sa8775p-ride: enable ethernet0
Quoted 7 lines
arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 109 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 42 +++++++++ 2 files changed, 151 insertions(+)Signature · 1 line
2.39.2
note, I did uncover a bug in stmmac (imo) wrt unbalanced calls to serdes_powerup/serdes_powerdown() which I plan on trying to fix shortly.
Not really related to any of the Qualcomm specific bits though. This looks good to me.
You can trigger the bug I mentioned by removing the dwmac-qcom-ethqos module:
[ 174.893710] ------------[ cut here ]------------
[ 174.898459] unbalanced disables for vreg_l5a
[ 174.902868] WARNING: CPU: 5 PID: 584 at drivers/regulator/core.c:2996 _regulator_disable+0xe8/0x1c8
[ 174.912150] Modules linked in: r8152 rfkill marvell dwmac_qcom_ethqos(-) stmmac_platform stmmac qcom_pon crct10dif_ce spi_geni_qcom i2c_qcom_geni phy_qcom_qmp_usb pcs_xpcs phy_qcom_snps_femto_v2 qcom_wdt socinfo fuse ufs_qcom phy_qcom_qmp_ufs
[ 174.934171] CPU: 5 PID: 584 Comm: modprobe Not tainted 6.4.0-rc7-next-20230622-00006-gb4d4b58e3c81-dirty #29
[ 174.944250] Hardware name: Qualcomm SA8775P Ride (DT)
[ 174.949438] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 174.956578] pc : _regulator_disable+0xe8/0x1c8
[ 174.961143] lr : _regulator_disable+0xe8/0x1c8
[ 174.965709] sp : ffff800082c13b50
[ 174.969114] x29: ffff800082c13b50 x28: ffff592b4c692d00 x27: 0000000000000000
[ 174.976431] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
[ 174.983750] x23: ffff592b40dd8c90 x22: ffff592b40f47490 x21: ffff592b41a72000
[ 174.991067] x20: ffff592b409c6900 x19: ffff592b409c6900 x18: 0000000000000006
[ 174.998385] x17: 3630333230322d74 x16: ffffcc489c71e6f8 x15: ffff800082c135d0
[ 175.005702] x14: 0000000000000000 x13: 61356c5f67657276 x12: 20726f662073656c
[ 175.013019] x11: fffffffffffe0000 x10: ffffcc489ea33488 x9 : ffffcc489c27aa10
[ 175.020336] x8 : 00000000ffffefff x7 : ffffcc489ea33488 x6 : 80000000fffff000
[ 175.027654] x5 : ffff5939bb92acc8 x4 : 0000000000000000 x3 : 0000000000000000
[ 175.034971] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff592b4c692d00
[ 175.042289] Call trace:
[ 175.044802] _regulator_disable+0xe8/0x1c8
[ 175.049010] regulator_disable+0x4c/0x98
[ 175.053040] phy_power_off+0x90/0xe0
[ 175.056714] qcom_ethqos_serdes_powerdown+0x28/0x48 [dwmac_qcom_ethqos]
[ 175.063510] stmmac_dvr_remove+0xa0/0x178 [stmmac]
[ 175.068440] stmmac_pltfr_remove+0x2c/0x80 [stmmac_platform]
[ 175.074255] platform_remove+0x34/0x80
[ 175.078107] device_remove+0x54/0x90
[ 175.081783] device_release_driver_internal+0x1dc/0x240
[ 175.087150] driver_detach+0x58/0xa8
[ 175.090824] bus_remove_driver+0x74/0xd0
[ 175.094856] driver_unregister+0x38/0x70
[ 175.098887] platform_driver_unregister+0x1c/0x30
[ 175.103721] qcom_ethqos_driver_exit+0x18/0x1b8 [dwmac_qcom_ethqos]
[ 175.110160] __arm64_sys_delete_module+0x1a8/0x298
[ 175.115082] invoke_syscall+0x50/0x128
[ 175.118936] el0_svc_common.constprop.0+0xcc/0xf8
[ 175.123770] do_el0_svc+0x40/0xa8
[ 175.127178] el0_svc+0x2c/0x88
[ 175.130318] el0t_64_sync_handler+0x100/0x130
[ 175.134795] el0t_64_sync+0x190/0x198
[ 175.138560] ---[ end trace 0000000000000000 ]---
[root@dhcp19-243-249 ~]# Just dumping the stack on serdes_powerdown/up calls you get the following:
[ 6.179584] qcom-ethqos 23040000.ethernet eth0: PHY [stmmac-0:08] driver [Marvell 88E1510] (irq=POLL)
[ 6.189571] CPU: 0 PID: 323 Comm: NetworkManager Not tainted 6.4.0-rc7-next-20230622-00006-gb4d4b58e3c81-dirty #29
[ 6.200192] Hardware name: Qualcomm SA8775P Ride (DT)
[ 6.205373] Call trace:
[ 6.207896] dump_backtrace+0x9c/0x100
[ 6.211752] show_stack+0x20/0x38
[ 6.215160] dump_stack_lvl+0x48/0x60
[ 6.218929] dump_stack+0x18/0x28
[ 6.222335] qcom_ethqos_serdes_powerup+0x20/0x70 [dwmac_qcom_ethqos]
[ 6.228957] __stmmac_open+0x138/0x488 [stmmac]
[ 6.233634] stmmac_open+0x4c/0xe8 [stmmac]
[ 6.237948] __dev_open+0x108/0x1e8
[ 6.241535] __dev_change_flags+0x194/0x218
[ 6.245834] dev_change_flags+0x2c/0x80
[ 6.249778] do_setlink+0x2b0/0xef8
[ 6.253363] __rtnl_newlink+0x514/0x870
[ 6.257305] rtnl_newlink+0x58/0x90
[ 6.260891] rtnetlink_rcv_msg+0x134/0x390
[ 6.265100] netlink_rcv_skb+0x64/0x138
[ 6.269046] rtnetlink_rcv+0x20/0x38
[ 6.272721] netlink_unicast+0x2f0/0x350
[ 6.276755] netlink_sendmsg+0x1b0/0x430
[ 6.280789] ____sys_sendmsg+0x1d8/0x2c8
[ 6.284826] ___sys_sendmsg+0xb4/0x110
[ 6.288680] __sys_sendmsg+0x8c/0xf0
[ 6.292357] __arm64_sys_sendmsg+0x2c/0x40
[ 6.296570] invoke_syscall+0x50/0x128
[ 6.300424] el0_svc_common.constprop.0+0xcc/0xf8
[ 6.305253] do_el0_svc+0x40/0xa8
[ 6.308662] el0_svc+0x2c/0x88
[ 6.311804] el0t_64_sync_handler+0x100/0x130
[ 6.316285] el0t_64_sync+0x190/0x198
<snip>
[root@dhcp19-243-249 ~]# modprobe -r dwmac_qcom_ethqos
[ 174.562075] qcom-ethqos 23040000.ethernet eth0: stmmac_dvr_remove: removing driver
[ 174.570660] stmmac_pcs: Link Down
[ 174.580082] CPU: 5 PID: 584 Comm: modprobe Not tainted 6.4.0-rc7-next-20230622-00006-gb4d4b58e3c81-dirty #29
[ 174.590176] Hardware name: Qualcomm SA8775P Ride (DT)
[ 174.595363] Call trace:
[ 174.597881] dump_backtrace+0x9c/0x100
[ 174.601744] show_stack+0x20/0x38
[ 174.605154] dump_stack_lvl+0x48/0x60
[ 174.608926] dump_stack+0x18/0x28
[ 174.612339] qcom_ethqos_serdes_powerdown+0x20/0x48 [dwmac_qcom_ethqos]
[ 174.619138] stmmac_release+0x234/0x2e0 [stmmac]
[ 174.623893] __dev_close_many+0xb4/0x160
[ 174.627920] dev_close_many+0x8c/0x140
[ 174.631777] unregister_netdevice_many_notify+0x140/0x7a0
[ 174.637320] unregister_netdevice_queue+0xa0/0xe8
[ 174.642151] unregister_netdev+0x2c/0x48
[ 174.646179] stmmac_dvr_remove+0x88/0x178 [stmmac]
[ 174.651109] stmmac_pltfr_remove+0x2c/0x80 [stmmac_platform]
[ 174.656925] platform_remove+0x34/0x80
[ 174.660786] device_remove+0x54/0x90
[ 174.664468] device_release_driver_internal+0x1dc/0x240
[ 174.669834] driver_detach+0x58/0xa8
[ 174.673514] bus_remove_driver+0x74/0xd0
[ 174.677552] driver_unregister+0x38/0x70
[ 174.681578] platform_driver_unregister+0x1c/0x30
[ 174.686408] qcom_ethqos_driver_exit+0x18/0x1b8 [dwmac_qcom_ethqos]
[ 174.692847] __arm64_sys_delete_module+0x1a8/0x298
[ 174.697767] invoke_syscall+0x50/0x128
[ 174.701617] el0_svc_common.constprop.0+0xcc/0xf8
[ 174.706449] do_el0_svc+0x40/0xa8
[ 174.709864] el0_svc+0x2c/0x88
[ 174.713009] el0t_64_sync_handler+0x100/0x130
[ 174.717482] el0t_64_sync+0x190/0x198
[ 174.721919] qcom-ethqos 23040000.ethernet eth0: FPE workqueue stop
[ 174.779478] CPU: 5 PID: 584 Comm: modprobe Not tainted 6.4.0-rc7-next-20230622-00006-gb4d4b58e3c81-dirty #29
[ 174.789565] Hardware name: Qualcomm SA8775P Ride (DT)
[ 174.794754] Call trace:
[ 174.797267] dump_backtrace+0x9c/0x100
[ 174.801123] show_stack+0x20/0x38
[ 174.804528] dump_stack_lvl+0x48/0x60
[ 174.808295] dump_stack+0x18/0x28
[ 174.811700] qcom_ethqos_serdes_powerdown+0x20/0x48 [dwmac_qcom_ethqos]
[ 174.818497] stmmac_dvr_remove+0xa0/0x178 [stmmac]
[ 174.823429] stmmac_pltfr_remove+0x2c/0x80 [stmmac_platform]
[ 174.829245] platform_remove+0x34/0x80
[ 174.833097] device_remove+0x54/0x90
[ 174.836772] device_release_driver_internal+0x1dc/0x240
[ 174.842138] driver_detach+0x58/0xa8
[ 174.845810] bus_remove_driver+0x74/0xd0
[ 174.849841] driver_unregister+0x38/0x70
[ 174.853870] platform_driver_unregister+0x1c/0x30
[ 174.858702] qcom_ethqos_driver_exit+0x18/0x1b8 [dwmac_qcom_ethqos]
[ 174.865140] __arm64_sys_delete_module+0x1a8/0x298
[ 174.870061] invoke_syscall+0x50/0x128
[ 174.873913] el0_svc_common.constprop.0+0xcc/0xf8
[ 174.878745] do_el0_svc+0x40/0xa8
[ 174.882153] el0_svc+0x2c/0x88
[ 174.885292] el0t_64_sync_handler+0x100/0x130
[ 174.889768] el0t_64_sync+0x190/0x198Need to figure out which one of those serdes_powerdown() calls to undo.
Thanks,
Andrew
Quoted 24 lines · Andrew Halaney
Quoted 15 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Bjorn,
Now that all other bits and pieces are in next, I'm resending the reviewed DTS patches for pick up. This enables one of the 1Gb ethernet ports on sa8775p-ride.
Bartosz Golaszewski (5):
arm64: dts: qcom: sa8775p: add the SGMII PHY node
arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface
arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY
arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0
arm64: dts: qcom: sa8775p-ride: enable ethernet0Quoted 7 lines
arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 109 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 42 +++++++++ 2 files changed, 151 insertions(+)Signature · 1 line
2.39.2
Quoted 8 lines
Tested-by Andrew Halaney <[email protected]>note, I did uncover a bug in stmmac (imo) wrt unbalanced calls to serdes_powerup/serdes_powerdown() which I plan on trying to fix shortly.
Not really related to any of the Qualcomm specific bits though. This looks good to me.
Bart already sent a fix!
https://lore.kernel.org/netdev/[email protected]/
Thanks,
Andrew
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Bjorn,
Now that all other bits and pieces are in next, I'm resending the reviewed DTS patches for pick up. This enables one of the 1Gb ethernet ports on sa8775p-ride.
[...]
Applied, thanks!
[1/5] arm64: dts: qcom: sa8775p: add the SGMII PHY node
commit: 683ef77158cbb56ede2a524751b150cec340128a
[2/5] arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface
commit: ff499a0fbb2352bff15d75c13afe46decf90d7eb
[3/5] arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY
commit: 5ef26fb8b3ed72cc5beb6461c258127e3a388247
[4/5] arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0
commit: 48c99529998026e21a78f84261d24c0b93c1027e
[5/5] arm64: dts: qcom: sa8775p-ride: enable ethernet0
commit: 120ab6c06f69b39e54c949542fa85fd49ff51278Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>