u-boot/lib
Ilias Apalodimas 738b34668f smbios: Fallback to the default DT if sysinfo nodes are missing
In order to fill in the SMBIOS tables U-Boot currently relies on a
"u-boot,sysinfo-smbios" compatible node.  This is fine for the boards
that already include such nodes.  However with some recent EFI changes,
the majority of boards can boot up distros, which usually rely on
things like dmidecode etc for their reporting.  For boards that
lack this special node the SMBIOS output looks like:

System Information
        Manufacturer: Unknown
        Product Name: Unknown
        Version: Unknown
        Serial Number: Unknown
        UUID: Not Settable
        Wake-up Type: Reserved
        SKU Number: Unknown
        Family: Unknown

This looks problematic since most of the info are "Unknown".  The DT spec
specifies standard properties containing relevant information like
'model' and 'compatible' for which the suggested format is
<manufacturer,model>. Unfortunately the 'model' string found in DTs is
usually lacking the manufacturer so we can't use it for both
'Manufacturer' and 'Product Name' SMBIOS entries reliably.

So let's add a last resort to our current smbios parsing.  If none of
the sysinfo properties are found, scan for those information in the
root node of the device tree. Use the 'model' to fill the 'Product
Name' and the first value of 'compatible' for the 'Manufacturer', since
that always contains one.

pre-patch:
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Unknown
        Product Name: Unknown
        Version: Unknown
        Serial Number: 100000000bb24ceb
        UUID: 30303031-3030-3030-3061-613234636435
        Wake-up Type: Reserved
        SKU Number: Unknown
        Family: Unknown
[...]

and post patch:
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: raspberrypi
        Product Name: Raspberry Pi 4 Model B Rev 1.1
        Version: Unknown
        Serial Number: 100000000bb24ceb
        UUID: 30303031-3030-3030-3061-613234636435
        Wake-up Type: Reserved
        SKU Number: Unknown
        Family: Unknown
[...]

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
2023-12-20 14:13:20 -05:00
..
acpi acpi: consider XSDT in acpi_find_table() 2023-12-13 18:39:05 -05:00
aes tools: avoid OpenSSL deprecation warnings 2021-12-26 06:57:20 +01:00
at91
blake2 lib: add BLAKE2 hash support 2022-01-18 08:31:02 -05:00
bzip2 cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
crypt lib: crypt: fix selecting a non-existent option 2022-10-11 15:40:48 -04:00
crypto common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
dhry global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
ecdsa mkimage: ecdsa: password for signing from environment 2023-06-20 16:08:13 -04:00
efi efi: Collect the ACPI tables in the app 2023-12-05 01:38:56 +01:00
efi_driver efi_loader: make efi_delete_handle() follow the EFI spec 2023-07-28 11:36:37 +02:00
efi_loader Prepare v2024.01-rc5 2023-12-18 09:55:32 -05:00
efi_selftest efi_selftest: BitBlt test 2023-10-12 08:32:27 +02:00
fwu_updates FWU: Avoid showing an unselectable menu option 2023-09-19 11:36:25 -04:00
libavb libavb: Fix a warning with clang-15 2023-03-22 15:22:48 -04:00
libfdt fdt_region: move fdt_region.c to common/ from lib/libfdt/ 2020-04-26 14:23:55 -06:00
lzma lzma: Fix decompression speed regression 2023-07-14 15:21:08 -04:00
lzo
optee Revert "arm: imx: mx7: Move CONFIG_OPTEE_TZDRAM_SIZE from lib/optee" 2023-08-28 15:59:22 -04:00
rsa rsa: use pkcs11 uri as defined in rfc7512 2023-12-20 09:48:17 -05:00
zlib lib/zlib: Fix a bug when getting a gzip header extra field 2023-07-14 15:21:08 -04:00
zstd lib: zstd: update to latest Linux zstd 1.5.2 2023-01-18 19:04:17 -05:00
.gitignore lib: ignore oid_registry_data.c file 2020-01-22 17:47:57 -05:00
abuf.c abuf: Allow incrementing the size 2023-08-25 13:54:33 -04:00
addr_map.c addrmap: Fix off by one in addrmap_set_entry() 2023-10-30 15:32:49 -04:00
aes.c common: Drop display_options.h from common header 2022-08-10 13:46:55 -04:00
asm-offsets.c spl: Use SYS_MALLOC_F instead of SYS_MALLOC_F_LEN 2023-10-06 14:38:12 -04:00
asn1_decoder.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
bch.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
binman.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
bitrev.c
charset.c lib/charset: fix u16_strlcat() return value 2023-08-08 17:05:43 -04:00
circbuf.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
crc7.c
crc8.c common: Drop linux/crc8.h 2019-12-02 18:23:07 -05:00
crc16-ccitt.c crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c 2022-04-21 14:32:40 -04:00
crc16.c crc16: Move standard CRC-16 implementation from ubifs to lib 2022-04-21 14:32:40 -04:00
crc32.c crc32: Drop duplicates crc header includes 2023-08-08 17:41:52 -04:00
crc32c.c
ctype.c
date.c lib/date: Make rtc_mktime and mktime64 Y2038-ready 2022-05-05 15:06:02 -04:00
display_options.c display_options: print_size: Fix order overflow 2022-09-23 15:13:18 -04:00
div64.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
elf.c video: Renname vbe.h to vesa.h 2022-08-12 08:14:23 -04:00
errno.c sandbox: errno: avoid conflict with libc's errno 2021-05-24 14:21:30 -04:00
errno_str.c lib: errno: sync error codes 2019-10-31 07:22:53 -04:00
fdt-libcrypto.c lib/rsa: Make fdt_add_bignum() available outside of RSA code 2021-04-14 15:06:08 -04:00
fdtdec.c treewide: unify the linker symbol reference format 2023-08-09 09:21:42 -04:00
fdtdec_common.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
fdtdec_test.c fdtdec: Support reserved-memory flags 2021-10-13 14:18:30 -07:00
getopt.c lib: Add getopt 2020-10-30 10:56:11 -04:00
gunzip.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
gzip.c global: Finish CONFIG -> CFG migration 2023-01-20 12:27:24 -05:00
hang.c serial: Rename SERIAL_SUPPORT to SERIAL 2021-09-04 12:26:01 -04:00
hash-checksum.c lib: parameter check in hash_calculate 2023-08-27 08:21:07 +02:00
hashtable.c Correct SPL use of ENV_WRITEABLE_LIST 2023-02-09 16:32:26 -05:00
hexdump.c hexdump: Allow ctrl-c to interrupt output 2021-06-08 11:39:09 -04:00
image-sparse.c fastboot: fix CRC32 chunk size checking 2023-10-31 14:36:30 +01:00
initcall.c common: board_r: Remove unused NEEDS_MANUAL_RELOC code bits 2023-09-14 10:42:24 -04:00
Kconfig Prepare v2024.01-rc5 2023-12-18 09:55:32 -05:00
ldiv.c
linux_compat.c common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
linux_string.c
list_sort.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
lmb.c lmb: remove overlapping region with next range 2023-10-09 15:24:31 -04:00
lz4.c lib/lz4: update LZ4 decompressor module 2022-03-15 16:19:29 -04:00
lz4_wrapper.c lz4: Fix compile warning comparison of distinct pointer types 2022-08-10 13:46:55 -04:00
Makefile fs: ext4: Fix building ext4 in SPL if write is enabled 2023-10-17 20:50:52 -04:00
md5.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
membuff.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
net_utils.c net: ipv6: Add string_to_ip6 converter 2022-12-05 12:47:16 -05:00
of_live.c dm: core: Add a way to convert a devicetree to a dtb 2023-10-06 14:38:13 -04:00
oid_registry.c lib: add oid registry utility 2019-12-06 16:44:20 -05:00
panic.c console: Use flush() before panic and reset 2023-03-22 12:51:08 -04:00
physmem.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
qsort.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
rand.c common: Move random-number functions into their own header 2019-12-02 18:23:07 -05:00
rational.c lib: rational: copy the rational fraction lib routines from Linux 2021-06-11 16:34:52 +05:30
rbtree.c
rc4.c rc4: mark key as const 2023-01-16 18:01:10 +08:00
rtc-lib.c lib: move rtc-lib.c to lib 2021-07-14 16:57:35 -04:00
semihosting.c lib: Add common semihosting library 2022-12-08 15:15:22 +08:00
sha1.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
sha256.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
sha512.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
slre.c lib/slre: Fix memory leak if regex compilation fails 2023-11-29 09:32:15 -05:00
smbios-parser.c efi_loader: add SMBIOS table measurement 2021-10-26 17:58:14 +02:00
smbios.c smbios: Fallback to the default DT if sysinfo nodes are missing 2023-12-20 14:13:20 -05:00
sscanf.c xen: Code style conformity 2020-08-24 14:11:31 -04:00
string.c Revert "lib: string: Fix strlcpy return value", fix callers 2023-08-08 17:05:43 -04:00
strto.c lib: Add a function to split a string into substrings 2023-01-23 18:11:39 -05:00
tables_csum.c
time.c time: Tidy up some unnecessary #ifdefs 2023-02-11 12:22:34 -05:00
tiny-printf.c net: Rename SPL_NET_SUPPORT to SPL_NET 2021-09-04 12:48:53 -04:00
tpm-common.c tpm: Check outgoing command size 2021-07-15 18:42:05 -04:00
tpm-utils.h doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
tpm-v1.c tpm: Implement tpm_auto_start() for TPMv1.2 2023-02-28 09:44:33 +02:00
tpm-v2.c tpm: Support boot measurements 2023-10-27 13:14:47 +03:00
tpm_api.c tpm: Implement tpm_auto_start() for TPMv1.2 2023-02-28 09:44:33 +02:00
trace.c treewide: unify the linker symbol reference format 2023-08-09 09:21:42 -04:00
uuid.c uuid: Add ChromiumOS partition types 2023-08-25 17:55:19 -04:00
vsprintf.c lib: Suppress E when writing error-string output 2023-08-09 23:31:11 +08:00
xxhash.c lib: Add xxhash support 2019-05-05 08:48:50 -04:00