summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/files/arch/mips
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-04-12 09:29:10 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-04-12 09:29:10 +0000
commit54ede248290368aadbd2012a3ca564e2e42bfef9 (patch)
tree55493231f5f93ab050d1c1de03a6e713c4db4e42 /target/linux/ar71xx/files/arch/mips
parentf358166236d05873db0781ef1b8f942914cb4370 (diff)
downloadmtk-20170518-54ede248290368aadbd2012a3ca564e2e42bfef9.zip
mtk-20170518-54ede248290368aadbd2012a3ca564e2e42bfef9.tar.gz
mtk-20170518-54ede248290368aadbd2012a3ca564e2e42bfef9.tar.bz2
ar71xx: Add support for WZR-HP-G301NH
Add support for the Buffalo WZR-HP-G301NH. The only difference between it and the WZR-HP-G00NH is that it has a RTL8366RB instead of a RTL8366S. Since we don't do runtime detection of the switch, we need a separate machine definition for it. While we are at it, also rename the profile to reflect that it now is for more than one device. Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com> SVN-Revision: 26601
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c54
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h1
2 files changed, 48 insertions, 7 deletions
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 383d87b..2806f3b 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
@@ -13,6 +13,7 @@
#include <linux/mtd/partitions.h>
#include <linux/nxp_74hc153.h>
#include <linux/rtl8366s.h>
+#include <linux/rtl8366rb.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
@@ -225,21 +226,43 @@ static struct platform_device wzrhpg300nh_rtl8366s_device = {
}
};
-static void __init wzrhpg300nh_setup(void)
+static struct rtl8366rb_platform_data wzrhpg301nh_rtl8366rb_data = {
+ .gpio_sda = WZRHPG300NH_GPIO_RTL8366_SDA,
+ .gpio_sck = WZRHPG300NH_GPIO_RTL8366_SCK,
+};
+
+static struct platform_device wzrhpg301nh_rtl8366rb_device = {
+ .name = RTL8366RB_DRIVER_NAME,
+ .id = -1,
+ .dev = {
+ .platform_data = &wzrhpg301nh_rtl8366rb_data,
+ }
+};
+
+static void __init wzrhpg30xnh_setup(bool hasrtl8366rb)
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
u8 *mac = eeprom + WZRHPG300NH_MAC_OFFSET;
ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
- ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
- ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
+
+ if (hasrtl8366rb) {
+ ar71xx_eth0_pll_data.pll_1000 = 0x1f000000;
+ ar71xx_eth0_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev;
+ ar71xx_eth1_pll_data.pll_1000 = 0x100;
+ ar71xx_eth1_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev;
+ } else {
+ ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
+ ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
+ ar71xx_eth1_pll_data.pll_1000 = 0x1e000100;
+ ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
+ }
+
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
- ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
- ar71xx_eth1_pll_data.pll_1000 = 0x1e000100;
- ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x10;
@@ -251,7 +274,11 @@ static void __init wzrhpg300nh_setup(void)
platform_device_register(&wzrhpg300nh_74hc153_device);
platform_device_register(&wzrhpg300nh_flash_device);
- platform_device_register(&wzrhpg300nh_rtl8366s_device);
+
+ if (hasrtl8366rb)
+ platform_device_register(&wzrhpg301nh_rtl8366rb_device);
+ else
+ platform_device_register(&wzrhpg300nh_rtl8366s_device);
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh_leds_gpio),
wzrhpg300nh_leds_gpio);
@@ -262,5 +289,18 @@ static void __init wzrhpg300nh_setup(void)
}
+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);
+
+MIPS_MACHINE(AR71XX_MACH_WZR_HP_G301NH, "WZR-HP-G301NH",
+ "Buffalo WZR-HP-G301NH", wzrhpg301nh_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h b/target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
index e7e5795..4b2a08c 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
@@ -61,6 +61,7 @@ enum ar71xx_mach_type {
AR71XX_MACH_WRT160NL, /* Linksys WRT160NL */
AR71XX_MACH_WRT400N, /* Linksys WRT400N */
AR71XX_MACH_WZR_HP_G300NH, /* Buffalo WZR-HP-G300NH */
+ AR71XX_MACH_WZR_HP_G301NH, /* Buffalo WZR-HP-G301NH */
AR71XX_MACH_EAP7660D, /* Senao EAP7660D */
AR71XX_MACH_ZCN_1523H_2, /* Zcomax ZCN-1523H-2-xx */
AR71XX_MACH_ZCN_1523H_5, /* Zcomax ZCN-1523H-5-xx */