ar71xx: build ALFA AP96 images with default profile as well
[oweals/openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-ubnt.c
index 06ce2126ee66e7a8ce8f1499315169b11935a730..8f1a1355d41d8148fac72b6c6b52937e677d4e73 100644 (file)
@@ -123,9 +123,18 @@ static struct gpio_keys_button ubnt_m_gpio_keys[] __initdata = {
        }
 };
 
+static const char *ubnt_part_probes[] = {
+       "RedBoot",
+       NULL,
+};
+
+static struct flash_platform_data ubnt_flash_data = {
+       .part_probes    = ubnt_part_probes,
+};
+
 static void __init ubnt_generic_setup(void)
 {
-       ar71xx_add_device_m25p80(NULL);
+       ar71xx_add_device_m25p80(&ubnt_flash_data);
 
        ar71xx_register_gpio_keys_polled(-1, UBNT_KEYS_POLL_INTERVAL,
                                         ARRAY_SIZE(ubnt_gpio_keys),
@@ -283,6 +292,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",
@@ -313,5 +353,5 @@ static void __init ubnt_unifi_setup(void)
                                        ubnt_unifi_leds_gpio);
 }
 
-MIPS_MACHINE(AR71XX_MACH_UBNT_UNIFI, "UBNT-XM", "Ubiquiti UniFi",
+MIPS_MACHINE(AR71XX_MACH_UBNT_UNIFI, "UBNT-UF", "Ubiquiti UniFi",
             ubnt_unifi_setup);