]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: board: Remove dwc3 usb init and gadget handler functions
authorJonas Karlman <jonas@kwiboo.se>
Sun, 12 Nov 2023 17:48:58 +0000 (17:48 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 19 Jan 2024 02:57:36 +0000 (10:57 +0800)
Remove board_usb_init() and dm_usb_gadget_handle_interrupts() functions
related to dwc3, they use e.g. a hard-coded reg address for RK3399 and
are obsolete with use of DM_USB_GADGET.

Use of DM_USB_GADGET, USB_DWC3_GENERIC and USB_DWC3_GADGET have replaced
same feature provided by the removed functions on RK3399 boards.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/Kconfig
arch/arm/mach-rockchip/board.c
configs/nanopc-t6-rk3588_defconfig
configs/orangepi-5-plus-rk3588_defconfig
configs/orangepi-5-rk3588s_defconfig
configs/rock5a-rk3588s_defconfig
configs/rock5b-rk3588_defconfig

index c80d644dd54223ea8dbf04bda687e33257d8d542..efb705375bb71d8ee0e24639ee79f80d7e02e9a5 100644 (file)
@@ -1986,6 +1986,7 @@ config ARCH_ROCKCHIP
        select DM_SERIAL
        select DM_SPI
        select DM_SPI_FLASH
+       select DM_USB_GADGET if USB_DWC3_GADGET
        select ENABLE_ARM_SOC_BOOT0_HOOK
        select OF_CONTROL
        select SPI
index 57f08e0be0e98ad8fc40e3fadcec68b95c9f0e43..38a2a4b95ec0e2183d621ac56f0a0f4acf7dca26 100644 (file)
@@ -208,10 +208,8 @@ void enable_caches(void)
 }
 #endif
 
-#if defined(CONFIG_USB_GADGET)
+#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
 #include <usb.h>
-
-#if defined(CONFIG_USB_GADGET_DWC2_OTG)
 #include <linux/usb/otg.h>
 #include <usb/dwc2_udc.h>
 
@@ -287,32 +285,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 <dwc3-uboot.h>
-
-static struct dwc3_device dwc3_device_data = {
-       .maximum_speed = USB_SPEED_HIGH,
-       .base = 0xfe800000,
-       .dr_mode = USB_DR_MODE_PERIPHERAL,
-       .index = 0,
-       .dis_u2_susphy_quirk = 1,
-       .hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW,
-};
-
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-       dwc3_uboot_handle_interrupt(dev);
-       return 0;
-}
-
-int board_usb_init(int index, enum usb_init_type init)
-{
-       return dwc3_uboot_init(&dwc3_device_data);
-}
-#endif /* CONFIG_USB_DWC3_GADGET */
-
-#endif /* CONFIG_USB_GADGET */
-
 #if IS_ENABLED(CONFIG_FASTBOOT)
 int fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
 {
index 070399ce2a86652bf5850132e032060e00f5ee3f..62f307a3f361d40746848b0bd9ba98f01872a6e3 100644 (file)
@@ -91,7 +91,6 @@ CONFIG_SYS_NS16550_MEM32=y
 CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
-CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
index 065f315e67585aa11f2c2afd082b61577a92764f..fa3ec0d3d582e0f7e8f25d7314481600a96cf828 100644 (file)
@@ -93,7 +93,6 @@ CONFIG_SYS_NS16550_MEM32=y
 CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
-CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
index 6517205014dfee845bed25952e3fe24cf522fe0d..3ff89c66bf7248fffcec7807cae0524f0187f287 100644 (file)
@@ -90,7 +90,6 @@ CONFIG_SYS_NS16550_MEM32=y
 CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
-CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
index a6471a519514102e2a179b73d731055a566bc9b8..efa7bcbdcda603e8e9fe4ef857312f9e944aa389 100644 (file)
@@ -75,7 +75,6 @@ CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
-CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
index d92a1fdf232dd985708e18b174db77c609880bab..a0678ff1290ceeb1bc133f583c6d76e37e41fe8f 100644 (file)
@@ -98,7 +98,6 @@ CONFIG_SYS_NS16550_MEM32=y
 CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
-CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y