2 * (C) Copyright 2015 Rockchip Electronics Co., Ltd
4 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/clock.h>
13 #include <asm/arch/periph.h>
14 #include <asm/arch/grf_rk3036.h>
15 #include <asm/arch/boot_mode.h>
16 #include <asm/arch/sdram_rk3036.h>
18 #include <dm/pinctrl.h>
20 DECLARE_GLOBAL_DATA_PTR;
22 __weak int rk_board_late_init(void)
27 int board_late_init(void)
31 return rk_board_late_init();
39 #if !CONFIG_IS_ENABLED(RAM)
41 * When CONFIG_RAM is enabled, the dram_init() function is implemented
46 gd->ram_size = sdram_size();
52 #ifndef CONFIG_SYS_DCACHE_OFF
53 void enable_caches(void)
55 /* Enable D-cache. I-cache is already enabled in start.S */
60 #if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
62 #include <usb/dwc2_udc.h>
64 static struct dwc2_plat_otg_data rk3036_otg_data = {
70 int board_usb_init(int index, enum usb_init_type init)
75 const void *blob = gd->fdt_blob;
77 /* find the usb_otg node */
78 node = fdt_node_offset_by_compatible(blob, -1,
79 "rockchip,rk3288-usb");
82 mode = fdt_getprop(blob, node, "dr_mode", NULL);
83 if (mode && strcmp(mode, "otg") == 0) {
88 node = fdt_node_offset_by_compatible(blob, node,
89 "rockchip,rk3288-usb");
92 debug("Not found usb_otg device\n");
95 rk3036_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg");
97 return dwc2_udc_probe(&rk3036_otg_data);
100 int board_usb_cleanup(int index, enum usb_init_type init)