diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-12-10 22:03:01 -0800 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2016-01-13 12:20:14 +0800 |
commit | 3340f2cc0b8b2e3213e8c4acbcfbd100d3ef5cfe (patch) | |
tree | a55afe6b0702215a9afb1fd15dc2dd847628890c | |
parent | 81f84aa6c903eb78d6650f159a6486a2a5af83cb (diff) | |
download | u-boot-imx-3340f2cc0b8b2e3213e8c4acbcfbd100d3ef5cfe.zip u-boot-imx-3340f2cc0b8b2e3213e8c4acbcfbd100d3ef5cfe.tar.gz u-boot-imx-3340f2cc0b8b2e3213e8c4acbcfbd100d3ef5cfe.tar.bz2 |
x86: fsp: Introduce CONFIG_FSP_USE_UPD Kconfig option
Not every FSP supports UPD, thus we introduce a Kconfig option
CONFIG_FSP_USE_UPD and use it to wrap these common UPD handling
codes in fsp_support.c.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/x86/Kconfig | 9 | ||||
-rw-r--r-- | arch/x86/lib/fsp/fsp_support.c | 23 |
2 files changed, 23 insertions, 9 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 7e7cb61..f07567c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -242,6 +242,15 @@ config FSP_SYS_MALLOC_F_LEN help Additional size of malloc() pool before relocation. +config FSP_USE_UPD + bool + depends on HAVE_FSP + default y + help + Most FSPs use UPD data region for some FSP customization. But there + are still some FSPs that might not even have UPD. For such FSPs, + override this to n in their platform Kconfig files. + config ENABLE_MRC_CACHE bool "Enable MRC cache" depends on !EFI && !SYS_COREBOOT diff --git a/arch/x86/lib/fsp/fsp_support.c b/arch/x86/lib/fsp/fsp_support.c index 9257745..d86a511 100644 --- a/arch/x86/lib/fsp/fsp_support.c +++ b/arch/x86/lib/fsp/fsp_support.c @@ -103,10 +103,12 @@ void fsp_init(u32 stack_top, u32 boot_mode, void *nvs_buf) fsp_init_f init; struct fsp_init_params params; struct fspinit_rtbuf rt_buf; - struct vpd_region *fsp_vpd; struct fsp_header *fsp_hdr; struct fsp_init_params *params_ptr; +#ifdef CONFIG_FSP_USE_UPD + struct vpd_region *fsp_vpd; struct upd_region *fsp_upd; +#endif #ifdef CONFIG_DEBUG_UART setup_early_uart(); @@ -122,14 +124,7 @@ void fsp_init(u32 stack_top, u32 boot_mode, void *nvs_buf) config_data.common.stack_top = stack_top; config_data.common.boot_mode = boot_mode; - fsp_upd = &config_data.fsp_upd; - memset(&rt_buf, 0, sizeof(struct fspinit_rtbuf)); - - /* Reserve a gap in stack top */ - rt_buf.common.stack_top = stack_top - 32; - rt_buf.common.boot_mode = boot_mode; - rt_buf.common.upd_data = fsp_upd; - +#ifdef CONFIG_FSP_USE_UPD /* Get VPD region start */ fsp_vpd = (struct vpd_region *)(fsp_hdr->img_base + fsp_hdr->cfg_region_off); @@ -137,12 +132,22 @@ void fsp_init(u32 stack_top, u32 boot_mode, void *nvs_buf) /* Verify the VPD data region is valid */ assert(fsp_vpd->sign == VPD_IMAGE_ID); + fsp_upd = &config_data.fsp_upd; + /* Copy default data from Flash */ memcpy(fsp_upd, (void *)(fsp_hdr->img_base + fsp_vpd->upd_offset), sizeof(struct upd_region)); /* Verify the UPD data region is valid */ assert(fsp_upd->terminator == UPD_TERMINATOR); +#endif + + memset(&rt_buf, 0, sizeof(struct fspinit_rtbuf)); + + /* Initialize runtime buffer for fsp_init() */ + rt_buf.common.stack_top = stack_top - 32; + rt_buf.common.boot_mode = boot_mode; + rt_buf.common.upd_data = fsp_upd; /* Override any configuration if required */ update_fsp_configs(&config_data); |