1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2015 Rockchip Electronics Co., Ltd
12 #include <asm/arch-rockchip/clock.h>
13 #include <asm/arch-rockchip/periph.h>
14 #include <asm/arch-rockchip/grf_rk3036.h>
15 #include <asm/arch-rockchip/boot_mode.h>
16 #include <asm/arch-rockchip/sdram_rk3036.h>
17 #include <dm/pinctrl.h>
19 DECLARE_GLOBAL_DATA_PTR;
21 __weak int rk_board_late_init(void)
26 int board_late_init(void)
30 return rk_board_late_init();
38 #if !CONFIG_IS_ENABLED(RAM)
40 * When CONFIG_RAM is enabled, the dram_init() function is implemented
45 gd->ram_size = sdram_size();
51 #ifndef CONFIG_SYS_DCACHE_OFF
52 void enable_caches(void)
54 /* Enable D-cache. I-cache is already enabled in start.S */
59 #if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
61 #include <usb/dwc2_udc.h>
63 static struct dwc2_plat_otg_data rk3036_otg_data = {
69 int board_usb_init(int index, enum usb_init_type init)
74 const void *blob = gd->fdt_blob;
76 /* find the usb_otg node */
77 node = fdt_node_offset_by_compatible(blob, -1,
78 "rockchip,rk3288-usb");
81 mode = fdt_getprop(blob, node, "dr_mode", NULL);
82 if (mode && strcmp(mode, "otg") == 0) {
87 node = fdt_node_offset_by_compatible(blob, node,
88 "rockchip,rk3288-usb");
91 debug("Not found usb_otg device\n");
94 rk3036_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg");
96 return dwc2_udc_probe(&rk3036_otg_data);
99 int board_usb_cleanup(int index, enum usb_init_type init)