diff mbox series

[1/4] rockchip: Update the default USB Product ID value

Message ID 20240226230822.2430391-2-jonas@kwiboo.se
State Superseded
Delegated to: Kever Yang
Headers show
Series rockchip: Migrate to use DM_USB_GADGET on RK3328 | expand

Commit Message

Jonas Karlman Feb. 26, 2024, 11:08 p.m. UTC
RK3036 is using the USB product id normally used by RK3066B, and RK3328
is using the product id normally used by RK3368.

Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option
for remaining supported Rockchip SoCs to match the product id used in
Mask ROM mode. Also remove a reference to the unknown ROCKCHIP_RK3229
symbol.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/usb/gadget/Kconfig | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Comments

Kever Yang March 8, 2024, 9:22 a.m. UTC | #1
Hi Jonas,

     Thanks for your patch.

On 2024/2/27 07:08, Jonas Karlman wrote:
> RK3036 is using the USB product id normally used by RK3066B, and RK3328
> is using the product id normally used by RK3368.
>
> Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option
> for remaining supported Rockchip SoCs to match the product id used in
> Mask ROM mode. Also remove a reference to the unknown ROCKCHIP_RK3229
> symbol.

RK3229 belongs to RK322X which is reuse with RK3228.

Note that this ID is used for rockusb gadget, if work as mass storage, 
it should use other

ID, or else it will confuse the driver in host side, eg. the Windows 
driver may not able to

recognize the device if using two different gadget type with the same ID.


Thanks,
- Kever
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
>   drivers/usb/gadget/Kconfig | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index c72a8047635c..4621a6fd5e64 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -70,12 +70,21 @@ config USB_GADGET_PRODUCT_NUM
>   	hex "Product ID of the USB device"
>   	default 0x701a if ARCH_TEGRA
>   	default 0x1010 if ARCH_SUNXI
> -	default 0x310a if ROCKCHIP_RK3036
> +	default 0x110a if ROCKCHIP_RV1108
> +	default 0x110b if ROCKCHIP_RV1126
>   	default 0x300a if ROCKCHIP_RK3066
> +	default 0x301a if ROCKCHIP_RK3036
> +	default 0x310b if ROCKCHIP_RK3188
>   	default 0x310c if ROCKCHIP_RK3128
> -	default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
> -	default 0x330a if ROCKCHIP_RK3328
> +	default 0x320a if ROCKCHIP_RK3288
> +	default 0x320b if ROCKCHIP_RK322X
> +	default 0x320c if ROCKCHIP_RK3328
> +	default 0x330a if ROCKCHIP_RK3368
>   	default 0x330c if ROCKCHIP_RK3399
> +	default 0x330d if ROCKCHIP_PX30
> +	default 0x330e if ROCKCHIP_RK3308
> +	default 0x350a if ROCKCHIP_RK3568
> +	default 0x350b if ROCKCHIP_RK3588
>   	default 0x0
>   	help
>   	  Product ID of the USB device emulated, reported to the host device.
Jonas Karlman March 8, 2024, 10:42 a.m. UTC | #2
Hi Kever,

On 2024-03-08 10:22, Kever Yang wrote:
> Hi Jonas,
> 
>      Thanks for your patch.
> 
> On 2024/2/27 07:08, Jonas Karlman wrote:
>> RK3036 is using the USB product id normally used by RK3066B, and RK3328
>> is using the product id normally used by RK3368.
>>
>> Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option
>> for remaining supported Rockchip SoCs to match the product id used in
>> Mask ROM mode. Also remove a reference to the unknown ROCKCHIP_RK3229
>> symbol.
> 
> RK3229 belongs to RK322X which is reuse with RK3228.
> 
> Note that this ID is used for rockusb gadget, if work as mass storage, 
> it should use other
> 
> ID, or else it will confuse the driver in host side, eg. the Windows 
> driver may not able to
> 
> recognize the device if using two different gadget type with the same ID.

Patch 3 in this series will change to use 0x0010 product id when ums
mode is enabled and fall back to use the USB_GADGET_PRODUCT_NUM for any
other gadget mode.

The ROCKCHIP_RK3229 symbol is not defined or used anywhere U-Boot so the
change in this patch to remove it from the condition should have no
impact. If RK3229 need a special product id separate from 0x320b used by
ROCKCHIP_RK322X, it can be defined in the defconfig for such board.

I tested this on Windows with rockusb and ums on RK3308, RK3328, RK3399
RK356x and RK3588 boards, switching between ums and rockusb should work
as intended, rockusb driver was used in rockusb mode and in ums mode the
device would show up as a disk.

  => rockusb 0 mmc 1
  => ums 0 mmc 1

I think all product id below is correct, but I have not been able to
runtime validate for other SoCs then the ones listed above.

Regards,
Jonas

> 
> 
> Thanks,
> - Kever
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>>   drivers/usb/gadget/Kconfig | 15 ++++++++++++---
>>   1 file changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
>> index c72a8047635c..4621a6fd5e64 100644
>> --- a/drivers/usb/gadget/Kconfig
>> +++ b/drivers/usb/gadget/Kconfig
>> @@ -70,12 +70,21 @@ config USB_GADGET_PRODUCT_NUM
>>   	hex "Product ID of the USB device"
>>   	default 0x701a if ARCH_TEGRA
>>   	default 0x1010 if ARCH_SUNXI
>> -	default 0x310a if ROCKCHIP_RK3036
>> +	default 0x110a if ROCKCHIP_RV1108
>> +	default 0x110b if ROCKCHIP_RV1126
>>   	default 0x300a if ROCKCHIP_RK3066
>> +	default 0x301a if ROCKCHIP_RK3036
>> +	default 0x310b if ROCKCHIP_RK3188
>>   	default 0x310c if ROCKCHIP_RK3128
>> -	default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
>> -	default 0x330a if ROCKCHIP_RK3328
>> +	default 0x320a if ROCKCHIP_RK3288
>> +	default 0x320b if ROCKCHIP_RK322X
>> +	default 0x320c if ROCKCHIP_RK3328
>> +	default 0x330a if ROCKCHIP_RK3368
>>   	default 0x330c if ROCKCHIP_RK3399
>> +	default 0x330d if ROCKCHIP_PX30
>> +	default 0x330e if ROCKCHIP_RK3308
>> +	default 0x350a if ROCKCHIP_RK3568
>> +	default 0x350b if ROCKCHIP_RK3588
>>   	default 0x0
>>   	help
>>   	  Product ID of the USB device emulated, reported to the host device.
Kever Yang March 11, 2024, 3:20 a.m. UTC | #3
Hi Jonas,

On 2024/3/8 18:42, Jonas Karlman wrote:
> Hi Kever,
>
> On 2024-03-08 10:22, Kever Yang wrote:
>> Hi Jonas,
>>
>>       Thanks for your patch.
>>
>> On 2024/2/27 07:08, Jonas Karlman wrote:
>>> RK3036 is using the USB product id normally used by RK3066B, and RK3328
>>> is using the product id normally used by RK3368.
>>>
>>> Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option
>>> for remaining supported Rockchip SoCs to match the product id used in
>>> Mask ROM mode. Also remove a reference to the unknown ROCKCHIP_RK3229
>>> symbol.
>> RK3229 belongs to RK322X which is reuse with RK3228.
>>
>> Note that this ID is used for rockusb gadget, if work as mass storage,
>> it should use other
>>
>> ID, or else it will confuse the driver in host side, eg. the Windows
>> driver may not able to
>>
>> recognize the device if using two different gadget type with the same ID.
> Patch 3 in this series will change to use 0x0010 product id when ums
> mode is enabled and fall back to use the USB_GADGET_PRODUCT_NUM for any
> other gadget mode.
Yes, I see that a few seconds after I send that mail.
>
> The ROCKCHIP_RK3229 symbol is not defined or used anywhere U-Boot so the
> change in this patch to remove it from the condition should have no
> impact. If RK3229 need a special product id separate from 0x320b used by
> ROCKCHIP_RK322X, it can be defined in the defconfig for such board.

ROCKCHIP_RK3229 does not need any more, because it's included in Rk322X.

So please update the commit message with " remove ROCKCHIP_RK3229 because
it's included in ROCKCHIP_RK322X" instead of "unknown ROCKCHIP_RK3229".

>
> I tested this on Windows with rockusb and ums on RK3308, RK3328, RK3399
> RK356x and RK3588 boards, switching between ums and rockusb should work
> as intended, rockusb driver was used in rockusb mode and in ums mode the
> device would show up as a disk.
>
>    => rockusb 0 mmc 1
>    => ums 0 mmc 1
>
> I think all product id below is correct,

Yes, I have check these IDs, they are correct.


Thanks,
- Kever
> but I have not been able to
> runtime validate for other SoCs then the ones listed above.
>
> Regards,
> Jonas
>
>>
>> Thanks,
>> - Kever
>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>> ---
>>>    drivers/usb/gadget/Kconfig | 15 ++++++++++++---
>>>    1 file changed, 12 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
>>> index c72a8047635c..4621a6fd5e64 100644
>>> --- a/drivers/usb/gadget/Kconfig
>>> +++ b/drivers/usb/gadget/Kconfig
>>> @@ -70,12 +70,21 @@ config USB_GADGET_PRODUCT_NUM
>>>    	hex "Product ID of the USB device"
>>>    	default 0x701a if ARCH_TEGRA
>>>    	default 0x1010 if ARCH_SUNXI
>>> -	default 0x310a if ROCKCHIP_RK3036
>>> +	default 0x110a if ROCKCHIP_RV1108
>>> +	default 0x110b if ROCKCHIP_RV1126
>>>    	default 0x300a if ROCKCHIP_RK3066
>>> +	default 0x301a if ROCKCHIP_RK3036
>>> +	default 0x310b if ROCKCHIP_RK3188
>>>    	default 0x310c if ROCKCHIP_RK3128
>>> -	default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
>>> -	default 0x330a if ROCKCHIP_RK3328
>>> +	default 0x320a if ROCKCHIP_RK3288
>>> +	default 0x320b if ROCKCHIP_RK322X
>>> +	default 0x320c if ROCKCHIP_RK3328
>>> +	default 0x330a if ROCKCHIP_RK3368
>>>    	default 0x330c if ROCKCHIP_RK3399
>>> +	default 0x330d if ROCKCHIP_PX30
>>> +	default 0x330e if ROCKCHIP_RK3308
>>> +	default 0x350a if ROCKCHIP_RK3568
>>> +	default 0x350b if ROCKCHIP_RK3588
>>>    	default 0x0
>>>    	help
>>>    	  Product ID of the USB device emulated, reported to the host device.
Jonas Karlman March 12, 2024, 9:50 p.m. UTC | #4
Hi Kever,

On 2024-03-11 04:20, Kever Yang wrote:
> Hi Jonas,
> 
> On 2024/3/8 18:42, Jonas Karlman wrote:
>> Hi Kever,
>>
>> On 2024-03-08 10:22, Kever Yang wrote:
>>> Hi Jonas,
>>>
>>>       Thanks for your patch.
>>>
>>> On 2024/2/27 07:08, Jonas Karlman wrote:
>>>> RK3036 is using the USB product id normally used by RK3066B, and RK3328
>>>> is using the product id normally used by RK3368.
>>>>
>>>> Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option
>>>> for remaining supported Rockchip SoCs to match the product id used in
>>>> Mask ROM mode. Also remove a reference to the unknown ROCKCHIP_RK3229
>>>> symbol.
>>> RK3229 belongs to RK322X which is reuse with RK3228.
>>>
>>> Note that this ID is used for rockusb gadget, if work as mass storage,
>>> it should use other
>>>
>>> ID, or else it will confuse the driver in host side, eg. the Windows
>>> driver may not able to
>>>
>>> recognize the device if using two different gadget type with the same ID.
>> Patch 3 in this series will change to use 0x0010 product id when ums
>> mode is enabled and fall back to use the USB_GADGET_PRODUCT_NUM for any
>> other gadget mode.
> Yes, I see that a few seconds after I send that mail.
>>
>> The ROCKCHIP_RK3229 symbol is not defined or used anywhere U-Boot so the
>> change in this patch to remove it from the condition should have no
>> impact. If RK3229 need a special product id separate from 0x320b used by
>> ROCKCHIP_RK322X, it can be defined in the defconfig for such board.
> 
> ROCKCHIP_RK3229 does not need any more, because it's included in Rk322X.
> 
> So please update the commit message with " remove ROCKCHIP_RK3229 because
> it's included in ROCKCHIP_RK322X" instead of "unknown ROCKCHIP_RK3229".

I have recently sent a v2 using the following message, let me know if
you want me to send a v3 with your suggested message instead.

"Also remove a reference to an undefined ROCKCHIP_RK3229 Kconfig symbol."

> 
>>
>> I tested this on Windows with rockusb and ums on RK3308, RK3328, RK3399
>> RK356x and RK3588 boards, switching between ums and rockusb should work
>> as intended, rockusb driver was used in rockusb mode and in ums mode the
>> device would show up as a disk.
>>
>>    => rockusb 0 mmc 1
>>    => ums 0 mmc 1
>>
>> I think all product id below is correct,
> 
> Yes, I have check these IDs, they are correct.

Great!

Regards,
Jonas

> 
> 
> Thanks,
> - Kever
>> but I have not been able to
>> runtime validate for other SoCs then the ones listed above.
>>
>> Regards,
>> Jonas
>>
>>>
>>> Thanks,
>>> - Kever
>>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>>> ---
>>>>    drivers/usb/gadget/Kconfig | 15 ++++++++++++---
>>>>    1 file changed, 12 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
>>>> index c72a8047635c..4621a6fd5e64 100644
>>>> --- a/drivers/usb/gadget/Kconfig
>>>> +++ b/drivers/usb/gadget/Kconfig
>>>> @@ -70,12 +70,21 @@ config USB_GADGET_PRODUCT_NUM
>>>>    	hex "Product ID of the USB device"
>>>>    	default 0x701a if ARCH_TEGRA
>>>>    	default 0x1010 if ARCH_SUNXI
>>>> -	default 0x310a if ROCKCHIP_RK3036
>>>> +	default 0x110a if ROCKCHIP_RV1108
>>>> +	default 0x110b if ROCKCHIP_RV1126
>>>>    	default 0x300a if ROCKCHIP_RK3066
>>>> +	default 0x301a if ROCKCHIP_RK3036
>>>> +	default 0x310b if ROCKCHIP_RK3188
>>>>    	default 0x310c if ROCKCHIP_RK3128
>>>> -	default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
>>>> -	default 0x330a if ROCKCHIP_RK3328
>>>> +	default 0x320a if ROCKCHIP_RK3288
>>>> +	default 0x320b if ROCKCHIP_RK322X
>>>> +	default 0x320c if ROCKCHIP_RK3328
>>>> +	default 0x330a if ROCKCHIP_RK3368
>>>>    	default 0x330c if ROCKCHIP_RK3399
>>>> +	default 0x330d if ROCKCHIP_PX30
>>>> +	default 0x330e if ROCKCHIP_RK3308
>>>> +	default 0x350a if ROCKCHIP_RK3568
>>>> +	default 0x350b if ROCKCHIP_RK3588
>>>>    	default 0x0
>>>>    	help
>>>>    	  Product ID of the USB device emulated, reported to the host device.
Kever Yang March 13, 2024, 10:40 a.m. UTC | #5
On 2024/2/27 07:08, Jonas Karlman wrote:
> RK3036 is using the USB product id normally used by RK3066B, and RK3328
> is using the product id normally used by RK3368.
>
> Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option
> for remaining supported Rockchip SoCs to match the product id used in
> Mask ROM mode. Also remove a reference to the unknown ROCKCHIP_RK3229
> symbol.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/usb/gadget/Kconfig | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index c72a8047635c..4621a6fd5e64 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -70,12 +70,21 @@ config USB_GADGET_PRODUCT_NUM
>   	hex "Product ID of the USB device"
>   	default 0x701a if ARCH_TEGRA
>   	default 0x1010 if ARCH_SUNXI
> -	default 0x310a if ROCKCHIP_RK3036
> +	default 0x110a if ROCKCHIP_RV1108
> +	default 0x110b if ROCKCHIP_RV1126
>   	default 0x300a if ROCKCHIP_RK3066
> +	default 0x301a if ROCKCHIP_RK3036
> +	default 0x310b if ROCKCHIP_RK3188
>   	default 0x310c if ROCKCHIP_RK3128
> -	default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
> -	default 0x330a if ROCKCHIP_RK3328
> +	default 0x320a if ROCKCHIP_RK3288
> +	default 0x320b if ROCKCHIP_RK322X
> +	default 0x320c if ROCKCHIP_RK3328
> +	default 0x330a if ROCKCHIP_RK3368
>   	default 0x330c if ROCKCHIP_RK3399
> +	default 0x330d if ROCKCHIP_PX30
> +	default 0x330e if ROCKCHIP_RK3308
> +	default 0x350a if ROCKCHIP_RK3568
> +	default 0x350b if ROCKCHIP_RK3588
>   	default 0x0
>   	help
>   	  Product ID of the USB device emulated, reported to the host device.
diff mbox series

Patch

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index c72a8047635c..4621a6fd5e64 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -70,12 +70,21 @@  config USB_GADGET_PRODUCT_NUM
 	hex "Product ID of the USB device"
 	default 0x701a if ARCH_TEGRA
 	default 0x1010 if ARCH_SUNXI
-	default 0x310a if ROCKCHIP_RK3036
+	default 0x110a if ROCKCHIP_RV1108
+	default 0x110b if ROCKCHIP_RV1126
 	default 0x300a if ROCKCHIP_RK3066
+	default 0x301a if ROCKCHIP_RK3036
+	default 0x310b if ROCKCHIP_RK3188
 	default 0x310c if ROCKCHIP_RK3128
-	default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
-	default 0x330a if ROCKCHIP_RK3328
+	default 0x320a if ROCKCHIP_RK3288
+	default 0x320b if ROCKCHIP_RK322X
+	default 0x320c if ROCKCHIP_RK3328
+	default 0x330a if ROCKCHIP_RK3368
 	default 0x330c if ROCKCHIP_RK3399
+	default 0x330d if ROCKCHIP_PX30
+	default 0x330e if ROCKCHIP_RK3308
+	default 0x350a if ROCKCHIP_RK3568
+	default 0x350b if ROCKCHIP_RK3588
 	default 0x0
 	help
 	  Product ID of the USB device emulated, reported to the host device.