From 415eab0655a8bdfa07464e2b3f9724a198afc81f Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 3 Nov 2020 15:34:51 +0100 Subject: smbios: add parsing API Add a very simple API to be able to access SMBIOS strings like vendor, model and bios version. Signed-off-by: Christian Gmeiner Reviewed-by: Bin Meng --- include/smbios.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include') diff --git a/include/smbios.h b/include/smbios.h index 97b9ddc..44f49e9 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -237,4 +237,31 @@ typedef int (*smbios_write_type)(ulong *addr, int handle); */ ulong write_smbios_table(ulong addr); +/** + * smbios_entry() - Get a valid struct smbios_entry pointer + * + * @address: address where smbios tables is located + * @size: size of smbios table + * @return: NULL or a valid pointer to a struct smbios_entry + */ +const struct smbios_entry *smbios_entry(u64 address, u32 size); + +/** + * smbios_header() - Search for SMBIOS header type + * + * @entry: pointer to a struct smbios_entry + * @type: SMBIOS type + * @return: NULL or a valid pointer to a struct smbios_header + */ +const struct smbios_header *smbios_header(const struct smbios_entry *entry, int type); + +/** + * smbios_string() - Return string from SMBIOS + * + * @header: pointer to struct smbios_header + * @index: string index + * @return: NULL or a valid const char pointer + */ +const char *smbios_string(const struct smbios_header *header, int index); + #endif /* _SMBIOS_H_ */ -- cgit v1.1 From 1779b8a96a32706dc8e2e71187889b38d9822443 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:57:14 -0700 Subject: Add an assembly guard around linux/bitops.h This file can be included by any header but it includes C code. Guard it to avoid errors when compiling ASL, etc. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/linux/bitops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 6b509dc..16f2899 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -1,7 +1,7 @@ #ifndef _LINUX_BITOPS_H #define _LINUX_BITOPS_H -#ifndef USE_HOSTCC +#if !defined(USE_HOSTCC) && !defined(__ASSEMBLY__) #include #include @@ -218,6 +218,6 @@ static inline void generic_clear_bit(int nr, volatile unsigned long *addr) *p &= ~mask; } -#endif /* !USE_HOSTCC */ +#endif /* !USE_HOSTCC && !__ASSEMBLY__ */ #endif -- cgit v1.1 From 5019e201ccaee4bd54ba707dfc4eece885857629 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:57:19 -0700 Subject: x86: acpi: Store the ACPI context in global_data At present we create the ACPI context but then drop it after generation of tables is complete. This is annoying because we have to then search for tables later. To fix this, allocate the context and store it in global_data. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/asm-generic/global_data.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index f392043..87d827d 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -24,6 +24,7 @@ #include #include +struct acpi_ctx; struct driver_rt; typedef struct global_data gd_t; @@ -420,6 +421,12 @@ struct global_data { */ struct udevice *watchdog_dev; #endif +#ifdef CONFIG_GENERATE_ACPI_TABLE + /** + * @acpi_ctx: ACPI context pointer + */ + struct acpi_ctx *acpi_ctx; +#endif }; /** @@ -452,6 +459,12 @@ struct global_data { #define gd_dm_driver_rt() NULL #endif +#ifdef CONFIG_GENERATE_ACPI_TABLE +#define gd_acpi_ctx() gd->acpi_ctx +#else +#define gd_acpi_ctx() NULL +#endif + /** * enum gd_flags - global data flags * -- cgit v1.1 From d2cb7a22da0fec2b67b356e9fb58247cdff8c95e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:57:25 -0700 Subject: x86: Allow putting some tables in the bloblist At present all tables are placed starting at address f0000 in memory, and can be up to 64KB in size. If the tables are very large, this may not provide enough space. Also if the tables point to other tables (such as console log or a ramoops area) then we must allocate other memory anyway. The bloblist is a nice place to put these tables since it is contiguous, which makes it easy to reserve this memory for linux using the 820 tables. Add an option to put some of the tables in the bloblist. For SMBIOS and ACPI, create suitable pointers from the f0000 region to the new location of the tables. Signed-off-by: Simon Glass Reviewed-by: Bin Meng [bmeng: squashed in http://patchwork.ozlabs.org/project/uboot/patch/ 20201105062407.1.I8091ad931cbbb5e3b6f6ababdf3f8d5db0d17bb9@changeid/] Signed-off-by: Bin Meng --- include/acpi/acpi_table.h | 10 ++++++++++ include/bloblist.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index abbca65..a28eb71 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -688,6 +688,16 @@ int acpi_add_table(struct acpi_ctx *ctx, void *table); */ void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start); +/** + * acpi_write_rsdp() - Write out an RSDP indicating where the ACPI tables are + * + * @rsdp: Address to write RSDP + * @rsdt: Address of RSDT + * @xsdt: Address of XSDT + */ +void acpi_write_rsdp(struct acpi_rsdp *rsdp, struct acpi_rsdt *rsdt, + struct acpi_xsdt *xsdt); + #endif /* !__ACPI__*/ #include diff --git a/include/bloblist.h b/include/bloblist.h index 2b4b669..8cdce61 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -36,6 +36,8 @@ enum bloblist_tag_t { BLOBLISTT_INTEL_VBT, /* Intel Video-BIOS table */ BLOBLISTT_TPM2_TCG_LOG, /* TPM v2 log space */ BLOBLISTT_TCPA_LOG, /* TPM log space */ + BLOBLISTT_ACPI_TABLES, /* ACPI tables for x86 */ + BLOBLISTT_SMBIOS_TABLES, /* SMBIOS tables for x86 */ BLOBLISTT_COUNT }; -- cgit v1.1 From 18434aec1b69d8490cb23ef35b2f39cf1784d1d0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:57:33 -0700 Subject: acpi: Don't reset the tables with every new generation At present if SSDT and DSDT code is created, only the latter is retained for examination by the 'acpi items' command. Fix this by only resetting the list when explicitly requested. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/dm/acpi.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/dm/acpi.h b/include/dm/acpi.h index e8b0336..e6951b6 100644 --- a/include/dm/acpi.h +++ b/include/dm/acpi.h @@ -226,6 +226,15 @@ void acpi_dump_items(enum acpi_dump_option option); */ int acpi_get_path(const struct udevice *dev, char *out_path, int maxlen); +/** + * acpi_reset_items() - Reset the list of ACPI items to empty + * + * This list keeps track of DSDT and SSDT items that are generated + * programmatically. The 'acpi items' command shows the list. Use this function + * to empty the list, before writing new items. + */ +void acpi_reset_items(void); + #endif /* __ACPI__ */ #endif -- cgit v1.1 From e0028ab75a8da96b85b210adda323ca2bf3da94f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:57:37 -0700 Subject: x86: Boot coral into Chrome OS by default Add a script to boot Chrome OS from the internal MMC. This involved adding a few commands and options. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/configs/chromebook_coral.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/chromebook_coral.h b/include/configs/chromebook_coral.h index a63c3c9..d4d3275 100644 --- a/include/configs/chromebook_coral.h +++ b/include/configs/chromebook_coral.h @@ -11,7 +11,14 @@ #define __CONFIG_H #define CONFIG_BOOTCOMMAND \ - "fatload mmc 1:c 1000000 syslinux/vmlinuz.A; zboot 1000000" + "tpm init; tpm startup TPM2_SU_CLEAR; " \ + "read mmc 2:2 100000 0 80; setexpr loader *001004f0; " \ + "setexpr size *00100518; setexpr blocks $size / 200; " \ + "read mmc 2:2 100000 80 $blocks; setexpr setup $loader - 1000; " \ + "setexpr cmdline $loader - 2000; " \ + "part uuid mmc 2:2 uuid; setenv bootargs_U $uuid; " \ + "zboot start 100000 0 0 0 $setup $cmdline; " \ + "zboot load; zboot setup; zboot dump; zboot go" #include #include -- cgit v1.1 From b73d61a5565c3ab9e207a288186049806ce13e1b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 4 Nov 2020 09:59:13 -0700 Subject: x86: zimage: Add a little more logging Add logging for each part of the boot process, using a new Signed-off-by: Simon Glass Reviewed-by: Bin Meng Reviewed-by: Igor Opaniuk --- include/log.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/log.h b/include/log.h index 4d0692f..29f18a8 100644 --- a/include/log.h +++ b/include/log.h @@ -96,6 +96,7 @@ enum log_category_t { LOGC_DEVRES, /** @LOGC_ACPI: Advanced Configuration and Power Interface (ACPI) */ LOGC_ACPI, + LOGC_BOOT, /* Related to boot process / boot image processing */ /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT, -- cgit v1.1 From 3a8ee3df836614b68881f5b84d3197305ee1b08e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 5 Nov 2020 06:32:05 -0700 Subject: board: Rename uclass to sysinfo This uclass is intended to provide a way to obtain information about a U-Boot board. But the concept of a U-Boot 'board' is the whole system, not just one circuit board, meaning that 'board' is something of a misnomer for this uclass. In addition, the name 'board' is a bit overused in U-Boot and we want to use the same uclass to provide SMBIOS information. The obvious name is 'system' but that is so vague as to be meaningless. Use 'sysinfo' instead, since this uclass is aimed at providing information on the system. Rename everything accordingly. Note: Due to the patch delta caused by the symbol renames, this patch shows some renamed files as being deleted in one place and created in another. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/board.h | 213 ------------------------------------------------- include/dm/uclass-id.h | 2 +- include/sysinfo.h | 213 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+), 214 deletions(-) delete mode 100644 include/board.h create mode 100644 include/sysinfo.h (limited to 'include') diff --git a/include/board.h b/include/board.h deleted file mode 100644 index 678b652..0000000 --- a/include/board.h +++ /dev/null @@ -1,213 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2017 - * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc - */ - -/* - * This uclass encapsulates hardware methods to gather information about a - * board or a specific device such as hard-wired GPIOs on GPIO expanders, - * read-only data in flash ICs, or similar. - * - * The interface offers functions to read the usual standard data types (bool, - * int, string) from the device, each of which is identified by a static - * numeric ID (which will usually be defined as a enum in a header file). - * - * If for example the board had a read-only serial number flash IC, we could - * call - * - * ret = board_detect(dev); - * if (ret) { - * debug("board device not found."); - * return ret; - * } - * - * ret = board_get_int(dev, ID_SERIAL_NUMBER, &serial); - * if (ret) { - * debug("Error when reading serial number from device."); - * return ret; - * } - * - * to read the serial number. - */ - -#if CONFIG_IS_ENABLED(BOARD) -struct board_ops { - /** - * detect() - Run the hardware info detection procedure for this - * device. - * @dev: The device containing the information - * - * This operation might take a long time (e.g. read from EEPROM, - * check the presence of a device on a bus etc.), hence this is not - * done in the probe() method, but later during operation in this - * dedicated method. - * - * Return: 0 if OK, -ve on error. - */ - int (*detect)(struct udevice *dev); - - /** - * get_bool() - Read a specific bool data value that describes the - * hardware setup. - * @dev: The board instance to gather the data. - * @id: A unique identifier for the bool value to be read. - * @val: Pointer to a buffer that receives the value read. - * - * Return: 0 if OK, -ve on error. - */ - int (*get_bool)(struct udevice *dev, int id, bool *val); - - /** - * get_int() - Read a specific int data value that describes the - * hardware setup. - * @dev: The board instance to gather the data. - * @id: A unique identifier for the int value to be read. - * @val: Pointer to a buffer that receives the value read. - * - * Return: 0 if OK, -ve on error. - */ - int (*get_int)(struct udevice *dev, int id, int *val); - - /** - * get_str() - Read a specific string data value that describes the - * hardware setup. - * @dev: The board instance to gather the data. - * @id: A unique identifier for the string value to be read. - * @size: The size of the buffer to receive the string data. - * @val: Pointer to a buffer that receives the value read. - * - * Return: 0 if OK, -ve on error. - */ - int (*get_str)(struct udevice *dev, int id, size_t size, char *val); - - /** - * get_fit_loadable - Get the name of an image to load from FIT - * This function can be used to provide the image names based on runtime - * detection. A classic use-case would when DTBOs are used to describe - * additionnal daughter cards. - * - * @dev: The board instance to gather the data. - * @index: Index of the image. Starts at 0 and gets incremented - * after each call to this function. - * @type: The type of image. For example, "fdt" for DTBs - * @strp: A pointer to string. Untouched if the function fails - * - * Return: 0 if OK, -ENOENT if no loadable is available else -ve on - * error. - */ - int (*get_fit_loadable)(struct udevice *dev, int index, - const char *type, const char **strp); -}; - -#define board_get_ops(dev) ((struct board_ops *)(dev)->driver->ops) - -/** - * board_detect() - Run the hardware info detection procedure for this device. - * - * @dev: The device containing the information - * - * Return: 0 if OK, -ve on error. - */ -int board_detect(struct udevice *dev); - -/** - * board_get_bool() - Read a specific bool data value that describes the - * hardware setup. - * @dev: The board instance to gather the data. - * @id: A unique identifier for the bool value to be read. - * @val: Pointer to a buffer that receives the value read. - * - * Return: 0 if OK, -ve on error. - */ -int board_get_bool(struct udevice *dev, int id, bool *val); - -/** - * board_get_int() - Read a specific int data value that describes the - * hardware setup. - * @dev: The board instance to gather the data. - * @id: A unique identifier for the int value to be read. - * @val: Pointer to a buffer that receives the value read. - * - * Return: 0 if OK, -ve on error. - */ -int board_get_int(struct udevice *dev, int id, int *val); - -/** - * board_get_str() - Read a specific string data value that describes the - * hardware setup. - * @dev: The board instance to gather the data. - * @id: A unique identifier for the string value to be read. - * @size: The size of the buffer to receive the string data. - * @val: Pointer to a buffer that receives the value read. - * - * Return: 0 if OK, -ve on error. - */ -int board_get_str(struct udevice *dev, int id, size_t size, char *val); - -/** - * board_get() - Return the board device for the board in question. - * @devp: Pointer to structure to receive the board device. - * - * Since there can only be at most one board instance, the API can supply a - * function that returns the unique device. This is especially useful for use - * in board files. - * - * Return: 0 if OK, -ve on error. - */ -int board_get(struct udevice **devp); - -/** - * board_get_fit_loadable - Get the name of an image to load from FIT - * This function can be used to provide the image names based on runtime - * detection. A classic use-case would when DTBOs are used to describe - * additionnal daughter cards. - * - * @dev: The board instance to gather the data. - * @index: Index of the image. Starts at 0 and gets incremented - * after each call to this function. - * @type: The type of image. For example, "fdt" for DTBs - * @strp: A pointer to string. Untouched if the function fails - * - * - * Return: 0 if OK, -ENOENT if no loadable is available else -ve on - * error. - */ -int board_get_fit_loadable(struct udevice *dev, int index, - const char *type, const char **strp); - -#else - -static inline int board_detect(struct udevice *dev) -{ - return -ENOSYS; -} - -static inline int board_get_bool(struct udevice *dev, int id, bool *val) -{ - return -ENOSYS; -} - -static inline int board_get_int(struct udevice *dev, int id, int *val) -{ - return -ENOSYS; -} - -static inline int board_get_str(struct udevice *dev, int id, size_t size, - char *val) -{ - return -ENOSYS; -} - -static inline int board_get(struct udevice **devp) -{ - return -ENOSYS; -} - -static inline int board_get_fit_loadable(struct udevice *dev, int index, - const char *type, const char **strp) -{ - return -ENOSYS; -} - -#endif diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 17542de..e952a99 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -36,7 +36,6 @@ enum uclass_id { UCLASS_AUDIO_CODEC, /* Audio codec with control and data path */ UCLASS_AXI, /* AXI bus */ UCLASS_BLK, /* Block device */ - UCLASS_BOARD, /* Device information from hardware */ UCLASS_BOOTCOUNT, /* Bootcount backing store */ UCLASS_BUTTON, /* Button */ UCLASS_CACHE, /* Cache controller */ @@ -107,6 +106,7 @@ enum uclass_id { UCLASS_SPI_GENERIC, /* Generic SPI flash target */ UCLASS_SPMI, /* System Power Management Interface bus */ UCLASS_SYSCON, /* System configuration device */ + UCLASS_SYSINFO, /* Device information from hardware */ UCLASS_SYSRESET, /* System reset device */ UCLASS_TEE, /* Trusted Execution Environment device */ UCLASS_THERMAL, /* Thermal sensor */ diff --git a/include/sysinfo.h b/include/sysinfo.h new file mode 100644 index 0000000..c045d31 --- /dev/null +++ b/include/sysinfo.h @@ -0,0 +1,213 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2017 + * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc + */ + +/* + * This uclass encapsulates hardware methods to gather information about a + * sysinfo or a specific device such as hard-wired GPIOs on GPIO expanders, + * read-only data in flash ICs, or similar. + * + * The interface offers functions to read the usual standard data types (bool, + * int, string) from the device, each of which is identified by a static + * numeric ID (which will usually be defined as a enum in a header file). + * + * If for example the sysinfo had a read-only serial number flash IC, we could + * call + * + * ret = sysinfo_detect(dev); + * if (ret) { + * debug("sysinfo device not found."); + * return ret; + * } + * + * ret = sysinfo_get_int(dev, ID_SERIAL_NUMBER, &serial); + * if (ret) { + * debug("Error when reading serial number from device."); + * return ret; + * } + * + * to read the serial number. + */ + +#if CONFIG_IS_ENABLED(SYSINFO) +struct sysinfo_ops { + /** + * detect() - Run the hardware info detection procedure for this + * device. + * @dev: The device containing the information + * + * This operation might take a long time (e.g. read from EEPROM, + * check the presence of a device on a bus etc.), hence this is not + * done in the probe() method, but later during operation in this + * dedicated method. + * + * Return: 0 if OK, -ve on error. + */ + int (*detect)(struct udevice *dev); + + /** + * get_bool() - Read a specific bool data value that describes the + * hardware setup. + * @dev: The sysinfo instance to gather the data. + * @id: A unique identifier for the bool value to be read. + * @val: Pointer to a buffer that receives the value read. + * + * Return: 0 if OK, -ve on error. + */ + int (*get_bool)(struct udevice *dev, int id, bool *val); + + /** + * get_int() - Read a specific int data value that describes the + * hardware setup. + * @dev: The sysinfo instance to gather the data. + * @id: A unique identifier for the int value to be read. + * @val: Pointer to a buffer that receives the value read. + * + * Return: 0 if OK, -ve on error. + */ + int (*get_int)(struct udevice *dev, int id, int *val); + + /** + * get_str() - Read a specific string data value that describes the + * hardware setup. + * @dev: The sysinfo instance to gather the data. + * @id: A unique identifier for the string value to be read. + * @size: The size of the buffer to receive the string data. + * @val: Pointer to a buffer that receives the value read. + * + * Return: 0 if OK, -ve on error. + */ + int (*get_str)(struct udevice *dev, int id, size_t size, char *val); + + /** + * get_fit_loadable - Get the name of an image to load from FIT + * This function can be used to provide the image names based on runtime + * detection. A classic use-case would when DTBOs are used to describe + * additionnal daughter cards. + * + * @dev: The sysinfo instance to gather the data. + * @index: Index of the image. Starts at 0 and gets incremented + * after each call to this function. + * @type: The type of image. For example, "fdt" for DTBs + * @strp: A pointer to string. Untouched if the function fails + * + * Return: 0 if OK, -ENOENT if no loadable is available else -ve on + * error. + */ + int (*get_fit_loadable)(struct udevice *dev, int index, + const char *type, const char **strp); +}; + +#define sysinfo_get_ops(dev) ((struct sysinfo_ops *)(dev)->driver->ops) + +/** + * sysinfo_detect() - Run the hardware info detection procedure for this device. + * + * @dev: The device containing the information + * + * Return: 0 if OK, -ve on error. + */ +int sysinfo_detect(struct udevice *dev); + +/** + * sysinfo_get_bool() - Read a specific bool data value that describes the + * hardware setup. + * @dev: The sysinfo instance to gather the data. + * @id: A unique identifier for the bool value to be read. + * @val: Pointer to a buffer that receives the value read. + * + * Return: 0 if OK, -ve on error. + */ +int sysinfo_get_bool(struct udevice *dev, int id, bool *val); + +/** + * sysinfo_get_int() - Read a specific int data value that describes the + * hardware setup. + * @dev: The sysinfo instance to gather the data. + * @id: A unique identifier for the int value to be read. + * @val: Pointer to a buffer that receives the value read. + * + * Return: 0 if OK, -ve on error. + */ +int sysinfo_get_int(struct udevice *dev, int id, int *val); + +/** + * sysinfo_get_str() - Read a specific string data value that describes the + * hardware setup. + * @dev: The sysinfo instance to gather the data. + * @id: A unique identifier for the string value to be read. + * @size: The size of the buffer to receive the string data. + * @val: Pointer to a buffer that receives the value read. + * + * Return: 0 if OK, -ve on error. + */ +int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val); + +/** + * sysinfo_get() - Return the sysinfo device for the sysinfo in question. + * @devp: Pointer to structure to receive the sysinfo device. + * + * Since there can only be at most one sysinfo instance, the API can supply a + * function that returns the unique device. This is especially useful for use + * in sysinfo files. + * + * Return: 0 if OK, -ve on error. + */ +int sysinfo_get(struct udevice **devp); + +/** + * sysinfo_get_fit_loadable - Get the name of an image to load from FIT + * This function can be used to provide the image names based on runtime + * detection. A classic use-case would when DTBOs are used to describe + * additionnal daughter cards. + * + * @dev: The sysinfo instance to gather the data. + * @index: Index of the image. Starts at 0 and gets incremented + * after each call to this function. + * @type: The type of image. For example, "fdt" for DTBs + * @strp: A pointer to string. Untouched if the function fails + * + * + * Return: 0 if OK, -ENOENT if no loadable is available else -ve on + * error. + */ +int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, + const char **strp); + +#else + +static inline int sysinfo_detect(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int sysinfo_get_bool(struct udevice *dev, int id, bool *val) +{ + return -ENOSYS; +} + +static inline int sysinfo_get_int(struct udevice *dev, int id, int *val) +{ + return -ENOSYS; +} + +static inline int sysinfo_get_str(struct udevice *dev, int id, size_t size, + char *val) +{ + return -ENOSYS; +} + +static inline int sysinfo_get(struct udevice **devp) +{ + return -ENOSYS; +} + +static inline int sysinfo_get_fit_loadable(struct udevice *dev, int index, + const char *type, const char **strp) +{ + return -ENOSYS; +} + +#endif -- cgit v1.1 From 78227d4eda26d5838b34e12f5080346728015fa5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 5 Nov 2020 06:32:07 -0700 Subject: x86: Pass an ofnode into each SMBIOS function As a first step to obtaining SMBIOS information from the devicetree, add an ofnode parameter to the writing functions. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/smbios.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/smbios.h b/include/smbios.h index 44f49e9..1846607 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -8,6 +8,8 @@ #ifndef _SMBIOS_H_ #define _SMBIOS_H_ +#include + /* SMBIOS spec version implemented */ #define SMBIOS_MAJOR_VER 3 #define SMBIOS_MINOR_VER 0 @@ -222,9 +224,10 @@ static inline void fill_smbios_header(void *table, int type, * * @addr: start address to write the structure * @handle: the structure's handle, a unique 16-bit number + * @node: node containing the information to write (ofnode_null() if none) * @return: size of the structure */ -typedef int (*smbios_write_type)(ulong *addr, int handle); +typedef int (*smbios_write_type)(ulong *addr, int handle, ofnode node); /** * write_smbios_table() - Write SMBIOS table -- cgit v1.1