@@ -94,6 +94,10 @@ sercomm,h500-s-vfes)
telsey,cpva502plus)
ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0"
;;
+tplink,archer-vr400-v1)
+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0.2"
+ ucidef_set_led_usbdev "usb" "USB" "green:usb" "1-1"
+ ;;
esac
board_config_flush
@@ -159,6 +159,10 @@ sky,sr102)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:wan" "8t@eth0"
;;
+tplink,archer-vr400-v1)
+ ucidef_add_switch "switch0" \
+ "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "8t@eth0"
+ ;;
*)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
new file mode 100644
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Device Tree file for TP-Link Archer VR400 v1
+ *
+ * Copyright (C) 2022 Daniel González Cabanelas <dgcbueu@gmail.com>
+ * Copyright (C) 2022 Artemii Karavashkin <artem.sid.key@gmail.com>
+ */
+
+#include "bcm63268.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "TP-Link Archer VR400 v1";
+ compatible = "tplink,archer-vr400-v1", "brcm,bcm63167", "brcm,bcm63268";
+
+ aliases {
+ led-boot = &led_power_green;
+ led-failsafe = &led_power_green;
+ led-running = &led_power_green;
+ led-upgrade = &led_power_green;
+ };
+
+ chosen {
+ bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
+ stdout-path = "serial0:115200n8";
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ gpios = <&pinctrl 32 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ debounce-interval = <60>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&pinctrl 33 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_WPS_BUTTON>;
+ debounce-interval = <60>;
+ };
+
+ rfkill {
+ label = "rfkill";
+ gpios = <&pinctrl 35 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RFKILL>;
+ debounce-interval = <60>;
+ };
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ wifi2g_green {
+ label = "green:wifi2g";
+ gpios = <&pinctrl 36 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&leds {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_leds>;
+
+ usb_green {
+ reg = <1>;
+ active-low;
+ label = "green:usb";
+ };
+
+ wan_green {
+ reg = <8>;
+ active-low;
+ label = "green:wan";
+ };
+
+ ephy0_act {
+ reg = <9>;
+ brcm,hardware-controlled;
+ };
+
+ ephy1_act {
+ reg = <10>;
+ brcm,hardware-controlled;
+ };
+
+ ephy2_act {
+ reg = <11>;
+ brcm,hardware-controlled;
+ };
+
+ gphy0_act {
+ reg = <12>;
+ brcm,hardware-controlled;
+ };
+
+ wifi5g_green {
+ reg = <14>;
+ active-low;
+ label = "green:wifi5g";
+ };
+
+ led_power_green: power_green {
+ reg = <18>;
+ active-low;
+ label = "green:power";
+ default-state = "on";
+ };
+
+ dsl_green {
+ reg = <20>;
+ active-low;
+ label = "green:dsl";
+ };
+
+ wps_green {
+ reg = <22>;
+ active-low;
+ label = "green:wps";
+ };
+};
+
+&hsspi {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ spi-max-frequency = <20000000>;
+ spi-tx-bus-width = <2>;
+ spi-rx-bus-width = <2>;
+ reg = <0>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cfe@0 {
+ reg = <0x000000 0x020000>;
+ label = "cfe";
+ read-only;
+ };
+
+ linux@20000 {
+ reg = <0x020000 0xfa0000>;
+ label = "linux";
+ compatible = "tplink,firmware";
+ };
+
+ nvram@fc0000 {
+ reg = <0xfc0000 0x040000>;
+ label = "nvram";
+ };
+ };
+ };
+};
+
+&pinctrl {
+ pinctrl_leds: leds {
+ function = "led";
+ pins = "gpio1", "gpio8",
+ "gpio9", "gpio10",
+ "gpio11", "gpio12",
+ "gpio14", "gpio18",
+ "gpio20", "gpio22";
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
@@ -1219,6 +1219,20 @@ endef
TARGET_DEVICES += telsey_magic
### TP-Link ###
+define Device/tplink_archer-vr400-v1
+ $(Device/bcm63xx_tplink)
+ DEVICE_MODEL := Archer VR400
+ DEVICE_VARIANT := v1
+ TPLINK_HWID := 0x491dfa01
+ TPLINK_HWREV := 0x70
+ TPLINK_HWREVADD := 0x0
+ TPLINK_FLASHLAYOUT := 16Mqca
+ CHIP_ID := 63167
+ CFE_BIN_FILE := tplink,archer-vr400-v1/cfe63268.bin
+ DEVICE_PACKAGES := $(USB2_PACKAGES)
+endef
+TARGET_DEVICES += tplink_archer-vr400-v1
+
define Device/tp-link_td-w8900gb
$(Device/bcm63xx-legacy)
DEVICE_VENDOR := TP-Link
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -2697,6 +2697,273 @@ static struct board_info __initdata boar
+@@ -2697,6 +2697,317 @@ static struct board_info __initdata boar
#endif /* CONFIG_BCM63XX_CPU_6368 */
/*
@@ -227,6 +227,50 @@
+ },
+};
+
++static struct board_info __initdata board_VR400 = {
++ .name = "963167TP",
++ .expected_cpu_id = 0x63268,
++
++ .has_pci = 1,
++ .has_ohci0 = 1,
++ .has_ehci0 = 1,
++ .num_usbh_ports = 1,
++
++ .has_enetsw = 1,
++ .enetsw = {
++ .used_ports = {
++ [0] = {
++ .used = 1,
++ .phy_id = 1,
++ .name = "LAN3",
++ },
++ [1] = {
++ .used = 1,
++ .phy_id = 2,
++ .name = "LAN2",
++ },
++ [2] = {
++ .used = 1,
++ .phy_id = 3,
++ .name = "LAN1",
++ },
++ [3] = {
++ .used = 1,
++ .phy_id = 4,
++ .name = "LAN4/WAN",
++ },
++ },
++ },
++
++ .use_fallback_sprom = 1,
++ .fallback_sprom = {
++ /* BCM4352 not supported */
++ //.type = SPROM_BCM4352,
++ .pci_bus = 1,
++ .pci_dev = 0,
++ },
++};
++
+static struct board_info __initdata board_vw6339gu = {
+ .name = "VW6339GU",
+ .expected_cpu_id = 0x63268,
@@ -274,7 +318,7 @@
* all boards
*/
static const struct board_info __initconst *bcm963xx_boards[] = {
-@@ -2801,6 +3068,15 @@ static const struct board_info __initcon
+@@ -2801,6 +3112,16 @@ static const struct board_info __initcon
&board_VR3026e,
&board_WAP5813n,
#endif /* CONFIG_BCM63XX_CPU_6368 */
@@ -285,12 +329,13 @@
+ &board_H500s,
+ &board_VG8050,
+ &board_VR3032u,
++ &board_VR400,
+ &board_vw6339gu,
+#endif /* CONFIG_BCM63XX_CPU_63268 */
};
static struct of_device_id const bcm963xx_boards_dt[] = {
-@@ -2918,6 +3194,14 @@ static struct of_device_id const bcm963x
+@@ -2918,6 +3239,15 @@ static struct of_device_id const bcm963x
{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
#endif /* CONFIG_BCM63XX_CPU_6368 */
#ifdef CONFIG_BCM63XX_CPU_63268
@@ -302,6 +347,7 @@
+ { .compatible = "sercomm,h500-s-lowi", .data = &board_H500s, },
+ { .compatible = "sercomm,h500-s-vfes", .data = &board_H500s, },
+ { .compatible = "sky,sr102", .data = &board_BSKYB_63168, },
++ { .compatible = "tplink,archer-vr400-v1", .data = &board_VR400, },
#endif /* CONFIG_BCM63XX_CPU_63268 */
#endif /* CONFIG_OF */
{ },
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -3230,6 +3230,22 @@ void __init board_bcm963xx_init(void)
+@@ -3276,6 +3276,22 @@ void __init board_bcm963xx_init(void)
val &= MPI_CSBASE_BASE_MASK;
}
boot_addr = (u8 *)KSEG1ADDR(val);
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -2697,6 +2697,273 @@ static struct board_info __initdata boar
+@@ -2697,6 +2697,317 @@ static struct board_info __initdata boar
#endif /* CONFIG_BCM63XX_CPU_6368 */
/*
@@ -227,6 +227,50 @@
+ },
+};
+
++static struct board_info __initdata board_VR400 = {
++ .name = "963167TP",
++ .expected_cpu_id = 0x63268,
++
++ .has_pci = 1,
++ .has_ohci0 = 1,
++ .has_ehci0 = 1,
++ .num_usbh_ports = 1,
++
++ .has_enetsw = 1,
++ .enetsw = {
++ .used_ports = {
++ [0] = {
++ .used = 1,
++ .phy_id = 1,
++ .name = "LAN3",
++ },
++ [1] = {
++ .used = 1,
++ .phy_id = 2,
++ .name = "LAN2",
++ },
++ [2] = {
++ .used = 1,
++ .phy_id = 3,
++ .name = "LAN1",
++ },
++ [3] = {
++ .used = 1,
++ .phy_id = 4,
++ .name = "LAN4/WAN",
++ },
++ },
++ },
++
++ .use_fallback_sprom = 1,
++ .fallback_sprom = {
++ /* BCM4352 not supported */
++ //.type = SPROM_BCM4352,
++ .pci_bus = 1,
++ .pci_dev = 0,
++ },
++};
++
+static struct board_info __initdata board_vw6339gu = {
+ .name = "VW6339GU",
+ .expected_cpu_id = 0x63268,
@@ -274,7 +318,7 @@
* all boards
*/
static const struct board_info __initconst *bcm963xx_boards[] = {
-@@ -2801,6 +3068,15 @@ static const struct board_info __initcon
+@@ -2801,6 +3112,16 @@ static const struct board_info __initcon
&board_VR3026e,
&board_WAP5813n,
#endif /* CONFIG_BCM63XX_CPU_6368 */
@@ -285,12 +329,13 @@
+ &board_H500s,
+ &board_VG8050,
+ &board_VR3032u,
++ &board_VR400,
+ &board_vw6339gu,
+#endif /* CONFIG_BCM63XX_CPU_63268 */
};
static struct of_device_id const bcm963xx_boards_dt[] = {
-@@ -2918,6 +3194,14 @@ static struct of_device_id const bcm963x
+@@ -2918,6 +3239,15 @@ static struct of_device_id const bcm963x
{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
#endif /* CONFIG_BCM63XX_CPU_6368 */
#ifdef CONFIG_BCM63XX_CPU_63268
@@ -302,6 +347,7 @@
+ { .compatible = "sercomm,h500-s-lowi", .data = &board_H500s, },
+ { .compatible = "sercomm,h500-s-vfes", .data = &board_H500s, },
+ { .compatible = "sky,sr102", .data = &board_BSKYB_63168, },
++ { .compatible = "tplink,archer-vr400-v1", .data = &board_VR400, },
#endif /* CONFIG_BCM63XX_CPU_63268 */
#endif /* CONFIG_OF */
{ },
@@ -1,6 +1,6 @@
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -3230,6 +3230,22 @@ void __init board_bcm963xx_init(void)
+@@ -3276,6 +3276,22 @@ void __init board_bcm963xx_init(void)
val &= MPI_CSBASE_BASE_MASK;
}
boot_addr = (u8 *)KSEG1ADDR(val);