ath79: add support for TP-Link Archer D7/D7b v1#2079
ath79: add support for TP-Link Archer D7/D7b v1#2079DavideFioravanti wants to merge 1 commit intoopenwrt:masterfrom
Conversation
| }; | ||
| }; | ||
|
|
||
| gpio-export { |
There was a problem hiding this comment.
Please convert this to use the userspace gpio-switch since gpio-export is never going to get accepted upstream.
See #1366 (comment)
EDIT: no wait. these are both usb power. So they are likely usb_vbus gpio regulators. Please look at
ar9331_tplink_tl-wr710n-v1.dts for an example on how to convert both to vbus regulator.
| ð0 { | ||
| status = "okay"; | ||
|
|
||
| mtd-mac-address = <&romfs 0xf100>; |
There was a problem hiding this comment.
this handle is defined in the device .dts but not the .dtsi. It works, but it is sort of cheesy, please move this property (and mtd-mac-address-increment) to the two dts files instead.
| lan { | ||
| label = "tp-link:white:lan"; | ||
| gpios = <&gpio 23 GPIO_ACTIVE_LOW>; | ||
| default-state = "off"; |
There was a problem hiding this comment.
No need to specify "default-state = off". it's the default already.
|
|
||
| define Device/tplink_archer-d7-v1 | ||
| ATH_SOC := qca9558 | ||
| DEVICE_TITLE := TP-Link Archer D7 v1 |
There was a problem hiding this comment.
Please update to use DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT as introduced in:
8c3dbaf
|
|
||
| define Device/tplink_archer-d7b-v1 | ||
| ATH_SOC := qca9558 | ||
| DEVICE_TITLE := TP-Link Archer D7b v1 |
There was a problem hiding this comment.
Please update to use DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT as introduced in:
8c3dbaf
|
I'm currently working on a PR to store the label-mac-address in the DTS (#2159). I would appreciate if you could provide information about your device: Now check which of those returned MAC addresses matches the one on the label/sticker/case of your device and tell me the device-tree path leading to it. Note that you do not have to post your MAC addresses here, but just a statement about which match, e.g. like There may be one, two or no paths giving the correct address. It may also happen that the |
|
Unfortunately, my description is slightly incorrect. The MAC addresses are stored binary, so you can't read with The include is obviously only required once. Sorry. |
| tplink,archer-d7-v1|\ | ||
| tplink,archer-d7b-v1) | ||
| ucidef_set_led_switch "lan" "LAN" "tp-link:white:lan" "switch0" "0x3c" | ||
| ucidef_set_led_wlan "wlan" "WLAN" "tp-link:white:wlan" "phy0tpt" "phy1tpt" |
There was a problem hiding this comment.
Use linux,default-trigger = "phy0tpt"; and linux,default-trigger = "phy1tpt"; in your LED nodes instead. Configuration of LEDs in DTS is preferred. Example:
openwrt/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts
Lines 36 to 40 in e65f935
| #include "qca9557.dtsi" | ||
|
|
||
| / { | ||
|
|
| gpios = <&gpio 18 GPIO_ACTIVE_LOW>; | ||
| trigger-sources = <&hub_port1>, <&hub_port0>; | ||
| linux,default-trigger = "usbport"; | ||
| default-state = "off"; |
There was a problem hiding this comment.
No need to specify "default-state = off". it's the default already.
| DEVICE_TITLE := TP-Link Archer D7b v1 | ||
| DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct | ||
| BOARDNAME := ARCHER-D7b-V1 | ||
| IMAGE_SIZE := 15936k |
|
@adrianschmutzler |
18584f4 to
d842fd6
Compare
|
@ynezz @adrianschmutzler @chunkeey Sorry for my late reply. I just finished my university exams, so it won't happen anymore... I promise! 😄 I should have solved all the problems you found in the commit. Moreover this is a dmesg from the router: |
| tplink,archer-d7-v1|\ | ||
| tplink,archer-d7b-v1) | ||
| ucidef_add_switch "switch0" \ | ||
| "0@eth1" "3:lan:3" "4:lan:2" "5:lan:1" "6@eth0" "2:wan:4" "1:wan" |
There was a problem hiding this comment.
I don't know how to name it... It is an internal wan connected to the Broadcom cpu (I can't test it because I don't have an adsl anymore, but it could work if previously configured using the OEM fw)
There was a problem hiding this comment.
Well, I'm not sure, but if you keep like this, won't you have two "port 1" in luci then?
If it's only internal and there is not external access anyway, I would not initialize it here, but just remove it.
| IMAGES := sysupgrade.bin | ||
| IMAGE/sysupgrade.bin := tplink-v2-image -s -V "ver. 2.0" | \ | ||
| append-metadata | check-size $$$$(IMAGE_SIZE) | ||
| SUPPORTED_DEVICES += archer-d7-v1 |
There was a problem hiding this comment.
I didn't find an archer-d7-v1 in ar71xx. Remove it? Same for d7b?
There was a problem hiding this comment.
Same question also arises for already merged d50-v1. This one also it not supported in ar71xx, so I suppose the SUPPORTED_DEVICES can be removed there, too?
There was a problem hiding this comment.
If it wasn't present there: Yes
Ok, fine! |
|
Hello, I have build problems with this patch and also with your own branch Error: ../dts/qca9558_tplink_archer-d7-v1.dts:11.1-8 syntax error Regards, |
|
@adrianschmutzler Thanks, now build working :-) |
|
@DavideFioravanti Ping. |
99eb9a6 to
5cb957f
Compare
|
@adrianschmutzler Rebased and tested |
5cb957f to
be585ec
Compare
42aba24 to
b71a3e2
Compare
There was a problem hiding this comment.
I've just added a tplink-v2 definition to ath79:
4897bf0
You should be able to reuse that one instead of the tplink-qca-dsl here.
While at it, please check whether you need the "-s" for the KERNEL_INITRAMFS.
There was a problem hiding this comment.
I updated my commit and I can confirm you that it's working using the tplink-v2 definition (I tested both initramfs and sysupgrade image).
For what concerns the "-s" option, it's working?
Looking into https://github.com/openwrt/openwrt/blob/master/tools/firmware-utils/src/mktplinkfw2.c seems that the variable "strip_padding" is never used
There was a problem hiding this comment.
You were using the "-s" option for INITRAMFS, which I haven't seen elsewhere before (e.g. ramips does not use it.) So I was interested in whether it was actually necessary, and since you now have removed it here (by invoking tplink-v2), it looks like you don't need it.
There was a problem hiding this comment.
Yes I don't need it.
However I was saying that the "-s" option doesn't do anything in mktplinkfw2.c... or am I missing something?
TP-Link Archer D7 v1 is a dual-band AC1750 router + modem. The router section is based on Qualcomm/Atheros QCA9558 + QCA9880. The "DSL" section is based on BCM6318 but it's currently not supported. The Archer D7b seems to differ from the Archer D7 only in the partition table Router section - Specification: 775/650/258 MHz (CPU/DDR/AHB) 128 MB of RAM (DDR2) 16 MB of FLASH (SPI NOR) 3T3R 2.4 GHz 3T3R 5 GHz 4x 10/100/1000 Mbps Ethernet 7x LED, 2x button UART header on PCB Known issues: Broadband LED (missing GPIO - probably driven by the BCM6318) Internet LED (missing GPIO - probably driven by the BCM6318) WIFI LED (working only for one interface at time, while in the OEM firmware works for both wifi interfaces) DSL not working (eth0) (WIP) UART connection --------------- J1 HEADER (Qualcomm CPU) . VCC . GND . RX O TX J41 HEADER (Broadcom CPU) . VCC . GND . RX O TX The following instructions require a connection to the J1 UART header and are tested for the Archer D7 v1. If you have an Arhcer D7b v1, you should change the names accordingly. Flash instructions under U-Boot, using UART ------------------------------------------ 1. Press "tpl" to stop autobooting and obtain U-Boot CLI access. 2. Setup ip addresses for U-Boot and your tftp server. 3. Issue below commands: tftpboot 0x81000000 openwrt-ath79-generic-tplink_archer-d7-v1-squashfs-sysupgrade.bin erase 0x9f020000 +f90000 cp.b 0x81000000 0x9f020000 0xf90000 reset Initramfs instructions under U-Boot for testing, using UART ---------------------------------------------------------- 1. Press "tpl" to stop autobooting and obtain U-Boot CLI access. 2. Setup ip addresses for U-Boot and your tftp server. 3. Issue below commands: tftpboot 0x81000000 openwrt-ath79-generic-tplink_archer-d7-v1-initramfs-kernel.bin bootm 0x81000000 4. Here you can backup the original firmware and/or flash the sysupgrade openwrt if you want Restore the original firmware ----------------------------- 0. Backup every partition using the OpenWrt web interface 1. Download the OEM firmware from the TP-Link website 2. Extract the bin file in a folder (eg. Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin) 3. Remove the U-Boot and the Broadcom image part from the file. Issue the following command: dd if="Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin" of="Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin.mod" skip=257 bs=512 count=31872 4. Double check the .mod file size. It must be 16318464 bytes. 5. Flash it using the OpenWrt web interface. Force the update if needed. WARNING: Remember to NOT keep settings. 5b. (Alternative to 5.) Flash it using the U-Boot and UART connection. Issue below commands in the U-Boot: tftpboot 0x81000000 Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin.mod erase 0x9f020000 +f90000 cp.b 0x81000000 0x9f020000 0xf90000 reset Signed-off-by: Davide Fioravanti <[email protected]>
b71a3e2 to
b207d9f
Compare
|
Hi, I plan to merge your PR, and have pulled the current state with some tiny adjustments to my staging tree: https://git.openwrt.org/?p=openwrt/staging/adrian.git;a=shortlog;h=refs/heads/staging Please respond to the comments I will raise in a minute, I'd then change according to your answers directly in my staging tree. |
| tplink,archer-d7-v1|\ | ||
| tplink,archer-d7b-v1) | ||
| ucidef_add_switch "switch0" \ | ||
| "0@eth1" "3:lan:3" "4:lan:2" "5:lan:1" "6@eth0" "2:wan:4" "1:wan:5" |
There was a problem hiding this comment.
In the commit message you say eth0 is not working ("WIP"). Can you provide more details on that? So, is just DSL not working, and this is acting as a switch, or should we better disable the ports?
There was a problem hiding this comment.
Despite, you use fixed-link for eth1 in DTS, so how can you actually have two wan-ports then?
There was a problem hiding this comment.
One port of the cpu is connected to the switch and the other port of the cpu is connected to the Broadcom cpu.
The last port of the switch is labeled as LAN/WAN so i chose to use this as wan port.
For what concerns the DSL part, the configuration of the DSL part is stored on the BCM flash.
If the dsl link is active and the user configured the modem using the OEM fw, it could work. However I don't have an adsl connection anymore so I can't test it but I chose to left it enabled because it doesn't cause trouble (many users alreay tested it https://forum.openwrt.org/t/archer-d7-support/15790/118)
I didn't get the question about the fixed-link... could you explain it? (I am sorry but I have very little experience in the dts world 😞 )
There was a problem hiding this comment.
The last port of the switch is labeled as LAN/WAN so i chose to use this as wan port.
So, this is either 2: or 1: (internally). Which is it and what's the other one then?
There was a problem hiding this comment.
So, that means you configure both WAN1 and WAN2 as if connected to eth0.
| wlan { | ||
| label = "tp-link:white:wlan"; | ||
| gpios = <&gpio 12 GPIO_ACTIVE_LOW>; | ||
| linux,default-trigger = "phy0tpt", "phy1tpt"; |
There was a problem hiding this comment.
Does this really work? From the commit message, it looks like it's only working for one interface at a time, which sounds to me like "broken". In this case, I'd actually prefer to have no default-trigger by default, so that user may set them up based on their needs afterwards.
There was a problem hiding this comment.
It doesn't works as intended, in fact it follows just the phy0tpt state. Your solution is fine to me 😉
|
|
||
| &pcie1 { | ||
| status = "okay"; | ||
| }; |
|
@adrianschmutzler Probably during one rebase I removed the wps and rfkill button configuration. I tested it on my device and verified on the GPL: Thank you for your patience |
|
Okay, will merge it today. |
|
Hey. Why Thies PR hast been closed? Archer D7 support look really interesting to me. |
it is already integrated in the openwrt master |

TP-Link Archer D7 v1 is a dual-band AC1750 router + modem.
The router section is based on Qualcomm/Atheros QCA9558 + QCA9880.
The "DSL" section is based on BCM6318 but it's currently not supported.
The Archer D7b seems to differ from the Archer D7 only in the
partition table
Router section - Specification:
775/650/258 MHz (CPU/DDR/AHB)
128 MB of RAM (DDR2)
16 MB of FLASH (SPI NOR)
3T3R 2.4 GHz
3T3R 5 GHz
4x 10/100/1000 Mbps Ethernet
7x LED, 2x button
UART header on PCB
Known issues:
Broadband LED (missing GPIO - probably driven by the BCM6318)
Internet LED (missing GPIO - probably driven by the BCM6318)
WIFI LED (working only for one interface at time, while in the
OEM firmware works for both wifi interfaces)
DSL not working (eth0) (WIP)
UART connection
J1 HEADER (Qualcomm CPU)
. VCC
. GND
. RX
O TX
J41 HEADER (Broadcom CPU)
. VCC
. GND
. RX
O TX
The following instructions require a connection to the J1 UART header
and are tested for the Archer D7 v1.
If you have an Arhcer D7b v1, you should change the names accordingly.
Flash instructions under U-Boot, using UART
tftpboot 0x81000000 openwrt-ath79-generic-tplink_archer-d7-v1-squashfs-sysupgrade.bin
erase 0x9f020000 +f90000
cp.b 0x81000000 0x9f020000 0xf90000
reset
Initramfs instructions under U-Boot for testing, using UART
tftpboot 0x81000000 openwrt-ath79-generic-tplink_archer-d7-v1-initramfs-kernel.bin
bootm 0x81000000
Restore the original firmware
Issue the following command:
dd if="Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin" of="Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin.mod" skip=257 bs=512 count=31872
WARNING: Remember to NOT keep settings.
5b. (Alternative to 5.) Flash it using the U-Boot and UART connection.
Issue below commands in the U-Boot:
tftpboot 0x81000000 Archer_D7v1_1.6.0_0.9.1_up_boot(160216)_2016-02-16_15.55.48.bin.mod
erase 0x9f020000 +f90000
cp.b 0x81000000 0x9f020000 0xf90000
reset
Signed-off-by: Davide Fioravanti [email protected]