BXU2000n-2 A1 is a BHU Networks WLAN board, use ar9341 chip. Signed-off-by: Terry Yang <yan...@bhunetworks.com>
Index: trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu-bxu2000n2-a.c =================================================================== --- trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu-bxu2000n2-a.c (revision 0) +++ trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu-bxu2000n2-a.c (revision 0) @@ -0,0 +1,118 @@ +/* + * BHU BXU2000n-2 A1 board support + * + * Copyright (C) 2013 Terry Yang <yan...@bhunetworks.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include <linux/gpio.h> +#include <linux/platform_device.h> + +#include <asm/mach-ath79/ath79.h> +#include <asm/mach-ath79/ar71xx_regs.h> + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define BHU_BXU2000N2_A1_GPIO_LED_WLAN 13 +#define BHU_BXU2000N2_A1_GPIO_LED_WAN 19 +#define BHU_BXU2000N2_A1_GPIO_LED_LAN 21 +#define BHU_BXU2000N2_A1_GPIO_LED_SYSTEM 14 + +#define BHU_BXU2000N2_A1_GPIO_BTN_RESET 17 + +#define BHU_BXU2000N2_KEYS_POLL_INTERVAL 20 /* msecs */ +#define BHU_BXU2000N2_KEYS_DEBOUNCE_INTERVAL (3 * BHU_BXU2000N2_KEYS_POLL_INTERVAL) + +static const char *bhu_bxu2000n2_part_probes[] = { + "cmdlinepart", + NULL, +}; + +static struct flash_platform_data bhu_bxu2000n2_flash_data = { + .part_probes = bhu_bxu2000n2_part_probes, +}; + +static struct gpio_led bhu_bxu2000n2_a1_leds_gpio[] __initdata = { + { + .name = "bhu:green:status", + .gpio = BHU_BXU2000N2_A1_GPIO_LED_SYSTEM, + .active_low = 1, + }, { + .name = "bhu:green:lan", + .gpio = BHU_BXU2000N2_A1_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "bhu:green:wan", + .gpio = BHU_BXU2000N2_A1_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "bhu:green:wlan", + .gpio = BHU_BXU2000N2_A1_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button bhu_bxu2000n2_a1_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = BHU_BXU2000N2_KEYS_DEBOUNCE_INTERVAL, + .gpio = BHU_BXU2000N2_A1_GPIO_BTN_RESET, + .active_low = 1, + } +}; + +static void __init bhu_ap123_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + + ath79_register_m25p80(&bhu_bxu2000n2_flash_data); + + ath79_register_mdio(1, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1); + + /* GMAC0 is connected to the PHY4 of the internal switch */ + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = BIT(4); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_register_eth(0); + + /* GMAC1 is connected to the internal switch. Only use PHY3 */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.phy_mask = BIT(3); + ath79_register_eth(1); + + ath79_register_wmac(ee, ee+2); +} + +static void __init bhu_bxu2000n2_a1_setup(void) +{ + bhu_ap123_setup(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(bhu_bxu2000n2_a1_leds_gpio), + bhu_bxu2000n2_a1_leds_gpio); + + ath79_register_gpio_keys_polled(1, BHU_BXU2000N2_KEYS_POLL_INTERVAL, + ARRAY_SIZE(bhu_bxu2000n2_a1_gpio_keys), + bhu_bxu2000n2_a1_gpio_keys); +} + +MIPS_MACHINE(ATH79_MACH_BHU_BXU2000N2_A1, "BXU2000n-2-A1", "BHU BXU2000n-2 rev. A1", + bhu_bxu2000n2_a1_setup); + Index: trunk/target/linux/ar71xx/image/Makefile =================================================================== --- trunk/target/linux/ar71xx/image/Makefile (revision 38362) +++ trunk/target/linux/ar71xx/image/Makefile (working copy) @@ -201,6 +201,7 @@ wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),1152k(kernel),24448k(rootfs),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved) zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware) mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro +bxu2000n2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),8448k(rootfs),6016k(user),64k(cfg),64k(oem),64k(art)ro define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(VMLINUX).elf @@ -815,6 +816,7 @@ $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),65536,2752512,KRuImage)) $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),65536,16318464,KRuImage)) $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),917504,2818048,KRuImage)) +$(eval $(call SingleProfile,AthLzma,64k,BXU2000N2A1,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),1441792,8650752,RKuImage)) $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00")) $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02")) @@ -990,6 +992,7 @@ $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDRMAC WNDRMACV2)) $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M)) $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M)) +$(eval $(call MultiProfile,BXU2000N2,BXU2000N2A1)) $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES))) $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES))) Index: trunk/target/linux/ar71xx/config-3.10 =================================================================== --- trunk/target/linux/ar71xx/config-3.10 (revision 38362) +++ trunk/target/linux/ar71xx/config-3.10 (working copy) @@ -35,6 +35,7 @@ CONFIG_ATH79_MACH_AP96=y CONFIG_ATH79_MACH_ARCHER_C7=y CONFIG_ATH79_MACH_AW_NR580=y +CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y CONFIG_ATH79_MACH_CAP4200AG=y CONFIG_ATH79_MACH_CARAMBOLA2=y CONFIG_ATH79_MACH_DB120=y Index: trunk/target/linux/ar71xx/patches-3.10/629-MIPS-ath79-add-BHU-BXU2000n2-A1-support.patch =================================================================== --- trunk/target/linux/ar71xx/patches-3.10/629-MIPS-ath79-add-BHU-BXU2000n2-A1-support.patch (revision 0) +++ trunk/target/linux/ar71xx/patches-3.10/629-MIPS-ath79-add-BHU-BXU2000n2-A1-support.patch (revision 0) @@ -0,0 +1,39 @@ +--- a/arch/mips/ath79/Kconfig ++++ b/arch/mips/ath79/Kconfig +@@ -806,6 +806,16 @@ config ATH79_MACH_CARAMBOLA2 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + ++config ATH79_MACH_BHU_BXU2000N2_A ++ bool "BHU BXU2000n-2 rev. A support" ++ select SOC_AR934X ++ select ATH79_DEV_ETH ++ select ATH79_DEV_GPIO_BUTTONS ++ select ATH79_DEV_LEDS_GPIO ++ select ATH79_DEV_M25P80 ++ select ATH79_DEV_USB ++ select ATH79_DEV_WMAC ++ + endmenu + + config SOC_AR71XX +--- a/arch/mips/ath79/Makefile ++++ b/arch/mips/ath79/Makefile +@@ -51,6 +51,7 @@ obj-$(CONFIG_ATH79_MACH_AP83) += mach-a + obj-$(CONFIG_ATH79_MACH_AP96) += mach-ap96.o + obj-$(CONFIG_ATH79_MACH_ARCHER_C7) += mach-archer-c7.o + obj-$(CONFIG_ATH79_MACH_AW_NR580) += mach-aw-nr580.o ++obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o + obj-$(CONFIG_ATH79_MACH_CAP4200AG) += mach-cap4200ag.o + obj-$(CONFIG_ATH79_MACH_DB120) += mach-db120.o + obj-$(CONFIG_ATH79_MACH_DIR_505_A1) += mach-dir-505-a1.o +--- a/arch/mips/ath79/machtypes.h ++++ b/arch/mips/ath79/machtypes.h +@@ -33,6 +33,7 @@ enum ath79_mach_type { + ATH79_MACH_AP96, /* Atheros AP96 */ + ATH79_MACH_ARCHER_C7, /* TP-LINK Archer C7 board */ + ATH79_MACH_AW_NR580, /* AzureWave AW-NR580 */ ++ ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */ + ATH79_MACH_CAP4200AG, /* Senao CAP4200AG */ + ATH79_MACH_CARAMBOLA2, /* 8devices Carambola2 */ + ATH79_MACH_DB120, /* Atheros DB120 reference board */ Index: trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh =================================================================== --- trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh (revision 38362) +++ trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh (working copy) @@ -573,6 +573,9 @@ "8devices Carambola2"*) name="carambola2" ;; + *"BHU BXU2000n-2 rev. A1") + name="bxu2000n-2-a1" + ;; esac case "$machine" in Index: trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh =================================================================== --- trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh (revision 38362) +++ trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh (working copy) @@ -98,6 +98,7 @@ ap96 | \ db120 | \ hornet-ub | \ + bxu2000n-2-a1 | \ zcn-1523h-2 | \ zcn-1523h-5) [ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && { Index: trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds =================================================================== --- trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds (revision 38362) +++ trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds (working copy) @@ -32,6 +32,10 @@ ucidef_set_led_usbdev "usb" "USB" "ap113:green:usb" "1-1" ;; +bxu2000n-2-a1) + ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt" + ;; + cap4200ag) ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1" ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber:wlan" "phy0tpt" Index: trunk/target/linux/ar71xx/base-files/etc/diag.sh =================================================================== --- trunk/target/linux/ar71xx/base-files/etc/diag.sh (revision 38362) +++ trunk/target/linux/ar71xx/base-files/etc/diag.sh (working copy) @@ -37,6 +37,9 @@ bullet-m | rocket-m | nano-m | nanostation-m) status_led="ubnt:green:link4" ;; + bxu2000n-2-a1) + status_led="bhu:green:status" + ;; cap4200ag) status_led="senao:green:pwr" ;; Index: trunk/target/linux/ar71xx/generic/profiles/bhu.mk =================================================================== --- trunk/target/linux/ar71xx/generic/profiles/bhu.mk (revision 0) +++ trunk/target/linux/ar71xx/generic/profiles/bhu.mk (revision 0) @@ -0,0 +1,17 @@ +# +# Copyright (C) 2013 BHU Networks. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/BXU2000N2 + NAME:=BHU BXU2000n-2 + PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage +endef + +define Profile/BXU2000N2/Description + Package set optimized for the BHU BXU2000n-2. +endef + +$(eval $(call Profile,BXU2000N2)) _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel