From 039c031e080c5b127c036a5db73e1ba91f5c0ed1 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 14 Aug 2019 01:23:05 -0700 Subject: x86: qemu: Fix build warnings with CONFIG_DISTRO_DEFAULTS=n Use DISTRO_BOOTENV to decouple BOOTENV from CONFIG_DISTRO_DEFAULTS. Reported-by: Heinrich Schuchardt Signed-off-by: Bin Meng --- include/configs/x86-common.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index ca27a4f9e2..54214f99e9 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -105,11 +105,14 @@ #define CONFIG_OTHBOOTARGS "othbootargs=acpi=off\0" #endif -#ifndef CONFIG_DISTRO_DEFAULTS -#define BOOTENV +#if defined(CONFIG_DISTRO_DEFAULTS) +#define DISTRO_BOOTENV BOOTENV +#else +#define DISTRO_BOOTENV #endif #define CONFIG_EXTRA_ENV_SETTINGS \ + DISTRO_BOOTENV \ CONFIG_STD_DEVICES_SETTINGS \ "pciconfighost=1\0" \ "netdev=eth0\0" \ @@ -118,8 +121,8 @@ "scriptaddr=0x7000000\0" \ "kernel_addr_r=0x1000000\0" \ "ramdisk_addr_r=0x4000000\0" \ - "ramdiskfile=initramfs.gz\0" \ - BOOTENV + "ramdiskfile=initramfs.gz\0" + #define CONFIG_RAMBOOTCOMMAND \ "setenv bootargs root=/dev/ram rw " \ -- cgit From c7f16934749b054ce1f0b75bd664d22af8b7c588 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 14 Aug 2019 19:56:13 -0600 Subject: cbfs: Move result variable into the struct Move the result variable into the struct also, so that it can be used when BSS is not available. Add a function to read it. Note that all functions sill use the BSS version of the data. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- include/cbfs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/cbfs.h b/include/cbfs.h index b8d1dabbf6..742e34e24f 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -90,6 +90,13 @@ extern enum cbfs_result file_cbfs_result; */ const char *file_cbfs_error(void); +/** + * cbfs_get_result() - Get the result of the last CBFS operation + * + *@return last result + */ +enum cbfs_result cbfs_get_result(void); + /** * file_cbfs_init() - Initialize the CBFS driver and load metadata into RAM. * -- cgit From 630b2f39ddabd43a27a98f0356b948df18e97d88 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 14 Aug 2019 19:56:14 -0600 Subject: cbfs: Add functions to support multiple CBFSs Sometimes an image has multiple CBFS. The current CBFS API is limited to handling only one at time. Also it keeps track of the CBFS internally in BSS, which does not work before relocation, for example. Add a few new functions to overcome these limitations. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng --- include/cbfs.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/cbfs.h b/include/cbfs.h index 742e34e24f..6d4c4d4b06 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -135,6 +135,28 @@ void file_cbfs_get_next(const struct cbfs_cachenode **file); */ const struct cbfs_cachenode *file_cbfs_find(const char *name); +struct cbfs_priv *priv; + +/** + * cbfs_find_file() - Find a file in a given CBFS + * + * @cbfs: CBFS to look in (use cbfs_init_mem() to set it up) + * @name: Filename to look for + * @return pointer to CBFS node if found, else NULL + */ +const struct cbfs_cachenode *cbfs_find_file(struct cbfs_priv *cbfs, + const char *name); + +/** + * cbfs_init_mem() - Set up a new CBFS + * + * @base: Base address of CBFS + * @size: Size of CBFS in bytes + * @cbfsp: Returns a pointer to CBFS on success + * @return 0 if OK, -ve on error + */ +int cbfs_init_mem(ulong base, ulong size, struct cbfs_priv **privp); + /***************************************************************************/ /* All of the functions below can be used without first initializing CBFS. */ -- cgit From d117f917bfd2ccf4eaf90bddfa256501a554b1a4 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Fri, 16 Aug 2019 14:45:29 +0200 Subject: global_data: Remove comment of reserved arch-specific GD flags With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags. As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY). Signed-off-by: Stefan Roese Cc: Bin Meng Cc: Simon Glass Cc: Tom Rini Cc: Simon Goldschmidt Reviewed-by: Bin Meng Reviewed-by: Simon Goldschmidt Reviewed-by: Simon Glass --- include/asm-generic/global_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 5372d5d8cd..7587ba2ee5 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -150,7 +150,7 @@ typedef struct global_data { #endif /* - * Global Data Flags - the top 16 bits are reserved for arch-specific flags + * Global Data Flags */ #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ -- cgit