[U-Boot] fm-eth: Don't mark the MAC we use for MDIO as disabled in device tree

Submitted by Kumar Gala on Oct. 14, 2011, 4:03 a.m.

Details

Message ID 1318565015-2292-1-git-send-email-galak@kernel.crashing.org
State Accepted
Commit e81c0aba9a5e56d6e9b25a669c582827f999302f
Delegated to: Kumar Gala
Headers show

Commit Message

Kumar Gala Oct. 14, 2011, 4:03 a.m.
FM1-DTSEC1's MAC was being marked as disabled if the port was not
configured based on the SoC configuration.  However we utilize the MAC
interface for MDIO and thus should NOT mark it disabled.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 drivers/net/fm/init.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Comments

Kumar Gala Oct. 21, 2011, 5:09 a.m.
On Oct 13, 2011, at 11:03 PM, Kumar Gala wrote:

> FM1-DTSEC1's MAC was being marked as disabled if the port was not
> configured based on the SoC configuration.  However we utilize the MAC
> interface for MDIO and thus should NOT mark it disabled.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> drivers/net/fm/init.c |   10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)

applied to 85xx

- k

Patch hide | download patch | download mbox

diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index 512d7dd..953c359 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -183,6 +183,8 @@  static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop)
 {
 	int off, ph;
 	phys_addr_t paddr = CONFIG_SYS_CCSRBAR_PHYS + info->compat_offset;
+	u64 dtsec1_addr = (u64)CONFIG_SYS_CCSRBAR_PHYS +
+				CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET;
 
 	off = fdt_node_offset_by_compat_reg(blob, prop, paddr);
 
@@ -195,9 +197,13 @@  static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop)
 	/* board code might have caused offset to change */
 	off = fdt_node_offset_by_compat_reg(blob, prop, paddr);
 
-	/* disable both the mac node and the node that has a handle to it */
-	fdt_setprop_string(blob, off, "status", "disabled");
+	/* Don't disable FM1-DTSEC1 MAC as its used for MDIO */
+	if (paddr != dtsec1_addr) {
+		/* disable the mac node */
+		fdt_setprop_string(blob, off, "status", "disabled");
+	}
 
+	/* disable the node point to the mac */
 	ph = fdt_get_phandle(blob, off);
 	do_fixup_by_prop(blob, "fsl,fman-mac", &ph, sizeof(ph),
 		"status", "disabled", strlen("disabled") + 1, 1);