[PATCH v3 25/28] rockchip: rk356x-generic: Add support for USB OTG

Kever Yang kever.yang at rock-chips.com
Mon Apr 22 10:10:47 CEST 2024


On 2024/4/22 14:29, Jonas Karlman wrote:
> Add support for USB OTG, RockUSB and UMS to the generic RK3566/RK3568
> target.
>
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>

Thanks,
- Kever
> ---
> v3: No change
> v2: Split patch
> ---
>   arch/arm/dts/rk3568-generic.dts  | 19 ++++++++++++++++++-
>   configs/generic-rk3568_defconfig | 10 ++++++++++
>   2 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/dts/rk3568-generic.dts b/arch/arm/dts/rk3568-generic.dts
> index 87c3aff26589..085a09268e8a 100644
> --- a/arch/arm/dts/rk3568-generic.dts
> +++ b/arch/arm/dts/rk3568-generic.dts
> @@ -1,6 +1,6 @@
>   // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>   /*
> - * Minimal generic DT for RK3566/RK3568 with eMMC, SD-card and SPI flash enabled
> + * Minimal generic DT for RK3566/RK3568 with eMMC, SD-card, SPI flash and USB OTG enabled
>    */
>   
>   /dts-v1/;
> @@ -58,3 +58,20 @@
>   &uart2 {
>   	status = "okay";
>   };
> +
> +&usb_host0_xhci {
> +	dr_mode = "peripheral";
> +	extcon = <&usb2phy0>;
> +	maximum-speed = "high-speed";
> +	phys = <&usb2phy0_otg>;
> +	phy-names = "usb2-phy";
> +	status = "okay";
> +};
> +
> +&usb2phy0 {
> +	status = "okay";
> +};
> +
> +&usb2phy0_otg {
> +	status = "okay";
> +};
> diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig
> index 9276eae63ee3..26114f9cb2a5 100644
> --- a/configs/generic-rk3568_defconfig
> +++ b/configs/generic-rk3568_defconfig
> @@ -31,6 +31,8 @@ CONFIG_SPL_ATF=y
>   CONFIG_CMD_GPIO=y
>   CONFIG_CMD_GPT=y
>   CONFIG_CMD_MMC=y
> +CONFIG_CMD_ROCKUSB=y
> +CONFIG_CMD_USB_MASS_STORAGE=y
>   # CONFIG_CMD_SETEXPR is not set
>   # CONFIG_SPL_DOS_PARTITION is not set
>   CONFIG_SPL_OF_CONTROL=y
> @@ -40,6 +42,7 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
>   CONFIG_SPL_REGMAP=y
>   CONFIG_SPL_SYSCON=y
>   CONFIG_SPL_CLK=y
> +# CONFIG_USB_FUNCTION_FASTBOOT is not set
>   CONFIG_ROCKCHIP_GPIO=y
>   CONFIG_MISC=y
>   # CONFIG_ROCKCHIP_IODOMAIN is not set
> @@ -57,6 +60,7 @@ CONFIG_SPI_FLASH_SILICONKAISER=y
>   CONFIG_SPI_FLASH_WINBOND=y
>   CONFIG_SPI_FLASH_XMC=y
>   CONFIG_SPI_FLASH_XTX=y
> +CONFIG_PHY_ROCKCHIP_INNO_USB2=y
>   CONFIG_SPL_PINCTRL=y
>   CONFIG_SPL_RAM=y
>   CONFIG_BAUDRATE=1500000
> @@ -64,4 +68,10 @@ CONFIG_DEBUG_UART_SHIFT=2
>   CONFIG_SYS_NS16550_MEM32=y
>   CONFIG_ROCKCHIP_SFC=y
>   CONFIG_SYSRESET=y
> +CONFIG_USB=y
> +CONFIG_USB_DWC3=y
> +CONFIG_USB_DWC3_GENERIC=y
> +CONFIG_USB_GADGET=y
> +CONFIG_USB_GADGET_DOWNLOAD=y
> +CONFIG_USB_FUNCTION_ROCKUSB=y
>   CONFIG_ERRNO_STR=y


More information about the U-Boot mailing list