aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
diff options
context:
space:
mode:
authorThibaut VARENE <hacks@slashdirt.org>2017-02-07 15:23:30 +0100
committerFelix Fietkau <nbd@nbd.name>2017-02-15 11:28:57 +0100
commitb18bae37a4f26949f71f1345caa2b6934f6a4663 (patch)
tree28f5d53de0e6cf7dded1d8dd8dfef1359b399a7f /target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
parentc59fa94eeecf16c79254ab4bc78f5b31c7387039 (diff)
downloadupstream-b18bae37a4f26949f71f1345caa2b6934f6a4663.tar.gz
upstream-b18bae37a4f26949f71f1345caa2b6934f6a4663.tar.bz2
upstream-b18bae37a4f26949f71f1345caa2b6934f6a4663.zip
ar71xx: provide support for RB-941-2nD via mach-rbspi.c
This patch implements support for the hAP lite in mach-rbspi.c hAP lite was supported via mach-rb941.c, so this file is removed as well as the corresponding build bits. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c39
1 files changed, 39 insertions, 0 deletions
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 3f154b4775..541865220c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c
@@ -2,6 +2,7 @@
* MikroTik SPI-NOR RouterBOARDs support
*
* - MikroTik RouterBOARD mAP L-2nD
+ * - MikroTik RouterBOARD 941L-2nD
*
* Copyright (C) 2017 Thibaut VARENE <varenet@parisc-linux.org>
*
@@ -155,6 +156,16 @@ static struct gpio_led rbmapl_leds[] __initdata = {
},
};
+/* RB 941L-2nD gpios */
+#define RBHAPL_GPIO_LED_USER 14
+static struct gpio_led rbhapl_leds[] __initdata = {
+ {
+ .name = "rb:green:user",
+ .gpio = RBHAPL_GPIO_LED_USER,
+ .active_low = 1,
+ },
+};
+
void __init rbspi_wlan_init(int wmac_offset)
{
char *art_buf;
@@ -276,4 +287,32 @@ static void __init rbmapl_setup(void)
ath79_gpio_output_select(RBMAPL_GPIO_LED_POWER, AR934X_GPIO_OUT_GPIO);
}
+/*
+ * Init the hAP lite hardware.
+ * The 941-2nD (hAP lite) has 4 ethernet ports, with port 2-4
+ * being assigned to LAN on the casing, and port 1 being assigned
+ * to "internet" (WAN) on the casing. Port 1 is connected to PHY3.
+ * Since WAN is neither PHY0 nor PHY4, we cannot use GMAC0 with this device.
+ */
+static void __init rbhapl_setup(void)
+{
+ u32 flags = RBSPI_HAS_WLAN;
+
+ if (rbspi_platform_setup())
+ return;
+
+ rbspi_peripherals_setup(flags);
+
+ /* GMAC1 is HW MAC, WLAN MAC is HW MAC + 4 */
+ rbspi_network_setup(flags, 0, 4);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(rbhapl_leds), rbhapl_leds);
+
+ /* hAP lite 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);
+}
+
MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAPL, "map-hb", rbmapl_setup);
+MIPS_MACHINE_NONAME(ATH79_MACH_RB_941, "H951L", rbhapl_setup);