[PATCH 1/3] ar71xx: add kernel support for LigoDLB series

Daniel Golle daniel at makrotopia.org
Sat Aug 15 22:05:42 UTC 2015


Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/ar71xx/config-4.1                     |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-v2v-dlb5xx.c | 175 +++++++++++++++++++++
 .../814-MIPS-ath79-add-ligodlb-support.patch       |  41 +++++
 3 files changed, 217 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-v2v-dlb5xx.c
 create mode 100644 target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-ligodlb-support.patch

diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 50dc7b2..ca8a4da 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -143,6 +143,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
 CONFIG_ATH79_MACH_TUBE2H=y
 CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_V2V_DLB5XX=y
 CONFIG_ATH79_MACH_WEIO=y
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WLAE_AG300N=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-v2v-dlb5xx.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-v2v-dlb5xx.c
new file mode 100644
index 0000000..c9cc578
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-v2v-dlb5xx.c
@@ -0,0 +1,175 @@
+/*
+ *  LigoWave DLB515 board
+ *
+ *  Copyright (C) 2015 Daniel Golle <daniel at makrotopia.org>
+ *  Copyright (C) 2010-2012 Gabor Juhos <juhosg at openwrt.org>
+ *  Copyright (C) 2011-2012 Anan Huang <axishero at foxmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
+#include <linux/ath9k_platform.h>
+#include <linux/ar8216_platform.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-spi.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define V2V_DLB5XX_GPIO_BTN_RESET	17
+
+#define V2V_DLB515_GPIO_LED_PWR		13
+#define V2V_DLB515_GPIO_LED_LAN		4
+#define V2V_DLB515_GPIO_LED_RSSI_LOW	3
+#define V2V_DLB515_GPIO_LED_RSSI_MEDLO	2
+#define V2V_DLB515_GPIO_LED_RSSI_MEDHI	1
+#define V2V_DLB515_GPIO_LED_RSSI_HIGH	0
+
+#define V2V_DLB520_GPIO_LED_PWR		0
+#define V2V_DLB520_GPIO_LED_LAN		1
+#define V2V_DLB520_GPIO_LED_RSSI_LOW	2
+#define V2V_DLB520_GPIO_LED_RSSI_MEDLO	3
+#define V2V_DLB520_GPIO_LED_RSSI_MEDHI	4
+#define V2V_DLB520_GPIO_LED_RSSI_HIGH	13
+
+#define V2V_DLB5XX_KEYS_POLL_INTERVAL		20	/* msecs */
+#define V2V_DLB5XX_KEYS_DEBOUNCE_INTERVAL	(3 * V2V_DLB5XX_KEYS_POLL_INTERVAL)
+
+static struct gpio_keys_button v2v_dlb5xx_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = V2V_DLB5XX_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= V2V_DLB5XX_GPIO_BTN_RESET,
+		.active_low	= 1,
+	}
+};
+
+static struct gpio_led v2v_dlb515_leds_gpio[] __initdata = {
+	{
+		.name		= "ligowave:green:power",
+		.gpio		= V2V_DLB515_GPIO_LED_PWR,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:green:lan",
+		.gpio		= V2V_DLB515_GPIO_LED_LAN,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssilow",
+		.gpio		= V2V_DLB515_GPIO_LED_RSSI_LOW,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssimedlo",
+		.gpio		= V2V_DLB515_GPIO_LED_RSSI_MEDLO,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssimedhi",
+		.gpio		= V2V_DLB515_GPIO_LED_RSSI_MEDHI,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssihigh",
+		.gpio		= V2V_DLB515_GPIO_LED_RSSI_HIGH,
+		.active_low	= 1,
+	},
+};
+
+static struct gpio_led v2v_dlb520_leds_gpio[] __initdata = {
+	{
+		.name		= "ligowave:green:power",
+		.gpio		= V2V_DLB520_GPIO_LED_PWR,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:green:lan",
+		.gpio		= V2V_DLB520_GPIO_LED_LAN,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssilow",
+		.gpio		= V2V_DLB520_GPIO_LED_RSSI_LOW,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssimedlo",
+		.gpio		= V2V_DLB520_GPIO_LED_RSSI_MEDLO,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssimedhi",
+		.gpio		= V2V_DLB520_GPIO_LED_RSSI_MEDHI,
+		.active_low	= 1,
+	},
+	{
+		.name		= "ligowave:yellow:rssihigh",
+		.gpio		= V2V_DLB520_GPIO_LED_RSSI_HIGH,
+		.active_low	= 1,
+	},
+};
+
+
+static void __init v2v_dlb_common_setup(void)
+{
+	u8 *wifi_mac = (u8 *) KSEG1ADDR(0x1fff1002);
+	u8 *eth_mac = (u8 *) KSEG1ADDR(0x1fff0000);
+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+	ath79_register_gpio_keys_polled(-1, V2V_DLB5XX_KEYS_POLL_INTERVAL,
+					 ARRAY_SIZE(v2v_dlb5xx_gpio_keys),
+					 v2v_dlb5xx_gpio_keys);
+
+	ath79_register_m25p80(NULL);
+
+	ath79_register_wmac(ee, wifi_mac);
+
+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 |
+				   AR934X_ETH_CFG_MII_GMAC0_SLAVE);
+
+	ath79_register_mdio(1, 0x0);
+	ath79_register_mdio(0, 0x0);
+
+	ath79_init_mac(ath79_eth0_data.mac_addr, eth_mac, 0);
+
+	/* GMAC0 is connected to an AR8032 PHY */
+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+	ath79_eth0_data.phy_mask = BIT(0);
+	ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+	ath79_register_eth(0);
+}
+
+static void __init v2v_dlb515_setup(void)
+{
+	v2v_dlb_common_setup();
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(v2v_dlb515_leds_gpio),
+				 v2v_dlb515_leds_gpio);
+}
+
+static void __init v2v_dlb520_setup(void)
+{
+	v2v_dlb_common_setup();
+	ath79_register_leds_gpio(-1, ARRAY_SIZE(v2v_dlb520_leds_gpio),
+				 v2v_dlb520_leds_gpio);
+}
+
+MIPS_MACHINE(ATH79_MACH_V2V_DLB515, "V2V-DLB515",
+	     "LigoDLB 5-15", v2v_dlb515_setup);
+
+MIPS_MACHINE(ATH79_MACH_V2V_DLB520, "V2V-DLB520",
+	     "LigoDLB 5-20", v2v_dlb520_setup);
diff --git a/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-ligodlb-support.patch b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-ligodlb-support.patch
new file mode 100644
index 0000000..6e7aa62
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/814-MIPS-ath79-add-ligodlb-support.patch
@@ -0,0 +1,41 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -1244,6 +1244,17 @@ config ATH79_MACH_WEIO
+ 	select ATH79_DEV_USB
+ 	select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_V2V_DLB5XX
++	bool "LigoWave LigoDLB 5-XX"
++	select SOC_AR934X
++	select ATH79_DEV_AP9X_PCI if PCI
++	select ATH79_DEV_ETH
++	select ATH79_DEV_GPIO_BUTTONS
++	select ATH79_DEV_LEDS_GPIO
++	select ATH79_DEV_M25P80
++	select ATH79_DEV_USB
++	select ATH79_DEV_WMAC
++
+ config ATH79_MACH_MYNET_N600
+ 	bool "WD My Net N600 board support"
+ 	select SOC_AR934X
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -146,6 +146,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3)	+=
+ obj-$(CONFIG_ATH79_MACH_TUBE2H)		+= mach-tube2h.o
+ obj-$(CONFIG_ATH79_MACH_UBNT)		+= mach-ubnt.o
+ obj-$(CONFIG_ATH79_MACH_UBNT_XM)	+= mach-ubnt-xm.o
++obj-$(CONFIG_ATH79_MACH_V2V_DLB5XX)	+= mach-v2v-dlb5xx.o
+ obj-$(CONFIG_ATH79_MACH_WEIO)		+= mach-weio.o
+ obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N)	+= mach-whr-hp-g300n.o
+ obj-$(CONFIG_ATH79_MACH_WLAE_AG300N)	+= mach-wlae-ag300n.o
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -192,6 +192,8 @@ enum ath79_mach_type {
+ 	ATH79_MACH_UBNT_UNIFI_OUTDOOR,	/* Ubiquiti UnifiAP Outdoor */
+ 	ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
+ 	ATH79_MACH_UBNT_XM,		/* Ubiquiti Networks XM board rev 1.0 */
++	ATH79_MACH_V2V_DLB515,		/* LigoWave LigoDLB 5-15 */
++	ATH79_MACH_V2V_DLB520,		/* LigoWave LigoDLB 5-20 */
+ 	ATH79_MACH_WEIO,			/* WeIO board */
+ 	ATH79_MACH_WHR_G301N,		/* Buffalo WHR-G301N */
+ 	ATH79_MACH_WHR_HP_G300N,	/* Buffalo WHR-HP-G300N */
-- 
2.6.0


--45Z9DzgjV8m4Oswq
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-ar71xx-add-user-space-support-for-LigoDLB-series.patch"



More information about the Battlemesh mailing list