Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
- index e5a943374f..b353f82397 100755
- --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
- +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
- @@ -145,6 +145,7 @@ ar71xx_setup_interfaces()
- gl-inet|\
- gl-mifi|\
- jwap003|\
- + minibox-v3|\
- om2p-hsv4|\
- om2pv4|\
- pb42|\
- diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
- index 5ef620b861..2ed6dd3c14 100644
- --- a/target/linux/ar71xx/base-files/etc/diag.sh
- +++ b/target/linux/ar71xx/base-files/etc/diag.sh
- @@ -25,6 +25,7 @@ get_status_led() {
- antminer-r1|\
- eap120|\
- minibox-v1|\
- + minibox-v3|\
- som9331|\
- sr3200|\
- tl-wr802n-v2|\
- diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
- index 99035632e6..251010f747 100755
- --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
- +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
- @@ -287,11 +287,17 @@ tplink_board_detect() {
- "360000"*)
- model="TP-Link TL-WDR3600"
- ;;
- - "3C0001"*)
- + "3c0001"*)
- model="OOLITE"
- +
- + [ "$hwid" = "3c00010c" -a "$mid" = "00000001" ] && {
- + model="MINIBOX_V3"
- + hwver=""
- + }
- ;;
- - "3C0002"*)
- + "3c0002"*)
- model="MINIBOX_V1"
- + hwver=""
- ;;
- "430000"*)
- model="TP-Link TL-WDR4300"
- @@ -720,6 +726,9 @@ ar71xx_board_detect() {
- *"MiniBox V1.0")
- name="minibox-v1"
- ;;
- + *"MiniBox V3")
- + name="minibox-v3"
- + ;;
- *"MR12")
- name="mr12"
- ;;
- diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
- index 18e5e41dd0..bfb0968606 100755
- --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
- +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
- @@ -387,6 +387,7 @@ platform_check_image() {
- gl-inet|\
- mc-mac1200r|\
- minibox-v1|\
- + minibox-v3|\
- omy-g1|\
- omy-x1|\
- onion-omega|\
- @@ -456,6 +457,7 @@ platform_check_image() {
- tl-wr941nd|\
- tl-wr941nd-v5|\
- tl-wr941nd-v6)
- +
- local magic_ver="0100"
- case "$board" in
- diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
- index 4793bf4deb..3c5a9ea33b 100644
- --- a/target/linux/ar71xx/config-4.4
- +++ b/target/linux/ar71xx/config-4.4
- @@ -119,6 +119,7 @@ CONFIG_ATH79_MACH_GL_INET=y
- CONFIG_ATH79_MACH_GL_MIFI=y
- CONFIG_ATH79_MACH_GL_USB150=y
- CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
- +CONFIG_ATH79_MACH_GS_MINIBOX_V3=y
- CONFIG_ATH79_MACH_GS_OOLITE=y
- # CONFIG_ATH79_MACH_HIVEAP_121 is not set
- CONFIG_ATH79_MACH_HIWIFI_HC6361=y
- diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
- index 84b2a0b72b..d299efafd6 100644
- --- a/target/linux/ar71xx/config-4.9
- +++ b/target/linux/ar71xx/config-4.9
- @@ -117,6 +117,7 @@ CONFIG_ATH79_MACH_GL_INET=y
- CONFIG_ATH79_MACH_GL_MIFI=y
- CONFIG_ATH79_MACH_GL_USB150=y
- CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
- +CONFIG_ATH79_MACH_GS_MINIBOX_V3=y
- CONFIG_ATH79_MACH_GS_OOLITE=y
- # CONFIG_ATH79_MACH_HIVEAP_121 is not set
- CONFIG_ATH79_MACH_HIWIFI_HC6361=y
- @@ -221,8 +222,8 @@ CONFIG_ATH79_MACH_UBNT=y
- CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
- CONFIG_ATH79_MACH_UBNT_XM=y
- CONFIG_ATH79_MACH_WEIO=y
- -# CONFIG_ATH79_MACH_WI2A_AC200I is not set
- CONFIG_ATH79_MACH_WHR_HP_G300N=y
- +# CONFIG_ATH79_MACH_WI2A_AC200I is not set
- CONFIG_ATH79_MACH_WLAE_AG300N=y
- CONFIG_ATH79_MACH_WLR8100=y
- CONFIG_ATH79_MACH_WNDAP360=y
- @@ -431,13 +432,24 @@ CONFIG_OF_NET=y
- CONFIG_OF_PCI=y
- CONFIG_OF_PCI_IRQ=y
- CONFIG_PCI=y
- +CONFIG_PCIEAER=y
- +CONFIG_PCIEASPM=y
- +# CONFIG_PCIEASPM_DEBUG is not set
- +CONFIG_PCIEASPM_DEFAULT=y
- +# CONFIG_PCIEASPM_PERFORMANCE is not set
- +# CONFIG_PCIEASPM_POWERSAVE is not set
- +CONFIG_PCIEPORTBUS=y
- +CONFIG_PCIE_DPC=y
- +CONFIG_PCIE_PTM=y
- CONFIG_PCI_AR724X=y
- CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
- CONFIG_PCI_DOMAINS=y
- CONFIG_PCI_DRIVERS_LEGACY=y
- +CONFIG_PCI_REALLOC_ENABLE_AUTO=y
- CONFIG_PERF_USE_VMALLOC=y
- CONFIG_PGTABLE_LEVELS=2
- CONFIG_PHYLIB=y
- +CONFIG_RAS=y
- CONFIG_RATIONAL=y
- # CONFIG_RCU_STALL_COMMON is not set
- CONFIG_RTL8306_PHY=y
- diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
- index 5cb4f7ed3e..19810a7a0f 100644
- --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
- +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
- @@ -825,6 +825,17 @@ config ATH79_MACH_GS_MINIBOX_V1
- select ATH79_DEV_USB
- select ATH79_DEV_WMAC
- +config ATH79_MACH_GS_MINIBOX_V3
- + bool "Gainstrong Minibox V3 support"
- + select SOC_QCA953X
- + select ATH79_DEV_GPIO_BUTTONS
- + select ATH79_DEV_LEDS_GPIO
- + select ATH79_DEV_SPI
- + select ATH79_DEV_USB
- + select ATH79_DEV_WMAC
- + select ATH79_DEV_ETH
- + select ATH79_DEV_M25P80
- +
- config ATH79_MACH_GS_OOLITE
- bool "GS Oolite V1 support"
- select SOC_AR933X
- diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
- index 7d12282baa..e225d3b7d2 100644
- --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
- +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
- @@ -125,6 +125,7 @@ obj-$(CONFIG_ATH79_MACH_GL_INET) += mach-gl-inet.o
- obj-$(CONFIG_ATH79_MACH_GL_MIFI) += mach-gl-mifi.o
- obj-$(CONFIG_ATH79_MACH_GL_USB150) += mach-gl-usb150.o
- obj-$(CONFIG_ATH79_MACH_GS_MINIBOX_V1) += mach-gs-minibox-v1.o
- +obj-$(CONFIG_ATH79_MACH_GS_MINIBOX_V3) += mach-gs-minibox-v3.o
- obj-$(CONFIG_ATH79_MACH_GS_OOLITE) += mach-gs-oolite.o
- obj-$(CONFIG_ATH79_MACH_HIVEAP_121) += mach-hiveap-121.o
- obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361) += mach-hiwifi-hc6361.o
- diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c
- index 123743b648..4517d10053 100644
- --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c
- +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c
- @@ -18,13 +18,18 @@
- *
- */
- +#include <linux/phy.h>
- +#include <linux/gpio.h>
- +#include <linux/pci.h>
- #include <linux/platform_device.h>
- #include <linux/ath9k_platform.h>
- #include <linux/ar8216_platform.h>
- +#include <asm/mach-ath79/ath79.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"
- @@ -33,6 +38,7 @@
- #include "dev-usb.h"
- #include "dev-wmac.h"
- #include "machtypes.h"
- +#include "pci.h"
- #define GS_MINIBOX_V3_GPIO_LED_STATUS 14
- #define GS_MINIBOX_V3_GPIO_BTN_RST 17
- @@ -53,7 +59,7 @@ static struct flash_platform_data gs_minibox_v3_flash_data = {
- static struct gpio_led gs_minibox_v3_leds_gpio[] __initdata = {
- {
- - .name = "minibox_v3:status",
- + .name = "minibox-v3:green:system",
- .gpio = GS_MINIBOX_V3_GPIO_LED_STATUS,
- .active_low = 1,
- },
- @@ -86,12 +92,13 @@ static void __init gs_minibox_v3_setup(void)
- ath79_register_m25p80(&gs_minibox_v3_flash_data);
- gs_minibox_v3_gpio_led_setup();
- - ath79_register_usb();
- + ath79_register_usb();
- - ath79_register_wmac(art + GS_MINIBOX_V3_WMAC_CALDATA_OFFSET, NULL);
- ath79_register_mdio(0, 0x0);
- ath79_register_mdio(1, 0x0);
- + ath79_register_wmac(art + GS_MINIBOX_V3_WMAC_CALDATA_OFFSET, NULL);
- +
- ath79_init_mac(ath79_eth0_data.mac_addr, art + GS_MINIBOX_V3_MAC0_OFFSET, 0);
- ath79_init_mac(ath79_eth1_data.mac_addr, art + GS_MINIBOX_V3_MAC1_OFFSET, 0);
- @@ -109,6 +116,8 @@ static void __init gs_minibox_v3_setup(void)
- ath79_switch_data.phy_poll_mask |= BIT(4);
- ath79_switch_data.phy4_mii_en = 1;
- ath79_register_eth(1);
- +
- + ath79_register_pci();
- }
- MIPS_MACHINE(ATH79_MACH_GS_MINIBOX_V3, "MINIBOX-V3", "Minibox V3",
- diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
- index 01472b679f..6d2a050c87 100644
- --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
- +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
- @@ -117,6 +117,7 @@ enum ath79_mach_type {
- ATH79_MACH_GL_MIFI, /* GL-MIFI support */
- ATH79_MACH_GL_USB150, /* GL.iNet GL-USB150 */
- ATH79_MACH_GS_MINIBOX_V1, /* Gainstrong MiniBox V1.0 */
- + ATH79_MACH_GS_MINIBOX_V3, /* Gainstrong MiniBox V3 */
- ATH79_MACH_GS_OOLITE, /* GS OOLITE V1.0 */
- ATH79_MACH_HIVEAP_121, /* Aerohive HiveAP-121*/
- ATH79_MACH_HIWIFI_HC6361, /* HiWiFi HC6361 */
- diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
- index 3c5fcc3f3c..6db8e61490 100644
- --- a/target/linux/ar71xx/image/generic.mk
- +++ b/target/linux/ar71xx/image/generic.mk
- @@ -608,6 +608,18 @@ define Device/minibox-v1
- endef
- TARGET_DEVICES += minibox-v1
- +define Device/minibox-v3
- + $(Device/tplink-16mlzma)
- + DEVICE_TITLE := Gainstrong MiniBox V3
- + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport \
- + kmod-ath10k ath10k-firmware-qca9887 -swconfig -uboot-envtools
- + BOARDNAME := MINIBOX-V3
- + DEVICE_PROFILE := MINIBOXV3
- + TPLINK_HWID := 0x3C00010C
- + CONSOLE := ttyATH0,115200
- +endef
- +TARGET_DEVICES += minibox-v3
- +
- define Device/omy-g1
- $(Device/tplink-16mlzma)
- DEVICE_TITLE := OMYlink OMY-G1
- diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
- index 42f9882bb2..4814671d54 100644
- --- a/target/linux/ar71xx/mikrotik/config-default
- +++ b/target/linux/ar71xx/mikrotik/config-default
- @@ -83,6 +83,7 @@
- # CONFIG_ATH79_MACH_GL_MIFI is not set
- # CONFIG_ATH79_MACH_GL_USB150 is not set
- # CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set
- +# CONFIG_ATH79_MACH_GS_MINIBOX_V3 is not set
- # CONFIG_ATH79_MACH_GS_OOLITE is not set
- # CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set
- # CONFIG_ATH79_MACH_HORNET_UB is not set
- diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
- index 340d64cab9..cf1032b67c 100644
- --- a/target/linux/ar71xx/nand/config-default
- +++ b/target/linux/ar71xx/nand/config-default
- @@ -84,6 +84,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
- # CONFIG_ATH79_MACH_GL_MIFI is not set
- # CONFIG_ATH79_MACH_GL_USB150 is not set
- # CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set
- +# CONFIG_ATH79_MACH_GS_MINIBOX_V3 is not set
- # CONFIG_ATH79_MACH_GS_OOLITE is not set
- CONFIG_ATH79_MACH_HIVEAP_121=y
- # CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set
- diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c
- new file mode 100644
- index 0000000000..123743b648
- --- /dev/null
- +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-minibox-v3.c
- @@ -0,0 +1,115 @@
- +/*
- + * Atheros GS_MINIBOX_V3 reference board support
- + *
- + * Copyright (c) 2013 The Linux Foundation. All rights reserved.
- + * Copyright (c) 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/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"
- +
- +#define GS_MINIBOX_V3_GPIO_LED_STATUS 14
- +#define GS_MINIBOX_V3_GPIO_BTN_RST 17
- +#define GS_MINIBOX_V3_KEYS_POLL_INTERVAL 20 /* msecs */
- +#define GS_MINIBOX_V3_KEYS_DEBOUNCE_INTERVAL (3 * GS_MINIBOX_V3_KEYS_POLL_INTERVAL)
- +#define GS_MINIBOX_V3_MAC0_OFFSET 0
- +#define GS_MINIBOX_V3_MAC1_OFFSET 6
- +#define GS_MINIBOX_V3_WMAC_CALDATA_OFFSET 0x1000
- +
- +static const char *gs_minibox_v3_part_probes[] = {
- + "tp-link",
- + NULL,
- +};
- +
- +static struct flash_platform_data gs_minibox_v3_flash_data = {
- + .part_probes = gs_minibox_v3_part_probes,
- +};
- +
- +static struct gpio_led gs_minibox_v3_leds_gpio[] __initdata = {
- + {
- + .name = "minibox_v3:status",
- + .gpio = GS_MINIBOX_V3_GPIO_LED_STATUS,
- + .active_low = 1,
- + },
- +};
- +
- +static struct gpio_keys_button gs_minibox_v3_gpio_keys[] __initdata = {
- + {
- + .desc = "reset button",
- + .type = EV_KEY,
- + .code = KEY_RESTART,
- + .debounce_interval = GS_MINIBOX_V3_KEYS_DEBOUNCE_INTERVAL,
- + .gpio = GS_MINIBOX_V3_GPIO_BTN_RST,
- + .active_low = 1,
- + },
- +};
- +
- +static void __init gs_minibox_v3_gpio_led_setup(void)
- +{
- + ath79_register_leds_gpio(-1, ARRAY_SIZE(gs_minibox_v3_leds_gpio),
- + gs_minibox_v3_leds_gpio);
- + ath79_register_gpio_keys_polled(-1, GS_MINIBOX_V3_KEYS_POLL_INTERVAL,
- + ARRAY_SIZE(gs_minibox_v3_gpio_keys),
- + gs_minibox_v3_gpio_keys);
- +}
- +
- +static void __init gs_minibox_v3_setup(void)
- +{
- + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- +
- + ath79_register_m25p80(&gs_minibox_v3_flash_data);
- + gs_minibox_v3_gpio_led_setup();
- +
- + ath79_register_usb();
- +
- + ath79_register_wmac(art + GS_MINIBOX_V3_WMAC_CALDATA_OFFSET, NULL);
- + ath79_register_mdio(0, 0x0);
- + ath79_register_mdio(1, 0x0);
- +
- + ath79_init_mac(ath79_eth0_data.mac_addr, art + GS_MINIBOX_V3_MAC0_OFFSET, 0);
- + ath79_init_mac(ath79_eth1_data.mac_addr, art + GS_MINIBOX_V3_MAC1_OFFSET, 0);
- +
- + /* 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_GS_MINIBOX_V3, "MINIBOX-V3", "Minibox V3",
- + gs_minibox_v3_setup);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement