summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/mach-mxs.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-09-25 13:32:18 +0200
committerShawn Guo <shawn.guo@linaro.org>2012-10-30 19:19:59 +0800
commit16d477018bdddcf87a908310ac9343734e26cde0 (patch)
treee42969251a1ac793b86ee0c57fc906d7fc43a55d /arch/arm/mach-mxs/mach-mxs.c
parent2bde51cb16e3b3f505b465cab263adc3a57d6c0a (diff)
downloadtalos-obmc-linux-16d477018bdddcf87a908310ac9343734e26cde0.tar.gz
talos-obmc-linux-16d477018bdddcf87a908310ac9343734e26cde0.zip
ARM: mx28: Skip OCOTP FEC MAC setup if in DT
Currently, the kernel unconditionally adds "local-mac-address" and "mac-address" properties under both FEC ethernet DT nodes in case the update_fec_mac_prop() function is called. These properties are loaded with MAC address compiled from vendors OUI and a per-device NIC saved in OCOTP storage. Some more advanced bootloaders do augment the DT passed to the kernel by these properties already. In such case, it is wrong for kernel to override these values. Adjust the FEC MAC address loading so that in case the DT properties are already present in the DT passed from the bootloader, skip the loading from OCOTP altogether. If the DT properties are not present, load them from OCOTP. Note that the later case will lead to zeroed out MAC address if OCOTP is not programmed. This will lead to FEC not working at all. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs/mach-mxs.c')
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 9cfb25cb0e90..48c2eba37b8b 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -176,8 +176,12 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
np = of_find_compatible_node(from, NULL, "fsl,imx28-fec");
if (!np)
return;
+
from = np;
+ if (of_get_property(np, "local-mac-address", NULL))
+ continue;
+
newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);
if (!newmac)
return;
OpenPOWER on IntegriCloud