diff mbox

[OpenWrt-Devel,2/2] ar71xx: add support for TP-LINK TL-WR841N/ND v10

Message ID 9bec1f3cef709ac690ff3a95ef937df10658ad34.1445515300.git.mschiffer@universe-factory.net
State Accepted
Headers show

Commit Message

Matthias Schiffer Oct. 22, 2015, 12:01 p.m. UTC
The TL-WR841N/ND v10 is mostly identical to the v9. Apart from some minor
changes, it contains a newer revision of the QCA9533 SoC and the CPU clock
is significantly higher.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 target/linux/ar71xx/image/Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Alexander 'lynxis' Couzens Oct. 25, 2015, 10:47 p.m. UTC | #1
Hi Matthias,

as long you can not flash the exact same image as v9,
you have to create a mips machine, but you can use the same setup
function as v9.

Many parts of openwrt use the mips machine to detect the board, like
sysupgrade.

Add your machine id to
target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
and use the MIPS_MACHINE macro in 
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c

Best
lynxis

PS. Nice catch on the revision/version fix for ar9533. The problem why
v9 didn't work in the first time was quite similiar.

On Thu, 22 Oct 2015 14:01:40 +0200
Matthias Schiffer <mschiffer@universe-factory.net> wrote:

> The TL-WR841N/ND v10 is mostly identical to the v9. Apart from some
> minor changes, it contains a newer revision of the QCA9533 SoC and
> the CPU clock is significantly higher.
> 
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
> ---
>  target/linux/ar71xx/image/Makefile | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile index 7759a0d..a659af9 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -704,6 +704,13 @@ define Device/tl-wr841n-v9
>      TPLINK_HWID := 0x08410009
>  endef
>  
> +define Device/tl-wr841n-v10
> +    $(Device/tplink-4mlzma)
> +    BOARDNAME := TL-WR841N-v9
> +    DEVICE_PROFILE := TLWR841
> +    TPLINK_HWID := 0x08410010
> +endef
> +
Matthias Schiffer Oct. 26, 2015, 12:21 a.m. UTC | #2
Thanks, but I know what I'm doing. The hardware is similar enough to
boot with the exact same initialization routines as the v9, thus reusing
the BOARDNAME is fine (it is done like this for other hardware as well -
OpenWrt has a distinction between "board" and "model", where multiple
models can have the same board, but still each model has its own images)

On TP-LINK devices, sysupgrade checks the TPLINK_HWID of the image
against the one in the flash, the BOARDNAME doesn't matter (except to
determine that it is a TP-LINK device).

Matthias


On 10/25/2015 11:47 PM, Alexander Couzens wrote:
> Hi Matthias,
> 
> as long you can not flash the exact same image as v9,
> you have to create a mips machine, but you can use the same setup
> function as v9.
> 
> Many parts of openwrt use the mips machine to detect the board, like
> sysupgrade.
> 
> Add your machine id to
> target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch
> and use the MIPS_MACHINE macro in 
> target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c
> 
> Best
> lynxis
> 
> PS. Nice catch on the revision/version fix for ar9533. The problem why
> v9 didn't work in the first time was quite similiar.
> 
> On Thu, 22 Oct 2015 14:01:40 +0200
> Matthias Schiffer <mschiffer@universe-factory.net> wrote:
> 
>> The TL-WR841N/ND v10 is mostly identical to the v9. Apart from some
>> minor changes, it contains a newer revision of the QCA9533 SoC and
>> the CPU clock is significantly higher.
>>
>> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
>> ---
>>  target/linux/ar71xx/image/Makefile | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/target/linux/ar71xx/image/Makefile
>> b/target/linux/ar71xx/image/Makefile index 7759a0d..a659af9 100644
>> --- a/target/linux/ar71xx/image/Makefile
>> +++ b/target/linux/ar71xx/image/Makefile
>> @@ -704,6 +704,13 @@ define Device/tl-wr841n-v9
>>      TPLINK_HWID := 0x08410009
>>  endef
>>  
>> +define Device/tl-wr841n-v10
>> +    $(Device/tplink-4mlzma)
>> +    BOARDNAME := TL-WR841N-v9
>> +    DEVICE_PROFILE := TLWR841
>> +    TPLINK_HWID := 0x08410010
>> +endef
>> +
Alexander 'lynxis' Couzens Oct. 26, 2015, 2:28 p.m. UTC | #3
On Mon, 26 Oct 2015 01:21:58 +0100
Matthias Schiffer <mschiffer@universe-factory.net> wrote:

> Thanks, but I know what I'm doing. The hardware is similar enough to
> boot with the exact same initialization routines as the v9, thus
> reusing the BOARDNAME is fine (it is done like this for other
> hardware as well - OpenWrt has a distinction between "board" and
> "model", where multiple models can have the same board, but still
> each model has its own images)
> 
> On TP-LINK devices, sysupgrade checks the TPLINK_HWID of the image
> against the one in the flash, the BOARDNAME doesn't matter (except to
> determine that it is a TP-LINK device).

Sorry, no offensive. I forgot the tplink specific check within
sysupgrade.
Alexander 'lynxis' Couzens Oct. 27, 2015, 1:50 a.m. UTC | #4
After taking some time to think about this.

Wouldn't luci tell the user it's running on a 841 v9?
This could confuse them because a v9 sysupgrade wouldn't work.
sysupgrade fails then. Also an automatic upgrade based on system info
wouldn't work either.

As long we don't have dts support, I see here two solution. Add another
mips machine or change the board detection to detect this difference.

Best,
lynxis

On Mon, 26 Oct 2015 15:28:09 +0100
Alexander Couzens <lynxis@fe80.eu> wrote:

> On Mon, 26 Oct 2015 01:21:58 +0100
> Matthias Schiffer <mschiffer@universe-factory.net> wrote:
> 
> > Thanks, but I know what I'm doing. The hardware is similar enough to
> > boot with the exact same initialization routines as the v9, thus
> > reusing the BOARDNAME is fine (it is done like this for other
> > hardware as well - OpenWrt has a distinction between "board" and
> > "model", where multiple models can have the same board, but still
> > each model has its own images)
> > 
> > On TP-LINK devices, sysupgrade checks the TPLINK_HWID of the image
> > against the one in the flash, the BOARDNAME doesn't matter (except
> > to determine that it is a TP-LINK device).  
> 
> Sorry, no offensive. I forgot the tplink specific check within
> sysupgrade.
Matthias Schiffer Oct. 27, 2015, 2:07 a.m. UTC | #5
No, LuCI uses util.ubus("system", "board"), which doesn't even expose
the internal board_name, but only the model name, so it will only see
the v10.

Automatic upgrade systems should also rely on the model name only, not
the board name.

The board name is really only an internal identifier. Reusing a board
name when new hardware has been released which is compatible with
another model is very common, just take a look at
target/linux/ar71xx/image/Makefile. There's a total of 7 models using
"TL-WR741ND", 5 models using "TL-WR741ND-v4" and another 5 using
"TL-WA901ND" as their BOARDNAME value...

Matthias


On 10/27/2015 02:50 AM, Alexander Couzens wrote:
> After taking some time to think about this.
> 
> Wouldn't luci tell the user it's running on a 841 v9?
> This could confuse them because a v9 sysupgrade wouldn't work.
> sysupgrade fails then. Also an automatic upgrade based on system info
> wouldn't work either.
> 
> As long we don't have dts support, I see here two solution. Add another
> mips machine or change the board detection to detect this difference.
> 
> Best,
> lynxis
> 
> On Mon, 26 Oct 2015 15:28:09 +0100
> Alexander Couzens <lynxis@fe80.eu> wrote:
> 
>> On Mon, 26 Oct 2015 01:21:58 +0100
>> Matthias Schiffer <mschiffer@universe-factory.net> wrote:
>>
>>> Thanks, but I know what I'm doing. The hardware is similar enough to
>>> boot with the exact same initialization routines as the v9, thus
>>> reusing the BOARDNAME is fine (it is done like this for other
>>> hardware as well - OpenWrt has a distinction between "board" and
>>> "model", where multiple models can have the same board, but still
>>> each model has its own images)
>>>
>>> On TP-LINK devices, sysupgrade checks the TPLINK_HWID of the image
>>> against the one in the flash, the BOARDNAME doesn't matter (except
>>> to determine that it is a TP-LINK device).  
>>
>> Sorry, no offensive. I forgot the tplink specific check within
>> sysupgrade.
> 
> 
>
diff mbox

Patch

diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 7759a0d..a659af9 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -704,6 +704,13 @@  define Device/tl-wr841n-v9
     TPLINK_HWID := 0x08410009
 endef
 
+define Device/tl-wr841n-v10
+    $(Device/tplink-4mlzma)
+    BOARDNAME := TL-WR841N-v9
+    DEVICE_PROFILE := TLWR841
+    TPLINK_HWID := 0x08410010
+endef
+
 define Device/tl-wr842n-v1
     $(Device/tplink-8m)
     BOARDNAME := TL-MR3420
@@ -731,7 +738,7 @@  define Device/tl-wr847n-v8
     DEVICE_PROFILE := TLWR841
     TPLINK_HWID := 0x08470008
 endef
-TARGET_DEVICES += tl-wr841nd-v3 tl-wr841nd-v5 tl-wr841nd-v7 tl-wr841n-v8 tl-wr841n-v9 tl-wr842n-v1 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
+TARGET_DEVICES += tl-wr841nd-v3 tl-wr841nd-v5 tl-wr841nd-v7 tl-wr841n-v8 tl-wr841n-v9 tl-wr841n-v10 tl-wr842n-v1 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
 
 define Device/tl-wr941nd-v2
     $(Device/tplink-4m)