blob: ccb1b4b063e39e1f6633c74ebff20f6a0b282a38 [file] [log] [blame]
Marek Vasut567356a2015-11-23 17:06:27 +01001/*
2 * Copyright (C) 2012 Altera Corporation <www.altera.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <asm/arch/reset_manager.h>
9#include <asm/io.h>
10
11#include <usb.h>
Marek Vasutf1be9cb2015-12-04 02:51:20 +010012#include <usb/dwc2_udc.h>
Marek Vasut567356a2015-11-23 17:06:27 +010013#include <usb_mass_storage.h>
14
Marek Vasut567356a2015-11-23 17:06:27 +010015DECLARE_GLOBAL_DATA_PTR;
16
17void s_init(void) {}
18
19/*
20 * Miscellaneous platform dependent initialisations
21 */
22int board_init(void)
23{
24 /* Address of boot parameters for ATAG (if ATAG is used) */
25 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
26
27 return 0;
28}
Marek Vasut567356a2015-11-23 17:06:27 +010029
30#ifdef CONFIG_USB_GADGET
Marek Vasut6939aca2015-12-04 02:23:29 +010031struct dwc2_plat_otg_data socfpga_otg_data = {
Marek Vasut567356a2015-11-23 17:06:27 +010032 .regs_otg = CONFIG_USB_DWC2_REG_ADDR,
33 .usb_gusbcfg = 0x1417,
34};
35
36int board_usb_init(int index, enum usb_init_type init)
37{
Marek Vasut01b61fa2015-12-04 02:26:33 +010038 return dwc2_udc_probe(&socfpga_otg_data);
Marek Vasut567356a2015-11-23 17:06:27 +010039}
40
41int g_dnl_board_usb_cable_connected(void)
42{
43 return 1;
44}
45#endif