9
0
Fork 0

ARM: i.MX6 sabre: register MAC address from dt

Use DT description to register the fec MAC address.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-07-22 15:38:43 +02:00
parent 8cd342fb77
commit cb4439bde6
4 changed files with 8 additions and 45 deletions

View File

@ -106,26 +106,6 @@ static int sabrelite_ksz9021rn_setup(void)
*/
fs_initcall(sabrelite_ksz9021rn_setup);
static inline int imx6_iim_register_fec_ethaddr(void)
{
u32 value;
u8 buf[6];
value = readl(MX6_OCOTP_BASE_ADDR + 0x630);
buf[0] = (value >> 8);
buf[1] = value;
value = readl(MX6_OCOTP_BASE_ADDR + 0x620);
buf[2] = value >> 24;
buf[3] = value >> 16;
buf[4] = value >> 8;
buf[5] = value;
eth_register_ethaddr(0, buf);
return 0;
}
static void sabrelite_ehci_init(void)
{
imx6_usb_phy2_disable_oc();
@ -157,9 +137,6 @@ static int sabrelite_coredevices_init(void)
{
phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
ksz9021rn_phy_fixup);
imx6_iim_register_fec_ethaddr();
return 0;
}
coredevice_initcall(sabrelite_coredevices_init);

View File

@ -80,26 +80,6 @@ static void sabresd_phy_reset(void)
gpio_set_value(IMX_GPIO_NR(1, 25), 1);
}
static inline int imx6_iim_register_fec_ethaddr(void)
{
u32 value;
u8 buf[6];
value = readl(MX6_OCOTP_BASE_ADDR + 0x630);
buf[0] = (value >> 8);
buf[1] = value;
value = readl(MX6_OCOTP_BASE_ADDR + 0x620);
buf[2] = value >> 24;
buf[3] = value >> 16;
buf[4] = value >> 8;
buf[5] = value;
eth_register_ethaddr(0, buf);
return 0;
}
static int sabresd_devices_init(void)
{
armlinux_set_bootparams((void *)0x10000100);
@ -118,8 +98,6 @@ static int sabresd_coredevices_init(void)
phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK,
ar8031_phy_fixup);
imx6_iim_register_fec_ethaddr();
return 0;
}
/*

View File

@ -108,6 +108,10 @@
};
};
&ocotp1 {
barebox,provide-mac-address = <&fec 0x620>;
};
&usbotg {
vbus-supply = <&reg_usb_otg_vbus>;
pinctrl-names = "default";

View File

@ -52,6 +52,10 @@
status = "okay";
};
&ocotp1 {
barebox,provide-mac-address = <&fec 0x620>;
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1_1>;