Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Altera Corporation <www.altera.com> |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <asm/arch/reset_manager.h> |
| 9 | #include <asm/io.h> |
| 10 | |
Marek Vasut | 40f1d6b | 2014-11-04 04:25:09 +0100 | [diff] [blame] | 11 | #include <usb.h> |
| 12 | #include <usb/s3c_udc.h> |
| 13 | #include <usb_mass_storage.h> |
| 14 | |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 15 | #include <netdev.h> |
| 16 | |
| 17 | DECLARE_GLOBAL_DATA_PTR; |
| 18 | |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 19 | /* |
| 20 | * Print Board information |
| 21 | */ |
| 22 | int checkboard(void) |
| 23 | { |
Marek Vasut | a6b59a1 | 2014-09-08 14:08:45 +0200 | [diff] [blame] | 24 | puts("BOARD: Altera SoCFPGA Cyclone5 Board\n"); |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | /* |
| 29 | * Initialization function which happen at early stage of c code |
| 30 | */ |
| 31 | int board_early_init_f(void) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | /* |
| 37 | * Miscellaneous platform dependent initialisations |
| 38 | */ |
| 39 | int board_init(void) |
| 40 | { |
Pavel Machek | 26ea1d9 | 2014-09-08 14:08:45 +0200 | [diff] [blame] | 41 | /* Address of boot parameters for ATAG (if ATAG is used) */ |
| 42 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
| 43 | |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 44 | return 0; |
| 45 | } |
Marek Vasut | 40f1d6b | 2014-11-04 04:25:09 +0100 | [diff] [blame] | 46 | |
| 47 | #ifdef CONFIG_USB_GADGET |
| 48 | struct s3c_plat_otg_data socfpga_otg_data = { |
| 49 | .regs_otg = CONFIG_USB_DWC2_REG_ADDR, |
| 50 | .usb_gusbcfg = 0x1417, |
| 51 | }; |
| 52 | |
| 53 | int board_usb_init(int index, enum usb_init_type init) |
| 54 | { |
| 55 | return s3c_udc_probe(&socfpga_otg_data); |
| 56 | } |
| 57 | |
| 58 | int g_dnl_board_usb_cable_connected(void) |
| 59 | { |
| 60 | return 1; |
| 61 | } |
| 62 | #endif |