2 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <asm/armv8/mmu.h>
9 #include <dwc3-uboot.h>
10 #include <power/regulator.h>
13 DECLARE_GLOBAL_DATA_PTR
;
19 ret
= regulators_enable_boot_on(false);
21 debug("%s: Cannot enable boot on regulator\n", __func__
);
26 #if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
28 #include <usb/dwc2_udc.h>
30 static struct dwc2_plat_otg_data rk3328_otg_data
= {
36 int board_usb_init(int index
, enum usb_init_type init
)
41 const void *blob
= gd
->fdt_blob
;
43 /* find the usb_otg node */
44 node
= fdt_node_offset_by_compatible(blob
, -1,
45 "rockchip,rk3328-usb");
48 mode
= fdt_getprop(blob
, node
, "dr_mode", NULL
);
49 if (mode
&& strcmp(mode
, "otg") == 0) {
54 node
= fdt_node_offset_by_compatible(blob
, node
,
55 "rockchip,rk3328-usb");
58 debug("Not found usb_otg device\n");
62 rk3328_otg_data
.regs_otg
= fdtdec_get_addr(blob
, node
, "reg");
64 return dwc2_udc_probe(&rk3328_otg_data
);
67 int board_usb_cleanup(int index
, enum usb_init_type init
)