[PATCH 1/2] ARM: dts: stih410-b2260: Fix ethernet phy DT node

patrice.chotard at st.com patrice.chotard at st.com
Tue Jan 7 04:38:27 PST 2020


From: Patrice Chotard <patrice.chotard at st.com>

Since 'd3e014ec7d5e ("net: stmmac: platform: Fix MDIO init for platforms without PHY")'
we got the following kernel Oops :

Unable to handle kernel NULL pointer dereference at virtual address 00000260
pgd = (ptrval)
[00000260] *pgd=79a79831
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 201 Comm: ip Not tainted 5.5.0-rc5 #13
Hardware name: STi SoC with Flattened Device Tree
PC is at mdiobus_get_phy+0x4/0x20
LR is at stmmac_open+0x278/0xaa8
pc : [<c0a7e41c>]    lr : [<c0b1755c>]    psr: a0070013
sp : ed663930  ip : 00000000  fp : c110079c
r10: ed663d4c  r9 : ed663d4c  r8 : ee774028
r7 : ee22ad00  r6 : ee776000  r5 : 00000000  r4 : ee774000
r3 : ee775000  r2 : ca451a07  r1 : 00000098  r0 : 00000000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c5387d  Table: 6d75404a  DAC: 00000051
Process ip (pid: 201, stack limit = 0x(ptrval))

This is due to lack of mdio DT subnode, so add it.

Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
---
 arch/arm/boot/dts/stih410-b2260.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts
index 4fbd8e9eb5b7..1df2c37eb3a7 100644
--- a/arch/arm/boot/dts/stih410-b2260.dts
+++ b/arch/arm/boot/dts/stih410-b2260.dts
@@ -176,6 +176,7 @@
 
 		ethernet0: dwmac at 9630000 {
 			phy-mode = "rgmii";
+			phy-handle = <&phy0>;
 			pinctrl-0 = <&pinctrl_rgmii1 &pinctrl_rgmii1_mdio_1>;
 
 			snps,phy-bus-name = "stmmac";
@@ -186,6 +187,15 @@
 			snps,reset-delays-us = <0 10000 1000000>;
 
 			status = "okay";
+
+			mdio0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "snps,dwmac-mdio";
+				phy0: ethernet-phy at 0 {
+					reg = <0>;
+				};
+			};
 		};
 
 		sti_uni_player0: sti-uni-player at 8d80000 {
-- 
2.17.1




More information about the linux-arm-kernel mailing list