ar71xx: add support for Ubiquiti AirRouter
authorGabor Juhos <juhosg@openwrt.org>
Thu, 1 Dec 2011 22:49:02 +0000 (22:49 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 1 Dec 2011 22:49:02 +0000 (22:49 +0000)
Signed-off-by: Gergely Barta <gergely.barta@printerfairkft.hu>
SVN-Revision: 29395

target/linux/ar71xx/base-files/etc/uci-defaults/network
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c
target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
target/linux/ar71xx/image/Makefile

index 8cec0b13d2d4dede07015e0eee597ce7cceacede..f9419b9866ee718c1c53ea6621292871109840c6 100755 (executable)
@@ -118,6 +118,7 @@ routerstation)
 ap121 |\
 ap121-mini |\
 ap96 |\
+airrouter |\
 dir-600-a1 |\
 dir-615-c1 |\
 ja76pf |\
index 513f0d2f75f944e30c4f5734990de6cf2d341432..314b44e4728cfbe138def3203f7a898b76a3fcf8 100755 (executable)
@@ -10,6 +10,9 @@ ar71xx_board_name() {
        machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
 
        case "$machine" in
+       *"AirRouter")
+               name="airrouter"
+               ;;
        *ALL0258N)
                name="all0258n"
                ;;
index 06ce2126ee66e7a8ce8f1499315169b11935a730..ab399f6f17611211ce3717a6446e4e0ad67a32ea 100644 (file)
@@ -283,6 +283,37 @@ static void __init ubnt_nano_m_setup(void)
 MIPS_MACHINE(AR71XX_MACH_UBNT_NANO_M, "UBNT-NM", "Ubiquiti Nanostation M",
             ubnt_nano_m_setup);
 
+static struct gpio_led ubnt_airrouter_leds_gpio[] __initdata = {
+       {
+               .name           = "ubnt:green:globe",
+               .gpio           = 0,
+               .active_low     = 1,
+       }
+};
+
+static void __init ubnt_airrouter_setup(void)
+{
+       u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
+       u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+       ar71xx_add_device_m25p80(NULL);
+       ar71xx_add_device_mdio(0, ~UBNT_M_WAN_PHYMASK);
+
+       ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac1, 0);
+       ubnt_init_secondary_mac(mac1);
+
+       ar71xx_add_device_eth(1);
+       ar71xx_add_device_eth(0);
+       ar71xx_add_device_usb();
+
+       ap91_pci_init(ee, NULL);
+       ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_airrouter_leds_gpio),
+                                       ubnt_airrouter_leds_gpio);
+}
+
+MIPS_MACHINE(AR71XX_MACH_UBNT_AIRROUTER, "UBNT-AR", "Ubiquiti AirRouter",
+            ubnt_airrouter_setup);
+
 static struct gpio_led ubnt_unifi_leds_gpio[] __initdata = {
        {
                .name           = "ubnt:orange:dome",
index be7df85d4a105d422221e9d49bc2df025e3e28c7..6b2c160c96ab2de7a076ea807ad65bfb1f2ba1b7 100644 (file)
@@ -57,6 +57,7 @@ enum ar71xx_mach_type {
        AR71XX_MACH_TL_WR741ND_V4, /* TP-LINK TL-WR741ND  v4*/
        AR71XX_MACH_TL_WR841N_V1, /* TP-LINK TL-WR841N v1 */
        AR71XX_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
+       AR71XX_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
        AR71XX_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
        AR71XX_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
        AR71XX_MACH_UBNT_LSX,   /* Ubiquiti LSX */
index 790dfda0e103bddfe20e357ab8667c746fdb6099..bda650ebfa2675abc372f1ba90482048379d5c59 100644 (file)
@@ -536,6 +536,11 @@ define Image/Build/Profile/A02RBW300N
        $(call Image/Build/Template/$(fs_squash)/$(1),Cameo913x,a02-rb-w300n,$(a05rbw300n_cmdline),"AP81-AR9130-RT-070614-03")
 endef
 
+ubntairrouter_cmdline=board=UBNT-AR console=ttyS0,115200
+define Image/Build/Profile/UBNTAIRROUTER
+       $(call Image/Build/Template/$(fs_64k)/$(1),UBNTXM,ubnt-airrouter,$(ubntairrouter_cmdline),XM,UBNTXM,ar7240)
+endef
+
 ubntrs_cmdline=board=UBNT-RS console=ttyS0,115200
 define Image/Build/Profile/UBNTRS
        $(call Image/Build/Template/$(fs_64k)/$(1),UBNT,ubnt-rs,$(ubntrs_cmdline),RS,RSx,ar7100)
@@ -572,6 +577,7 @@ define Image/Build/Profile/UBNTUNIFI
 endef
 
 define Image/Build/Profile/UBNT
+       $(call Image/Build/Profile/UBNTAIRROUTER,$(1))
        $(call Image/Build/Profile/UBNTRS,$(1))
        $(call Image/Build/Profile/UBNTRSPRO,$(1))
        $(call Image/Build/Profile/UBNTLSSR71,$(1))