Re: [U-Boot] [PATCH v9 3/9] x86: Add a common HOB library
On Sat, Aug 3, 2019 at 4:30 PM Park, Aiden wrote: > > FSP (CONFIG_HAVE_FSP) and Slim Bootloader (CONFIG_SYS_SLIMBOOTLOADER) > consume HOB (CONFIG_USE_HOB) data from the each HOB list pointer. > Add a common HOB library in lib/hob.c and include/asm/hob.h. > > Signed-off-by: Aiden Park > Reviewed-by: Andy Shevchenko > Reviewed-by: Bin Meng > Tested-by: Bin Meng > --- > Changes in v8: > * Add a space between acronym and (definition) > > Changes in v7: > * Split HOB library into EFI_GUID pre-work and making a common lirary > > Changes in v6: > * Use CONFIG_USE_HOB > * Change struct efi_guid to efi_guid_t > * Use EFI_GUID to define GUIDs > > Changes in v3: > * Create a common HOB libary from fsp_hob and fsp_support > > arch/x86/include/asm/fsp/fsp_hob.h| 184 +--- > arch/x86/include/asm/fsp/fsp_support.h| 37 +--- > arch/x86/include/asm/{fsp/fsp_hob.h => hob.h} | 196 +++--- > arch/x86/lib/Makefile | 1 + > arch/x86/lib/fsp/fsp_support.c| 57 + > arch/x86/lib/hob.c| 84 > cmd/x86/Makefile | 1 + > cmd/x86/fsp.c | 65 +- > cmd/x86/hob.c | 77 +++ > 9 files changed, 242 insertions(+), 460 deletions(-) > copy arch/x86/include/asm/{fsp/fsp_hob.h => hob.h} (67%) > create mode 100644 arch/x86/lib/hob.c > create mode 100644 cmd/x86/hob.c > applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v9 3/9] x86: Add a common HOB library
FSP (CONFIG_HAVE_FSP) and Slim Bootloader (CONFIG_SYS_SLIMBOOTLOADER) consume HOB (CONFIG_USE_HOB) data from the each HOB list pointer. Add a common HOB library in lib/hob.c and include/asm/hob.h. Signed-off-by: Aiden Park Reviewed-by: Andy Shevchenko Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes in v8: * Add a space between acronym and (definition) Changes in v7: * Split HOB library into EFI_GUID pre-work and making a common lirary Changes in v6: * Use CONFIG_USE_HOB * Change struct efi_guid to efi_guid_t * Use EFI_GUID to define GUIDs Changes in v3: * Create a common HOB libary from fsp_hob and fsp_support arch/x86/include/asm/fsp/fsp_hob.h| 184 +--- arch/x86/include/asm/fsp/fsp_support.h| 37 +--- arch/x86/include/asm/{fsp/fsp_hob.h => hob.h} | 196 +++--- arch/x86/lib/Makefile | 1 + arch/x86/lib/fsp/fsp_support.c| 57 + arch/x86/lib/hob.c| 84 cmd/x86/Makefile | 1 + cmd/x86/fsp.c | 65 +- cmd/x86/hob.c | 77 +++ 9 files changed, 242 insertions(+), 460 deletions(-) copy arch/x86/include/asm/{fsp/fsp_hob.h => hob.h} (67%) create mode 100644 arch/x86/lib/hob.c create mode 100644 cmd/x86/hob.c diff --git a/arch/x86/include/asm/fsp/fsp_hob.h b/arch/x86/include/asm/fsp/fsp_hob.h index 843d7b513b..3bb79c4b67 100644 --- a/arch/x86/include/asm/fsp/fsp_hob.h +++ b/arch/x86/include/asm/fsp/fsp_hob.h @@ -7,125 +7,7 @@ #ifndef __FSP_HOB_H__ #define __FSP_HOB_H__ -#include -#include - -/* Type of HOB Header */ -#define HOB_TYPE_MEM_ALLOC 0x0002 -#define HOB_TYPE_RES_DESC 0x0003 -#define HOB_TYPE_GUID_EXT 0x0004 -#define HOB_TYPE_UNUSED0xFFFE -#define HOB_TYPE_EOH 0x - -/* - * Describes the format and size of the data inside the HOB. - * All HOBs must contain this generic HOB header. - */ -struct hob_header { - u16 type; /* HOB type */ - u16 len;/* HOB length */ - u32 reserved; /* always zero */ -}; - -/* - * Describes all memory ranges used during the HOB producer phase that - * exist outside the HOB list. This HOB type describes how memory is used, - * not the physical attributes of memory. - */ -struct hob_mem_alloc { - struct hob_header hdr; - /* -* A GUID that defines the memory allocation region's type and purpose, -* as well as other fields within the memory allocation HOB. This GUID -* is used to define the additional data within the HOB that may be -* present for the memory allocation HOB. Type efi_guid is defined in -* InstallProtocolInterface() in the UEFI 2.0 specification. -*/ - efi_guid_t name; - /* -* The base address of memory allocated by this HOB. -* Type phys_addr_t is defined in AllocatePages() in the UEFI 2.0 -* specification. -*/ - phys_addr_t mem_base; - /* The length in bytes of memory allocated by this HOB */ - phys_size_t mem_len; - /* -* Defines the type of memory allocated by this HOB. -* The memory type definition follows the EFI_MEMORY_TYPE definition. -* Type EFI_MEMORY_TYPE is defined in AllocatePages() in the UEFI 2.0 -* specification. -*/ - enum efi_mem_type mem_type; - /* padding */ - u8 reserved[4]; -}; - -/* Value of ResourceType in HOB_RES_DESC */ -#define RES_SYS_MEM0x -#define RES_MMAP_IO0x0001 -#define RES_IO 0x0002 -#define RES_FW_DEVICE 0x0003 -#define RES_MMAP_IO_PORT 0x0004 -#define RES_MEM_RESERVED 0x0005 -#define RES_IO_RESERVED0x0006 -#define RES_MAX_MEM_TYPE 0x0007 - -/* - * These types can be ORed together as needed. - * - * The first three enumerations describe settings - * The rest of the settings describe capabilities - */ -#define RES_ATTR_PRESENT 0x0001 -#define RES_ATTR_INITIALIZED 0x0002 -#define RES_ATTR_TESTED0x0004 -#define RES_ATTR_SINGLE_BIT_ECC0x0008 -#define RES_ATTR_MULTIPLE_BIT_ECC 0x0010 -#define RES_ATTR_ECC_RESERVED_10x0020 -#define RES_ATTR_ECC_RESERVED_20x0040 -#define RES_ATTR_READ_PROTECTED0x0080 -#define RES_ATTR_WRITE_PROTECTED 0x0100 -#define RES_ATTR_EXECUTION_PROTECTED 0x0200 -#define RES_ATTR_UNCACHEABLE 0x0400 -#define RES_ATTR_WRITE_COMBINEABLE 0x0800 -#define RES_ATTR_WRITE_THROUGH_CACHEABLE 0x1000 -#define