Re: [PATCH v1 09/11] rockchip: move dwc3 config to chip specific handler

2023-02-26 Thread Jagan Teki
On Tue, Feb 22, 2022 at 7:03 AM Peter Geis  wrote:
>
> The dwc3 code in the mach-rockchip board file is specific to the rk3399.
> Move it to the rk3399 chip specific code.

Though it is rk3399, there is no new SoC that requires OTG as of now
even if needed it is easy to support here instead of moving this
redundant on each board file.
https://patchwork.ozlabs.org/project/uboot/patch/20230226132234.31949-2-abbaraju.manoj...@amarulasolutions.com/

So, please don't move.

Jagan.


Re: [PATCH v1 09/11] rockchip: move dwc3 config to chip specific handler

2022-03-11 Thread Simon Glass
On Mon, 21 Feb 2022 at 18:31, Peter Geis  wrote:
>
> The dwc3 code in the mach-rockchip board file is specific to the rk3399.
> Move it to the rk3399 chip specific code.
>
> Signed-off-by: Peter Geis 
> ---
>  arch/arm/mach-rockchip/board.c | 24 -
>  arch/arm/mach-rockchip/rk3399/rk3399.c | 29 ++
>  2 files changed, 29 insertions(+), 24 deletions(-)

Reviewed-by: Simon Glass 


[PATCH v1 09/11] rockchip: move dwc3 config to chip specific handler

2022-02-21 Thread Peter Geis
The dwc3 code in the mach-rockchip board file is specific to the rk3399.
Move it to the rk3399 chip specific code.

Signed-off-by: Peter Geis 
---
 arch/arm/mach-rockchip/board.c | 24 -
 arch/arm/mach-rockchip/rk3399/rk3399.c | 29 ++
 2 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index 5304eb055c6d..b19c15c26f2e 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -127,30 +127,6 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 }
 #endif /* CONFIG_USB_GADGET_DWC2_OTG */
 
-#if defined(CONFIG_USB_DWC3_GADGET) && !defined(CONFIG_DM_USB_GADGET)
-#include 
-
-static struct dwc3_device dwc3_device_data = {
-   .maximum_speed = USB_SPEED_HIGH,
-   .base = 0xfe80,
-   .dr_mode = USB_DR_MODE_PERIPHERAL,
-   .index = 0,
-   .dis_u2_susphy_quirk = 1,
-   .hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW,
-};
-
-int usb_gadget_handle_interrupts(int index)
-{
-   dwc3_uboot_handle_interrupt(0);
-   return 0;
-}
-
-int board_usb_init(int index, enum usb_init_type init)
-{
-   return dwc3_uboot_init(_device_data);
-}
-#endif /* CONFIG_USB_DWC3_GADGET */
-
 #endif /* CONFIG_USB_GADGET */
 
 #if CONFIG_IS_ENABLED(FASTBOOT)
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c 
b/arch/arm/mach-rockchip/rk3399/rk3399.c
index d40969c88898..c7e38997e521 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -284,3 +284,32 @@ void spl_board_init(void)
 #endif
 }
 #endif
+
+#if defined(CONFIG_USB_GADGET)
+#include 
+
+#if defined(CONFIG_USB_DWC3_GADGET) && !defined(CONFIG_DM_USB_GADGET)
+#include 
+
+static struct dwc3_device dwc3_device_data = {
+   .maximum_speed = USB_SPEED_HIGH,
+   .base = 0xfe80,
+   .dr_mode = USB_DR_MODE_PERIPHERAL,
+   .index = 0,
+   .dis_u2_susphy_quirk = 1,
+   .hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW,
+};
+
+int usb_gadget_handle_interrupts(int index)
+{
+   dwc3_uboot_handle_interrupt(0);
+   return 0;
+}
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+   return dwc3_uboot_init(_device_data);
+}
+#endif /* CONFIG_USB_DWC3_GADGET */
+
+#endif /* CONFIG_USB_GADGET */
-- 
2.25.1