[LEDE-DEV] [PATCH] ar71xx: add support for TP-Link TL-WDR7500v6

Piotr Dymacz pepe2k at gmail.com
Wed Nov 29 11:03:15 PST 2017


Hello Karol,

Sorry for a late reply.

On 06.11.2017 18:58, Bizon wrote:
> Hi Piotr,
> 
>   Thank You for comments.
> 
> Before sending v2 patch lets clarify all doubts.
> 
> 2017-11-05 23:22 GMT+01:00 Piotr Dymacz <pepe2k at gmail.com>:
>> Hello Karol,
>>
>> Thank you for your patch but it seems that it got whitespace mangled and
>> tabs were replaced with spaces. Please, send v2 using git send-email.
>>
>> Also, please see my comments inline, below.
>>
>> On 30.10.2017 20:32, Bizon wrote:
>>>
>>> Add support for TP-Link TL-WDR7500 V6.
>>>
>>> Specifications:
>>> - WiSoC: QCA9563 - 3x3 2.4GHz
>>> - Radio2: QCA9880 - 3x3 5GHz
>>> - RAM: 64MB DDR2
>>> - Storage: 8MB NOR SPI flash, can be replaced with 16M
>>> - Switch: RTL8367S, now unmanaged
>>> - Ethernet: 5x1G
>>> - Misc: 2x button, 2x LED
>>
>>
>> Please, include in commit message how to install LEDE on this device as
>> described under "commit description" section on [1].
> 
> Ok, will prepare manual how to change bootloader to non-RSA one, move art and
> install LEDE.

I'm sorry but I'm against accepting support for devices which requires 
such invasive modifications. We always try to make it possible for users 
to get back to the stock firmware which wouldn't be easy (or possible at 
all) with your changes in mtd layout and after bootloader swap.

-- 
Cheers,
Piotr

> 
>>
>>>
>>> Signed-off-by: Karol Bizewski <bizongod at gmail.com>
>>> ---
>>>   package/boot/uboot-envtools/files/ar71xx                |  2 ++
>>>   target/linux/ar71xx/base-files/etc/board.d/02_network   |  2 ++
>>>   target/linux/ar71xx/base-files/etc/diag.sh              |  4 ++++
>>>   .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata |  5 +++++
>>>   target/linux/ar71xx/base-files/lib/ar71xx.sh            |  6 ++++++
>>>   target/linux/ar71xx/config-4.4                          |  1 +
>>>   target/linux/ar71xx/config-4.9                          |  1 +
>>>   .../linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt  | 10 ++++++++++
>>>   target/linux/ar71xx/files/arch/mips/ath79/Makefile      |  1 +
>>>   target/linux/ar71xx/files/arch/mips/ath79/machtypes.h   |  1 +
>>>   target/linux/ar71xx/image/generic.mk                    | 17
>>> +++++++++++++++++
>>>   .../files/arch/mips/ath79/mach-tl-wdr7500-v6.c          | 112
>>> +++++++++++++++++++++
>>>   12 files changed, 162 insertions(+)
>>>   create mode 100644
>>> target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr7500-v6.c
>>>
>>>   diff --git a/package/boot/uboot-envtools/files/ar71xx
>>> b/package/boot/uboot-envtools/files/ar71xx
>>> index 0bdb6de..789c317 100644
>>> --- a/package/boot/uboot-envtools/files/ar71xx
>>> +++ b/package/boot/uboot-envtools/files/ar71xx
>>> @@ -46,6 +46,8 @@ om5p-acv2|\
>>>   om5p-an|\
>>>   sr3200|\
>>>   tube2h|\
>>> +tl-wdr7500-v6|\
>>> +tl-wdr7500-v6-16M|\
>>
>>
>> Please, drop this "tl-wdr7500-v6-16M" thing. As far as I understand, this is
>> only your custom hardware modification and the default/factory version comes
>> with just 8 MB of FLASH.
> 
> Ok. 16MB flash is hw mod.
> 
>>
>> And I really don't think this device has a writable U-Boot environment in a
>> separate sector. Please, provide some explanation.
> 
> Original bootloader checks RSA for second bootloader and system.
> To install LEDE I chose to replace bootloader instead of using any
> workarounds (if even exists).
> 
> Working bootloader is available at:
> https://github.com/bizongod/u-boot_wdr7500v6
> It is based on u-boot from TL-WDR1043v4 plus initializing routines for
> switch and other usable mods. It has also writable env.
> 
> With changing bootloader I decided also that's good opportunity to move
> art to better address, that's end of flash.
> 
>>
>>
>>>   wndr3700|\
>>>   xd3200)
>>>    ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
>>> 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 d838352..6cdd2fe 100755
>>> --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
>>> +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
>>> @@ -122,6 +122,8 @@ ar71xx_setup_interfaces()
>>>    tl-wa901nd-v2|\
>>>    tl-wa901nd-v3|\
>>>    tl-wa901nd-v4|\
>>> + tl-wdr7500-v6|\
>>> + tl-wdr7500-v6-16M|\
>>>    tl-wr703n|\
>>>    tl-wr802n-v1|\
>>>    tl-wr802n-v2|\
>>> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
>>> b/target/linux/ar71xx/base-files/etc/diag.sh
>>> index ade726f..f0ec9e6 100644
>>> --- a/target/linux/ar71xx/base-files/etc/diag.sh
>>> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
>>> @@ -20,6 +20,10 @@ get_status_led() {
>>>    all0305)
>>>    status_led="eap7660d:green:ds4"
>>>    ;;
>>> + tl-wdr7500-v6|\
>>> + tl-wdr7500-v6-16M)
>>> + status_led="$board:blue:system"
>>> + ;;
>>>    antminer-s1|\
>>>    antminer-s3|\
>>>    antminer-r1|\
>>> diff --git
>>> a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
>>> b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
>>> index 85a2a63..bd0cf2e 100644
>>> ---
>>> a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
>>> +++
>>> b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
>>> @@ -98,6 +98,11 @@ case "$FIRMWARE" in
>>>    rb-952ui-5ac2nd)
>>>    ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116
>>>    ;;
>>> + tl-wdr7500-v6|\
>>> + tl-wdr7500-v6-16M)
>>> + ath10kcal_extract "art" 8192 2116
>>> + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +2)
>>> + ;;
>>>    re450|\
>>>    tl-wr902ac-v1)
>>>    ath10kcal_extract "art" 20480 2116
>>> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> index 835ced6..dbf132b 100755
>>> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
>>> @@ -1109,6 +1109,12 @@ ar71xx_board_detect() {
>>>    *"TL-WDR6500 v2")
>>>    name="tl-wdr6500-v2"
>>>    ;;
>>> + *"TL-WDR7500 v6")
>>> +                local size="$(mtd_get_part_size 'firmware')"
>>> +
>>> +                [ "$size" = "8060928" ] && name="tl-wdr7500-v6"
>>> +                [ "$size" = "16449536" ] && name="tl-wdr7500-v6-16M"
>>
>>
>> As above.
>> Please don't include support for custom modified hardware.
>>
>> [snip]
>>
>>> diff --git a/target/linux/ar71xx/image/generic.mk
>>> b/target/linux/ar71xx/image/generic.mk
>>> index 6f5a701..39be043 100644
>>> --- a/target/linux/ar71xx/image/generic.mk
>>> +++ b/target/linux/ar71xx/image/generic.mk
>>> @@ -713,6 +713,23 @@ define Device/tellstick-znet-lite
>>>   endef
>>>   TARGET_DEVICES += tellstick-znet-lite
>>>
>>> +define Device/tl-wdr7500-v6
>>> +  DEVICE_TITLE := TP-LINK WDR7500 v6
>>> +  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
>>> +  BOARDNAME := TL-WDR7500-V6
>>> +  IMAGE_SIZE := 7872k
>>> +  MTDPARTS :=
>>> spi0.0:192k(u-boot)ro,64k(u-boot-env),7872k(firmware),64k(art)ro
>>
>>
>> This is definitely not a correct mtd organization for this device.
>> Based on bootlogs found on OpenWrt forum [2], it should look more or less
>> like:
>>
>> [    0.290000] 0x000000000000-0x00000001d800 : "factory_boot"
>> [    0.310000] 0x00000001d800-0x00000001e000 : "factory_info"
>> [    0.310000] 0x00000001e000-0x000000020000 : "art"
>> [    0.320000] 0x000000020000-0x000000030000 : "config"
>> [    0.330000] 0x000000030000-0x000000040000 : "normal_boot"
>> [    0.330000] 0x000000040000-0x00000014027c : "kernel"
>> [    0.350000] 0x00000014027c-0x0000006b0000 : "rootfs"
>> [    0.380000] 0x0000006b0000-0x000000800000 : "rootfs_data"
>> [    0.380000] 0x000000040000-0x000000800000 : "firmware"
>>
> 
> As above.
> 
>>> +endef
>>> +TARGET_DEVICES += tl-wdr7500-v6
>>
>>
>> We have a separate place for TP-Link devices, please use image/tp-link.mk
>> file instead.
> 
> As I saw, image/tp-link.mk is used because of specific tp-link image header etc,
> what in case of replaced bootloader, which accepts normal header, don't make
> sense any more.
> Is this correct?
> 
>>
>> [snip]
>>
>> [1] https://lede-project.org/submitting-patches
>> [2] https://forum.openwrt.org/viewtopic.php?pid=358852#p358852
>>
>> --
>> Cheers,
>> Piotr
> 
> Best regards,
> Karol
> 




More information about the Lede-dev mailing list