2022-07-22 13:17:50

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH 0/4] usb: misc: adopt onboard hub support on stm32mp1 boards

Add support for USB2514B HUB found on stm32mp1 boards:
- Extend the ehci-generic dt-binding to fully use the usb-hcd.yaml, and so
the usb-device.yaml.
- Add usb-device compatible ("usbVID,PID") for the USB2514B USB2.0 HUB to
the onboard_usb_hub driver.
- Add relevant device tree node to stm32mp15 DK boards.
- Enable the onboard_usb_hub driver on multi_v7 platforms.

Fabrice Gasnier (4):
dt-bindings: usb: generic-ehci: allow usb-hcd schema properties
usb: misc: onboard-hub: add support for Microchip USB2514B USB 2.0 hub
ARM: dts: stm32: add support for USB2514B onboard hub on
stm32mp15xx-dkx
ARM: multi_v7_defconfig: enable USB onboard HUB driver

Documentation/devicetree/bindings/usb/generic-ehci.yaml | 7 +------
arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 8 ++++++++
arch/arm/configs/multi_v7_defconfig | 1 +
drivers/usb/misc/onboard_usb_hub.c | 2 ++
drivers/usb/misc/onboard_usb_hub.h | 1 +
5 files changed, 13 insertions(+), 6 deletions(-)

--
2.25.1


2022-07-22 13:18:07

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH 4/4] ARM: multi_v7_defconfig: enable USB onboard HUB driver

Enable the USB onboard HUB driver, used on STM32MP1 boards.

Signed-off-by: Fabrice Gasnier <[email protected]>
---
arch/arm/configs/multi_v7_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index ce9826bce29b3..d0f16b7f682bf 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -861,6 +861,7 @@ CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_ISP1760=y
CONFIG_USB_HSIC_USB3503=y
+CONFIG_USB_ONBOARD_HUB=m
CONFIG_AB8500_USB=y
CONFIG_KEYSTONE_USB_PHY=m
CONFIG_NOP_USB_XCEIV=y
--
2.25.1

2022-07-22 13:21:41

by Fabrice Gasnier

[permalink] [raw]
Subject: [PATCH 2/4] usb: misc: onboard-hub: add support for Microchip USB2514B USB 2.0 hub

Add support for Microchip USB2514B USB 2.0 hub to the onboard usb hub
driver. Adopt the generic usb-device compatible ("usbVID,PID") as
discussed with Matthias in [1].
Some STM32MP1 boards have this hub on-board, with a supply that needs to
be enabled for proper operation.

[1] https://lore.kernel.org/lkml/[email protected]/

Signed-off-by: Fabrice Gasnier <[email protected]>
---
drivers/usb/misc/onboard_usb_hub.c | 2 ++
drivers/usb/misc/onboard_usb_hub.h | 1 +
2 files changed, 3 insertions(+)

diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c
index 6b9b949d17d30..929a4e724ec12 100644
--- a/drivers/usb/misc/onboard_usb_hub.c
+++ b/drivers/usb/misc/onboard_usb_hub.c
@@ -310,6 +310,7 @@ static struct platform_driver onboard_hub_driver = {
/************************** USB driver **************************/

#define VENDOR_ID_REALTEK 0x0bda
+#define VENDOR_ID_MICROCHIP 0x0424

/*
* Returns the onboard_hub platform device that is associated with the USB
@@ -387,6 +388,7 @@ static const struct usb_device_id onboard_hub_id_table[] = {
{ USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */
{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */
{ USB_DEVICE(VENDOR_ID_REALTEK, 0x5414) }, /* RTS5414 USB 2.1 */
+ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */
{}
};
MODULE_DEVICE_TABLE(usb, onboard_hub_id_table);
diff --git a/drivers/usb/misc/onboard_usb_hub.h b/drivers/usb/misc/onboard_usb_hub.h
index d3a5b6938582e..43d6af4230dfd 100644
--- a/drivers/usb/misc/onboard_usb_hub.h
+++ b/drivers/usb/misc/onboard_usb_hub.h
@@ -11,6 +11,7 @@ static const struct of_device_id onboard_hub_match[] = {
{ .compatible = "usbbda,5411" },
{ .compatible = "usbbda,414" },
{ .compatible = "usbbda,5414" },
+ { .compatible = "usb424,2514" },
{}
};

--
2.25.1

2022-07-22 16:43:56

by Matthias Kaehlcke

[permalink] [raw]
Subject: Re: [PATCH 2/4] usb: misc: onboard-hub: add support for Microchip USB2514B USB 2.0 hub

Hi Fabrice

On Fri, Jul 22, 2022 at 03:05:52PM +0200, Fabrice Gasnier wrote:
> Add support for Microchip USB2514B USB 2.0 hub to the onboard usb hub
> driver. Adopt the generic usb-device compatible ("usbVID,PID") as
> discussed with Matthias in [1].

The reference isn't really relevant in the commit message.

> Some STM32MP1 boards have this hub on-board, with a supply that needs to
> be enabled for proper operation.
>
> [1] https://lore.kernel.org/lkml/[email protected]/
>
> Signed-off-by: Fabrice Gasnier <[email protected]>
> ---
> drivers/usb/misc/onboard_usb_hub.c | 2 ++
> drivers/usb/misc/onboard_usb_hub.h | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c
> index 6b9b949d17d30..929a4e724ec12 100644
> --- a/drivers/usb/misc/onboard_usb_hub.c
> +++ b/drivers/usb/misc/onboard_usb_hub.c
> @@ -310,6 +310,7 @@ static struct platform_driver onboard_hub_driver = {
> /************************** USB driver **************************/
>
> #define VENDOR_ID_REALTEK 0x0bda
> +#define VENDOR_ID_MICROCHIP 0x0424

nit: let's sort the vendor ids alphabetically

>
> /*
> * Returns the onboard_hub platform device that is associated with the USB
> @@ -387,6 +388,7 @@ static const struct usb_device_id onboard_hub_id_table[] = {
> { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */
> { USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */
> { USB_DEVICE(VENDOR_ID_REALTEK, 0x5414) }, /* RTS5414 USB 2.1 */
> + { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */

ditto

> {}
> };
> MODULE_DEVICE_TABLE(usb, onboard_hub_id_table);
> diff --git a/drivers/usb/misc/onboard_usb_hub.h b/drivers/usb/misc/onboard_usb_hub.h
> index d3a5b6938582e..43d6af4230dfd 100644
> --- a/drivers/usb/misc/onboard_usb_hub.h
> +++ b/drivers/usb/misc/onboard_usb_hub.h
> @@ -11,6 +11,7 @@ static const struct of_device_id onboard_hub_match[] = {
> { .compatible = "usbbda,5411" },
> { .compatible = "usbbda,414" },
> { .compatible = "usbbda,5414" },
> + { .compatible = "usb424,2514" },

Let's also sort the vendor ids alphanumerically (not necessarily applicable for
the product ids, here it makes sense to group the PIDs of the same hub chip
together).