1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
7 #include <asm/armv8/mmu.h>
8 #include <dwc3-uboot.h>
9 #include <power/regulator.h>
12 DECLARE_GLOBAL_DATA_PTR;
18 ret = regulators_enable_boot_on(false);
20 debug("%s: Cannot enable boot on regulator\n", __func__);
25 #if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
27 #include <usb/dwc2_udc.h>
29 static struct dwc2_plat_otg_data rk3328_otg_data = {
35 int board_usb_init(int index, enum usb_init_type init)
40 const void *blob = gd->fdt_blob;
42 /* find the usb_otg node */
43 node = fdt_node_offset_by_compatible(blob, -1,
44 "rockchip,rk3328-usb");
47 mode = fdt_getprop(blob, node, "dr_mode", NULL);
48 if (mode && strcmp(mode, "otg") == 0) {
53 node = fdt_node_offset_by_compatible(blob, node,
54 "rockchip,rk3328-usb");
57 debug("Not found usb_otg device\n");
61 rk3328_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg");
63 return dwc2_udc_probe(&rk3328_otg_data);
66 int board_usb_cleanup(int index, enum usb_init_type init)