[LEDE-DEV] [PATCH 3/3] ar71xx: Add preliminary support for several SPI NOR MikroTik RB devices

hacks at slashdirt.org hacks at slashdirt.org
Sun Feb 5 04:31:58 PST 2017


From: Thibaut VARENE <hacks at slashdirt.org>

This patch adds preliminary support for the following devices
- RouterBOARD cAP
- RouterBOARD cAP lite
- RouterBOARD hAP
- RouterBOARD mAP
- RouterBOARD wAP

These devices apparently all share the same QCA953x / 16MB SPI NOR platform.

This patch will provide basic hardware initialization:
- WLAN will be initialized
- All PHYs will be connected to the internal switch and be assigned to "eth0"

It is impossible to flash LEDE directly from the RouterOS upgrade interface.
Instead, one must first boot an initramfs image and then flash LEDE (via
sysupgrade).

Thus, even by providing incomplete support, it is impossible to brick these
devices. If the image boots, the users can then log into the device and report
useful information to improve support (GPIOs, additional devices, etc).

Signed-off-by: Thibaut VARENE <hacks at slashdirt.org>
---
 target/linux/ar71xx/base-files/etc/board.d/02_network     |  1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh              |  3 +++
 target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt |  5 +++++
 target/linux/ar71xx/files/arch/mips/ath79/mach-rbxap.c    | 11 +++++++++++
 target/linux/ar71xx/files/arch/mips/ath79/machtypes.h     |  5 +++++
 5 files changed, 25 insertions(+)

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 639ae55..7cc9e3a 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -90,6 +90,7 @@ ar71xx_setup_interfaces()
 	rb-911g-5hpnd|\
 	rb-912uag-2hpnd|\
 	rb-912uag-5hpnd|\
+	rb-generic|\
 	rb-mapl-2nd|\
 	rb-sxt2n|\
 	rb-sxt5n|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 7c249c5..c448d01 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -877,6 +877,9 @@ ar71xx_board_detect() {
 	*"RouterBOARD SXT Lite5")
 		name="rb-sxt5n"
 		;;
+	*"RouterBOARD"*)
+		name="rb-generic"
+		;;
 	*"Rocket M")
 		name="rocket-m"
 		ubnt_xm_board_detect
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 1be6799..026e7a4 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -917,6 +917,11 @@ config ATH79_MACH_RBXAP
 	  Say 'Y' here if you want your kernel to support the
 	  MikroTik RouterBOARD mAP lite
 	  MikroTik RouterBOARD hAP lite
+	  MikroTik RouterBOARD hAP (EXPERIMENTAL)
+	  MikroTik RouterBOARD cAP (EXPERIMENTAL)
+	  MikroTik RouterBOARD cAP lite (EXPERIMENTAL)
+	  MikroTik RouterBOARD mAP (EXPERIMENTAL)
+	  MikroTik RouterBOARD wAP (EXPERIMENTAL)
 
 config ATH79_MACH_RBSXTLITE
 	bool "MikroTik RouterBOARD SXT Lite"
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbxap.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbxap.c
index ffdb785..62288fd 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbxap.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbxap.c
@@ -233,5 +233,16 @@ static void __init rbhapl_setup(void)
 					rbmapl_gpio_keys);
 }
 
+/* Provide basic initialization for "supportable" but untested hardware. */
+static void __init rbxap_generic_setup(void)
+{
+	rbxap_setup(1);
+}
+
 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", rbxap_generic_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAP, "wap-hb", rbxap_generic_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAPL, "cap-hb", rbxap_generic_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cm2n", rbxap_generic_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP2, "map2-hb", rbxap_generic_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 1e161de..58e711d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -168,9 +168,14 @@ enum ath79_mach_type {
 	ATH79_MACH_RB_941,			/* MikroTik RouterBOARD 941-2nD */
 	ATH79_MACH_RB_951G,			/* Mikrotik RouterBOARD 951G */
 	ATH79_MACH_RB_951U,			/* Mikrotik RouterBOARD 951Ui-2HnD */
+	ATH79_MACH_RB_952,			/* Mikrotik RouterBOARD 951Ui-2nD */
+	ATH79_MACH_RB_CAP,			/* MikroTik RouterBOARD cAP-2nD */
+	ATH79_MACH_RB_CAPL,			/* MikroTik RouterBOARD cAPL-2nD */
 	ATH79_MACH_RB_MAPL,			/* Mikrotik RouterBOARD mAP L-2nD */
+	ATH79_MACH_RB_MAP2,			/* MikroTik RouterBOARD mAP 2nD */
 	ATH79_MACH_RB_SXTLITE2ND,		/* Mikrotik RouterBOARD SXT Lite 2nD */
 	ATH79_MACH_RB_SXTLITE5ND,		/* Mikrotik RouterBOARD SXT Lite 5nD */
+	ATH79_MACH_RB_WAP,			/* MikroTik RouterBOARD wAP */
 	ATH79_MACH_RE450,			/* TP-LINK RE450 */
 	ATH79_MACH_RW2458N,			/* Redwave RW2458N */
 	ATH79_MACH_SC1750,			/* Abicom SC1750 */
-- 
2.1.4




More information about the Lede-dev mailing list