diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-07-24 14:40:35 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-07-24 14:40:35 +0000 |
commit | 9e4113b49342f371a2eaa3372b49dd2c336153de (patch) | |
tree | 8292cc1e7c2eb764d5f99c5779a888c5093d10a7 | |
parent | 5b32d62fcff0eb919da5f7af25254eeaf131f567 (diff) | |
download | mtk-20170518-9e4113b49342f371a2eaa3372b49dd2c336153de.zip mtk-20170518-9e4113b49342f371a2eaa3372b49dd2c336153de.tar.gz mtk-20170518-9e4113b49342f371a2eaa3372b49dd2c336153de.tar.bz2 |
ar71xx: autodetect rtl8366s/rtl8366rb on wzr-hp-g300nh
SVN-Revision: 27756
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig | 1 | ||||
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c | 20 |
2 files changed, 8 insertions, 13 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig b/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig index 865fc47..0864b99 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig @@ -151,6 +151,7 @@ config AR71XX_MACH_WZR_HP_G300NH select AR71XX_DEV_GPIO_BUTTONS select AR71XX_DEV_LEDS_GPIO select AR71XX_DEV_USB + select RTL8366_SMI default y config AR71XX_MACH_WP543 diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c index 35f2165..308f931 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c @@ -234,14 +234,18 @@ static struct platform_device wzrhpg301nh_rtl8366rb_device = { } }; -static void __init wzrhpg30xnh_setup(bool hasrtl8366rb) +static void __init wzrhpg30xnh_setup(void) { u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000); u8 *mac = eeprom + WZRHPG300NH_MAC_OFFSET; + bool hasrtl8366rb = false; ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0); ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1); + if (rtl8366_smi_detect(&wzrhpg300nh_rtl8366_data) == RTL8366_TYPE_RB) + hasrtl8366rb = true; + if (hasrtl8366rb) { ar71xx_eth0_pll_data.pll_1000 = 0x1f000000; ar71xx_eth0_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev; @@ -284,18 +288,8 @@ static void __init wzrhpg30xnh_setup(bool hasrtl8366rb) } -static void __init wzrhpg300nh_setup(void) -{ - wzrhpg30xnh_setup(false); -} - -static void __init wzrhpg301nh_setup(void) -{ - wzrhpg30xnh_setup(true); -} - MIPS_MACHINE(AR71XX_MACH_WZR_HP_G300NH, "WZR-HP-G300NH", - "Buffalo WZR-HP-G300NH", wzrhpg300nh_setup); + "Buffalo WZR-HP-G300NH", wzrhpg30xnh_setup); MIPS_MACHINE(AR71XX_MACH_WZR_HP_G301NH, "WZR-HP-G301NH", - "Buffalo WZR-HP-G301NH", wzrhpg301nh_setup); + "Buffalo WZR-HP-G301NH", wzrhpg30xnh_setup); |