Skip to content

Commit

Permalink
ath79: initial tl-wr1043nd v1 support
Browse files Browse the repository at this point in the history
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: John Crispin <john@phrozen.org>
  • Loading branch information
lucize authored and blogic committed May 24, 2018
1 parent f7aa085 commit 2530951
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 14 deletions.
21 changes: 21 additions & 0 deletions target/linux/ath79/dts/ar9132.dtsi
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/clock/ath79-clk.h>
#include "ath79.dtsi"

/ {
compatible = "qca,ar9132";
Expand Down Expand Up @@ -160,6 +161,15 @@
#address-cells = <1>;
#size-cells = <0>;
};

wmac: gmac@180c0000 {
compatible = "qca,ar9130-wmac";
reg = <0x180c0000 0x230000>;

interrupts = <2>;

status = "disabled";
};
};

usb_phy: usb-phy {
Expand All @@ -173,3 +183,14 @@
status = "disabled";
};
};

&eth0 {
compatible = "qca,ar9130-eth", "syscon";
reg = <0x19000000 0x200
0x18070000 0x4>;
pll-data = <0x1a000000 0x13000a44 0x00441099>;
pll-reg = <0x4 0x10 17>;
pll-handle = <&pll>;
resets = <&rst 8>, <&rst 9>;
reset-names = "phy", "mac";
};
Expand Up @@ -10,6 +10,10 @@
compatible = "tplink,tl-wr1043nd-v1", "qca,ar9132";
model = "TP-Link TL-WR1043ND Version 1";

aliases {
led-status = &system;
};

memory@0 {
device_type = "memory";
reg = <0x0 0x2000000>;
Expand All @@ -22,19 +26,18 @@
};

keys {
compatible = "gpio-keys-polled";
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;

poll-interval = <20>;
button@0 {
button0 {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};

button@1 {
button1 {
label = "qss";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
Expand All @@ -44,27 +47,50 @@

leds {
compatible = "gpio-leds";
led@0 {
usb {
label = "tp-link:green:usb";
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
default-state = "off";
trigger-sources = <&hub_port>;
linux,default-trigger = "usbport";
};

led@1 {
system: system {
label = "tp-link:green:system";
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
};

led@2 {
qss {
label = "tp-link:green:qss";
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
};

led@3 {
wlan {
label = "tp-link:green:wlan";
gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
default-state = "off";
linux,default-trigger = "phy0tpt";
};
};

rtl8366rb {
compatible = "realtek,rtl8366rb";
gpio-sda = <&gpio 18 GPIO_ACTIVE_HIGH>;
gpio-sck = <&gpio 19 GPIO_ACTIVE_HIGH>;

resets = <&rst 8>;
reset-names = "switch";

mdio-bus {
status = "okay";

phy0: ethernet-phy@0 {
reg = <0>;
};
};
};

};

&uart {
Expand All @@ -77,6 +103,16 @@

&usb {
status = "okay";

port@1 {
reg = <1>;
#trigger-source-cells = <0>;

hub_port: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};
};

&usb_phy {
Expand All @@ -90,7 +126,7 @@
flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "s25sl064a";
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;

Expand All @@ -99,22 +135,44 @@
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
uboot: partition@0 {
label = "u-boot";
reg = <0x000000 0x020000>;
read-only;
};

partition@1 {
partition@020000 {
label = "firmware";
reg = <0x020000 0x7D0000>;
};

partition@2 {
art: partition@7F0000 {
label = "art";
reg = <0x7F0000 0x010000>;
read-only;
};
};
};
};

&eth0 {
status = "okay";

phy-mode = "rgmii";
mtd-mac-address = <&uboot 0x1fc00>;

resets = <&rst 9>;
reset-names = "mac";

phy-handle = <&phy0>;

This comment has been minimized.

Copy link
@981213

981213 Jun 28, 2018

Member

@lucize phy-handle isn't needed because eth0 here only need a fixed link. (And a phy-handle will be ignored because fixed-link is defined below.)

fixed-link {
speed = <1000>;
full-duplex;
};
};

&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&uboot 0x1fc00>;
};
4 changes: 2 additions & 2 deletions target/linux/ath79/image/generic-tp-link.mk
Expand Up @@ -78,15 +78,15 @@ $(Device/tplink)
IMAGE_SIZE := 7936k
endef

define Device/tl_wr1043nd_v1
define Device/tl-wr1043nd-v1
$(Device/tplink-8m)
ATH_SOC := ar9132
DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
TPLINK_HWID := 0x10430001
SUPPORTED_DEVICES := tplink,tl-wr1043nd-v1 tl-wr1043nd
endef
#TARGET_DEVICES += tl_wr1043nd_v1
TARGET_DEVICES += tl-wr1043nd-v1

define Device/tl-wdr3600
$(Device/tplink-8mlzma)
Expand Down

4 comments on commit 2530951

@lucize
Copy link
Contributor Author

@lucize lucize commented on 2530951 May 25, 2018

Choose a reason for hiding this comment

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

@blogic I don't know what's the problem, but for me is the same problem, I see traffic on eth0.1 and eth0.2 with tcpdump but is not working
before bootm a tftp image the network worked, not anymore

@lucize
Copy link
Contributor Author

@lucize lucize commented on 2530951 May 26, 2018

Choose a reason for hiding this comment

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

something is really wired on my device, tried changing some things about led triggering, and I had it all working, but after 2 reboot with the same image, is not working anymore !

@xabolcs
Copy link
Contributor

Choose a reason for hiding this comment

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

@blogic is the tl-wr1043nd-v1 port working?
Lot of fixes landed since this commit (currently at: 512c57e) , but I am unable to get this working.

Lot of things works:

  • it compiles successfuly
  • it boots successfully
  • pwr, sys, lan1..4, wan and usb LEDs working
  • failsafe works

But it's unreachable: no dhcp server, no reply to ping from static address, even in failsafe mode.

Sadly I have no serial access, so I am unable to provide any boot log.

@lucize
Copy link
Contributor Author

@lucize lucize commented on 2530951 Jun 21, 2018

Choose a reason for hiding this comment

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

I tried changing the pll values, even tried the network adapter ar7100-eth, all work when I boot from ram, as soon as I flash the image the only thing that is working is tcpdump

root@OpenWrt:/# tcpdump -i eth0.2
[  130.023753] device eth0.2 entered promiscuous mode
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0.2, link-type EN10MB (Ethernet), capture size 262144 bytes
10:02:12.157237 IP 192.168.123.247.62520 > 239.255.255.250.1900: UDP, length 173
10:02:13.157925 IP 192.168.123.247.62520 > 239.255.255.250.1900: UDP, length 173
10:02:13.158437 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:14.158301 IP 192.168.123.247.62520 > 239.255.255.250.1900: UDP, length 173
10:02:15.661840 LLDP, length 167: lede
10:02:16.160918 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:16.487196 IP 192.168.0.5.59785 > 192.168.0.255.1947: UDP, length 40
10:02:18.697342 IP 192.168.123.1 > 224.0.0.5: OSPFv2, Hello, length 44
10:02:19.698964 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:20.493556 IP 192.168.1.100.59785 > 192.168.1.255.1947: UDP, length 40
10:02:20.595070 IP 192.168.0.5.59780 > 239.255.255.250.1900: UDP, length 137
10:02:22.597657 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:23.596572 IP 192.168.0.5.59780 > 239.255.255.250.1900: UDP, length 137
10:02:24.500112 IP 192.168.123.118.59785 > 192.168.123.255.1947: UDP, length 40
10:02:25.501765 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:26.596616 IP 192.168.0.5.59780 > 239.255.255.250.1900: UDP, length 137
10:02:28.599221 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:28.697867 IP 192.168.123.1 > 224.0.0.5: OSPFv2, Hello, length 44
10:02:29.600211 IP 192.168.0.5.59780 > 239.255.255.250.1900: UDP, length 137
10:02:31.602813 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:32.601246 IP 192.168.0.5.59780 > 239.255.255.250.1900: UDP, length 137
10:02:34.603604 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
10:02:35.602144 IP 192.168.0.5.59780 > 239.255.255.250.1900: UDP, length 137
10:02:36.611895 IP 192.168.123.1.137 > 192.168.123.255.137: UDP, length 50
10:02:37.613587 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:ec:38:e9:c1:66 (oui Unknown), length 300
^C
25 packets capture[  156.470998] device eth0.2 left promiscuous mode
25 packets received by filter
0 packets dropped by kernel

Please sign in to comment.