Skip to contentSkip to conversation

arm: mvebu: turris_mox: Set "sfp" label in eth1 DT node when only Mox SFP is detected

PATCH In review Pali Rohár 3 participants 4 messages Aug 10, 2022 – Aug 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mvebu: turris_mox: Set "sfp" label in eth1 DT node when only Mox SFP is detected

When Mox SFP module is connected after Topaz or Peridot module then port DT node already contains "sfp" label. But Mox SFP module can be connected also without Topaz or Peridot module in which case it is connected directly into he eth1 DT node, which is without any label. So add "sfp" label into eth1 DT node in this case.

---
 board/CZ.NIC/turris_mox/turris_mox.c | 5 +++++
 1 file changed, 5 insertions(+)
board/CZ.NIC/turris_mox/turris_mox.c +5 -0
index 28259e71405f..3dbd68e52366 100644
@@ -821,6 +821,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 						 "sgmii");
 			if (res < 0)
 				return res;
+
+			res = fdt_setprop_string(blob, node, "label",
+						 "sfp");
+			if (res < 0)
+				return res;
 		}
 
 		res = fdt_status_okay_by_compatible(blob, "cznic,moxtet-gpio");
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Wed, 10 Aug 2022 12:54:11 +0200 Pali Rohár <[email protected]> wrote:

When Mox SFP module is connected after Topaz or Peridot module then port DT node already contains "sfp" label. But Mox SFP module can be connected also without Topaz or Peridot module in which case it is connected directly into he eth1 DT node, which is without any label. So add "sfp" label into eth1 DT node in this case.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Pali Rohár
Quoted 7 lines · Pali Rohár

When Mox SFP module is connected after Topaz or Peridot module then port DT node already contains "sfp" label. But Mox SFP module can be connected also without Topaz or Peridot module in which case it is connected directly into he eth1 DT node, which is without any label. So add "sfp" label into eth1 DT node in this case.

Thanks,
Stefan

Quoted 10 lines
---
  board/CZ.NIC/turris_mox/turris_mox.c | 5 +++++
  1 file changed, 5 insertions(+)
board/CZ.NIC/turris_mox/turris_mox.c +0 -0
index 28259e71405f..3dbd68e52366 100644
@@ -821,6 +821,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
  						 "sgmii");

board/CZ.NIC/turris_mox/turris_mox.c int ft_board_setup(void *blob, struct bd_info *bd) · line 831

Quoted 10 lines
board/CZ.NIC/turris_mox/turris_mox.c +5 -0
  			if (res < 0)
  				return res;
+
+			res = fdt_setprop_string(blob, node, "label",
+						 "sfp");
+			if (res < 0)
+				return res;
  		}
 
  		res = fdt_status_okay_by_compatible(blob, "cznic,moxtet-gpio");

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw
In reply to Pali Rohár
Quoted 7 lines · Pali Rohár

When Mox SFP module is connected after Topaz or Peridot module then port DT node already contains "sfp" label. But Mox SFP module can be connected also without Topaz or Peridot module in which case it is connected directly into he eth1 DT node, which is without any label. So add "sfp" label into eth1 DT node in this case.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 10 lines
---
  board/CZ.NIC/turris_mox/turris_mox.c | 5 +++++
  1 file changed, 5 insertions(+)
board/CZ.NIC/turris_mox/turris_mox.c +0 -0
index 28259e71405f..3dbd68e52366 100644
@@ -821,6 +821,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
  						 "sgmii");

board/CZ.NIC/turris_mox/turris_mox.c int ft_board_setup(void *blob, struct bd_info *bd) · line 831

Quoted 10 lines
board/CZ.NIC/turris_mox/turris_mox.c +5 -0
  			if (res < 0)
  				return res;
+
+			res = fdt_setprop_string(blob, node, "label",
+						 "sfp");
+			if (res < 0)
+				return res;
  		}
 
  		res = fdt_status_okay_by_compatible(blob, "cznic,moxtet-gpio");

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]