[OpenWrt-Devel] ath79: Add SUPPORTED_DEVICES for Archer C7 v1/v2
diff mbox series

Message ID 20190417134552.9294-1-freifunk@adrianschmutzler.de
State New
Headers show
Series
  • [OpenWrt-Devel] ath79: Add SUPPORTED_DEVICES for Archer C7 v1/v2
Related show

Commit Message

Adrian Schmutzler April 17, 2019, 1:45 p.m. UTC
The identifier for both devices is "archer-c7" on ar71xx, set here:
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 target/linux/ath79/image/generic-tp-link.mk | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christian Lamparter April 20, 2019, 6:59 p.m. UTC | #1
On Wednesday, April 17, 2019 3:45:52 PM CEST Adrian Schmutzler wrote:
> The identifier for both devices is "archer-c7" on ar71xx, set here:
> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  target/linux/ath79/image/generic-tp-link.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
> index 6853f12341..db1eabd420 100644
> --- a/target/linux/ath79/image/generic-tp-link.mk
> +++ b/target/linux/ath79/image/generic-tp-link.mk
> @@ -70,6 +70,7 @@ define Device/tplink_archer-c7-v1
>    DEVICE_TITLE := TP-Link Archer C7 v1
>    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
>    TPLINK_HWID := 0x75000001
> +  SUPPORTED_DEVICES += archer-c7
>  endef
>  TARGET_DEVICES += tplink_archer-c7-v1
>  
> @@ -79,6 +80,7 @@ define Device/tplink_archer-c7-v2
>    DEVICE_TITLE := TP-Link Archer C7 v2
>    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
>    TPLINK_HWID := 0xc7000002
> +  SUPPORTED_DEVICES += archer-c7
In case of the v2, I think there's still the problem that a straight up upgrade
from ar71xx to ath79 will affect the 5GHz ath10k wireless because it now has a
new device path and hence a new default configuration (where the card is 
disabled) is created.

Tomasz Maciej Nowak worked on the WMAC part already (that's why the C7 v1
hunk should be fine! But I think untested) in his series for the EPG5000.
<https://patchwork.ozlabs.org/patch/1056131/>.

So I think that maybe it's possible to extend the migration script for
pcie devices as well.

Cheers,
Christian
David Bauer April 21, 2019, 9:42 a.m. UTC | #2
Hello Christian,

On 20.04.19 20:59, Christian Lamparter wrote:
> On Wednesday, April 17, 2019 3:45:52 PM CEST Adrian Schmutzler wrote:
>> The identifier for both devices is "archer-c7" on ar71xx, set here:
>> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
>> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511
>>
>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>> ---
>>  target/linux/ath79/image/generic-tp-link.mk | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
>> index 6853f12341..db1eabd420 100644
>> --- a/target/linux/ath79/image/generic-tp-link.mk
>> +++ b/target/linux/ath79/image/generic-tp-link.mk
>> @@ -70,6 +70,7 @@ define Device/tplink_archer-c7-v1
>>    DEVICE_TITLE := TP-Link Archer C7 v1
>>    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
>>    TPLINK_HWID := 0x75000001
>> +  SUPPORTED_DEVICES += archer-c7
>>  endef
>>  TARGET_DEVICES += tplink_archer-c7-v1
>>  
>> @@ -79,6 +80,7 @@ define Device/tplink_archer-c7-v2
>>    DEVICE_TITLE := TP-Link Archer C7 v2
>>    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
>>    TPLINK_HWID := 0xc7000002
>> +  SUPPORTED_DEVICES += archer-c7
> In case of the v2, I think there's still the problem that a straight up upgrade
> from ar71xx to ath79 will affect the 5GHz ath10k wireless because it now has a
> new device path and hence a new default configuration (where the card is 
> disabled) is created.

I recall upgrading my OCEDO Koala (which uses the same 9558/9880 combo)
from ar71xx to ath79 and the PCIe path being consistent on both platforms.

This however might have changed in the meantime, so someone should
probably confirm this with a real C7.

Best wishes
David

> 
> Tomasz Maciej Nowak worked on the WMAC part already (that's why the C7 v1
> hunk should be fine! But I think untested) in his series for the EPG5000.
> <https://patchwork.ozlabs.org/patch/1056131/>.
> 
> So I think that maybe it's possible to extend the migration script for
> pcie devices as well.
> 
> Cheers,
> Christian
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
Christian Lamparter April 21, 2019, 12:17 p.m. UTC | #3
Hello David,

On Sunday, April 21, 2019 11:42:52 AM CEST David Bauer wrote:
> On 20.04.19 20:59, Christian Lamparter wrote:
> > On Wednesday, April 17, 2019 3:45:52 PM CEST Adrian Schmutzler wrote:
> >> The identifier for both devices is "archer-c7" on ar71xx, set here:
> >> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
> >> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511
> >>
> >> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> >> ---
> >>  target/linux/ath79/image/generic-tp-link.mk | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
> >> index 6853f12341..db1eabd420 100644
> >> --- a/target/linux/ath79/image/generic-tp-link.mk
> >> +++ b/target/linux/ath79/image/generic-tp-link.mk
> >> @@ -70,6 +70,7 @@ define Device/tplink_archer-c7-v1
> >>    DEVICE_TITLE := TP-Link Archer C7 v1
> >>    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
> >>    TPLINK_HWID := 0x75000001
> >> +  SUPPORTED_DEVICES += archer-c7
> >>  endef
> >>  TARGET_DEVICES += tplink_archer-c7-v1
> >>  
> >> @@ -79,6 +80,7 @@ define Device/tplink_archer-c7-v2
> >>    DEVICE_TITLE := TP-Link Archer C7 v2
> >>    DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
> >>    TPLINK_HWID := 0xc7000002
> >> +  SUPPORTED_DEVICES += archer-c7
> > In case of the v2, I think there's still the problem that a straight up upgrade
> > from ar71xx to ath79 will affect the 5GHz ath10k wireless because it now has a
> > new device path and hence a new default configuration (where the card is 
> > disabled) is created.
> 
> I recall upgrading my OCEDO Koala (which uses the same 9558/9880 combo)
> from ar71xx to ath79 and the PCIe path being consistent on both platforms.
> 
> This however might have changed in the meantime, so someone should
> probably confirm this with a real C7.

On my C7 v1 with a QCA9880v2 the ar71xx installation back in
2018-08-17 looked like this:

config wifi-device 'radio0'
        option type             'mac80211'
        option country          'DE'
        option channel          'auto'
        option hwmode           '11g'
        option path             'platform/qca955x_wmac'
        option htmode           'HT20'
        option disabled         '0'
        option txpower          '10'

config wifi-device 'radio1'
        option type             'mac80211'
        option channel          '52'
        option country          'DE'
        option hwmode           '11a'
        option path             'pci0000:01/0000:01:00.0'
        option htmode           'VHT80'
        option disabled         '0'
        option txpower          '14'

vs ath79 (today):

config wifi-device 'radio0'
        option type             'mac80211'
        option country          'DE'
        option channel          'auto'
        option hwmode           '11g'
        option path             'platform/ahb/ahb:apb/18100000.wmac'
        option htmode           'HT20'
        option disabled         '0'
        option txpower          '10'

config wifi-device 'radio1'
        option type             'mac80211'
        option channel          '52'
        option country          'DE'
        option hwmode           '11a'
        option path             'pci0000:00/0000:00:00.0'
        option htmode           'VHT80'
        option disabled         '0'
        option txpower          '14'

so the path changed from "pci0000:01/0000:01:00.0" to
"pci0000:00/0000:00:00.0". But again this is on a C7 v1.

Based on the bootlog on the wiki for 18.06.1 :
https://openwrt.org/toh/tp-link/archer-c7-1750#boot_logs
The ar71xx image enabling both pcie Root Complexes of the QCA955x. 
But unfortunately the pcie slot of the C7 is wired to the second RC,
so the ath10k card gets pci0000:01/0000:01:00.0. Does anybody want to
test what happens if the ath79 C7 v2 DTS enables "pcie0" too? It might
work, but it might not (depending on whenever it might end up in a
different pci domain like pci0001:00.).

Cheers,
Christian
David Bauer April 21, 2019, 1:18 p.m. UTC | #4
Hello Christian,

On 21.04.19 14:17, Christian Lamparter wrote:
> Hello David,
> 
> On Sunday, April 21, 2019 11:42:52 AM CEST David Bauer wrote:
>> On 20.04.19 20:59, Christian Lamparter wrote:
>>> On Wednesday, April 17, 2019 3:45:52 PM CEST Adrian Schmutzler wrote:
>>>> The identifier for both devices is "archer-c7" on ar71xx, set here:
>>>> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
>>>> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511
>>>>
>>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>>>> ---
>>>>   target/linux/ath79/image/generic-tp-link.mk | 2 ++
>>>>   1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
>>>> index 6853f12341..db1eabd420 100644
>>>> --- a/target/linux/ath79/image/generic-tp-link.mk
>>>> +++ b/target/linux/ath79/image/generic-tp-link.mk
>>>> @@ -70,6 +70,7 @@ define Device/tplink_archer-c7-v1
>>>>     DEVICE_TITLE := TP-Link Archer C7 v1
>>>>     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
>>>>     TPLINK_HWID := 0x75000001
>>>> +  SUPPORTED_DEVICES += archer-c7
>>>>   endef
>>>>   TARGET_DEVICES += tplink_archer-c7-v1
>>>>   
>>>> @@ -79,6 +80,7 @@ define Device/tplink_archer-c7-v2
>>>>     DEVICE_TITLE := TP-Link Archer C7 v2
>>>>     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
>>>>     TPLINK_HWID := 0xc7000002
>>>> +  SUPPORTED_DEVICES += archer-c7
>>> In case of the v2, I think there's still the problem that a straight up upgrade
>>> from ar71xx to ath79 will affect the 5GHz ath10k wireless because it now has a
>>> new device path and hence a new default configuration (where the card is
>>> disabled) is created.
>>
>> I recall upgrading my OCEDO Koala (which uses the same 9558/9880 combo)
>> from ar71xx to ath79 and the PCIe path being consistent on both platforms.
>>
>> This however might have changed in the meantime, so someone should
>> probably confirm this with a real C7.
> 
> On my C7 v1 with a QCA9880v2 the ar71xx installation back in
> 2018-08-17 looked like this:
> 
> config wifi-device 'radio0'
>          option type             'mac80211'
>          option country          'DE'
>          option channel          'auto'
>          option hwmode           '11g'
>          option path             'platform/qca955x_wmac'
>          option htmode           'HT20'
>          option disabled         '0'
>          option txpower          '10'
> 
> config wifi-device 'radio1'
>          option type             'mac80211'
>          option channel          '52'
>          option country          'DE'
>          option hwmode           '11a'
>          option path             'pci0000:01/0000:01:00.0'
>          option htmode           'VHT80'
>          option disabled         '0'
>          option txpower          '14'
> 
> vs ath79 (today):
> 
> config wifi-device 'radio0'
>          option type             'mac80211'
>          option country          'DE'
>          option channel          'auto'
>          option hwmode           '11g'
>          option path             'platform/ahb/ahb:apb/18100000.wmac'
>          option htmode           'HT20'
>          option disabled         '0'
>          option txpower          '10'
> 
> config wifi-device 'radio1'
>          option type             'mac80211'
>          option channel          '52'
>          option country          'DE'
>          option hwmode           '11a'
>          option path             'pci0000:00/0000:00:00.0'
>          option htmode           'VHT80'
>          option disabled         '0'
>          option txpower          '14'
> 
> so the path changed from "pci0000:01/0000:01:00.0" to
> "pci0000:00/0000:00:00.0". But again this is on a C7 v1.
> 
> Based on the bootlog on the wiki for 18.06.1 :
> https://openwrt.org/toh/tp-link/archer-c7-1750#boot_logs
> The ar71xx image enabling both pcie Root Complexes of the QCA955x.
> But unfortunately the pcie slot of the C7 is wired to the second RC,
> so the ath10k card gets pci0000:01/0000:01:00.0. Does anybody want to
> test what happens if the ath79 C7 v2 DTS enables "pcie0" too? It might
> work, but it might not (depending on whenever it might end up in a
> different pci domain like pci0001:00.).

Damn, you are right. The Koala has it's only PCIe endpoint wired to the 
first bus, so this works fine.

Regarding enabling the first bus: Personally, I would prefer a migration 
script over enabling a non-wired interface. There is already a migration 
script for exactly this case in the mpc85xx target, so most of this work 
is probably straight up copy-paste ;)

Best wishes
David
Adrian Schmutzler April 22, 2019, 11:45 a.m. UTC | #5
Hi all,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of David Bauer
> Sent: Sonntag, 21. April 2019 15:19
> To: Christian Lamparter <chunkeey@gmail.com>
> Cc: Adrian Schmutzler <freifunk@adrianschmutzler.de>; openwrt-
> devel@lists.openwrt.org; Tomasz Maciej Nowak <tomek_n@o2.pl>
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: Add SUPPORTED_DEVICES for
> Archer C7 v1/v2
> 
> Hello Christian,
> 
> On 21.04.19 14:17, Christian Lamparter wrote:
> > Hello David,
> >
> > On Sunday, April 21, 2019 11:42:52 AM CEST David Bauer wrote:
> >> On 20.04.19 20:59, Christian Lamparter wrote:
> >>> On Wednesday, April 17, 2019 3:45:52 PM CEST Adrian Schmutzler wrote:
> >>>> The identifier for both devices is "archer-c7" on ar71xx, set here:
> >>>>
> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/
> >>>> base-files/lib/ar71xx.sh#L348
> >>>>
> https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/
> >>>> base-files/lib/ar71xx.sh#L511
> >>>>
> >>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> >>>> ---
> >>>>   target/linux/ath79/image/generic-tp-link.mk | 2 ++
> >>>>   1 file changed, 2 insertions(+)
> >>>>
> >>>> diff --git a/target/linux/ath79/image/generic-tp-link.mk
> >>>> b/target/linux/ath79/image/generic-tp-link.mk
> >>>> index 6853f12341..db1eabd420 100644
> >>>> --- a/target/linux/ath79/image/generic-tp-link.mk
> >>>> +++ b/target/linux/ath79/image/generic-tp-link.mk
> >>>> @@ -70,6 +70,7 @@ define Device/tplink_archer-c7-v1
> >>>>     DEVICE_TITLE := TP-Link Archer C7 v1
> >>>>     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-
> usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
> >>>>     TPLINK_HWID := 0x75000001
> >>>> +  SUPPORTED_DEVICES += archer-c7
> >>>>   endef
> >>>>   TARGET_DEVICES += tplink_archer-c7-v1
> >>>>
> >>>> @@ -79,6 +80,7 @@ define Device/tplink_archer-c7-v2
> >>>>     DEVICE_TITLE := TP-Link Archer C7 v2
> >>>>     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-
> usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
> >>>>     TPLINK_HWID := 0xc7000002
> >>>> +  SUPPORTED_DEVICES += archer-c7
> >>> In case of the v2, I think there's still the problem that a straight
> >>> up upgrade from ar71xx to ath79 will affect the 5GHz ath10k wireless
> >>> because it now has a new device path and hence a new default
> >>> configuration (where the card is
> >>> disabled) is created.
> >>
> >> I recall upgrading my OCEDO Koala (which uses the same 9558/9880
> >> combo) from ar71xx to ath79 and the PCIe path being consistent on both
> platforms.
> >>
> >> This however might have changed in the meantime, so someone should
> >> probably confirm this with a real C7.
> >
> > On my C7 v1 with a QCA9880v2 the ar71xx installation back in
> > 2018-08-17 looked like this:
> >
> > config wifi-device 'radio0'
> >          option type             'mac80211'
> >          option country          'DE'
> >          option channel          'auto'
> >          option hwmode           '11g'
> >          option path             'platform/qca955x_wmac'
> >          option htmode           'HT20'
> >          option disabled         '0'
> >          option txpower          '10'
> >
> > config wifi-device 'radio1'
> >          option type             'mac80211'
> >          option channel          '52'
> >          option country          'DE'
> >          option hwmode           '11a'
> >          option path             'pci0000:01/0000:01:00.0'
> >          option htmode           'VHT80'
> >          option disabled         '0'
> >          option txpower          '14'
> >
> > vs ath79 (today):
> >
> > config wifi-device 'radio0'
> >          option type             'mac80211'
> >          option country          'DE'
> >          option channel          'auto'
> >          option hwmode           '11g'
> >          option path             'platform/ahb/ahb:apb/18100000.wmac'
> >          option htmode           'HT20'
> >          option disabled         '0'
> >          option txpower          '10'
> >
> > config wifi-device 'radio1'
> >          option type             'mac80211'
> >          option channel          '52'
> >          option country          'DE'
> >          option hwmode           '11a'
> >          option path             'pci0000:00/0000:00:00.0'
> >          option htmode           'VHT80'
> >          option disabled         '0'
> >          option txpower          '14'
> >
> > so the path changed from "pci0000:01/0000:01:00.0" to
> > "pci0000:00/0000:00:00.0". But again this is on a C7 v1.
> >
> > Based on the bootlog on the wiki for 18.06.1 :
> > https://openwrt.org/toh/tp-link/archer-c7-1750#boot_logs
> > The ar71xx image enabling both pcie Root Complexes of the QCA955x.
> > But unfortunately the pcie slot of the C7 is wired to the second RC,
> > so the ath10k card gets pci0000:01/0000:01:00.0. Does anybody want to
> > test what happens if the ath79 C7 v2 DTS enables "pcie0" too? It might
> > work, but it might not (depending on whenever it might end up in a
> > different pci domain like pci0001:00.).
> 
> Damn, you are right. The Koala has it's only PCIe endpoint wired to the first
> bus, so this works fine.
> 
> Regarding enabling the first bus: Personally, I would prefer a migration script
> over enabling a non-wired interface. There is already a migration script for
> exactly this case in the mpc85xx target, so most of this work is probably
> straight up copy-paste ;)
> 
> Best wishes
> David

I normally do not care about the config-upgrade as I do it manually with custom scripts, partially relying on default config after upgrade.

My patch was only meant to fix image-check.
If the discussed upgrade-issue is considered a requirement for enabling SUPPORTED_DEVICES, I will have to wait for someone to test on C7v2.

Best

Adrian


> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
camden lindsay April 30, 2019, 1:48 a.m. UTC | #6
Adrian-
I have a C7V2 and can do some testing on it if you'd explain exactly what
you're looking for...  I don't quite follow what is needed in the above
thread.  Something about looking at PCI paths before and after an upgrade
from one version to another...
Camden

On Mon, Apr 22, 2019 at 4:45 AM <mail@adrianschmutzler.de> wrote:

> Hi all,
>
> > -----Original Message-----
> > From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> > On Behalf Of David Bauer
> > Sent: Sonntag, 21. April 2019 15:19
> > To: Christian Lamparter <chunkeey@gmail.com>
> > Cc: Adrian Schmutzler <freifunk@adrianschmutzler.de>; openwrt-
> > devel@lists.openwrt.org; Tomasz Maciej Nowak <tomek_n@o2.pl>
> > Subject: Re: [OpenWrt-Devel] [PATCH] ath79: Add SUPPORTED_DEVICES for
> > Archer C7 v1/v2
> >
> > Hello Christian,
> >
> > On 21.04.19 14:17, Christian Lamparter wrote:
> > > Hello David,
> > >
> > > On Sunday, April 21, 2019 11:42:52 AM CEST David Bauer wrote:
> > >> On 20.04.19 20:59, Christian Lamparter wrote:
> > >>> On Wednesday, April 17, 2019 3:45:52 PM CEST Adrian Schmutzler wrote:
> > >>>> The identifier for both devices is "archer-c7" on ar71xx, set here:
> > >>>>
> > https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/
> > >>>> base-files/lib/ar71xx.sh#L348
> > >>>>
> > https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/
> > >>>> base-files/lib/ar71xx.sh#L511
> > >>>>
> > >>>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> > >>>> ---
> > >>>>   target/linux/ath79/image/generic-tp-link.mk | 2 ++
> > >>>>   1 file changed, 2 insertions(+)
> > >>>>
> > >>>> diff --git a/target/linux/ath79/image/generic-tp-link.mk
> > >>>> b/target/linux/ath79/image/generic-tp-link.mk
> > >>>> index 6853f12341..db1eabd420 100644
> > >>>> --- a/target/linux/ath79/image/generic-tp-link.mk
> > >>>> +++ b/target/linux/ath79/image/generic-tp-link.mk
> > >>>> @@ -70,6 +70,7 @@ define Device/tplink_archer-c7-v1
> > >>>>     DEVICE_TITLE := TP-Link Archer C7 v1
> > >>>>     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-
> > usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
> > >>>>     TPLINK_HWID := 0x75000001
> > >>>> +  SUPPORTED_DEVICES += archer-c7
> > >>>>   endef
> > >>>>   TARGET_DEVICES += tplink_archer-c7-v1
> > >>>>
> > >>>> @@ -79,6 +80,7 @@ define Device/tplink_archer-c7-v2
> > >>>>     DEVICE_TITLE := TP-Link Archer C7 v2
> > >>>>     DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-
> > usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
> > >>>>     TPLINK_HWID := 0xc7000002
> > >>>> +  SUPPORTED_DEVICES += archer-c7
> > >>> In case of the v2, I think there's still the problem that a straight
> > >>> up upgrade from ar71xx to ath79 will affect the 5GHz ath10k wireless
> > >>> because it now has a new device path and hence a new default
> > >>> configuration (where the card is
> > >>> disabled) is created.
> > >>
> > >> I recall upgrading my OCEDO Koala (which uses the same 9558/9880
> > >> combo) from ar71xx to ath79 and the PCIe path being consistent on both
> > platforms.
> > >>
> > >> This however might have changed in the meantime, so someone should
> > >> probably confirm this with a real C7.
> > >
> > > On my C7 v1 with a QCA9880v2 the ar71xx installation back in
> > > 2018-08-17 looked like this:
> > >
> > > config wifi-device 'radio0'
> > >          option type             'mac80211'
> > >          option country          'DE'
> > >          option channel          'auto'
> > >          option hwmode           '11g'
> > >          option path             'platform/qca955x_wmac'
> > >          option htmode           'HT20'
> > >          option disabled         '0'
> > >          option txpower          '10'
> > >
> > > config wifi-device 'radio1'
> > >          option type             'mac80211'
> > >          option channel          '52'
> > >          option country          'DE'
> > >          option hwmode           '11a'
> > >          option path             'pci0000:01/0000:01:00.0'
> > >          option htmode           'VHT80'
> > >          option disabled         '0'
> > >          option txpower          '14'
> > >
> > > vs ath79 (today):
> > >
> > > config wifi-device 'radio0'
> > >          option type             'mac80211'
> > >          option country          'DE'
> > >          option channel          'auto'
> > >          option hwmode           '11g'
> > >          option path             'platform/ahb/ahb:apb/18100000.wmac'
> > >          option htmode           'HT20'
> > >          option disabled         '0'
> > >          option txpower          '10'
> > >
> > > config wifi-device 'radio1'
> > >          option type             'mac80211'
> > >          option channel          '52'
> > >          option country          'DE'
> > >          option hwmode           '11a'
> > >          option path             'pci0000:00/0000:00:00.0'
> > >          option htmode           'VHT80'
> > >          option disabled         '0'
> > >          option txpower          '14'
> > >
> > > so the path changed from "pci0000:01/0000:01:00.0" to
> > > "pci0000:00/0000:00:00.0". But again this is on a C7 v1.
> > >
> > > Based on the bootlog on the wiki for 18.06.1 :
> > > https://openwrt.org/toh/tp-link/archer-c7-1750#boot_logs
> > > The ar71xx image enabling both pcie Root Complexes of the QCA955x.
> > > But unfortunately the pcie slot of the C7 is wired to the second RC,
> > > so the ath10k card gets pci0000:01/0000:01:00.0. Does anybody want to
> > > test what happens if the ath79 C7 v2 DTS enables "pcie0" too? It might
> > > work, but it might not (depending on whenever it might end up in a
> > > different pci domain like pci0001:00.).
> >
> > Damn, you are right. The Koala has it's only PCIe endpoint wired to the
> first
> > bus, so this works fine.
> >
> > Regarding enabling the first bus: Personally, I would prefer a migration
> script
> > over enabling a non-wired interface. There is already a migration script
> for
> > exactly this case in the mpc85xx target, so most of this work is probably
> > straight up copy-paste ;)
> >
> > Best wishes
> > David
>
> I normally do not care about the config-upgrade as I do it manually with
> custom scripts, partially relying on default config after upgrade.
>
> My patch was only meant to fix image-check.
> If the discussed upgrade-issue is considered a requirement for enabling
> SUPPORTED_DEVICES, I will have to wait for someone to test on C7v2.
>
> Best
>
> Adrian
>
>
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
Adrian Schmutzler April 30, 2019, 12:18 p.m. UTC | #7
Hi Camden,

> From: camden lindsay [mailto:camden.lindsay+lede@gmail.com] 
> Sent: Dienstag, 30. April 2019 03:48
> To: mail@adrianschmutzler.de
> Cc: David Bauer <mail@david-bauer.net>; Christian Lamparter <chunkeey@gmail.com>; Adrian Schmutzler <freifunk@adrianschmutzler.de>; OpenWrt Development List <openwrt-devel@lists.openwrt.org>; Tomasz Maciej Nowak <tomek_n@o2.pl>
> Subject: Re: [OpenWrt-Devel] [PATCH] ath79: Add SUPPORTED_DEVICES for Archer C7 v1/v2
>
> Adrian-
> I have a C7V2 and can do some testing on it if you'd explain exactly what you're looking for...  I don't quite follow what is needed in the above thread.  Something about looking at PCI paths before and after an upgrade from one version to another...
> Camden
>

Thanks for your offer.

Unfortunately, I do not use the normal OpenWrt upgrade mechanism; so I also do not know precisely what's the problem here.
From the other people's comments, I can extract the following:

> >>> In case of the v2, I think there's still the problem that a straight
> >>> up upgrade from ar71xx to ath79 will affect the 5GHz ath10k wireless
> >>> because it now has a new device path and hence a new default
> >>> configuration (where the card is
> >>> disabled) is created.
> >>
[ ... ]
> >
> > On my C7 v1 with a QCA9880v2 the ar71xx installation back in
> > 2018-08-17 looked like this:
> >
> > config wifi-device 'radio0'
> >          option type             'mac80211'
> >          option country          'DE'
> >          option channel          'auto'
> >          option hwmode           '11g'
> >          option path             'platform/qca955x_wmac'
> >          option htmode           'HT20'
> >          option disabled         '0'
> >          option txpower          '10'
> >
> > config wifi-device 'radio1'
> >          option type             'mac80211'
> >          option channel          '52'
> >          option country          'DE'
> >          option hwmode           '11a'
> >          option path             'pci0000:01/0000:01:00.0'
> >          option htmode           'VHT80'
> >          option disabled         '0'
> >          option txpower          '14'
> >
> > vs ath79 (today):
> >
> > config wifi-device 'radio0'
> >          option type             'mac80211'
> >          option country          'DE'
> >          option channel          'auto'
> >          option hwmode           '11g'
> >          option path             'platform/ahb/ahb:apb/18100000.wmac'
> >          option htmode           'HT20'
> >          option disabled         '0'
> >          option txpower          '10'
> >
> > config wifi-device 'radio1'
> >          option type             'mac80211'
> >          option channel          '52'
> >          option country          'DE'
> >          option hwmode           '11a'
> >          option path             'pci0000:00/0000:00:00.0'
> >          option htmode           'VHT80'
> >          option disabled         '0'
> >          option txpower          '14'
> >
> > so the path changed from "pci0000:01/0000:01:00.0" to
> > "pci0000:00/0000:00:00.0". But again this is on a C7 v1.
> >
> > Based on the bootlog on the wiki for 18.06.1 :
> > https://openwrt.org/toh/tp-link/archer-c7-1750#boot_logs
> > The ar71xx image enabling both pcie Root Complexes of the QCA955x.
> > But unfortunately the pcie slot of the C7 is wired to the second RC,
> > so the ath10k card gets pci0000:01/0000:01:00.0. Does anybody want to
> > test what happens if the ath79 C7 v2 DTS enables "pcie0" too? It might
> > work, but it might not (depending on whenever it might end up in a
> > different pci domain like pci0001:00.).
> 
[...]
> Regarding enabling the first bus: Personally, I would prefer a migration script
> over enabling a non-wired interface. There is already a migration script for
> exactly this case in the mpc85xx target, so most of this work is probably
> straight up copy-paste ;)

From the different comments, I'm not quite sure whether this is a matter of simple testing or whether there is still a migration script required.

Best

Adrian
camden lindsay May 2, 2019, 3:37 a.m. UTC | #8
Hmmm; well, i've got this; Fresh 'firstboot' on an archer c7 V2, following
version info:
root@LEDE:~# cat /etc/openwrt_*
DISTRIB_ID='LEDE'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r3189-12db207'
DISTRIB_CODENAME='reboot'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='LEDE Reboot SNAPSHOT r3189-12db207'
DISTRIB_TAINTS='no-all'
r3189-12db207
root@LEDE:~#

/etc/config/wifi has this in it:
root@LEDE:~# cat /etc/config/wireless

config wifi-device 'radio0'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'pci0000:01/0000:01:00.0'
option htmode 'VHT80'
option disabled '1'

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'LEDE'
option encryption 'none'

config wifi-device 'radio1'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option path 'platform/qca955x_wmac'
option htmode 'HT20'
option disabled '1'

config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'LEDE'
option encryption 'none'

and
root@LEDE:/sys/class/ieee80211# ls -al /sys/class/ieee80211/
drwxr-xr-x    2 root     root             0 Jan 27 22:39 .
drwxr-xr-x   21 root     root             0 Jan  1  1970 ..
lrwxrwxrwx    1 root     root             0 Jan 27 22:39 phy0 ->
../../devices/pci0000:01/0000:01:00.0/ieee80211/phy0
lrwxrwxrwx    1 root     root             0 Jan 27 22:39 phy1 ->
../../devices/platform/qca955x_wmac/ieee80211/phy1


After upgrading using sysupgrade to stable ar71xx:
http://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/openwrt-18.06.2-ar71xx-generic-archer-c7-v2-squashfs-sysupgrade.bin
root@LEDE:~# cat /etc/openwrt_*
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='18.06.2'
DISTRIB_REVISION='r7676-cddd7b4c77'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='OpenWrt 18.06.2 r7676-cddd7b4c77'
DISTRIB_TAINTS=''
r7676-cddd7b4c77
root@LEDE:~#

I should have double checked wireless config but didn't :-/  derp. I'll
rollback to this at the end and post a firstboot'd wireless config from
18.06.2.

PCI paths:
root@LEDE:~# ls -al /sys/class/ieee80211/
drwxr-xr-x    2 root     root             0 Jan 30 12:21 .
drwxr-xr-x   22 root     root             0 Jan  1  1970 ..
lrwxrwxrwx    1 root     root             0 Jan 30 12:21 phy0 ->
../../devices/pci0000:01/0000:01:00.0/ieee80211/phy0
lrwxrwxrwx    1 root     root             0 Jan 30 12:21 phy1 ->
../../devices/platform/qca955x_wmac/ieee80211/phy1

Attempting to sysupgrade to ath79 brings this on:
root@LEDE:~# sysupgrade
/tmp/openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin
Device archer-c7 not supported by this image
Supported devices: tplink,archer-c7-v2
Image check 'fwtool_check_image' failed.
root@LEDE:~#

Forcing upgrade with -f ... After upgrading using sysupgrade to snapshot
ath79:
http://downloads.openwrt.org/snapshots/targets/ath79/generic/openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin

root@LEDE:~# cat /etc/openwrt_*
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r9915-d6643aca34'
DISTRIB_TARGET='ath79/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r9915-d6643aca34'
DISTRIB_TAINTS=''
r9915-d6643aca34
root@LEDE:~#


root@LEDE:~# ls -al /sys/class/ieee80211/
drwxr-xr-x    2 root     root             0 May  1 05:25 .
drwxr-xr-x   24 root     root             0 Jan  1  1970 ..
lrwxrwxrwx    1 root     root             0 May  1 05:25 phy0 ->
../../devices/pci0000:00/0000:00:00.0/ieee80211/phy0
lrwxrwxrwx    1 root     root             0 May  1 05:25 phy1 ->
../../devices/platform/ahb/ahb:apb/18100000.wmac/ieee80211/phy1
root@LEDE:~#

wireless config seems to have both new and old paths..
root@LEDE:~# cat /etc/config/wireless

config wifi-device 'radio0'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'pci0000:01/0000:01:00.0'
option htmode 'VHT80'
option disabled '1'

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'LEDE'
option encryption 'none'

config wifi-device 'radio1'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option htmode 'HT20'
option disabled '1'
option path 'platform/ahb/ahb:apb/18100000.wmac'

config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'LEDE'
option encryption 'none'

config wifi-device 'radio2'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'pci0000:00/0000:00:00.0'
option htmode 'VHT80'
option disabled '1'

config wifi-iface 'default_radio2'
option device 'radio2'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

root@LEDE:~#


And .. sorry its out of order, after downgrading using sysupgrade -F  to
18.06.2, then firstbooting,see as follows
root@OpenWrt:~# grep 18 /etc/openwrt_*
/etc/openwrt_release:DISTRIB_RELEASE='18.06.2'
/etc/openwrt_release:DISTRIB_DESCRIPTION='OpenWrt 18.06.2 r7676-cddd7b4c77'
root@OpenWrt:~#

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path 'pci0000:01/0000:01:00.0'
option htmode 'VHT80'
option disabled '1'

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

config wifi-device 'radio1'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option path 'platform/qca955x_wmac'
option htmode 'HT20'
option disabled '1'

config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

root@OpenWrt:~#




Hope this helps some.  I've never used DTS... Heck, i don't even know which
DTS ya'll are talking about since none of these seem to make sense(
https://en.wikipedia.org/wiki/DTS)... so i'm  not clear on what needs to be
done to test the following... (oh, wait .. device tree source.... still
unsure how to proceed):
"Does anybody want to
> > test what happens if the ath79 C7 v2 DTS enables "pcie0" too? It might
> > work, but it might not (depending on whenever it might end up in a
> > different pci domain like pci0001:00.)."

 c

Patch
diff mbox series

diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index 6853f12341..db1eabd420 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -70,6 +70,7 @@  define Device/tplink_archer-c7-v1
   DEVICE_TITLE := TP-Link Archer C7 v1
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
   TPLINK_HWID := 0x75000001
+  SUPPORTED_DEVICES += archer-c7
 endef
 TARGET_DEVICES += tplink_archer-c7-v1
 
@@ -79,6 +80,7 @@  define Device/tplink_archer-c7-v2
   DEVICE_TITLE := TP-Link Archer C7 v2
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
   TPLINK_HWID := 0xc7000002
+  SUPPORTED_DEVICES += archer-c7
   IMAGES += factory-us.bin factory-eu.bin
   IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US
   IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU