diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acpi_table.h | 10 | ||||
-rw-r--r-- | include/asm-generic/global_data.h | 13 | ||||
-rw-r--r-- | include/bloblist.h | 2 | ||||
-rw-r--r-- | include/configs/chromebook_coral.h | 9 | ||||
-rw-r--r-- | include/configs/ge_b1x5v2.h | 127 | ||||
-rw-r--r-- | include/configs/meson64.h | 3 | ||||
-rw-r--r-- | include/configs/meson64_android.h | 11 | ||||
-rw-r--r-- | include/configs/phycore_imx8mm.h | 130 | ||||
-rw-r--r-- | include/dm/acpi.h | 9 | ||||
-rw-r--r-- | include/dm/uclass-id.h | 2 | ||||
-rw-r--r-- | include/linux/bitops.h | 4 | ||||
-rw-r--r-- | include/log.h | 1 | ||||
-rw-r--r-- | include/smbios.h | 32 | ||||
-rw-r--r-- | include/sysinfo.h (renamed from include/board.h) | 80 |
14 files changed, 383 insertions, 50 deletions
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index abbca6530d..a28eb71f4d 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 <asm/acpi_table.h> diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index f392043796..87d827d0f4 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -24,6 +24,7 @@ #include <membuff.h> #include <linux/list.h> +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 * diff --git a/include/bloblist.h b/include/bloblist.h index 2b4b669689..8cdce61187 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 }; diff --git a/include/configs/chromebook_coral.h b/include/configs/chromebook_coral.h index a63c3c9eea..d4d32758e9 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 <configs/x86-common.h> #include <configs/x86-chromebook.h> diff --git a/include/configs/ge_b1x5v2.h b/include/configs/ge_b1x5v2.h new file mode 100644 index 0000000000..7db6afd88c --- /dev/null +++ b/include/configs/ge_b1x5v2.h @@ -0,0 +1,127 @@ +/* + * GE B1x5v2 + * + * Copyright 2018-2020 GE Inc. + * Copyright 2018-2020 Collabora Ltd. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __GE_B1X5V2_CONFIG_H +#define __GE_B1X5V2_CONFIG_H + +#include "mx6_common.h" + +#include "imx6_spl.h" +#define CONFIG_SPL_TARGET "u-boot-with-spl.imx" + +/* Size of malloc() pool */ +#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) + +/* PWM */ +#define CONFIG_IMX6_PWM_PER_CLK 66000000 + +/* UART */ +#define CONFIG_MXC_UART_BASE UART3_BASE + +#if CONFIG_MXC_UART_BASE == UART2_BASE +/* UART2 requires CONFIG_DEBUG_UART_BASE=0x21e8000 */ +#define CONSOLE_DEVICE "ttymxc1" /* System on Module debug connector */ +#else +/* UART3 requires CONFIG_DEBUG_UART_BASE=0x21ec000 */ +#define CONSOLE_DEVICE "ttymxc2" /* Base board debug connector */ +#endif + +/* USB */ +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */ +#define CONFIG_USBD_HS + +/* Video */ +#define CONFIG_HIDE_LOGO_VERSION +#define CONFIG_IMX_VIDEO_SKIP + +/* Memory */ +#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR + +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM +#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR +#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE + +#define CONFIG_SYS_INIT_SP_OFFSET \ + (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) + +/* Command definition */ +#define CONFIG_EXTRA_ENV_SETTINGS \ + "image=/boot/fitImage\0" \ + "fdt_addr_r=0x18000000\0" \ + "splash_addr_r=0x20000000\0" \ + "mmcdev=2\0" \ + "mmcpart=1\0" \ + "console=console="CONSOLE_DEVICE",115200\0" \ + "quiet=quiet loglevel=0\0" \ + "rootdev=/dev/mmcblk1p\0" \ + "setargs=setenv bootargs ${console} ${quiet} ${fsckforcerepair} " \ + "bootcause=${bootcause} vt.global_cursor_default=0 vt.cur_default=1 " \ + "root=${rootdev}${mmcpart} video=HDMI-A-1:${resolution} rootwait ro\0" \ + "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ + "showsplashscreen=load mmc ${mmcdev}:${mmcpart} ${splash_addr_r} /boot/splashscreen-${resolution}.bmp; " \ + "bmp display ${splash_addr_r};\0" \ + "setconfidx=" \ + "if test \"${devicetype}\" = \"B105v2\"; then " \ + "setenv confidx 1; " \ + "elif test \"${devicetype}\" = \"B125v2\"; then " \ + "setenv confidx 2; " \ + "elif test \"${devicetype}\" = \"B155v2\"; then " \ + "setenv confidx 3; " \ + "elif test \"${devicetype}\" = \"B105Pv2\"; then " \ + "setenv confidx 4; " \ + "elif test \"${devicetype}\" = \"B125Pv2\"; then " \ + "setenv confidx 5; " \ + "fi;\0" \ + "set_default_type=setenv devicetype B155v2; setenv resolution 1366x768;" \ + "setenv fdtfile imx6dl-b155v2.dtb; run setconfidx;\0" \ + "checkconfidx=env exists confidx || run set_default_type;\0" \ + "checkfsckforcerepair=" \ + "if test \"${bootcount}\" > \"3\" ; then " \ + "setenv fsckforcerepair fsck.repair=1; " \ + "fi;\0" \ + "helix=run setconfidx; run checkconfidx; run checkfsckforcerepair; run setargs; " \ + "regulator dev LED_VCC; regulator enable; " \ + "regulator dev 5V0_AUDIO; regulator enable; " \ + "bootm ${loadaddr}#conf@${confidx};\0" \ + "failbootcmd=" \ + "echo reached failbootcmd;" \ + "cls; setcurs 5 4; " \ + "lcdputs \"Monitor failed to start. Try again, or contact GE Service for support.\"; " \ + "bootcount reset; \0" \ + "hasfirstboot=" \ + "load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ + "/boot/bootcause/firstboot;\0" \ + "swappartitions=" \ + "setexpr mmcpart 3 - ${mmcpart};\0" \ + "doboot=" \ + "echo Booting from mmc:${mmcdev}:${mmcpart} ...; " \ + "run helix;\0" \ + "altbootcmd=" \ + "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \ + "run hasfirstboot || setenv mmcpart 0; " \ + "if test ${mmcpart} != 0; then " \ + "setenv bootcause REVERT; " \ + "run swappartitions loadimage doboot; " \ + "fi; " \ + "run failbootcmd\0" \ + "tryboot=" \ + "setenv mmcpart 1; run hasfirstboot || setenv mmcpart 2; " \ + "run loadimage || run swappartitions && run loadimage || " \ + "setenv mmcpart 0 && echo MISSING IMAGE;" \ + "run showsplashscreen; sleep 1; " \ + "run doboot; run failbootcmd;\0" \ + +#define CONFIG_BOOTCOMMAND "run tryboot;" + +#endif /* __GE_B1X5V2_CONFIG_H */ diff --git a/include/configs/meson64.h b/include/configs/meson64.h index cee6900680..52cc01f73d 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -69,6 +69,8 @@ func(DHCP, dhcp, na) #endif +#include <config_distro_bootcmd.h> + #ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ "stdin=" STDIN_CFG "\0" \ @@ -83,6 +85,5 @@ BOOTENV #endif -#include <config_distro_bootcmd.h> #endif /* __MESON64_CONFIG_H */ diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 8fff915b50..c47d51c853 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -98,11 +98,14 @@ func(SYSTEM, system, na) \ #define PREBOOT_LOAD_LOGO \ - "mmc dev ${mmcdev};" \ - "part start mmc ${mmcdev} ${logopart} boot_start;" \ - "part size mmc ${mmcdev} ${logopart} boot_size;" \ - "if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \ + "if test \"${boot_source}\" != \"usb\" && " \ + "gpt verify mmc ${mmcdev} ${partitions}; then; " \ + "mmc dev ${mmcdev};" \ + "part start mmc ${mmcdev} ${logopart} boot_start;" \ + "part size mmc ${mmcdev} ${logopart} boot_size;" \ + "if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \ "bmp display ${loadaddr} m m;" \ + "fi;" \ "fi;" #define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h new file mode 100644 index 0000000000..fd69dc41a8 --- /dev/null +++ b/include/configs/phycore_imx8mm.h @@ -0,0 +1,130 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2019-2020 PHYTEC Messtechnik GmbH + * Author: Teresa Remmet <t.remmet@phytec.de> + */ + +#ifndef __PHYCORE_IMX8MM_H +#define __PHYCORE_IMX8MM_H + +#include <linux/sizes.h> +#include <linux/stringify.h> +#include <asm/arch/imx-regs.h> + +#define CONFIG_SYS_BOOTM_LEN SZ_64M +#define CONFIG_SPL_MAX_SIZE (148 * SZ_1K) +#define CONFIG_SYS_MONITOR_LEN SZ_512K +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 +#define CONFIG_SYS_UBOOT_BASE \ + (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) + +#ifdef CONFIG_SPL_BUILD +#define CONFIG_SPL_STACK 0x920000 +#define CONFIG_SPL_BSS_START_ADDR 0x910000 +#define CONFIG_SPL_BSS_MAX_SIZE SZ_8K +#define CONFIG_SYS_SPL_MALLOC_START 0x42200000 +#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K + +/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */ +#define CONFIG_MALLOC_F_ADDR 0x930000 +/* For RAW image gives a error info not panic */ +#define CONFIG_SPL_ABORT_ON_RAW_IMAGE +#endif + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "image=Image\0" \ + "console=ttymxc2,115200\0" \ + "fdt_addr=0x48000000\0" \ + "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "ipaddr=192.168.3.11\0" \ + "serverip=192.168.3.10\0" \ + "netmask=255.225.255.0\0" \ + "ip_dyn=no\0" \ + "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ + "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ + "mmcroot=2\0" \ + "mmcautodetect=yes\0" \ + "mmcargs=setenv bootargs console=${console} " \ + "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \ + "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ + "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ + "mmcboot=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "if run loadfdt; then " \ + "booti ${loadaddr} - ${fdt_addr}; " \ + "else " \ + "echo WARN: Cannot load the DT; " \ + "fi;\0 " \ + "nfsroot=/nfs\0" \ + "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \ + "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ + "netboot=echo Booting from net ...; " \ + "run netargs; " \ + "if test ${ip_dyn} = yes; then " \ + "setenv get_cmd dhcp; " \ + "else " \ + "setenv get_cmd tftp; " \ + "fi; " \ + "${get_cmd} ${loadaddr} ${image}; " \ + "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ + "booti ${loadaddr} - ${fdt_addr}; " \ + "else " \ + "echo WARN: Cannot load the DT; " \ + "fi;\0" \ + +#define CONFIG_BOOTCOMMAND \ + "mmc dev ${mmcdev}; if mmc rescan; then " \ + "if run loadimage; then " \ + "run mmcboot; " \ + "else run netboot; " \ + "fi; " \ + "fi;" + +/* Link Definitions */ +#define CONFIG_LOADADDR 0x40480000 +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR + +#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 +#define CONFIG_SYS_INIT_RAM_SIZE SZ_512K +#define CONFIG_SYS_INIT_SP_OFFSET \ + (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) + +#define CONFIG_MMCROOT "/dev/mmcblk2p2" /* USDHC3 */ + +/* Size of malloc() pool */ +#define CONFIG_SYS_MALLOC_LEN SZ_32M +#define CONFIG_SYS_SDRAM_BASE 0x40000000 + +#define PHYS_SDRAM SZ_1G +#define PHYS_SDRAM_SIZE SZ_2G /* 2GB DDR */ + +/* UART */ +#define CONFIG_MXC_UART_BASE UART3_BASE_ADDR + +/* Monitor Command Prompt */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_CBSIZE SZ_2K +#define CONFIG_SYS_MAXARGS 64 +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) +/* USDHC */ +#define CONFIG_FSL_USDHC +#define CONFIG_SYS_FSL_USDHC_NUM 2 +#define CONFIG_SYS_FSL_ESDHC_ADDR 0 +#define CONFIG_SYS_MMC_IMG_LOAD_PART 1 + +/* I2C */ +#define CONFIG_SYS_I2C_SPEED 100000 + +/* ENET1 */ +#define CONFIG_ETHPRIME "FEC" +#define CONFIG_FEC_XCV_TYPE RGMII +#define CONFIG_FEC_MXC_PHYADDR 0 +#define FEC_QUIRK_ENET_MAC +#define IMX_FEC_BASE 0x30BE0000 + +#endif /* __PHYCORE_IMX8MM_H */ diff --git a/include/dm/acpi.h b/include/dm/acpi.h index e8b0336f6d..e6951b6a25 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 diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 17542de2f3..e952a9967c 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/linux/bitops.h b/include/linux/bitops.h index 6b509dce58..16f28993f5 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 <asm/types.h> #include <asm-generic/bitsperlong.h> @@ -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 diff --git a/include/log.h b/include/log.h index 4d0692f155..29f18a82dc 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, diff --git a/include/smbios.h b/include/smbios.h index 97b9ddce23..1846607c3c 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -8,6 +8,8 @@ #ifndef _SMBIOS_H_ #define _SMBIOS_H_ +#include <dm/ofnode.h> + /* 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 @@ -237,4 +240,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_ */ diff --git a/include/board.h b/include/sysinfo.h index 678b652b0a..c045d316b0 100644 --- a/include/board.h +++ b/include/sysinfo.h @@ -6,23 +6,23 @@ /* * This uclass encapsulates hardware methods to gather information about a - * board or a specific device such as hard-wired GPIOs on GPIO expanders, + * 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 board had a read-only serial number flash IC, we could + * If for example the sysinfo had a read-only serial number flash IC, we could * call * - * ret = board_detect(dev); + * ret = sysinfo_detect(dev); * if (ret) { - * debug("board device not found."); + * debug("sysinfo device not found."); * return ret; * } * - * ret = board_get_int(dev, ID_SERIAL_NUMBER, &serial); + * ret = sysinfo_get_int(dev, ID_SERIAL_NUMBER, &serial); * if (ret) { * debug("Error when reading serial number from device."); * return ret; @@ -31,8 +31,8 @@ * to read the serial number. */ -#if CONFIG_IS_ENABLED(BOARD) -struct board_ops { +#if CONFIG_IS_ENABLED(SYSINFO) +struct sysinfo_ops { /** * detect() - Run the hardware info detection procedure for this * device. @@ -50,7 +50,7 @@ struct board_ops { /** * get_bool() - Read a specific bool data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @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. * @@ -61,7 +61,7 @@ struct board_ops { /** * get_int() - Read a specific int data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @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. * @@ -72,7 +72,7 @@ struct board_ops { /** * get_str() - Read a specific string data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @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. @@ -87,7 +87,7 @@ struct board_ops { * detection. A classic use-case would when DTBOs are used to describe * additionnal daughter cards. * - * @dev: The board instance to gather the data. + * @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 @@ -100,70 +100,70 @@ struct board_ops { const char *type, const char **strp); }; -#define board_get_ops(dev) ((struct board_ops *)(dev)->driver->ops) +#define sysinfo_get_ops(dev) ((struct sysinfo_ops *)(dev)->driver->ops) /** - * board_detect() - Run the hardware info detection procedure for this device. + * 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 board_detect(struct udevice *dev); +int sysinfo_detect(struct udevice *dev); /** - * board_get_bool() - Read a specific bool data value that describes the + * sysinfo_get_bool() - Read a specific bool data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @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 board_get_bool(struct udevice *dev, int id, bool *val); +int sysinfo_get_bool(struct udevice *dev, int id, bool *val); /** - * board_get_int() - Read a specific int data value that describes the + * sysinfo_get_int() - Read a specific int data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @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 board_get_int(struct udevice *dev, int id, int *val); +int sysinfo_get_int(struct udevice *dev, int id, int *val); /** - * board_get_str() - Read a specific string data value that describes the + * sysinfo_get_str() - Read a specific string data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @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 board_get_str(struct udevice *dev, int id, size_t size, char *val); +int sysinfo_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. + * 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 board instance, the API can supply a + * 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 board files. + * in sysinfo files. * * Return: 0 if OK, -ve on error. */ -int board_get(struct udevice **devp); +int sysinfo_get(struct udevice **devp); /** - * board_get_fit_loadable - Get the name of an image to load from FIT + * 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 board instance to gather the data. + * @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 @@ -173,39 +173,39 @@ int board_get(struct udevice **devp); * 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); +int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, + const char **strp); #else -static inline int board_detect(struct udevice *dev) +static inline int sysinfo_detect(struct udevice *dev) { return -ENOSYS; } -static inline int board_get_bool(struct udevice *dev, int id, bool *val) +static inline int sysinfo_get_bool(struct udevice *dev, int id, bool *val) { return -ENOSYS; } -static inline int board_get_int(struct udevice *dev, int id, int *val) +static inline int sysinfo_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) +static inline int sysinfo_get_str(struct udevice *dev, int id, size_t size, + char *val) { return -ENOSYS; } -static inline int board_get(struct udevice **devp) +static inline int sysinfo_get(struct udevice **devp) { return -ENOSYS; } -static inline int board_get_fit_loadable(struct udevice *dev, int index, - const char *type, const char **strp) +static inline int sysinfo_get_fit_loadable(struct udevice *dev, int index, + const char *type, const char **strp) { return -ENOSYS; } |