Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lantiq: [WIP] Add support for Archer D2 v1 #4059

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
425 changes: 425 additions & 0 deletions target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar10.dtsi

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "ar10.dtsi"

#include <dt-bindings/input/input.h>
#include <dt-bindings/mips/lantiq_rcu_gphy.h>

/ {
compatible = "tplink,archer-d2", "lantiq,xway", "lantiq,ar10";
model = "TP-Link Archer D2 v1";

memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};

aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;

led-dsl = &led_dsl;
led-internet = &led_internet;
led-wifi = &led_wlan;
};

keys {
compatible = "gpio-keys-polled";
poll-interval = <100>;

reset {
label = "reset";
gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};

wifi {
label = "wifi";
gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_RFKILL>;
linux,input-type = <EV_SW>;
};

wps {
label = "wps";
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};

leds: leds {
compatible = "gpio-leds";

led_power: power {
label = "white:power";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
default-state = "keep";
};

led_dsl: dsl {
label = "white:dsl";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};

led_internet: internet {
label = "white:internet";
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
};

usb {
label = "white:usb";
gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
trigger-sources = <&ehci_port1>;
linux,default-trigger = "usbport";
};

lan {
label = "white:lan";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};

led_wlan: wlan {
label = "white:wlan";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};

wps {
label = "white:wps";
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
};
};

usb_vbus: regulator-usb-vbus {
compatible = "regulator-fixed";

regulator-name = "USB_VBUS";

regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;

gpio = <&gpio 25 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};

&spi {
status = "okay";

flash@0 {
compatible = "jedec,spi-nor";
reg = <1>;
spi-max-frequency = <25000000>;
m25p,fast-read;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
reg = <0x0 0x20000>;
label = "u-boot";
read-only;
};

partition@20000 {
reg = <0x20000 0xf90000>;
label = "firmware";
};

partition@fb0000 {
reg = <0xfb0000 0x10000>;
label = "radioDECT";
read-only;
};

partition@fc0000 {
reg = <0xfc0000 0x10000>;
label = "config";
read-only;
};

romfile: partition@fd0000 {
reg = <0xfd0000 0x10000>;
label = "romfile";
read-only;
};

partition@fe0000 {
reg = <0xfe0000 0x10000>;
label = "rom";
read-only;
};

radio: partition@ff0000 {
reg = <0xff0000 0x10000>;
label = "radio";
read-only;
};
};
};
};

&eth0 {
pinctrl-names = "default";
mtd-mac-address = <&romfile 0xf100>;
};

&gswip {
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
};

&gphy0 {
lantiq,gphy-mode = <GPHY_MODE_GE>;
};
&gphy1 {
lantiq,gphy-mode = <GPHY_MODE_GE>;
};
&gphy2 {
lantiq,gphy-mode = <GPHY_MODE_GE>;
};

&gswip_mdio {
phy1: ethernet-phy@1 {
reg = <0x1>;
};
phy2: ethernet-phy@2 {
reg = <0x2>;
};
phy4: ethernet-phy@4 {
reg = <0x4>;
};
phy5: ethernet-phy@5 {
reg = <0x5>;
};
};

&gswip_ports {
port@1 {
reg = <1>;
phy-mode = "internal";
phy-handle = <&phy1>;
label = "lan1";
};
port@2 {
reg = <2>;
phy-mode = "internal";
phy-handle = <&phy2>;
label = "lan3";
};
port@4 {
reg = <4>;
phy-mode = "internal";
phy-handle = <&phy4>;
label = "lan2";
};
port@5 {
reg = <5>;
phy-mode = "rgmii";
phy-handle = <&phy5>;
label = "lan4";
};
};

&stp {
status = "okay";
lantiq,phy1 = <0x2>;
lantiq,phy2 = <0x2>;
lantiq,phy3 = <0x2>;
};

&usb0 {
status = "okay";
vbus-supply = <&usb_vbus>;
};

&usb_phy0 {
status = "okay";
};

&pcie0 {
pcie@0 {
reg = <0 0 0 0 0>;
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";

wifi@0,0 {
reg = <0 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x0000>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mtd-eeprom is deprecated in favor of nvmem

big-endian;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&romfile 0xf100>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mtd-mac* is gone. nvmem is the replacement.

mtd-mac-address-increment = <2>;
};
};
};
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion target/linux/lantiq/image/Makefile
Original file line number Diff line number Diff line change
@@ -154,7 +154,6 @@ include ar9.mk
endif

ifeq ($(SUBTARGET),xrx200)
DEFAULT_SOC := vr9
include tp-link.mk
include vr9.mk
endif
15 changes: 15 additions & 0 deletions target/linux/lantiq/image/tp-link.mk
Original file line number Diff line number Diff line change
@@ -17,6 +17,17 @@ define Device/lantiqTpLink
check-size | append-metadata
endef

define Device/tplink_archer-d2
$(Device/lantiqTpLink)
DEVICE_MODEL := Archer D2
DEVICE_VARIANT := v1
SOC := ar10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we start to have separate SOC values for xrx200, the SOC variable should be set individually for all devices far clarity.

TPLINK_FLASHLAYOUT := 16Mltq
IMAGE_SIZE := 15808k
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += tplink_archer-d2

define Device/tplink_tdw8970
$(Device/dsa-migration)
$(Device/lantiqTpLink)
@@ -25,6 +36,7 @@ define Device/tplink_tdw8970
TPLINK_FLASHLAYOUT := 8Mltq
TPLINK_HWID := 0x89700001
TPLINK_HWREV := 1
SOC := vr9
IMAGE_SIZE := 7680k
DEVICE_PACKAGES:= kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += TDW8970
@@ -39,6 +51,7 @@ define Device/tplink_tdw8980
TPLINK_FLASHLAYOUT := 8Mltq
TPLINK_HWID := 0x89800001
TPLINK_HWREV := 14
SOC := vr9
IMAGE_SIZE := 7680k
DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += TDW8980
@@ -53,6 +66,7 @@ define Device/tplink_vr200
TPLINK_FLASHLAYOUT := 16Mltq
TPLINK_HWID := 0x63e64801
TPLINK_HWREV := 0x53
SOC := vr9
IMAGE_SIZE := 15808k
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += VR200
@@ -67,6 +81,7 @@ define Device/tplink_vr200v
TPLINK_FLASHLAYOUT := 16Mltq
TPLINK_HWID := 0x73b70801
TPLINK_HWREV := 0x2f
SOC := vr9
IMAGE_SIZE := 15808k
DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc
SUPPORTED_DEVICES += VR200v
Loading
Oops, something went wrong.