BXO2000n-2s A1 is a BHU Networks WLAN board, use ar9341 chip.
Signed-off-by: Terry Yang <yan...@bhunetworks.com>

Index: svn/target/linux/ar71xx/config-3.10
===================================================================
--- svn/target/linux/ar71xx/config-3.10    (revision 40511)
+++ svn/target/linux/ar71xx/config-3.10    (working copy)
@@ -36,7 +36,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_BHU=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
 CONFIG_ATH79_MACH_DB120=y
Index: svn/target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- svn/target/linux/ar71xx/base-files/lib/ar71xx.sh    (revision 40511)
+++ svn/target/linux/ar71xx/base-files/lib/ar71xx.sh    (working copy)
@@ -655,6 +655,9 @@
     *"BHU BXU2000n-2 rev. A1")
         name="bxu2000n-2-a1"
         ;;
+    *"BHU BXO2000n-2S rev. A1")
+        name="bxo2000n-2s-a1"
+        ;;
     esac

     case "$machine" in
Index: svn/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
===================================================================
--- svn/target/linux/ar71xx/base-files/lib/upgrade/platform.sh (revision 40511) +++ svn/target/linux/ar71xx/base-files/lib/upgrade/platform.sh (working copy)
@@ -132,6 +132,7 @@
     db120 | \
     hornet-ub | \
     bxu2000n-2-a1 | \
+    bxo2000n-2s-a1 | \
     zcn-1523h-2 | \
     zcn-1523h-5)
[ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {
Index: svn/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
===================================================================
--- svn/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds (revision 40511) +++ svn/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds (working copy)
@@ -45,6 +45,14 @@
     ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
     ;;

+bxo2000n-2s-a1)
+    ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
+    ucidef_set_rssimon "wlan0" "40000" "1"
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "bhu:green:rssilow" "wlan0" "1" "40" "0" "6" + ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "bhu:green:rssimedium" "wlan0" "30" "80" "-29" "5" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "bhu:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+    ;;
+
 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: svn/target/linux/ar71xx/base-files/etc/diag.sh
===================================================================
--- svn/target/linux/ar71xx/base-files/etc/diag.sh    (revision 40511)
+++ svn/target/linux/ar71xx/base-files/etc/diag.sh    (working copy)
@@ -40,6 +40,9 @@
     bxu2000n-2-a1)
         status_led="bhu:green:status"
         ;;
+    bxo2000n-2s-a1)
+        status_led="bhu:green:status"
+        ;;
     cap4200ag)
         status_led="senao:green:pwr"
         ;;
Index: svn/target/linux/ar71xx/generic/profiles/bhu.mk
===================================================================
--- svn/target/linux/ar71xx/generic/profiles/bhu.mk    (revision 40511)
+++ svn/target/linux/ar71xx/generic/profiles/bhu.mk    (working copy)
@@ -15,3 +15,14 @@
 endef

 $(eval $(call Profile,BXU2000N2))
+
+define Profile/BXO2000N2S
+    NAME:=BHU BXO2000n-2S
+    PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage
+endef
+
+define Profile/BXO2000N2S/Description
+    Package set optimized for the BHU BXO2000n-2S.
+endef
+
+$(eval $(call Profile,BXO2000N2S))
Index: svn/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu-bxu2000n2-a.c
===================================================================
--- svn/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu-bxu2000n2-a.c (revision 40511) +++ svn/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu-bxu2000n2-a.c (working copy)
@@ -1,120 +0,0 @@
-/*
- *  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: svn/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu.c
===================================================================
--- svn/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu.c (revision 0)
+++ svn/target/linux/ar71xx/files/arch/mips/ath79/mach-bhu.c (revision 0)
@@ -0,0 +1,202 @@
+/*
+ *  BHU board support
+ *
+ *  Copyright (C) 2013-2014 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"
+
+/*
+ * BHU BXU2000n-2 A1 board
+ */
+
+#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);
+
+/*
+ * BHU BXO2000n-2S A1 board
+ */
+
+#define BHU_BXO2000N2S_A1_GPIO_LED_SYSTEM   14
+#define BHU_BXO2000N2S_A1_GPIO_LED_S0       14
+#define BHU_BXO2000N2S_A1_GPIO_LED_S1       19
+#define BHU_BXO2000N2S_A1_GPIO_LED_S2       15
+#define BHU_BXO2000N2S_A1_GPIO_LED_S3       21
+#define BHU_BXO2000N2S_A1_GPIO_LED_WLAN     13
+#define BHU_BXO2000N2S_A1_GPIO_LED_WAN      20
+#define BHU_BXO2000N2S_A1_GPIO_LED_LAN      22
+
+#define BHU_BXO2000N2S_A1_GPIO_BTN_RESET        17
+
+#define BHU_BXO2000N2S_KEYS_POLL_INTERVAL   20  /* msecs */
+#define BHU_BXO2000N2S_KEYS_DEBOUNCE_INTERVAL   \
+    (3 * BHU_BXO2000N2S_KEYS_POLL_INTERVAL)
+
+static struct gpio_led bhu_bxo2000n2s_a1_leds_gpio[] __initdata = {
+    {
+        .name       = "bhu:green:status",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_SYSTEM,
+        .active_low = 1,
+    }, {
+        .name       = "bhu:green:lan",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_LAN,
+        .active_low = 1,
+    }, {
+        .name       = "bhu:green:wan",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_WAN,
+        .active_low = 1,
+    }, {
+        .name       = "bhu:green:wlan",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_WLAN,
+        .active_low = 1,
+    }, {
+        .name       = "bhu:green:rssilow",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_S1,
+        .active_low = 1,
+    }, {
+        .name       = "bhu:green:rssimedium",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_S2,
+        .active_low = 1,
+    }, {
+        .name       = "bhu:green:rssihigh",
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_LED_S3,
+        .active_low = 1,
+    },
+};
+
+static struct gpio_keys_button bhu_bxo2000n2s_a1_gpio_keys[] __initdata = {
+    {
+        .desc       = "Reset button",
+        .type       = EV_KEY,
+        .code       = KEY_RESTART,
+        .debounce_interval = BHU_BXO2000N2S_KEYS_DEBOUNCE_INTERVAL,
+        .gpio       = BHU_BXO2000N2S_A1_GPIO_BTN_RESET,
+        .active_low = 1,
+    }
+};
+
+static void __init bhu_bxo2000n2s_a1_setup(void)
+{
+    bhu_ap123_setup();
+
+    ath79_register_leds_gpio(-1, ARRAY_SIZE(bhu_bxo2000n2s_a1_leds_gpio),
+                 bhu_bxo2000n2s_a1_leds_gpio);
+
+    ath79_register_gpio_keys_polled(1, BHU_BXO2000N2S_KEYS_POLL_INTERVAL,
+                    ARRAY_SIZE(bhu_bxo2000n2s_a1_gpio_keys),
+                    bhu_bxo2000n2s_a1_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_BHU_BXO2000N2S_A1, "BXO2000n-2S-A1",
+         "BHU BXO2000n-2S rev. A1",
+         bhu_bxo2000n2s_a1_setup);
+
Index: svn/target/linux/ar71xx/image/Makefile
===================================================================
--- svn/target/linux/ar71xx/image/Makefile    (revision 40511)
+++ svn/target/linux/ar71xx/image/Makefile    (working copy)
@@ -253,6 +253,7 @@
 
ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
 
ap136_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(mib0),64k(art)ro,7744k@0x50000(firmware)
 
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
+bxo2000n2s_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),6400k(rootfs),1280k(kernel),64k(cfg),64k(oem),64k(art)ro
 
cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
 
cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware),64k(mac)ro,64k(art)ro
 
cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
@@ -1011,6 +1012,7 @@
$(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage)) $(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage)) $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage)) +$(eval $(call SingleProfile,AthLzma,64k,BXO2000N2S,bxo2000n-2s-a1,BXO2000n-2S-A1,ttyS0,115200,$$(bxo2000n2s_mtdlayout),RKuImage)) $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage)) $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage)) $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to