Skip to contentSkip to conversation

arm: socfpga: Fix ethernet reset handling

PATCH New Marek Vasut 3 participants 3 messages Feb 11, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Fix ethernet reset handling

The following patch caused cpu_eth_init() to not be called anymore for DM-capable boards:

commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d
Date: Sun Jan 17 14:51:56 2016 -0700
net: Don't call board/cpu_eth_init() with driver model

This breaks ethernet on SoCFPGA, since we use that function to un-reset the ethernet blocks. Invoke the ethernet reset function from arch_misc_init() instead to fix the breakage.

Cc Dinh Nguyen <[email protected]>
Cc Chin Liang See <[email protected]>
Cc Denis Bakhvalov <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc.c +7 -2
index 9b43b92..ce3ff0a 100644
@@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int of_reset_id)
 	socfpga_per_reset(reset, 0);
 }
 
-int cpu_eth_init(bd_t *bis)
+static int socfpga_eth_reset(void)
 {
 	const void *fdt = gd->fdt_blob;
 	struct fdtdec_phandle_args args;
@@ -137,6 +137,11 @@ int cpu_eth_init(bd_t *bis)
 
 	return 0;
 }
+#else
+static int socfpga_eth_reset(void)
+{
+	return 0
+};
 #endif
 
 struct {
@@ -232,7 +237,7 @@ int arch_misc_init(void)
 	setenv("bootmode", bsel_str[bsel].mode);
 	if (fpga_id >= 0)
 		setenv("fpgatype", socfpga_fpga_model[fpga_id].var);
-	return 0;
+	return socfpga_eth_reset();
 }
 #endif
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 arm: socfpga: Fix ethernet reset handling

Quoted 7 lines · Marek Vasut

The following patch caused cpu_eth_init() to not be called anymore for DM-capable boards:

commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d
Date: Sun Jan 17 14:51:56 2016 -0700
net: Don't call board/cpu_eth_init() with driver model

Quoted 8 lines

This breaks ethernet on SoCFPGA, since we use that function to un-reset the ethernet blocks. Invoke the ethernet reset function from arch_misc_init() instead to fix the breakage.

Cc Dinh Nguyen <[email protected]>
Cc Chin Liang See <[email protected]>
Cc Denis Bakhvalov <[email protected]>

Works for me as well. So:

Thanks,
Stefan

#2 lore raw

PATCH 1/1 arm: socfpga: Fix ethernet reset handling

Quoted 13 lines · Stefan Roese
Quoted 12 lines · Marek Vasut

The following patch caused cpu_eth_init() to not be called anymore for DM-capable boards:

commit c32a6fd07b1839e4a45729587ebc8e1c55601a4d
Date: Sun Jan 17 14:51:56 2016 -0700
net: Don't call board/cpu_eth_init() with driver model

This breaks ethernet on SoCFPGA, since we use that function to un-reset the ethernet blocks. Invoke the ethernet reset function from arch_misc_init()
instead to fix the breakage.

Quoted 9 lines
Quoted 4 lines
Cc Dinh Nguyen <[email protected]>
Cc Chin Liang See <[email protected]>
Cc Denis Bakhvalov <[email protected]>

Works for me as well. So:

For me as well.