ar71xx: add support for Zbtlink ZBT-WE1526

Zbtlink ZBT-WE1526 is based on Qualcomm Atheros QCA9531 v2.
Short specification:

- 650/400/200 MHz (CPU/DDR/AHB)
- 5x 10/100 Mbps Ethernet
- 1x USB 2.0
- 128 MB of RAM (DDR2)
- 16 MB of FLASH
- 2T2R 2.4 GHz, up to 22 dBm
- two external, non-detachable antennas
- 8x LED, 1x button
- UART header (pinout: VCC, RX, TX, GND)

Flash instruction:

Use sysupgrade in vendor firmare which is based on OpenWrt.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
This commit is contained in:
Piotr Dymacz 2016-08-18 00:05:03 +02:00 committed by John Crispin
parent 57ef81d78f
commit f478fba663
12 changed files with 191 additions and 1 deletions

View File

@ -813,6 +813,15 @@ wzr-hp-g300nh)
ucidef_set_led_usbdev "usb" "USB" "buffalo:blue:usb" "1-1"
;;
zbt-we1526)
ucidef_set_led_netdev "wan" "WAN" "zbt-we1526:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "zbt-we1526:green:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "zbt-we1526:green:lan2" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "zbt-we1526:green:lan3" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "zbt-we1526:green:lan4" "switch0" "0x02"
ucidef_set_led_wlan "wlan" "WLAN" "zbt-we1526:green:wlan" "phy0tpt"
;;
zcn-1523h-2)
ucidef_set_led_netdev "lan1" "lan1" "zcn-1523h:green:lan1" "eth0"
;;

View File

@ -479,7 +479,8 @@ tl-wr842n-v3 |\
whr-g301n |\
whr-hp-g300n |\
whr-hp-gn |\
wzr-hp-ag300h)
wzr-hp-ag300h |\
zbt-we1526)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"

View File

@ -426,6 +426,9 @@ get_status_led() {
wrt160nl)
status_led="wrt160nl:blue:wps"
;;
zbt-we1526)
status_led="zbt-we1526:green:status"
;;
zcn-1523h-2 | zcn-1523h-5)
status_led="zcn-1523h:amber:init"
;;

View File

@ -1098,6 +1098,9 @@ ar71xx_board_detect() {
*WHR-HP-G300N)
name="whr-hp-g300n"
;;
*ZBT-WE1526)
name="zbt-we1526"
;;
*ZCN-1523H-2)
name="zcn-1523h-2"
;;

View File

@ -198,6 +198,7 @@ platform_check_image() {
mr12 | \
mr16 | \
wpj558 | \
zbt-we1526 | \
zcn-1523h-2 | \
zcn-1523h-5)
[ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {

View File

@ -201,6 +201,7 @@ CONFIG_ATH79_MACH_WZR_HP_AG300H=y
CONFIG_ATH79_MACH_WZR_HP_G300NH=y
CONFIG_ATH79_MACH_WZR_HP_G300NH2=y
CONFIG_ATH79_MACH_WZR_HP_G450H=y
CONFIG_ATH79_MACH_ZBT_WE1526=y
CONFIG_ATH79_MACH_ZCN_1523H=y
CONFIG_ATH79_NVRAM=y
CONFIG_ATH79_PCI_ATH9K_FIXUP=y

View File

@ -1552,6 +1552,16 @@ config ATH79_MACH_MYNET_REXT
select ATH79_DEV_WMAC
select ATH79_NVRAM
config ATH79_MACH_ZBT_WE1526
bool "Zbtlink ZBT-WE1526 board support"
select SOC_QCA953X
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_ZCN_1523H
bool "Zcomax ZCN-1523H support"
select SOC_AR724X

View File

@ -205,6 +205,7 @@ obj-$(CONFIG_ATH79_MACH_WZR_HP_G300NH2) += mach-wzr-hp-g300nh2.o
obj-$(CONFIG_ATH79_MACH_WZR_HP_AG300H) += mach-wzr-hp-ag300h.o
obj-$(CONFIG_ATH79_MACH_WZR_HP_G450H) += mach-wzr-hp-g450h.o
obj-$(CONFIG_ATH79_MACH_WZR_450HP2) += mach-wzr-450hp2.o
obj-$(CONFIG_ATH79_MACH_ZBT_WE1526) += mach-zbt-we1526.o
obj-$(CONFIG_ATH79_MACH_ZCN_1523H) += mach-zcn-1523h.o
obj-$(CONFIG_ATH79_MACH_CARAMBOLA2) += mach-carambola2.o
obj-$(CONFIG_ATH79_MACH_NBG6716) += mach-nbg6716.o

View File

@ -0,0 +1,153 @@
/*
* Zbtlink ZBT-WE1526 board support
*
* Copyright (C) 2016 Piotr Dymacz <pepe2k@gmail.com>
*
* Based on mach-dr531.c and mach-tl-wr841n-v9.c
*
* 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/gpio.h>
#include <linux/platform_device.h>
#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>
#include "common.h"
#include "dev-eth.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
#include "dev-usb.h"
#include "dev-wmac.h"
#include "machtypes.h"
#define ZBT_WE1526_GPIO_LED_STATUS 13
#define ZBT_WE1526_GPIO_LED_LAN1 16
#define ZBT_WE1526_GPIO_LED_LAN2 15
#define ZBT_WE1526_GPIO_LED_LAN3 14
#define ZBT_WE1526_GPIO_LED_LAN4 11
#define ZBT_WE1526_GPIO_LED_WAN 4
#define ZBT_WE1526_GPIO_LED_WLAN 12
#define ZBT_WE1526_GPIO_BTN_RESET 17
#define ZBT_WE1526_KEYS_POLL_INTERVAL 20 /* msecs */
#define ZBT_WE1526_KEYS_DEBOUNCE_INTERVAL \
(3 * ZBT_WE1526_KEYS_POLL_INTERVAL)
#define ZBT_WE1526_MAC0_OFFSET 0x0
#define ZBT_WE1526_MAC1_OFFSET 0x6
#define ZBT_WE1526_WMAC_CALDATA_OFFSET 0x1000
static struct gpio_led zbt_we1526_leds_gpio[] __initdata = {
{
.name = "zbt-we1526:green:status",
.gpio = ZBT_WE1526_GPIO_LED_STATUS,
.active_low = 1,
},
{
.name = "zbt-we1526:green:lan1",
.gpio = ZBT_WE1526_GPIO_LED_LAN1,
.active_low = 1,
},
{
.name = "zbt-we1526:green:lan2",
.gpio = ZBT_WE1526_GPIO_LED_LAN2,
.active_low = 1,
},
{
.name = "zbt-we1526:green:lan3",
.gpio = ZBT_WE1526_GPIO_LED_LAN3,
.active_low = 1,
},
{
.name = "zbt-we1526:green:lan4",
.gpio = ZBT_WE1526_GPIO_LED_LAN4,
.active_low = 1,
},
{
.name = "zbt-we1526:green:wan",
.gpio = ZBT_WE1526_GPIO_LED_WAN,
.active_low = 1,
},
{
.name = "zbt-we1526:green:wlan",
.gpio = ZBT_WE1526_GPIO_LED_WLAN,
.active_low = 1,
},
};
static struct gpio_keys_button zbt_we1526_gpio_keys[] __initdata = {
{
.desc = "reset",
.type = EV_KEY,
.code = KEY_RESTART,
.debounce_interval = ZBT_WE1526_KEYS_DEBOUNCE_INTERVAL,
.gpio = ZBT_WE1526_GPIO_BTN_RESET,
.active_low = 1,
},
};
static void __init zbt_we1526_gpio_setup(void)
{
/* For LED on GPIO4 */
ath79_gpio_function_disable(AR934X_GPIO_FUNC_CLK_OBS4_EN);
ath79_gpio_output_select(ZBT_WE1526_GPIO_LED_WAN, 0);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_STATUS, true);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_LAN1, true);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_LAN2, true);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_LAN3, true);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_LAN4, true);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_WAN, true);
ath79_gpio_direction_select(ZBT_WE1526_GPIO_LED_WLAN, true);
ath79_register_leds_gpio(-1, ARRAY_SIZE(zbt_we1526_leds_gpio),
zbt_we1526_leds_gpio);
ath79_register_gpio_keys_polled(-1, ZBT_WE1526_KEYS_POLL_INTERVAL,
ARRAY_SIZE(zbt_we1526_gpio_keys),
zbt_we1526_gpio_keys);
}
static void __init zbt_we1526_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
ath79_register_m25p80(NULL);
zbt_we1526_gpio_setup();
ath79_setup_ar933x_phy4_switch(false, false);
ath79_register_mdio(0, 0x0);
/* LAN */
ath79_eth1_data.duplex = DUPLEX_FULL;
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
ath79_switch_data.phy_poll_mask |= BIT(4);
ath79_init_mac(ath79_eth1_data.mac_addr,
art + ZBT_WE1526_MAC0_OFFSET, 0);
ath79_register_eth(1);
/* WAN */
ath79_switch_data.phy4_mii_en = 1;
ath79_eth0_data.duplex = DUPLEX_FULL;
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ath79_eth0_data.phy_mask = BIT(4);
ath79_eth0_data.speed = SPEED_100;
ath79_init_mac(ath79_eth0_data.mac_addr,
art + ZBT_WE1526_MAC1_OFFSET, 0);
ath79_register_eth(0);
ath79_register_wmac(art + ZBT_WE1526_WMAC_CALDATA_OFFSET, NULL);
ath79_register_usb();
}
MIPS_MACHINE(ATH79_MACH_ZBT_WE1526, "ZBT-WE1526", "Zbtlink ZBT-WE1526",
zbt_we1526_setup);

View File

@ -266,6 +266,7 @@ enum ath79_mach_type {
ATH79_MACH_WZR_HP_G300NH2, /* Buffalo WZR-HP-G300NH2 */
ATH79_MACH_WZR_HP_G450H, /* Buffalo WZR-HP-G450H */
ATH79_MACH_WZR_450HP2, /* Buffalo WZR-450HP2 */
ATH79_MACH_ZBT_WE1526, /* Zbtlink ZBT-WE1526 */
ATH79_MACH_ZCN_1523H_2, /* Zcomax ZCN-1523H-2-xx */
ATH79_MACH_ZCN_1523H_5, /* Zcomax ZCN-1523H-5-xx */
};

View File

@ -705,6 +705,12 @@ define LegacyDevice/WZR450HP2
endef
LEGACY_DEVICES += WZR450HP2
define LegacyDevice/ZBTWE1526
DEVICE_TITLE := Zbtlink ZBT-WE1526
DEVICE_PACKAGES := kmod-usb-core kmod-usb2
endef
LEGACY_DEVICES += ZBTWE1526
define LegacyDevice/ZCN1523H28
DEVICE_TITLE := Zcomax ZCN-1523H-2-8
endef

View File

@ -964,6 +964,7 @@ $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,11520
$(eval $(call SingleProfile,AthLzma,64k,WRTNODE2Q,wrtnode2q,WRTNODE2Q,ttyS0,115200,$$(wrtnode2q_mtdlayout),KRuImage))
$(eval $(call SingleProfile,AthLzma,64k,YUN_8M,yun-8M,Yun,ttyATH0,250000,$$(yun_mtdlayout_8M),RKuImage))
$(eval $(call SingleProfile,AthLzma,64k,YUN_16M,yun-16M,Yun,ttyATH0,250000,$$(yun_mtdlayout_16M),RKuImage))
$(eval $(call SingleProfile,AthLzma,64k,ZBTWE1526,zbt-we1526,ZBT-WE1526,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
$(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))