ar71xx: add support for RB750UPr2

This patch adds support for the MikroTik RouterBOARD hEX PoE lite
https://routerboard.com/RB750UPr2

Specifications:
- SoC: Qualcomm QCA9531 (650MHz)
- RAM: 64MB
- Storage: 16MB NOR SPI flash
- Ethernet: 5x100M (1 PoE in, 1 PoE out)
- USB: Type A

This ethernet router is based on the same platform as the wireless router hAP.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
This commit is contained in:
Thibaut VARENE 2017-02-09 22:50:08 +01:00 committed by Felix Fietkau
parent 8cbb2ac633
commit 19f42663d2
9 changed files with 68 additions and 19 deletions

View file

@ -222,6 +222,14 @@ 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-750up-r2)
ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
;;
rb-941-2nd)
ucidef_set_led_timer "user" "USR/ACT" "rb:green:user" "1000" "1000"
;;

View file

@ -136,6 +136,7 @@ ar71xx_setup_interfaces()
om2p-hsv4|\
pb42|\
pb44|\
rb-750up-r2|\
rb-951ui-2hnd|\
rb-951ui-2nd|\
routerstation|\

View file

@ -27,6 +27,7 @@ rb-912uag-2hpnd|\
rb-912uag-5hpnd)
ucidef_add_gpio_switch "usb_power_switch" "USB Power Switch" "52" "1"
;;
rb-750up-r2|\
rb-951ui-2nd)
ucidef_add_gpio_switch "usb_power_switch" "USB Power Switch" "45" "1"
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "14"

View file

@ -293,6 +293,7 @@ get_status_led() {
rb-750)
status_led="rb750:green:act"
;;
rb-750up-r2|\
rb-911g-2hpnd|\
rb-911g-5hpacd|\
rb-911g-5hpnd|\

View file

@ -838,6 +838,9 @@ ar71xx_board_detect() {
*"RouterBOARD 750GL")
name="rb-750gl"
;;
*"RouterBOARD 750UP r2")
name="rb-750up-r2"
;;
*"RouterBOARD 751")
name="rb-751"
;;

View file

@ -343,6 +343,7 @@ platform_check_image() {
ls-sr71|\
pb42|\
pb44|\
rb-750up-r2|\
rb-941-2nd|\
rb-951ui-2nd|\
rb-mapl-2nd|\
@ -617,6 +618,7 @@ platform_pre_upgrade() {
local board=$(ar71xx_board_name)
case "$board" in
rb-750up-r2|\
rb-941-2nd|\
rb-951ui-2nd|\
rb-mapl-2nd)
@ -655,6 +657,7 @@ platform_do_upgrade() {
local board=$(ar71xx_board_name)
case "$board" in
rb-750up-r2|\
rb-941-2nd|\
rb-951ui-2nd|\
rb-mapl-2nd)

View file

@ -929,6 +929,7 @@ config ATH79_MACH_RBSPI
MikroTik RouterBOARD mAP lite
MikroTik RouterBOARD hAP lite
MikroTik RouterBOARD hAP
MikroTik RouterBOARD hEX PoE lite
config ATH79_MACH_RBSXTLITE
bool "MikroTik RouterBOARD SXT Lite"

View file

@ -4,6 +4,7 @@
* - MikroTik RouterBOARD mAP L-2nD
* - MikroTik RouterBOARD 941L-2nD
* - MikroTik RouterBOARD 951Ui-2nD
* - MikroTik RouterBOARD 750UP r2
*
* Copyright (C) 2017 Thibaut VARENE <varenet@parisc-linux.org>
*
@ -45,6 +46,7 @@
#define RBSPI_HAS_WLAN BIT(1)
#define RBSPI_HAS_WAN4 BIT(2) /* has WAN port on PHY4 */
#define RBSPI_HAS_SSR BIT(3) /* has an SSR on SPI bus 0 */
#define RBSPI_HAS_POE BIT(4)
#define RB_ROUTERBOOT_OFFSET 0x0000
#define RB_BIOS_SIZE 0x1000
@ -418,6 +420,37 @@ static void __init rbhapl_setup(void)
rbspi_gpio_keys_reset16);
}
/*
* The hAP, hEX lite and hEX PoE lite share the same platform
*/
static void __init rbspi_952_750r2_setup(u32 flags)
{
if (flags & RBSPI_HAS_SSR)
rbspi_spi_cs_gpios[1] = RB952_GPIO_SSR_CS;
rbspi_peripherals_setup(flags);
/* GMAC1 is HW MAC + 1, WLAN MAC IS HW MAC + 5 */
rbspi_network_setup(flags, 1, 5);
if (flags & RBSPI_HAS_USB)
gpio_request_one(RB952_GPIO_USB_POWER,
GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
"USB power");
if (flags & RBSPI_HAS_POE)
gpio_request_one(RB952_GPIO_POE_POWER,
GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
"POE power");
ath79_register_leds_gpio(-1, ARRAY_SIZE(rb952_leds), rb952_leds);
/* These devices have a single reset button as gpio 16 */
ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
ARRAY_SIZE(rbspi_gpio_keys_reset16),
rbspi_gpio_keys_reset16);
}
/*
* Init the hAP hardware.
* The 951Ui-2nD (hAP) has 5 ethernet ports, with ports 2-5 being assigned
@ -430,34 +463,31 @@ static void __init rbhapl_setup(void)
static void __init rb952_setup(void)
{
u32 flags = RBSPI_HAS_WLAN | RBSPI_HAS_WAN4 | RBSPI_HAS_USB |
RBSPI_HAS_SSR;
RBSPI_HAS_SSR | RBSPI_HAS_POE;
if (rbspi_platform_setup())
return;
rbspi_spi_cs_gpios[1] = RB952_GPIO_SSR_CS;
rbspi_952_750r2_setup(flags);
}
rbspi_peripherals_setup(flags);
/*
* Init the hEX PoE lite hardware.
* The 750UP r2 (hEX PoE lite) is nearly identical to the hAP, only without
* WLAN.
*/
static void __init rb750upr2_setup(void)
{
u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_USB |
RBSPI_HAS_SSR | RBSPI_HAS_POE;
/* GMAC1 is HW MAC + 1, WLAN MAC IS HW MAC + 5 */
rbspi_network_setup(flags, 1, 5);
if (rbspi_platform_setup())
return;
gpio_request_one(RB952_GPIO_USB_POWER,
GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
"USB power");
gpio_request_one(RB952_GPIO_POE_POWER,
GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
"POE power");
ath79_register_leds_gpio(-1, ARRAY_SIZE(rb952_leds), rb952_leds);
/* hAP has a single reset button as gpio 16 */
ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL,
ARRAY_SIZE(rbspi_gpio_keys_reset16),
rbspi_gpio_keys_reset16);
rbspi_952_750r2_setup(flags);
}
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_952, "952-hb", rb952_setup);
MIPS_MACHINE_NONAME(ATH79_MACH_RB_750UPR2, "750-hb", rb750upr2_setup);

View file

@ -167,6 +167,7 @@ enum ath79_mach_type {
ATH79_MACH_RB_711GR100, /* Mikrotik RouterBOARD 911/912 boards */
ATH79_MACH_RB_750, /* MikroTik RouterBOARD 750 */
ATH79_MACH_RB_750G_R3, /* MikroTik RouterBOARD 750GL */
ATH79_MACH_RB_750UPR2, /* MikroTik RouterBOARD 750UP r2 */
ATH79_MACH_RB_751, /* MikroTik RouterBOARD 751 */
ATH79_MACH_RB_751G, /* Mikrotik RouterBOARD 751G */
ATH79_MACH_RB_922GS, /* Mikrotik RouterBOARD 911/922GS boards */