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/io.h> |
| 9 | #include <asm/u-boot.h> |
| 10 | #include <asm/utils.h> |
| 11 | #include <version.h> |
| 12 | #include <image.h> |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 13 | #include <asm/arch/reset_manager.h> |
| 14 | #include <spl.h> |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 15 | #include <asm/arch/system_manager.h> |
Chin Liang See | 6ae4473 | 2013-12-02 12:01:39 -0600 | [diff] [blame] | 16 | #include <asm/arch/freeze_controller.h> |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 17 | |
| 18 | DECLARE_GLOBAL_DATA_PTR; |
| 19 | |
| 20 | u32 spl_boot_device(void) |
| 21 | { |
| 22 | return BOOT_DEVICE_RAM; |
| 23 | } |
| 24 | |
| 25 | /* |
| 26 | * Board initialization after bss clearance |
| 27 | */ |
| 28 | void spl_board_init(void) |
| 29 | { |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 30 | #ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET |
Chin Liang See | 6ae4473 | 2013-12-02 12:01:39 -0600 | [diff] [blame] | 31 | debug("Freezing all I/O banks\n"); |
| 32 | /* freeze all IO banks */ |
| 33 | sys_mgr_frzctrl_freeze_req(); |
| 34 | |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 35 | /* configure the pin muxing through system manager */ |
| 36 | sysmgr_pinmux_init(); |
| 37 | #endif /* CONFIG_SOCFPGA_VIRTUAL_TARGET */ |
| 38 | |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 39 | /* de-assert reset for peripherals and bridges based on handoff */ |
| 40 | reset_deassert_peripherals_handoff(); |
| 41 | |
Chin Liang See | 6ae4473 | 2013-12-02 12:01:39 -0600 | [diff] [blame] | 42 | debug("Unfreezing/Thaw all I/O banks\n"); |
| 43 | /* unfreeze / thaw all IO banks */ |
| 44 | sys_mgr_frzctrl_thaw_req(); |
| 45 | |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 46 | /* enable console uart printing */ |
| 47 | preloader_console_init(); |
| 48 | } |