From 5a515132d9f25b1ff2c15e2013de9be33bf71067 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 14 Nov 2021 08:41:07 +0100 Subject: lmb: remove lmb_is_nomap() from include Defining static functions in includes should be avoided. Function lmb_is_nomap() is only used in the unit test. So move it to the unit test. Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- include/lmb.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/lmb.h b/include/lmb.h index 19842911322..ee5b938e194 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -124,13 +124,6 @@ void board_lmb_reserve(struct lmb *lmb); void arch_lmb_reserve(struct lmb *lmb); void arch_lmb_reserve_generic(struct lmb *lmb, ulong sp, ulong end, ulong align); -/* Low level functions */ - -static inline bool lmb_is_nomap(struct lmb_property *m) -{ - return m->flags & LMB_NOMAP; -} - #endif /* __KERNEL__ */ #endif /* _LINUX_LMB_H */ -- cgit v1.2.3 From 4ad4c2daeb44a1761e944e819213ceb3c3bd1340 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 14 Nov 2021 08:43:07 +0100 Subject: doc: add include/lmb.h to the HTML documentation Correct Sphinx style comments in include/lmb.h Add the logical memory block API to the HTML documentation. Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- include/lmb.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/lmb.h b/include/lmb.h index ee5b938e194..5efdf9d2e8f 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -25,8 +25,9 @@ enum lmb_flags { /** * struct lmb_property - Description of one region. * - * @base: Base address of the region. - * @size: Size of the region + * @base: Base address of the region. + * @size: Size of the region + * @flags: memory region attributes */ struct lmb_property { phys_addr_t base; @@ -83,11 +84,11 @@ extern long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size); /** * lmb_reserve_flags - Reserve one region with a specific flags bitfield. * - * @lmb the logical memory block struct - * @base base address of the memory region - * @size size of the memory region - * @flags flags for the memory region - * @return 0 if OK, > 0 for coalesced region or a negative error code. + * @lmb: the logical memory block struct + * @base: base address of the memory region + * @size: size of the memory region + * @flags: flags for the memory region + * Return: 0 if OK, > 0 for coalesced region or a negative error code. */ long lmb_reserve_flags(struct lmb *lmb, phys_addr_t base, phys_size_t size, enum lmb_flags flags); @@ -103,10 +104,10 @@ extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr); /** * lmb_is_reserved_flags - test if tha address is in reserved region with a bitfield flag * - * @lmb the logical memory block struct - * @addr address to be tested - * @flags flags bitfied to be tested - * @return 0 if not reserved or reserved without the requested flag else 1 + * @lmb: the logical memory block struct + * @addr: address to be tested + * @flags: flags bitfied to be tested + * Return: if not reserved or reserved without the requested flag else 1 */ int lmb_is_reserved_flags(struct lmb *lmb, phys_addr_t addr, int flags); extern long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size); -- cgit v1.2.3 From 951a8c487120b7f0a4badecb9402d7eaaad8dbfb Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 14 Nov 2021 08:52:48 +0100 Subject: lmb: remove extern keyword in lmb.h The extern keyword is not needed in include/lmb.h to declare functions. Remove it. Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- include/lmb.h | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/lmb.h b/include/lmb.h index 5efdf9d2e8f..6182054f68e 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -74,13 +74,12 @@ struct lmb { #endif }; -extern void lmb_init(struct lmb *lmb); -extern void lmb_init_and_reserve(struct lmb *lmb, struct bd_info *bd, - void *fdt_blob); -extern void lmb_init_and_reserve_range(struct lmb *lmb, phys_addr_t base, - phys_size_t size, void *fdt_blob); -extern long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size); -extern long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size); +void lmb_init(struct lmb *lmb); +void lmb_init_and_reserve(struct lmb *lmb, struct bd_info *bd, void *fdt_blob); +void lmb_init_and_reserve_range(struct lmb *lmb, phys_addr_t base, + phys_size_t size, void *fdt_blob); +long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size); +long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size); /** * lmb_reserve_flags - Reserve one region with a specific flags bitfield. * @@ -92,15 +91,14 @@ extern long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size); */ long lmb_reserve_flags(struct lmb *lmb, phys_addr_t base, phys_size_t size, enum lmb_flags flags); -extern phys_addr_t lmb_alloc(struct lmb *lmb, phys_size_t size, ulong align); -extern phys_addr_t lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, - phys_addr_t max_addr); -extern phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, - phys_addr_t max_addr); -extern phys_addr_t lmb_alloc_addr(struct lmb *lmb, phys_addr_t base, - phys_size_t size); -extern phys_size_t lmb_get_free_size(struct lmb *lmb, phys_addr_t addr); -extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr); +phys_addr_t lmb_alloc(struct lmb *lmb, phys_size_t size, ulong align); +phys_addr_t lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, + phys_addr_t max_addr); +phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, + phys_addr_t max_addr); +phys_addr_t lmb_alloc_addr(struct lmb *lmb, phys_addr_t base, phys_size_t size); +phys_size_t lmb_get_free_size(struct lmb *lmb, phys_addr_t addr); +int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr); /** * lmb_is_reserved_flags - test if tha address is in reserved region with a bitfield flag * @@ -110,10 +108,10 @@ extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr); * Return: if not reserved or reserved without the requested flag else 1 */ int lmb_is_reserved_flags(struct lmb *lmb, phys_addr_t addr, int flags); -extern long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size); +long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size); -extern void lmb_dump_all(struct lmb *lmb); -extern void lmb_dump_all_force(struct lmb *lmb); +void lmb_dump_all(struct lmb *lmb); +void lmb_dump_all_force(struct lmb *lmb); static inline phys_size_t lmb_size_bytes(struct lmb_region *type, unsigned long region_nr) -- cgit v1.2.3 From 7db07aa24fa869bfa0e56709ffaa992051075942 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 14 Nov 2021 09:03:27 +0100 Subject: lmb: drop unused lmb_size_bytes() lmb_size_bytes() is unused. Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- include/lmb.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/lmb.h b/include/lmb.h index 6182054f68e..ab277ca8000 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -113,12 +113,6 @@ long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size); void lmb_dump_all(struct lmb *lmb); void lmb_dump_all_force(struct lmb *lmb); -static inline phys_size_t -lmb_size_bytes(struct lmb_region *type, unsigned long region_nr) -{ - return type->region[region_nr].size; -} - void board_lmb_reserve(struct lmb *lmb); void arch_lmb_reserve(struct lmb *lmb); void arch_lmb_reserve_generic(struct lmb *lmb, ulong sp, ulong end, ulong align); -- cgit v1.2.3 From 45c16fd0c2457d64fa94ddf3f96818542ebf72b6 Mon Sep 17 00:00:00 2001 From: Masahisa Kojima Date: Fri, 12 Nov 2021 16:24:27 +0900 Subject: efi: add comment for efi_system_table and efi_configuration_table This commit adds the comment for efi_system_table and efi_configuration_table structure. Signed-off-by: Masahisa Kojima Reviewed-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- include/efi_api.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') diff --git a/include/efi_api.h b/include/efi_api.h index 0accad08c8e..db358194739 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -417,6 +417,15 @@ struct efi_runtime_services { EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, \ 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25) +/** + * struct efi_configuration_table - EFI Configuration Table + * + * This table contains a set of GUID/pointer pairs. + * The EFI Configuration Table may contain at most one instance of each table type. + * + * @guid: GUID that uniquely identifies the system configuration table + * @table: A pointer to the table associated with guid + */ struct efi_configuration_table { efi_guid_t guid; void *table; @@ -424,6 +433,29 @@ struct efi_configuration_table { #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) +/** + * struct efi_system_table - EFI System Table + * + * EFI System Table contains pointers to the runtime and boot services tables. + * + * @hdr: The table header for the EFI System Table + * @fw_vendor: A pointer to a null terminated string that identifies the vendor + * that produces the system firmware + * @fw_revision: The revision of the system firmware + * @con_in_handle: The handle for the active console input device + * @con_in: A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface + * that is associated with con_in_handle + * @con_out_handle: The handle for the active console output device + * @con_out: A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface + * that is associated with con_out_handle + * @stderr_handle: The handle for the active standard error console device + * @std_err: A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface + * that is associated with stderr_handle + * @runtime: A pointer to the EFI Runtime Services Table + * @boottime: A pointer to the EFI Boot Services Table + * @nr_tables: The number of system configuration tables + * @tables: A pointer to the system configuration tables + */ struct efi_system_table { struct efi_table_hdr hdr; u16 *fw_vendor; /* physical addr of wchar_t vendor string */ -- cgit v1.2.3 From e032cb2ac98d7085bec258dd19617409f0f70e90 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 20 Nov 2021 09:28:54 +0100 Subject: efi_loader: Sphinx comments in efi_api.h Fix incorrect Sphinx comments in efi_api.h: * add missing 'struct' * correct indentation Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/efi_api.h b/include/efi_api.h index db358194739..41516cc7eb7 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -902,8 +902,8 @@ struct efi_hii_package_list_header { * @fields: 'fields' replaces the bit-fields defined in the EFI * specification to to avoid possible compiler incompatibilities:: * - * u32 length:24; - * u32 type:8; + * u32 length:24; + * u32 type:8; */ struct efi_hii_package_header { u32 fields; @@ -1841,7 +1841,7 @@ struct efi_system_resource_table { 0x34, 0x7d, 0x37, 0x56, 0x65, 0xa7) /** - * win_certificate_uefi_guid - A certificate that encapsulates + * struct win_certificate_uefi_guid - A certificate that encapsulates * a GUID-specific signature * * @hdr: Windows certificate header @@ -1855,7 +1855,7 @@ struct win_certificate_uefi_guid { } __attribute__((__packed__)); /** - * efi_variable_authentication_2 - A time-based authentication method + * struct efi_variable_authentication_2 - A time-based authentication method * descriptor * * This structure describes an authentication information for @@ -1872,7 +1872,7 @@ struct efi_variable_authentication_2 { } __attribute__((__packed__)); /** - * efi_firmware_image_authentication - Capsule authentication method + * struct efi_firmware_image_authentication - Capsule authentication method * descriptor * * This structure describes an authentication information for @@ -1890,7 +1890,7 @@ struct efi_firmware_image_authentication { /** - * efi_signature_data - A format of signature + * struct efi_signature_data - A format of signature * * This structure describes a single signature in signature database. * @@ -1903,7 +1903,7 @@ struct efi_signature_data { } __attribute__((__packed__)); /** - * efi_signature_list - A format of signature database + * struct efi_signature_list - A format of signature database * * This structure describes a list of signatures with the same type. * An authenticated variable's value is a concatenation of one or more -- cgit v1.2.3 From 43eaf5b13f31395afbef3ff89d99a4f6c1a2ba63 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 16 Nov 2021 18:46:27 +0100 Subject: efi_loader: EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES Implement the EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES event group handling. Add the definition of EFI_EVENT_GROUP_AFTER_READY_TO_BOOT. Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/efi_api.h b/include/efi_api.h index 41516cc7eb7..1e956569a03 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -360,10 +360,15 @@ struct efi_runtime_services { }; /* EFI event group GUID definitions */ + #define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \ EFI_GUID(0x27abf055, 0xb1b8, 0x4c26, 0x80, 0x48, \ 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf) +#define EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES \ + EFI_GUID(0x8be0e274, 0x3970, 0x4b44, 0x80, 0xc5, \ + 0x1a, 0xb9, 0x50, 0x2f, 0x3b, 0xfc) + #define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \ EFI_GUID(0x13fa7698, 0xc831, 0x49c7, 0x87, 0xea, \ 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96) @@ -376,6 +381,10 @@ struct efi_runtime_services { EFI_GUID(0x7ce88fb3, 0x4bd7, 0x4679, 0x87, 0xa8, \ 0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b) +#define EFI_EVENT_GROUP_AFTER_READY_TO_BOOT \ + EFI_GUID(0x3a2a00ad, 0x98b9, 0x4cdf, 0xa4, 0x78, \ + 0x70, 0x27, 0x77, 0xf1, 0xc1, 0xb) + #define EFI_EVENT_GROUP_RESET_SYSTEM \ EFI_GUID(0x62da6a56, 0x13fb, 0x485a, 0xa8, 0xda, \ 0xa3, 0xdd, 0x79, 0x12, 0xcb, 0x6b) -- cgit v1.2.3 From dc52578d7b48342c04484184199831893a983cbf Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 17 Nov 2021 18:55:59 +0100 Subject: efi_loader: bump EFI_SPECIFICATION_VERSION to 2.9 We have implemented all what is new in UEFI specification 2.9 and relevant for U-Boot. Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/efi_api.h b/include/efi_api.h index 1e956569a03..80109f012bc 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -20,8 +20,8 @@ #include #include -/* UEFI spec version 2.8 */ -#define EFI_SPECIFICATION_VERSION (2 << 16 | 80) +/* UEFI spec version 2.9 */ +#define EFI_SPECIFICATION_VERSION (2 << 16 | 90) /* Types and defines for EFI CreateEvent */ enum efi_timer_delay { -- cgit v1.2.3