public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/8] SMBIOS improvements
@ 2024-10-22 20:05 Raymond Mao
  2024-10-22 20:05 ` [PATCH v2 1/8] smbios: Refactor the smbios headfile Raymond Mao
                   ` (8 more replies)
  0 siblings, 9 replies; 36+ messages in thread
From: Raymond Mao @ 2024-10-22 20:05 UTC (permalink / raw)
  To: u-boot
  Cc: iwamatsu, marek.vasut+renesas, Raymond Mao, Tom Rini,
	Tuomas Tynkkynen, Heinrich Schuchardt, Ilias Apalodimas,
	Simon Glass, Stefan Roese, Marek Behún, Michal Simek,
	Wan Yee Lau, Caleb Connolly, Alexander Gendin, Jonas Karlman,
	Masahisa Kojima, Francesco Dolcini, Max Krummenacher,
	Peter Robinson

Motivations for changes:
Current SMBIOS library and command-line tool is not fully matching with
the requirements:
1. Missing support for other mandatory types (#7, #9, #16, #17, #19).
2. Only a few platforms support SMBIOS node from the device tree.
3. Values of some fields are hardcoded in the library other than fetching
   from the device hardware.
4. Embedded data with dynamic length is not supported (E.g. Contained
   Object Handles in Type #2 and Contained Elements in Type #3)

Changes:
1. Refactor the SMBIOS library and command-line tool to better align with
   the SMBIOS spec.
2. Create an arch-specific driver for all aarch64-based platforms to fetch
   SMBIOS private data from the device hardware (processor and cache).
3. Create a sysinfo driver to poppulate platform SMBIOS private data.
4. Add generic SMBIOS DTS file for arm64 platforms for those common strings
   and values which cannot be retrieved from the system registers.
   Vendors can create their own SMBIOS node using this as an example.
   For those boards without SMBIOS nodes, this DTS file can be included to
   have a generic SMBIOS information of the system.
5. Add support for Type #7 (Cache Information) and link its handles to
   Type #4.

Once this patch is acceptted, subsequent patch sets will add other missing
types (#9, #16, #17, #19).

Tests:
To test this with QEMU arm64, please follow the guide on dt_qemu.rst to
get a merged DT to run with.
```
qemu-system-arm -machine virt -machine dumpdtb=qemu.dtb
cat  <(dtc -I dtb qemu.dtb) <(dtc -I dtb ./dts/dt.dtb | grep -v /dts-v1/) \
  | dtc - -o merged.dtb
qemu-system-arm -machine virt -nographic -bios u-boot.bin -dtb merged.dtb
```

Known issues:
It hits the image size limitation on R-CAR board(rcar3_salvator-x).
```
u-boot.img exceeds file size limit:
  limit:  0x100000 bytes
  actual: 0x10049d bytes
  excess: 0x49d bytes
```
This board needs a clean-up to reserve spaces for the changes as SMBIOS
is a fundamental feature.

Below is the breakdown of the size-growth of the related functions:
  function                                   old     new   delta
    static.smbios_write_type4                  252    1052    +800
    static.smbios_write_type7                    -     764    +764
    static.smbios_write_type3                  188     488    +300
    smbios_get_val_si                            -     128    +128
    static.smbios_write_type2                  316     376     +60
    sysinfo_get_data                             -      56     +56
    static.smbios_write_type1                  380     396     +16
    smbios_write_funcs                         112     128     +16
    ofnode_read_u32                              -      12     +12
    sysinfo_rcar_ops                            40      48      +8
    install_smbios_table                       468     472      +4

Raymond Mao (8):
  smbios: Refactor the smbios headfile
  sysinfo: Add sysinfo API for accessing data area
  sysinfo: Add sysinfo driver and data structure for smbios
  smbios: Refactor smbios library
  armv8: Add arch-specific sysinfo platform driver
  armv8: Add generic smbios information into the device tree
  cmd: update smbios cmd
  configs: Enable sysinfo for QEMU Arm64

 arch/arm/cpu/armv8/Makefile      |   2 +
 arch/arm/cpu/armv8/sysinfo.c     | 292 +++++++++++++++++++
 arch/arm/dts/qemu-arm64.dts      |   4 +
 arch/arm/dts/smbios_generic.dtsi |  82 ++++++
 cmd/smbios.c                     | 346 ++++++++++++++++++++---
 configs/qemu_arm64_defconfig     |   2 +
 drivers/misc/Kconfig             |   2 +-
 drivers/sysinfo/smbios.c         | 228 +++++++++++++++
 drivers/sysinfo/sysinfo-uclass.c |  20 ++
 include/smbios.h                 | 158 ++++++-----
 include/smbios_def.h             | 191 +++++++++++++
 include/smbios_plat.h            |  79 ++++++
 include/sysinfo.h                | 125 ++++++++-
 lib/smbios.c                     | 462 ++++++++++++++++++++++++++-----
 test/py/tests/test_smbios.py     |   2 +-
 15 files changed, 1822 insertions(+), 173 deletions(-)
 create mode 100644 arch/arm/cpu/armv8/sysinfo.c
 create mode 100644 arch/arm/dts/smbios_generic.dtsi
 create mode 100644 include/smbios_def.h
 create mode 100644 include/smbios_plat.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2024-12-09 15:36 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22 20:05 [PATCH v2 0/8] SMBIOS improvements Raymond Mao
2024-10-22 20:05 ` [PATCH v2 1/8] smbios: Refactor the smbios headfile Raymond Mao
2024-10-28 17:03   ` Simon Glass
2024-10-22 20:05 ` [PATCH v2 2/8] sysinfo: Add sysinfo API for accessing data area Raymond Mao
2024-10-28 17:04   ` Simon Glass
2024-10-22 20:05 ` [PATCH v2 3/8] sysinfo: Add sysinfo driver and data structure for smbios Raymond Mao
2024-10-28 17:04   ` Simon Glass
2024-10-28 19:43     ` Raymond Mao
2024-10-29 15:45       ` Simon Glass
2024-12-05 17:28     ` Raymond Mao
2024-12-06 15:31       ` Simon Glass
2024-12-06 15:54         ` Raymond Mao
2024-12-06 23:43           ` Simon Glass
2024-12-09 15:36             ` Raymond Mao
2024-10-22 20:05 ` [PATCH v2 4/8] smbios: Refactor smbios library Raymond Mao
2024-10-28 17:04   ` Simon Glass
2024-10-22 20:05 ` [PATCH v2 5/8] armv8: Add arch-specific sysinfo platform driver Raymond Mao
2024-10-28 17:04   ` Simon Glass
2024-10-28 19:53     ` Raymond Mao
2024-10-22 20:05 ` [PATCH v2 6/8] armv8: Add generic smbios information into the device tree Raymond Mao
2024-10-28 17:04   ` Simon Glass
2024-10-28 20:00     ` Raymond Mao
2024-10-29 15:45       ` Simon Glass
2024-11-01  5:28         ` Heinrich Schuchardt
2024-11-01  6:02         ` Heinrich Schuchardt
2024-11-01 16:23           ` Raymond Mao
2024-10-22 20:05 ` [PATCH v2 7/8] cmd: update smbios cmd Raymond Mao
2024-10-28 17:04   ` Simon Glass
2024-10-28 20:02     ` Raymond Mao
2024-10-22 20:05 ` [PATCH v2 8/8] configs: Enable sysinfo for QEMU Arm64 Raymond Mao
2024-10-28 17:05   ` Simon Glass
2024-10-24  0:22 ` [PATCH v2 0/8] SMBIOS improvements Tom Rini
2024-10-24 13:35   ` Raymond Mao
2024-10-24 14:10     ` Tom Rini
2024-10-24 14:19       ` Raymond Mao
2024-10-24 15:20         ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox