2 * Copyright (C) 2012 Altera Corporation <www.altera.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/reset_manager.h>
13 #include <usb/dwc2_udc.h>
15 DECLARE_GLOBAL_DATA_PTR;
20 * Miscellaneous platform dependent initialisations
24 /* Address of boot parameters for ATAG (if ATAG is used) */
25 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
30 #ifdef CONFIG_USB_GADGET
31 struct dwc2_plat_otg_data socfpga_otg_data = {
32 .usb_gusbcfg = 0x1417,
35 int board_usb_init(int index, enum usb_init_type init)
40 count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc",
41 COMPAT_ALTERA_SOCFPGA_DWC2USB,
43 if (count <= 0) /* No controller found. */
46 addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg");
47 if (addr == FDT_ADDR_T_NONE) {
48 printf("UDC Controller has no 'reg' property!\n");
52 /* Patch the address from OF into the controller pdata. */
53 socfpga_otg_data.regs_otg = addr;
55 return dwc2_udc_probe(&socfpga_otg_data);
58 int g_dnl_board_usb_cable_connected(void)