[PATCH] at91: Automatically detect USB feature

Hauke Mehrtens hauke at hauke-m.de
Thu Apr 7 10:37:35 PDT 2022


On 4/7/22 08:49, Claudiu.Beznea at microchip.com wrote:
> On 07.04.2022 01:49, Hauke Mehrtens wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> The sama7 sub target does not have USB support, the feature should not
>> be activated there. OpenWrt can automatically detect if the target
>> supports USB by using the scripts/target-metadata.pl script. With the
>> automatic detection USB support will only get activated on subtargest
>> which actually support USB.
>>
>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>> ---
>>
>> This should replace the patch activating USB support for the sama7 sub target.
>>
>>   target/linux/at91/Makefile | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
>> index 36804a1eeb6f..af0dc3f33849 100644
>> --- a/target/linux/at91/Makefile
>> +++ b/target/linux/at91/Makefile
>> @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
>>   ARCH:=arm
>>   BOARD:=at91
>>   BOARDNAME:=Microchip (Atmel AT91)
>> -FEATURES:=ext4 squashfs targz usb usbgadget ubifs
>> +FEATURES:=ext4 squashfs targz usbgadget ubifs
> 
> Just to be sure as I don't master these: USB support is available for the
> rest of AT91 sub targets (sam9x, sama5), only sama7 doesn't have it at the
> moment. This patch should be good also for sam9x and sama5, right?

Yes it is fine. The usb feature flag will automatically activated when 
the kernel config option CONFIG_USB_SUPPORT is set. This is the case for 
the other two sub targets, there it will be activated. I tried it before 
sending the patch.

When you later activate CONFIG_USB_SUPPORT for sama7 the usb feature 
will be activated there automatically too.

Hauke



More information about the openwrt-devel mailing list