ar71xx: add support for the devolo dLAN pro 500 Wireless+

Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>

SVN-Revision: 46338
This commit is contained in:
John Crispin 2015-07-14 07:32:33 +00:00
parent a06c1c810e
commit 02984a6e09
10 changed files with 279 additions and 6 deletions

View file

@ -75,6 +75,9 @@ get_status_led() {
dir-835-a1)
status_led="d-link:amber:power"
;;
dlan-pro-500-wp)
status_led="devolo:green:wlan-2g"
;;
dragino2)
status_led="dragino2:red:system"
;;

View file

@ -173,6 +173,13 @@ dir-825-c1)
ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:blue:wlan2g" "phy0tpt"
;;
dlan-pro-500-wp)
ucidef_set_led_default "power" "System Power" "devolo:green:status" "1"
ucidef_set_led_netdev "lan" "Ethernet Activity" "devolo:green:eth" "br-lan"
ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "devolo:green:wlan-2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
;;
gl-inet)
ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"

View file

@ -301,6 +301,10 @@ esr900)
[ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
;;
dlan-pro-500-wp)
ucidef_set_interface_lan "eth0 eth1"
;;
all0305 |\
aw-nr580 |\
bullet-m |\

View file

@ -423,6 +423,9 @@ ar71xx_board_detect() {
*"DIR-835 rev. A1")
name="dir-835-a1"
;;
*"dLAN pro 500 Wireless+")
name="dlan-pro-500-wp"
;;
*"Dragino v2")
name="dragino2"
;;

View file

@ -208,6 +208,7 @@ platform_check_image() {
dir-615-i1 | \
dir-825-c1 | \
dir-835-a1 | \
dlan-pro-500-wp | \
dragino2 | \
epg5000 | \
esr1750 | \

View file

@ -56,6 +56,7 @@ CONFIG_ATH79_MACH_DIR_615_C1=y
CONFIG_ATH79_MACH_DIR_615_I1=y
CONFIG_ATH79_MACH_DIR_825_B1=y
CONFIG_ATH79_MACH_DIR_825_C1=y
CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
CONFIG_ATH79_MACH_DRAGINO2=y
CONFIG_ATH79_MACH_EAP300V2=y
CONFIG_ATH79_MACH_EAP7660D=y

View file

@ -0,0 +1,203 @@
/*
* devolo dLAN pro 500 Wireless+ support
*
* Copyright (c) 2013-2015 devolo AG
* Copyright (c) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#include <linux/pci.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/ath9k_platform.h>
#include <linux/ar8216_platform.h>
#include <linux/gpio.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 DLAN_PRO_500_WP_GPIO_DLAN_POWER_ENABLE 13
#define DLAN_PRO_500_WP_GPIO_DLAN_LED_ENABLE 17
#define DLAN_PRO_500_WP_GPIO_LED_WLAN_5G 11
#define DLAN_PRO_500_WP_GPIO_LED_WLAN_2G 12
#define DLAN_PRO_500_WP_GPIO_LED_STATUS 16
#define DLAN_PRO_500_WP_GPIO_LED_ETH 14
#define DLAN_PRO_500_WP_GPIO_BTN_WPS 20
#define DLAN_PRO_500_WP_GPIO_BTN_WLAN 22
#define DLAN_PRO_500_WP_GPIO_BTN_DLAN 21
#define DLAN_PRO_500_WP_GPIO_BTN_RESET 4
#define DLAN_PRO_500_WP_KEYS_POLL_INTERVAL 20 /* msecs */
#define DLAN_PRO_500_WP_KEYS_DEBOUNCE_INTERVAL (3 * DLAN_PRO_500_WP_KEYS_POLL_INTERVAL)
#define DLAN_PRO_500_WP_ART_ADDRESS 0x1fff0000
#define DLAN_PRO_500_WP_CALDATA_OFFSET 0x1000
#define DLAN_PRO_500_WP_MAC_ADDRESS_OFFSET 0x1002
#define DLAN_PRO_500_WP_PCIE_CALDATA_OFFSET 0x5000
static struct gpio_led dlan_pro_500_wp_leds_gpio[] __initdata = {
{
.name = "devolo:green:status",
.gpio = DLAN_PRO_500_WP_GPIO_LED_STATUS,
.active_low = 1,
},
{
.name = "devolo:green:eth",
.gpio = DLAN_PRO_500_WP_GPIO_LED_ETH,
.active_low = 1,
},
{
.name = "devolo:blue:wlan-5g",
.gpio = DLAN_PRO_500_WP_GPIO_LED_WLAN_5G,
.active_low = 1,
},
{
.name = "devolo:green:wlan-2g",
.gpio = DLAN_PRO_500_WP_GPIO_LED_WLAN_2G,
.active_low = 1,
}
};
static struct gpio_keys_button dlan_pro_500_wp_gpio_keys[] __initdata = {
{
.desc = "dLAN button",
.type = EV_KEY,
.code = BTN_0,
.debounce_interval = DLAN_PRO_500_WP_KEYS_DEBOUNCE_INTERVAL,
.gpio = DLAN_PRO_500_WP_GPIO_BTN_DLAN,
.active_low = 0,
},
{
.desc = "WPS button",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
.debounce_interval = DLAN_PRO_500_WP_KEYS_DEBOUNCE_INTERVAL,
.gpio = DLAN_PRO_500_WP_GPIO_BTN_WPS,
.active_low = 0,
},
{
.desc = "WLAN button",
.type = EV_KEY,
.code = BTN_2,
.debounce_interval = DLAN_PRO_500_WP_KEYS_DEBOUNCE_INTERVAL,
.gpio = DLAN_PRO_500_WP_GPIO_BTN_WLAN,
.active_low = 1,
},
{
.desc = "Reset button",
.type = EV_KEY,
.code = KEY_RESTART,
.debounce_interval = DLAN_PRO_500_WP_KEYS_DEBOUNCE_INTERVAL,
.gpio = DLAN_PRO_500_WP_GPIO_BTN_RESET,
.active_low = 1,
}
};
static struct ar8327_pad_cfg dlan_pro_500_wp_ar8327_pad0_cfg = {
.mode = AR8327_PAD_PHY_RGMII,
.txclk_delay_en = false,
.rxclk_delay_en = false,
.txclk_delay_sel = AR8327_CLK_DELAY_SEL0,
.rxclk_delay_sel = AR8327_CLK_DELAY_SEL0,
};
static struct ar8327_led_cfg dlan_pro_500_wp_ar8327_led_cfg = {
.led_ctrl0 = 0x00000000,
.led_ctrl1 = 0xc737c737,
.led_ctrl2 = 0x00000000,
.led_ctrl3 = 0x00c30c00,
.open_drain = true,
};
static struct ar8327_platform_data dlan_pro_500_wp_ar8327_data = {
.pad0_cfg = &dlan_pro_500_wp_ar8327_pad0_cfg,
.port0_cfg = {
.force_link = 1,
.speed = AR8327_PORT_SPEED_1000,
.duplex = 1,
.txpause = 0,
.rxpause = 0,
},
.led_cfg = &dlan_pro_500_wp_ar8327_led_cfg,
};
static struct mdio_board_info dlan_pro_500_wp_mdio0_info[] = {
{
.bus_id = "ag71xx-mdio.0",
.phy_addr = 0,
.platform_data = &dlan_pro_500_wp_ar8327_data,
},
};
static void __init dlan_pro_500_wp_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(DLAN_PRO_500_WP_ART_ADDRESS);
u8 *cal = art + DLAN_PRO_500_WP_CALDATA_OFFSET;
u8 *wifi_mac = art + DLAN_PRO_500_WP_MAC_ADDRESS_OFFSET;
ath79_register_m25p80(NULL);
ath79_register_leds_gpio(-1, ARRAY_SIZE(dlan_pro_500_wp_leds_gpio),
dlan_pro_500_wp_leds_gpio);
ath79_register_gpio_keys_polled(-1, DLAN_PRO_500_WP_KEYS_POLL_INTERVAL,
ARRAY_SIZE(dlan_pro_500_wp_gpio_keys),
dlan_pro_500_wp_gpio_keys);
gpio_request_one(DLAN_PRO_500_WP_GPIO_DLAN_POWER_ENABLE,
GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED,
"PLC power");
gpio_request_one(DLAN_PRO_500_WP_GPIO_DLAN_LED_ENABLE,
GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED,
"PLC LEDs");
ath79_register_wmac(cal, wifi_mac);
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
ath79_register_mdio(1, 0x0);
ath79_register_mdio(0, 0x0);
mdiobus_register_board_info(dlan_pro_500_wp_mdio0_info,
ARRAY_SIZE(dlan_pro_500_wp_mdio0_info));
/* GMAC0 is connected to a AR7400 PLC in PHY mode */
ath79_init_mac(ath79_eth0_data.mac_addr, wifi_mac, 2);
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth0_pll_data.pll_1000 = 0x0e000000;
ath79_eth0_data.speed = SPEED_1000;
ath79_eth0_data.duplex = DUPLEX_FULL;
ath79_register_eth(0);
/* GMAC1 is connected to the internal switch */
ath79_init_mac(ath79_eth1_data.mac_addr, wifi_mac, 1);
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
ath79_eth1_data.speed = SPEED_1000;
ath79_eth1_data.duplex = DUPLEX_FULL;
ath79_register_eth(1);
}
MIPS_MACHINE(ATH79_MACH_DLAN_PRO_500_WP, "dLAN-pro-500-wp", "devolo dLAN pro 500 Wireless+",
dlan_pro_500_wp_setup);

View file

@ -0,0 +1,19 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/dLAN_pro_500_wp
NAME:=devolo dLAN pro 500 Wireless+
PACKAGES:=open-plc-utils open-plc-utils-chkpib open-plc-utils-getpib open-plc-utils-modpib \
open-plc-utils-setpib open-plc-utils-hpavkey open-plc-utils-amphost \
open-plc-utils-plctool open-plc-utils-pibdump open-plc-utils-plcstat \
ebtables hostapd-utils wifitoggle wpad
endef
define Profile/dLAN_pro_500_wp/Description
Package set optimized for the devolo dLAN pro 500 Wireless+.
endef
$(eval $(call Profile,dLAN_pro_500_wp))

View file

@ -1185,6 +1185,7 @@ cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-
eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
dlan_pro_500_wp_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,1152k@0x70000(kernel),6528k(rootfs),7680k@0x70000(firmware),64k(art)ro
cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)
esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
@ -1402,6 +1403,22 @@ Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap12
Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
define Image/Build/dLAN
$(eval fwsize=$(call mtdpartsize,firmware,$(4)))
$(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
$(eval kernsize=$(call mtdpartsize,kernel,$(4)))
$(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
if [ -e "$(call factoryname,$(1),$(2))" ]; then \
dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
dd if=$(KDIR)/root.$(1) \
of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
fi
endef
Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
define Image/Build/Ath
$(eval fwsize=$(call mtdpartsize,firmware,$(4)))
@ -2063,6 +2080,8 @@ $(eval $(call SingleProfile,CameoAP94,64kraw,DIR825B1,dir-825-b1,DIR-825-B1,ttyS
$(eval $(call SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
$(eval $(call SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS0,115200,$$(dlrtdev_mtdlayout),$$(dlrtdev_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
$(eval $(call SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout) root=31:5 mem=128M,KRuImage))
$(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
$(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
$(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))

View file

@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
@@ -16,22 +16,193 @@
@@ -16,22 +16,194 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@ -39,6 +39,7 @@
+ ATH79_MACH_DIR_825_B1, /* D-Link DIR-825 rev. B1 */
+ ATH79_MACH_DIR_825_C1, /* D-Link DIR-825 rev. C1 */
+ ATH79_MACH_DIR_835_A1, /* D-Link DIR-835 rev. A1 */
+ ATH79_MACH_DLAN_PRO_500_WP, /* devolo dLAN pro 500 Wireless+ */
+ ATH79_MACH_DRAGINO2, /* Dragino Version 2 */
+ ATH79_MACH_ESR900, /* EnGenius ESR900 */
+ ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */
@ -267,7 +268,7 @@
config ATH79_MACH_AP121
bool "Atheros AP121 reference board"
select SOC_AR933X
@@ -11,62 +75,1007 @@ config ATH79_MACH_AP121
@@ -11,62 +75,1018 @@ config ATH79_MACH_AP121
select ATH79_DEV_M25P80
select ATH79_DEV_USB
select ATH79_DEV_WMAC
@ -615,6 +616,17 @@
+ select ATH79_DEV_USB
+ select ATH79_DEV_WMAC
+
+config ATH79_MACH_DLAN_PRO_500_WP
+ bool "devolo dLAN pro 500 Wireless+ support"
+ select SOC_AR934X
+ select ATH79_DEV_ETH
+ select ATH79_DEV_GPIO_BUTTONS
+ select ATH79_DEV_LEDS_GPIO
+ select ATH79_DEV_SPI
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_WMAC
+ select ATH79_DEV_USB
+
+config ATH79_MACH_DRAGINO2
+ bool "DRAGINO V2 support"
+ select SOC_AR933X
@ -1303,7 +1315,7 @@
config ATH79_MACH_UBNT_XM
bool "Ubiquiti Networks XM/UniFi boards"
@@ -83,6 +1092,97 @@ config ATH79_MACH_UBNT_XM
@@ -83,6 +1103,97 @@ config ATH79_MACH_UBNT_XM
Say 'Y' here if you want your kernel to support the
Ubiquiti Networks XM (rev 1.0) board.
@ -1401,7 +1413,7 @@
endmenu
config SOC_AR71XX
@@ -124,7 +1224,10 @@ config ATH79_DEV_DSA
@@ -124,7 +1235,10 @@ config ATH79_DEV_DSA
config ATH79_DEV_ETH
def_bool n
@ -1413,7 +1425,7 @@
def_bool n
config ATH79_DEV_GPIO_BUTTONS
@@ -154,6 +1257,11 @@ config ATH79_PCI_ATH9K_FIXUP
@@ -154,6 +1268,11 @@ config ATH79_PCI_ATH9K_FIXUP
def_bool n
config ATH79_ROUTERBOOT
@ -1427,7 +1439,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
@@ -38,9 +38,122 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
@@ -38,9 +38,123 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
@ -1448,6 +1460,7 @@
+obj-$(CONFIG_ATH79_MACH_CAP4200AG) += mach-cap4200ag.o
+obj-$(CONFIG_ATH79_MACH_CPE510) += mach-cpe510.o
obj-$(CONFIG_ATH79_MACH_DB120) += mach-db120.o
+obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP) += mach-dlan-pro-500-wp.o
+obj-$(CONFIG_ATH79_MACH_DGL_5500_A1) += mach-dgl-5500-a1.o
+obj-$(CONFIG_ATH79_MACH_DHP_1565_A1) += mach-dhp-1565-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_505_A1) += mach-dir-505-a1.o