ar71xx: add support for RB750r2
authorThibaut VARENE <hacks@slashdirt.org>
Thu, 9 Feb 2017 22:07:23 +0000 (23:07 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 15 Feb 2017 10:28:58 +0000 (11:28 +0100)
This patch adds support for the MikroTik RouterBOARD hEX lite
https://routerboard.com/RB750r2

Specifications:
- SoC: Qualcomm QCA9531 (850MHz)
- RAM: 64MB
- Storage: 16MB NOR SPI flash
- Ethernet: 5x100M (1 PoE in)

This ethernet router is based on the same platform as the hEX PoE lite (it
shares the same board identifier), but has no USB and no PoE out.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
target/linux/ar71xx/base-files/etc/board.d/01_leds
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c

index c2129ea5f6eef3816b8295ed334ac5a054e9e136..af0287772189c0764e08bab2d344db032ef89c1c 100755 (executable)
@@ -222,6 +222,7 @@ rb-750)
        ucidef_set_led_switch "port4" "port4" "rb750:green:port4" "switch0" "0x04"
        ucidef_set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02"
        ;;
+rb-750-r2|\
 rb-750up-r2)
        ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
        ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
index 4f7ddacaca4a5084ce216688c1e4af251668d782..621a010671f8af20a86be249a28fcdad0f1daf69 100755 (executable)
@@ -136,6 +136,7 @@ ar71xx_setup_interfaces()
        om2p-hsv4|\
        pb42|\
        pb44|\
+       rb-750-r2|\
        rb-750up-r2|\
        rb-951ui-2hnd|\
        rb-951ui-2nd|\
index 3a75e1080c8942c1fdbdc6c4e39ef0d51f69596d..ae6c693da8ac393b285b3870b18c75dc2ad2d96b 100644 (file)
@@ -293,6 +293,7 @@ get_status_led() {
        rb-750)
                status_led="rb750:green:act"
                ;;
+       rb-750-r2|\
        rb-750up-r2|\
        rb-911g-2hpnd|\
        rb-911g-5hpacd|\
index f4e54415ae702b5a40bb7bd49200863095ca87be..fc3a5dda8b763ce10606f527b086407a2583cc0b 100755 (executable)
@@ -838,6 +838,9 @@ ar71xx_board_detect() {
        *"RouterBOARD 750GL")
                name="rb-750gl"
                ;;
+       *"RouterBOARD 750 r2")
+               name="rb-750-r2"
+               ;;
        *"RouterBOARD 750UP r2")
                name="rb-750up-r2"
                ;;
index 110525448394cc58660352f16813fbef142be935..fa83db23b4369f77f0e1d6f61f4e4877b34697d0 100755 (executable)
@@ -343,6 +343,7 @@ platform_check_image() {
        ls-sr71|\
        pb42|\
        pb44|\
+       rb-750-r2|\
        rb-750up-r2|\
        rb-941-2nd|\
        rb-951ui-2nd|\
@@ -618,6 +619,7 @@ platform_pre_upgrade() {
        local board=$(ar71xx_board_name)
 
        case "$board" in
+       rb-750-r2|\
        rb-750up-r2|\
        rb-941-2nd|\
        rb-951ui-2nd|\
@@ -657,6 +659,7 @@ platform_do_upgrade() {
        local board=$(ar71xx_board_name)
 
        case "$board" in
+       rb-750-r2|\
        rb-750up-r2|\
        rb-941-2nd|\
        rb-951ui-2nd|\
index 3f4347106face7887c29df2abfff51a357d8953f..bc06481e3963ae3bc02cccea6c952a8e8dd09f0e 100644 (file)
@@ -930,6 +930,7 @@ config ATH79_MACH_RBSPI
          MikroTik RouterBOARD hAP lite
          MikroTik RouterBOARD hAP
          MikroTik RouterBOARD hEX PoE lite
+         MikroTik RouterBOARD hEX lite
 
 config ATH79_MACH_RBSXTLITE
        bool "MikroTik RouterBOARD SXT Lite"
index 81659ef5035611c3ef6fd3384668ee632a0f440a..c0b27190fecca14b9da72e0d70954bd0c6acbd8a 100644 (file)
@@ -5,6 +5,7 @@
  *  - MikroTik RouterBOARD 941L-2nD
  *  - MikroTik RouterBOARD 951Ui-2nD
  *  - MikroTik RouterBOARD 750UP r2
+ *  - MikroTik RouterBOARD 750 r2
  *
  *  Copyright (C) 2017 Thibaut VARENE <varenet@parisc-linux.org>
  *
@@ -472,18 +473,22 @@ static void __init rb952_setup(void)
 }
 
 /*
- * Init the hEX PoE lite hardware.
+ * Init the hEX (PoE) lite hardware.
  * The 750UP r2 (hEX PoE lite) is nearly identical to the hAP, only without
- * WLAN.
+ * WLAN. The 750 r2 (hEX lite) is nearly identical to the 750UP r2, only
+ * without USB and POE. It shares the same bootloader board identifier.
  */
 static void __init rb750upr2_setup(void)
 {
-       u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_USB |
-                       RBSPI_HAS_SSR | RBSPI_HAS_POE;
+       u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_SSR;
 
        if (rbspi_platform_setup())
                return;
 
+       /* differentiate the hEX lite from the hEX PoE lite */
+       if (strstr(mips_get_machine_name(), "750UP r2"))
+               flags |= RBSPI_HAS_USB | RBSPI_HAS_POE;
+
        rbspi_952_750r2_setup(flags);
 }