2 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
3 * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/usb/otg.h>
10 #include <dwc3-sti-glue.h>
11 #include <dwc3-uboot.h>
14 DECLARE_GLOBAL_DATA_PTR;
18 gd->ram_size = PHYS_SDRAM_1_SIZE;
22 int dram_init_banksize(void)
24 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
25 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
30 #ifndef CONFIG_SYS_DCACHE_OFF
31 void enable_caches(void)
33 /* Enable D-cache. I-cache is already enabled in start.S */
43 #ifdef CONFIG_USB_DWC3
44 static struct dwc3_device dwc3_device_data = {
45 .maximum_speed = USB_SPEED_HIGH,
46 .dr_mode = USB_DR_MODE_PERIPHERAL,
50 int usb_gadget_handle_interrupts(int index)
52 dwc3_uboot_handle_interrupt(index);
56 int board_usb_init(int index, enum usb_init_type init)
59 const void *blob = gd->fdt_blob;
61 /* find the snps,dwc3 node */
62 node = fdt_node_offset_by_compatible(blob, -1, "snps,dwc3");
64 dwc3_device_data.base = fdtdec_get_addr(blob, node, "reg");
66 return dwc3_uboot_init(&dwc3_device_data);
69 int board_usb_cleanup(int index, enum usb_init_type init)
71 dwc3_uboot_exit(index);
75 int g_dnl_board_usb_cable_connected(void)