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>
18 DECLARE_GLOBAL_DATA_PTR;
20 __weak int rk_board_late_init(void)
25 int board_late_init(void)
29 return rk_board_late_init();
37 #if !CONFIG_IS_ENABLED(RAM)
39 * When CONFIG_RAM is enabled, the dram_init() function is implemented
44 gd->ram_size = sdram_size();
50 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
51 void enable_caches(void)
53 /* Enable D-cache. I-cache is already enabled in start.S */
58 #if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
60 #include <usb/dwc2_udc.h>
62 static struct dwc2_plat_otg_data rk3036_otg_data = {
68 int board_usb_init(int index, enum usb_init_type init)
73 const void *blob = gd->fdt_blob;
75 /* find the usb_otg node */
76 node = fdt_node_offset_by_compatible(blob, -1,
77 "rockchip,rk3288-usb");
80 mode = fdt_getprop(blob, node, "dr_mode", NULL);
81 if (mode && strcmp(mode, "otg") == 0) {
86 node = fdt_node_offset_by_compatible(blob, node,
87 "rockchip,rk3288-usb");
90 debug("Not found usb_otg device\n");
93 rk3036_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg");
95 return dwc2_udc_probe(&rk3036_otg_data);
98 int board_usb_cleanup(int index, enum usb_init_type init)