[PATCH 0/3] USB OTG support for radxa cm3 IO board

Patch 1/3 Enable usb otg nodes in device tree. Patch 2/3 Update dwc3_device register offset of rk3568. Patch 3/3 Enable Usb gadget and update the fastboot address in config.
Manoj Sai (3): arm: dts: rockchip: rk3566: Enable USB OTG for Radxa CM3 rockchip: rk356x: update the dwc3_device register offset rk3566: radxa-cm3: Enable USB OTG
arch/arm/dts/rk3566-radxa-cm3-io.dts | 8 ++++++++ arch/arm/mach-rockchip/board.c | 3 +++ configs/radxa-cm3-io-rk3566_defconfig | 3 +++ 3 files changed, 14 insertions(+)

Enable USB OTG support for Radxa Compute Module 3 IO Board
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com ---
Note: Above changeset has sent to kernel mailing list, which is currently under review. https://lore.kernel.org/linux-arm-kernel/20230223135929.630787-1-abbaraju.ma... --- arch/arm/dts/rk3566-radxa-cm3-io.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/rk3566-radxa-cm3-io.dts b/arch/arm/dts/rk3566-radxa-cm3-io.dts index d89d5263cb..5e4236af4f 100644 --- a/arch/arm/dts/rk3566-radxa-cm3-io.dts +++ b/arch/arm/dts/rk3566-radxa-cm3-io.dts @@ -254,6 +254,14 @@ status = "okay"; };
+&usb2phy0_otg { + status = "okay"; +}; + +&usb_host0_xhci { + status = "okay"; +}; + &vop { assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;

update the dwc3_device register offset in board_usb_init() for rk3568 platforms.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com --- arch/arm/mach-rockchip/board.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index f1f70c81d0..c7729c966a 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -300,6 +300,9 @@ int usb_gadget_handle_interrupts(int index)
int board_usb_init(int index, enum usb_init_type init) { + if (IS_ENABLED(CONFIG_ROCKCHIP_RK3568)) + dwc3_device_data.base = 0xfcc00000; + return dwc3_uboot_init(&dwc3_device_data); } #endif /* CONFIG_USB_DWC3_GADGET */

On Thu, Feb 23, 2023 at 10:06 PM Manoj Sai abbaraju.manojsai@amarulasolutions.com wrote:
update the dwc3_device register offset in board_usb_init() for rk3568 platforms.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com
Reviewed-by: Jagan Teki jagan@amarulasolutions.com

Enable USB OTG support and update the fastboot buffer address for Radxa Compute Module 3 IO Board.
This would help to use fastboot by default.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com --- configs/radxa-cm3-io-rk3566_defconfig | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/configs/radxa-cm3-io-rk3566_defconfig b/configs/radxa-cm3-io-rk3566_defconfig index 2100cf2cb2..4d2acef6cd 100644 --- a/configs/radxa-cm3-io-rk3566_defconfig +++ b/configs/radxa-cm3-io-rk3566_defconfig @@ -21,6 +21,7 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0xc00800 CONFIG_DEBUG_UART=y +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y @@ -47,6 +48,7 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_REGMAP=y CONFIG_SPL_SYSCON=y CONFIG_SPL_CLK=y +CONFIG_FASTBOOT_BUF_ADDR=0xc00800 CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y @@ -74,4 +76,5 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_GADGET=y CONFIG_ERRNO_STR=y

On Thu, Feb 23, 2023 at 10:06 PM Manoj Sai abbaraju.manojsai@amarulasolutions.com wrote:
Enable USB OTG support and update the fastboot buffer address for Radxa Compute Module 3 IO Board.
This would help to use fastboot by default.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com
configs/radxa-cm3-io-rk3566_defconfig | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/configs/radxa-cm3-io-rk3566_defconfig b/configs/radxa-cm3-io-rk3566_defconfig index 2100cf2cb2..4d2acef6cd 100644 --- a/configs/radxa-cm3-io-rk3566_defconfig +++ b/configs/radxa-cm3-io-rk3566_defconfig @@ -21,6 +21,7 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0xc00800 CONFIG_DEBUG_UART=y +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y @@ -47,6 +48,7 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_REGMAP=y CONFIG_SPL_SYSCON=y CONFIG_SPL_CLK=y +CONFIG_FASTBOOT_BUF_ADDR=0xc00800
was this address used in bsp or used load addr? add it in drivers/fastboot/Kconfig
Jagan.

Enable USB OTG support for Radxa Compute Module 3 IO Board
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com --- Changes for v2 :- - None.
Note: Above changeset has sent to kernel mailing list, which is currently under review. https://lore.kernel.org/linux-arm-kernel/20230223135929.630787-1-abbaraju.ma... --- arch/arm/dts/rk3566-radxa-cm3-io.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/rk3566-radxa-cm3-io.dts b/arch/arm/dts/rk3566-radxa-cm3-io.dts index d89d5263cb..5e4236af4f 100644 --- a/arch/arm/dts/rk3566-radxa-cm3-io.dts +++ b/arch/arm/dts/rk3566-radxa-cm3-io.dts @@ -254,6 +254,14 @@ status = "okay"; };
+&usb2phy0_otg { + status = "okay"; +}; + +&usb_host0_xhci { + status = "okay"; +}; + &vop { assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;

update the dwc3_device register offset in board_usb_init() for rk3568 platforms.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com Reviewed-by: Jagan Teki jagan@amarulasolutions.com --- Changes for v2:- - None --- arch/arm/mach-rockchip/board.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index f1f70c81d0..c7729c966a 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -300,6 +300,9 @@ int usb_gadget_handle_interrupts(int index)
int board_usb_init(int index, enum usb_init_type init) { + if (IS_ENABLED(CONFIG_ROCKCHIP_RK3568)) + dwc3_device_data.base = 0xfcc00000; + return dwc3_uboot_init(&dwc3_device_data); } #endif /* CONFIG_USB_DWC3_GADGET */

Hi Manoj,
This functions has been update, please check the latest version.
Thanks,
- Kever
On 2023/2/26 21:22, Manoj Sai wrote:
update the dwc3_device register offset in board_usb_init() for rk3568 platforms.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com Reviewed-by: Jagan Teki jagan@amarulasolutions.com
Changes for v2:-
- None
arch/arm/mach-rockchip/board.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index f1f70c81d0..c7729c966a 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -300,6 +300,9 @@ int usb_gadget_handle_interrupts(int index)
int board_usb_init(int index, enum usb_init_type init) {
- if (IS_ENABLED(CONFIG_ROCKCHIP_RK3568))
dwc3_device_data.base = 0xfcc00000;
- return dwc3_uboot_init(&dwc3_device_data); } #endif /* CONFIG_USB_DWC3_GADGET */

hi,
could you tell me current status of this patch?
-- FUKAUMI Naoki
On 2/26/23 22:22, Manoj Sai wrote:
update the dwc3_device register offset in board_usb_init() for rk3568 platforms.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com Reviewed-by: Jagan Teki jagan@amarulasolutions.com
Changes for v2:-
- None
arch/arm/mach-rockchip/board.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index f1f70c81d0..c7729c966a 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -300,6 +300,9 @@ int usb_gadget_handle_interrupts(int index)
int board_usb_init(int index, enum usb_init_type init) {
- if (IS_ENABLED(CONFIG_ROCKCHIP_RK3568))
dwc3_device_data.base = 0xfcc00000;
- return dwc3_uboot_init(&dwc3_device_data); } #endif /* CONFIG_USB_DWC3_GADGET */

Enable USB OTG support and update the fastboot buffer address for Radxa Compute Module 3 IO Board.
This would help to use fastboot by default.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com --- Changes for v2 :- - Updated the fastboot buffer address in drivers/fastboot/Kconfig. --- configs/radxa-cm3-io-rk3566_defconfig | 2 ++ drivers/fastboot/Kconfig | 1 + 2 files changed, 3 insertions(+)
diff --git a/configs/radxa-cm3-io-rk3566_defconfig b/configs/radxa-cm3-io-rk3566_defconfig index 2100cf2cb2..aba3a65e7f 100644 --- a/configs/radxa-cm3-io-rk3566_defconfig +++ b/configs/radxa-cm3-io-rk3566_defconfig @@ -21,6 +21,7 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0xc00800 CONFIG_DEBUG_UART=y +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y @@ -74,4 +75,5 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_GADGET=y CONFIG_ERRNO_STR=y diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index eefa34779c..53f0b3a659 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -41,6 +41,7 @@ config FASTBOOT_BUF_ADDR default 0x800800 if ROCKCHIP_RK3288 || ROCKCHIP_RK3329 || \ ROCKCHIP_RK3399 default 0x280000 if ROCKCHIP_RK3368 + default 0xc00800 if ROCKCHIP_RK3568 default 0x100000 if ARCH_ZYNQMP default 0 if SANDBOX help

On 2023/2/26 21:22, Manoj Sai wrote:
Enable USB OTG support and update the fastboot buffer address for Radxa Compute Module 3 IO Board.
This would help to use fastboot by default.
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com
Changes for v2 :-
- Updated the fastboot buffer address in drivers/fastboot/Kconfig.
configs/radxa-cm3-io-rk3566_defconfig | 2 ++ drivers/fastboot/Kconfig | 1 + 2 files changed, 3 insertions(+)
diff --git a/configs/radxa-cm3-io-rk3566_defconfig b/configs/radxa-cm3-io-rk3566_defconfig index 2100cf2cb2..aba3a65e7f 100644 --- a/configs/radxa-cm3-io-rk3566_defconfig +++ b/configs/radxa-cm3-io-rk3566_defconfig @@ -21,6 +21,7 @@ CONFIG_DEBUG_UART_BASE=0xFE660000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0xc00800 CONFIG_DEBUG_UART=y +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y @@ -74,4 +75,5 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_GADGET=y CONFIG_ERRNO_STR=y diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index eefa34779c..53f0b3a659 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -41,6 +41,7 @@ config FASTBOOT_BUF_ADDR default 0x800800 if ROCKCHIP_RK3288 || ROCKCHIP_RK3329 || \ ROCKCHIP_RK3399 default 0x280000 if ROCKCHIP_RK3368
- default 0xc00800 if ROCKCHIP_RK3568
Why you need a new address for rk3568?
Thanks,
- Kever
default 0x100000 if ARCH_ZYNQMP default 0 if SANDBOX help

On 2023/2/26 21:22, Manoj Sai wrote:
Enable USB OTG support for Radxa Compute Module 3 IO Board
Signed-off-by: Manoj Sai abbaraju.manojsai@amarulasolutions.com
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
Changes for v2 :-
- None.
Note: Above changeset has sent to kernel mailing list, which is currently under review. https://lore.kernel.org/linux-arm-kernel/20230223135929.630787-1-abbaraju.ma...
arch/arm/dts/rk3566-radxa-cm3-io.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/rk3566-radxa-cm3-io.dts b/arch/arm/dts/rk3566-radxa-cm3-io.dts index d89d5263cb..5e4236af4f 100644 --- a/arch/arm/dts/rk3566-radxa-cm3-io.dts +++ b/arch/arm/dts/rk3566-radxa-cm3-io.dts @@ -254,6 +254,14 @@ status = "okay"; };
+&usb2phy0_otg {
- status = "okay";
+};
+&usb_host0_xhci {
- status = "okay";
+};
- &vop { assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
participants (4)
-
FUKAUMI Naoki
-
Jagan Teki
-
Kever Yang
-
Manoj Sai