diff options
author | Thibaut VARÈNE <hacks@slashdirt.org> | 2018-07-12 13:43:36 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-07-16 15:12:17 +0200 |
commit | c2d2647c099679d64c8d5ef5260ba0f9d4c8f2ba (patch) | |
tree | 17e4f72c9ccce2ba3816a60ac6a4103003c5465d /target/linux | |
parent | f21bcb4db8a12cef62e5698f0f711db8dde99db8 (diff) | |
download | upstream-c2d2647c099679d64c8d5ef5260ba0f9d4c8f2ba.tar.gz upstream-c2d2647c099679d64c8d5ef5260ba0f9d4c8f2ba.tar.bz2 upstream-c2d2647c099679d64c8d5ef5260ba0f9d4c8f2ba.zip |
ar71xx: add support for MikroTik RB931-2nD
This patch adds support for the MikroTik RB931-2nD (hAP mini):
https://mikrotik.com/product/RB931-2nD
Specifications:
* SoC: Qualcomm QCA9533 (650MHz)
* RAM: 32MiB
* Storage: 16MiB SPI NOR flash
* Ethernet: 3x100M
* Wireless: QCA9533 built-in, dual-chain 802.11b/g/n
Installation:
1. Setup a DHCP/BOOTP Server with the following parameters:
* DHCP-Option 66 (TFTP server name): pointing to a local TFTP
server within the same subnet of the DHCP range
* DHCP-Option 67 (Bootfile-Name): matching the initramfs filename
of the to be booted image. The usable intramfs files are:
- openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf
- openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf
- openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin
2. Press the reset button on the board and keep that pressed.
3. Connect the board to your local network via its Internet port.
4. Release the button after the LEDs on the board are turned off.
Now the board should load and start the initramfs image from
the TFTP server.
5. Now connect the board via either of its LAN ports (2 or 3).
6. Upload the sysupgrade image to the board with scp:
$ scp openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/fw.bin
7. Log in to the running system listening on 192.168.1.1 via ssh
as root (without password):
$ ssh root@192.168.1.1
8. Flash the uploaded firmware file from the ssh session via the
sysupgrade command:
root@OpenWrt:~# sysupgrade /tmp/fw.bin
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Diffstat (limited to 'target/linux')
9 files changed, 75 insertions, 2 deletions
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index c44fb7d047..11299dcb92 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -626,6 +626,7 @@ rb-911-2hn|\ rb-911-5hn) ucidef_set_led_netdev "eth" "ETH" "rb:green:eth" "eth0" ;; +rb-931-2nd|\ rb-941-2nd) ucidef_set_led_timer "user" "USR/ACT" "rb:green:user" "1000" "1000" ;; diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 4a141e9f87..f43392709e 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -315,6 +315,10 @@ ar71xx_setup_interfaces() dap-2695-a1) ucidef_add_switch "switch0" "0@eth0" "2:lan" "3:wan" "6@eth1" ;; + rb-931-2nd) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1" + ;; rb-941-2nd) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1" diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 137baa935e..d3cdc81b39 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -368,6 +368,7 @@ get_status_led() { rb-911g-2hpnd|\ rb-911g-5hpacd|\ rb-911g-5hpnd|\ + rb-931-2nd|\ rb-941-2nd|\ rb-951ui-2nd|\ rb-952ui-5ac2nd|\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 63b7a4f108..82b902545c 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -1061,6 +1061,9 @@ ar71xx_board_detect() { *"RouterBOARD 921GS-5HPacD r2") name="rb-921gs-5hpacd-r2" ;; + *"RouterBOARD 931-2nD") + name="rb-931-2nd" + ;; *"RouterBOARD 941-2nD") name="rb-941-2nd" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 41e60d7f01..3607fc22a6 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -704,6 +704,7 @@ platform_check_image() { rb-750up-r2|\ rb-911-2hn|\ rb-911-5hn|\ + rb-931-2nd|\ rb-941-2nd|\ rb-951ui-2nd|\ rb-952ui-5ac2nd|\ @@ -731,6 +732,7 @@ platform_pre_upgrade() { rb-750up-r2|\ rb-911-2hn|\ rb-911-5hn|\ + rb-931-2nd|\ rb-941-2nd|\ rb-951ui-2nd|\ rb-952ui-5ac2nd|\ diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 394e8d3c5e..7b454d6504 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1133,6 +1133,7 @@ config ATH79_MACH_RBSPI MikroTik ROuterBOARD 911-5Hn (911 Lite5) MikroTik RouterBOARD mAP MikroTik RouterBOARD mAP lite + MikroTik RouterBOARD hAP mini MikroTik RouterBOARD hAP lite MikroTik RouterBOARD hAP MikroTik RouterBOARD hAP ac diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c index d0fac59f9e..2997018aa3 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c @@ -5,6 +5,7 @@ * - MikroTik RouterBOARD mAP L-2nD * - MikroTik RouterBOARD 911-2Hn (911 Lite2) * - MikroTik RouterBOARD 911-5Hn (911 Lite5) + * - MikroTik RouterBOARD 931-2nD (hAP mini) * - MikroTik RouterBOARD 941L-2nD * - MikroTik RouterBOARD 951Ui-2nD * - MikroTik RouterBOARD 952Ui-5ac2nD @@ -23,7 +24,7 @@ * hardware as the mAP L-2nD. It is unknown if they share the same board * identifier. * - * Copyright (C) 2017 Thibaut VARENE <varenet@parisc-linux.org> + * Copyright (C) 2017-2018 Thibaut VARENE <varenet@parisc-linux.org> * Copyright (C) 2016 David Hutchison <dhutchison@bluemesh.net> * Copyright (C) 2017 Ryan Mounce <ryan@mounce.com.au> * @@ -562,6 +563,37 @@ static struct gpio_led rb911l_leds[] __initdata = { }, }; +/* RB 931-2nD gpios */ +#define RB931_GPIO_BTN_RESET 0 +#define RB931_GPIO_BTN_MODE 9 +#define RB931_GPIO_LED_USER 1 + +static struct gpio_keys_button rb931_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL, + .gpio = RB931_GPIO_BTN_RESET, + .active_low = 1, + }, { + .desc = "Mode button", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL, + .gpio = RB931_GPIO_BTN_MODE, + .active_low = 1, + } +}; + +static struct gpio_led rb931_leds[] __initdata = { + { + .name = "rb:green:user", + .gpio = RB931_GPIO_LED_USER, + .active_low = 1, + }, +}; + static struct gen_74x164_chip_platform_data rbspi_ssr_data = { .base = RBSPI_SSR_GPIO_BASE, .num_registers = 1, @@ -1112,6 +1144,33 @@ static void __init rb911l_setup(void) ath79_register_leds_gpio(-1, ARRAY_SIZE(rb911l_leds), rb911l_leds); } +/* + * Init the hAP mini hardware (QCA953x). + * The 931-2nD (hAP mini) has 3 ethernet ports, with port 2-3 + * being assigned to LAN on the casing, and port 1 being assigned + * to "internet" (WAN) on the casing. Port 1 is connected to PHY2. + * Since WAN is neither PHY0 nor PHY4, we cannot use GMAC0 with this device. + */ +static void __init rb931_setup(void) +{ + u32 flags = RBSPI_HAS_WLAN0; + + if (!rbspi_platform_setup()) + return; + + rbspi_peripherals_setup(flags); + + /* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 3 */ + rbspi_network_setup(flags, 0, 3, 0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rb931_leds), rb931_leds); + + /* hAP mini has two buttons */ + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rb931_gpio_keys), + rb931_gpio_keys); +} + MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAPL, "map-hb", rbmapl_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_941, "H951L", rbhapl_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_911L, "911L", rb911l_setup); @@ -1124,3 +1183,4 @@ MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPR, "wap-lte", rbwap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cap-hb", rbcap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP, "map2-hb", rbmap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPAC, "wapg-sc", rbwapgsc_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_931, "931", rb931_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index c5be6b9a38..fc01b9b62b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -211,6 +211,7 @@ enum ath79_mach_type { ATH79_MACH_RB_751G, /* Mikrotik RouterBOARD 751G */ ATH79_MACH_RB_911L, /* Mikrotik RouterBOARD 911-2Hn/911-5Hn boards */ ATH79_MACH_RB_922GS, /* Mikrotik RouterBOARD 911/922GS boards */ + ATH79_MACH_RB_931, /* MikroTik RouterBOARD 931-2nD */ ATH79_MACH_RB_941, /* MikroTik RouterBOARD 941-2nD */ ATH79_MACH_RB_951G, /* Mikrotik RouterBOARD 951G */ ATH79_MACH_RB_951U, /* Mikrotik RouterBOARD 951Ui-2HnD */ diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk index 3238a885a8..afef8f7618 100644 --- a/target/linux/ar71xx/image/mikrotik.mk +++ b/target/linux/ar71xx/image/mikrotik.mk @@ -46,7 +46,7 @@ define Device/rb-nor-flash-16M DEVICE_PACKAGES := rbcfg rssileds -nand-utils kmod-ledtrig-gpio IMAGE_SIZE := 16000k KERNEL_INSTALL := 1 - SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-911-2hn rb-911-5hn rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd rb-wapr-2nd + SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-911-2hn rb-911-5hn rb-931-2nd rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd rb-wapr-2nd IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef |