1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
4 * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
10 #include <asm/cache.h>
11 #include <linux/usb/otg.h>
12 #include <dwc3-sti-glue.h>
13 #include <dwc3-uboot.h>
16 DECLARE_GLOBAL_DATA_PTR;
20 gd->ram_size = PHYS_SDRAM_1_SIZE;
24 int dram_init_banksize(void)
26 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
27 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
32 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
33 void enable_caches(void)
35 /* Enable D-cache. I-cache is already enabled in start.S */
45 #ifdef CONFIG_USB_DWC3
46 static struct dwc3_device dwc3_device_data = {
47 .maximum_speed = USB_SPEED_HIGH,
48 .dr_mode = USB_DR_MODE_PERIPHERAL,
52 int usb_gadget_handle_interrupts(int index)
54 dwc3_uboot_handle_interrupt(index);
58 int board_usb_init(int index, enum usb_init_type init)
61 const void *blob = gd->fdt_blob;
63 /* find the snps,dwc3 node */
64 node = fdt_node_offset_by_compatible(blob, -1, "snps,dwc3");
66 dwc3_device_data.base = fdtdec_get_addr(blob, node, "reg");
68 return dwc3_uboot_init(&dwc3_device_data);
71 int board_usb_cleanup(int index, enum usb_init_type init)
73 dwc3_uboot_exit(index);
77 int g_dnl_board_usb_cable_connected(void)