Simon Glass | 509805b | 2015-01-27 22:13:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <errno.h> |
| 9 | #include <asm/io.h> |
| 10 | #include <asm/post.h> |
| 11 | #include <asm/processor.h> |
| 12 | #include <asm/fsp/fsp_support.h> |
| 13 | |
Simon Glass | daa93d9 | 2015-07-31 09:31:31 -0600 | [diff] [blame] | 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
Simon Glass | 509805b | 2015-01-27 22:13:39 -0700 | [diff] [blame] | 16 | int print_cpuinfo(void) |
| 17 | { |
| 18 | post_code(POST_CPU_INFO); |
| 19 | return default_print_cpuinfo(); |
| 20 | } |
| 21 | |
Simon Glass | fa91273 | 2015-08-10 07:05:07 -0600 | [diff] [blame] | 22 | int fsp_init_phase_pci(void) |
Simon Glass | 509805b | 2015-01-27 22:13:39 -0700 | [diff] [blame] | 23 | { |
| 24 | u32 status; |
| 25 | |
| 26 | /* call into FspNotify */ |
| 27 | debug("Calling into FSP (notify phase INIT_PHASE_PCI): "); |
| 28 | status = fsp_notify(NULL, INIT_PHASE_PCI); |
Simon Glass | fa91273 | 2015-08-10 07:05:07 -0600 | [diff] [blame] | 29 | if (status) |
Simon Glass | 509805b | 2015-01-27 22:13:39 -0700 | [diff] [blame] | 30 | debug("fail, error code %x\n", status); |
| 31 | else |
| 32 | debug("OK\n"); |
| 33 | |
Simon Glass | fa91273 | 2015-08-10 07:05:07 -0600 | [diff] [blame] | 34 | return status ? -EPERM : 0; |
| 35 | } |
| 36 | |
| 37 | int board_pci_post_scan(struct pci_controller *hose) |
| 38 | { |
| 39 | return fsp_init_phase_pci(); |
Simon Glass | 509805b | 2015-01-27 22:13:39 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | void board_final_cleanup(void) |
| 43 | { |
| 44 | u32 status; |
| 45 | |
| 46 | /* call into FspNotify */ |
| 47 | debug("Calling into FSP (notify phase INIT_PHASE_BOOT): "); |
| 48 | status = fsp_notify(NULL, INIT_PHASE_BOOT); |
| 49 | if (status != FSP_SUCCESS) |
| 50 | debug("fail, error code %x\n", status); |
| 51 | else |
| 52 | debug("OK\n"); |
| 53 | |
| 54 | return; |
| 55 | } |
Bin Meng | d560c5c | 2015-06-07 11:33:14 +0800 | [diff] [blame] | 56 | |
| 57 | int x86_fsp_init(void) |
| 58 | { |
| 59 | if (!gd->arch.hob_list) |
| 60 | fsp_init(CONFIG_FSP_TEMP_RAM_ADDR, BOOT_FULL_CONFIG, NULL); |
| 61 | |
| 62 | return 0; |
| 63 | } |