diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 0ed533dddb7d3db039071cfaab1f7876faa79c65..32d49318e60233e467620a300a89c36684884359 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -49,6 +49,11 @@ antrouter-r1) ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" ucidef_set_led_default "btc" "BTC" "$board:green:btc" "0" ;; +ap531b0|\ +sc1750|\ +sc450) + ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" + ;; archer-c59-v1|\ archer-c60-v1) ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x1E" @@ -490,10 +495,6 @@ re450) ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt" ;; -sc1750|\ -sc450) - ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" - ;; smart-300) ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 7987e51a671cebc5ce1b6df9168d2eb92b1da481..461d0daf4bf53d728bdd1c3e154631168721e87c 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -31,6 +31,7 @@ get_status_led() { status_led="$board:green:system" ;; ap132|\ + ap531b0|\ db120|\ dr344|\ tew-632brp|\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index ae0189d05b4dbb73f79d5c338a34f9db494595f7..4a0c85d631f9fae5971cda595ad4b87a3b4ec2c2 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -458,6 +458,9 @@ ar71xx_board_detect() { *"AP152 reference board") name="ap152" ;; + *AP531B0) + name="ap531b0" + ;; *AP90Q) name="ap90q" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 576ff6c06ccbc018a158900047b1da8d0bc2d997..f89ad2cda9579999481b76e7bdd69966d25d95a7 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -204,6 +204,7 @@ platform_check_image() { airgateway|\ airrouter|\ ap132|\ + ap531b0|\ ap90q|\ archer-c59-v1|\ archer-c60-v1|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 206ace62f730ab9295d718dfe0989eb25b4de05f..68b408a65b90b328c1a77c300872590fad9115af 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -47,6 +47,7 @@ CONFIG_ATH79_MACH_AP136=y CONFIG_ATH79_MACH_AP143=y CONFIG_ATH79_MACH_AP147=y CONFIG_ATH79_MACH_AP152=y +CONFIG_ATH79_MACH_AP531B0=y # CONFIG_ATH79_MACH_AP81 is not set CONFIG_ATH79_MACH_AP90Q=y CONFIG_ATH79_MACH_AP96=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 514d05d6dea4f3e817d1877ace8276486c033957..72f3591bbe72c777a2d9009e92f7bf4d40a48652 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -183,6 +183,18 @@ config ATH79_MACH_AP152 select ATH79_DEV_WMAC select ATH79_DEV_AP9X_PCI if PCI +config ATH79_MACH_AP531B0 + bool "Rockeetech AP531B0 support" + select SOC_QCA953X + 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_SPI + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_AP90Q bool "YunCore AP90Q support" select SOC_QCA953X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 64752591d5b17d18e6d886fe36cb684495ec85cc..73832448cd80ead9d820111f8439106e41770c8b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -53,6 +53,7 @@ obj-$(CONFIG_ATH79_MACH_AP136) += mach-ap136.o obj-$(CONFIG_ATH79_MACH_AP143) += mach-ap143.o obj-$(CONFIG_ATH79_MACH_AP147) += mach-ap147.o obj-$(CONFIG_ATH79_MACH_AP152) += mach-ap152.o +obj-$(CONFIG_ATH79_MACH_AP531B0) += mach-ap531b0.o obj-$(CONFIG_ATH79_MACH_AP90Q) += mach-ap90q.o obj-$(CONFIG_ATH79_MACH_AP96) += mach-ap96.o obj-$(CONFIG_ATH79_MACH_ARCHER_C59_V1) += mach-archer-c59-v1.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ap531b0.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap531b0.c new file mode 100644 index 0000000000000000000000000000000000000000..3cb26979556d868ca102adc442980365a7bd7b8a --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap531b0.c @@ -0,0 +1,112 @@ +/* + * Rockeetech AP531B0 11ng wireless AP board support + * + * Copyright (C) 2013 Gabor Juhos <juhosg@openwrt.org> + * Copyright (C) 2016 Shuanglin Liu <roboidler@gmail.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/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-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-spi.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "pci.h" +#include "dev-ap9x-pci.h" + +#define AP531B0_GPIO_LED_WLAN 12 +#define AP531B0_GPIO_LED_STATUS 11 + +#define AP531B0_GPIO_RST_BTN 17 + +#define AP531B0_KEYS_POLL_INTERVAL 20 /* msecs */ +#define AP531B0_KEYS_DEBOUNCE_INTERVAL (3 * AP531B0_KEYS_POLL_INTERVAL) + +#define AP531B0_WMAC_CALDATA_OFFSET 0x1000 + + +static struct gpio_led ap531b0_leds_gpio[] __initdata = { + { + .name = "ap531b0:green:status", + .gpio = AP531B0_GPIO_LED_STATUS, + .active_low = 1, + }, + { + .name = "ap531b0:green:wlan", + .gpio = AP531B0_GPIO_LED_WLAN, + .active_low = 1, + } +}; + +static struct gpio_keys_button ap531b0_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = AP531B0_KEYS_DEBOUNCE_INTERVAL, + .gpio = AP531B0_GPIO_RST_BTN, + .active_low = 1, + }, +}; + + +static void __init ap531b0_gpio_led_setup(void) +{ + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ap531b0_leds_gpio), + ap531b0_leds_gpio); + + ath79_register_gpio_keys_polled(-1, AP531B0_KEYS_POLL_INTERVAL, + ARRAY_SIZE(ap531b0_gpio_keys), + ap531b0_gpio_keys); +} + +static void __init ap531b0_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + u8 *pmac; + + ath79_register_m25p80(NULL); + ap531b0_gpio_led_setup(); + ath79_register_usb(); + ath79_register_pci(); + + ath79_register_mdio(0, 0x0); + + pmac = art + AP531B0_WMAC_CALDATA_OFFSET + 2; + ath79_init_mac(ath79_eth0_data.mac_addr, pmac, 1); + ath79_init_mac(ath79_eth1_data.mac_addr, pmac, 2); + + ath79_register_wmac(art + AP531B0_WMAC_CALDATA_OFFSET, pmac); + + /* WAN port */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(4); + ath79_register_eth(0); + + /* LAN ports */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_switch_data.phy4_mii_en = 1; + ath79_register_eth(1); +} + +MIPS_MACHINE(ATH79_MACH_AP531B0, "AP531B0", "Rockeetech AP531B0", + ap531b0_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 4cad6287a844978c2e93196b17f960ebf749292f..f3277cd2a07e7c2de92c394c705fa9f4b2ae67c8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -37,6 +37,7 @@ enum ath79_mach_type { ATH79_MACH_AP143, /* Atheros AP143 reference board */ ATH79_MACH_AP147_010, /* Atheros AP147-010 reference board */ ATH79_MACH_AP152, /* Atheros AP152 reference board */ + ATH79_MACH_AP531B0, /* Rockeetech AP531B0 */ ATH79_MACH_AP90Q, /* YunCore AP90Q */ ATH79_MACH_AP96, /* Atheros AP96 */ ATH79_MACH_ARCHER_C5, /* TP-LINK Archer C5 board */ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 02f074796e2a0bb9e2fc7d627afb5e0b631f6db3..34bb7da84d66bff1ab7bd1dcf770820d5d96aca6 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -1,3 +1,12 @@ +define Device/ap531b0 + DEVICE_TITLE := Rockeetech AP531B0 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME = AP531B0 + IMAGE_SIZE := 16000k + MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro +endef +TARGET_DEVICES += ap531b0 + define Device/ap90q DEVICE_TITLE := YunCore AP90Q BOARDNAME = AP90Q diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default index 733914983ef0220ff6332c05cc015b15e874bcc9..cf6f754c84906ea86c33ab427b2e3c44e2d4a591 100644 --- a/target/linux/ar71xx/mikrotik/config-default +++ b/target/linux/ar71xx/mikrotik/config-default @@ -13,6 +13,7 @@ # CONFIG_ATH79_MACH_AP143 is not set # CONFIG_ATH79_MACH_AP147 is not set # CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP90Q is not set # CONFIG_ATH79_MACH_AP96 is not set # CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index 14504a4b3cacb509994f07346a84117077949209..24e712c18b06f0d8c4e6eb9c903849069cd673f3 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -13,6 +13,7 @@ # CONFIG_ATH79_MACH_AP143 is not set # CONFIG_ATH79_MACH_AP147 is not set # CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP90Q is not set # CONFIG_ATH79_MACH_AP96 is not set # CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set