Changeset 26601


Ignore:
Timestamp:
2011-04-12T11:29:10+02:00 (7 years ago)
Author:
juhosg
Message:

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@…>

Location:
trunk/target/linux/ar71xx
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/base-files/etc/diag.sh

    r26119 r26601  
    124124                status_led="wrt160nl:blue:wps" 
    125125                ;; 
    126         wzr-hp-g300nh) 
     126        wzr-hp-g300nh | wzr-hp-g301nh) 
    127127                status_led="wzr-hp-g300nh:green:router" 
    128128                ;; 
  • trunk/target/linux/ar71xx/base-files/etc/uci-defaults/wzr-hp-g300nh

    r24648 r26601  
    3333} 
    3434 
    35 if [ "${board}" == "wzr-hp-g300nh" ]; then 
     35if [ "${board}" == "wzr-hp-g300nh" || "${board}" == "wzr-hp-g301nh" ]; then 
    3636        wzrhpg300nh_set_leds 
    3737fi 
  • trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh

    r26119 r26601  
    149149                name="wzr-hp-g300nh" 
    150150                ;; 
     151        *WZR-HP-G301NH) 
     152                name="wzr-hp-g301nh" 
     153                ;; 
    151154        *ZCN-1523H-2) 
    152155                name="zcn-1523h-2" 
  • trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh

    r26119 r26601  
    7070 
    7171        case "$board" in 
    72         ap81 | ap83 | dir-600-a1 | dir-615-c1 | dir-825-b1 | mzk-w04nu | mzk-w300nh | tew-632brp | wrt400n | bullet-m | nanostation-m | rocket-m | wzr-hp-g300nh | nbg460n_550n_550nh | unifi ) 
     72        ap81 | ap83 | dir-600-a1 | dir-615-c1 | dir-825-b1 | mzk-w04nu | mzk-w300nh | tew-632brp | wrt400n | bullet-m | nanostation-m | rocket-m | wzr-hp-g300nh | wzr-hp-g301nh | nbg460n_550n_550nh | unifi ) 
    7373                [ "$magic" != "2705" ] && { 
    7474                        echo "Invalid image type." 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c

    r26595 r26601  
    1414#include <linux/nxp_74hc153.h> 
    1515#include <linux/rtl8366s.h> 
     16#include <linux/rtl8366rb.h> 
    1617 
    1718#include <asm/mips_machine.h> 
     
    226227}; 
    227228 
    228 static void __init wzrhpg300nh_setup(void) 
     229static struct rtl8366rb_platform_data wzrhpg301nh_rtl8366rb_data = { 
     230        .gpio_sda       = WZRHPG300NH_GPIO_RTL8366_SDA, 
     231        .gpio_sck       = WZRHPG300NH_GPIO_RTL8366_SCK, 
     232}; 
     233 
     234static struct platform_device wzrhpg301nh_rtl8366rb_device = { 
     235        .name           = RTL8366RB_DRIVER_NAME, 
     236        .id             = -1, 
     237        .dev = { 
     238                .platform_data  = &wzrhpg301nh_rtl8366rb_data, 
     239        } 
     240}; 
     241 
     242static void __init wzrhpg30xnh_setup(bool hasrtl8366rb) 
    229243{ 
    230244        u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000); 
     
    232246 
    233247        ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0); 
    234         ar71xx_eth0_pll_data.pll_1000 = 0x1e000100; 
    235         ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev; 
     248        ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1); 
     249 
     250        if (hasrtl8366rb) { 
     251                ar71xx_eth0_pll_data.pll_1000 = 0x1f000000; 
     252                ar71xx_eth0_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev; 
     253                ar71xx_eth1_pll_data.pll_1000 = 0x100; 
     254                ar71xx_eth1_data.mii_bus_dev = &wzrhpg301nh_rtl8366rb_device.dev; 
     255        } else { 
     256                ar71xx_eth0_pll_data.pll_1000 = 0x1e000100; 
     257                ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev; 
     258                ar71xx_eth1_pll_data.pll_1000 = 0x1e000100; 
     259                ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev; 
     260        } 
     261 
    236262        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; 
    237263        ar71xx_eth0_data.speed = SPEED_1000; 
    238264        ar71xx_eth0_data.duplex = DUPLEX_FULL; 
    239265 
    240         ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1); 
    241         ar71xx_eth1_pll_data.pll_1000 = 0x1e000100; 
    242         ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev; 
    243266        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; 
    244267        ar71xx_eth1_data.phy_mask = 0x10; 
     
    252275        platform_device_register(&wzrhpg300nh_74hc153_device); 
    253276        platform_device_register(&wzrhpg300nh_flash_device); 
    254         platform_device_register(&wzrhpg300nh_rtl8366s_device); 
     277 
     278        if (hasrtl8366rb) 
     279                platform_device_register(&wzrhpg301nh_rtl8366rb_device); 
     280        else 
     281                platform_device_register(&wzrhpg300nh_rtl8366s_device); 
    255282 
    256283        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wzrhpg300nh_leds_gpio), 
     
    263290} 
    264291 
     292static void __init wzrhpg300nh_setup(void) 
     293{ 
     294        wzrhpg30xnh_setup(false); 
     295} 
     296 
     297static void __init wzrhpg301nh_setup(void) 
     298{ 
     299        wzrhpg30xnh_setup(true); 
     300} 
     301 
    265302MIPS_MACHINE(AR71XX_MACH_WZR_HP_G300NH, "WZR-HP-G300NH", 
    266303             "Buffalo WZR-HP-G300NH", wzrhpg300nh_setup); 
     304 
     305MIPS_MACHINE(AR71XX_MACH_WZR_HP_G301NH, "WZR-HP-G301NH", 
     306             "Buffalo WZR-HP-G301NH", wzrhpg301nh_setup); 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h

    r26518 r26601  
    6262        AR71XX_MACH_WRT400N,    /* Linksys WRT400N */ 
    6363        AR71XX_MACH_WZR_HP_G300NH, /* Buffalo WZR-HP-G300NH */ 
     64        AR71XX_MACH_WZR_HP_G301NH, /* Buffalo WZR-HP-G301NH */ 
    6465        AR71XX_MACH_EAP7660D,   /* Senao EAP7660D */ 
    6566        AR71XX_MACH_ZCN_1523H_2, /* Zcomax ZCN-1523H-2-xx */ 
  • trunk/target/linux/ar71xx/generic/profiles/buffalo.mk

    r24940 r26601  
    66# 
    77 
    8 define Profile/WZRHPG300NH 
    9         NAME:=Buffalo WZR-HP-G300NH 
     8define Profile/WZRHPG30XNH 
     9        NAME:=Buffalo WZR-HP-G30XNH 
    1010        PACKAGES:=kmod-ath9k wpad-mini kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev 
    1111endef 
    1212 
    13 define Profile/WZRHPG300NH/Description 
    14         Package set optimized for the Buffalo WZR-HP-G300NH 
     13define Profile/WZRHPG30XNH/Description 
     14        Package set optimized for the Buffalo WZR-HP-G300NH and WZR-HP-G301NH 
    1515endef 
    1616 
    17 $(eval $(call Profile,WZRHPG300NH)) 
     17$(eval $(call Profile,WZRHPG30XNH)) 
  • trunk/target/linux/ar71xx/image/Makefile

    r26519 r26601  
    119119endef 
    120120 
    121 define Image/Build/WZRHPG300NH 
     121define Image/Build/WZRHPG30XNH 
    122122        $(call PatchKernelLzma,$(2),$(3)) 
    123123        if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt 1048576 ]; then \ 
     
    689689endef 
    690690 
    691 define Image/Build/Profile/WZRHPG300NH 
    692         $(call Image/Build/Template/$(fs_128k)/$(1),WZRHPG300NH,wzr-hp-g300nh,board=WZR-HP-G300NH) 
     691define Image/Build/Profile/WZRHPG30XNH 
     692        $(call Image/Build/Template/$(fs_128k)/$(1),WZRHPG30XNH,wzr-hp-g300nh,board=WZR-HP-G300NH) 
     693        $(call Image/Build/Template/$(fs_128k)/$(1),WZRHPG30XNH,wzr-hp-g301nh,board=WZR-HP-G301NH) 
    693694endef 
    694695 
     
    741742        $(call Image/Build/Profile/WRT400N,$(1)) 
    742743        $(call Image/Build/Profile/WRT160NL,$(1)) 
    743         $(call Image/Build/Profile/WZRHPG300NH,$(1)) 
     744        $(call Image/Build/Profile/WZRHPG30XNH,$(1)) 
    744745        $(call Image/Build/Profile/ZCN1523H28,$(1)) 
    745746        $(call Image/Build/Profile/ZCN1523H516,$(1)) 
Note: See TracChangeset for help on using the changeset viewer.