Skip to contentSkip to conversation

Makefile: Generate U_BOOT_DMI_DATE for SMBIOS

PATCH New Bin Meng 2 participants 6 messages Oct 12, 2015 – Oct 18, 2015

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/2 Makefile: Generate U_BOOT_DMI_DATE for SMBIOS

Add U_BOOT_DMI_DATE (format mm/dd/yyyy) generation to be used by SMBIOS tables, as required by SMBIOS spec 3.0 [1]. See chapter 7.1, BIOS information structure offset 08h for details.

[1] http://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0.pdf

---

Changes in v2: None

 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index 8c0ca1b..3177e43 100644
@@ -1278,6 +1278,7 @@ define filechk_timestamp.h
 			LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
 			LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
 			LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+			LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
 		else \
 			return 42; \
 		fi; \
@@ -1285,6 +1286,7 @@ define filechk_timestamp.h
 		LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
 		LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
 		LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
+		LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
 	fi)
 endef
 
Signature · 1 line
1.8.2.1
author
#1 lore raw

PATCH 2/2 x86: Add SMBIOS table support

System Management BIOS (SMBIOS) is a specification for how motherboard and system vendors present management information about their products in a standard format by extending the BIOS interface on Intel architecture systems. As of today the latest spec is 3.0 and can be downloaded from DMTF website. This commit adds a simple and minimum required implementation.

---

Changes in v2:
- Add comments for smbios_add_string() and smbios_string_table_len()
- Add inline function fill_smbios_header() to fill the table header
- Remove update_max() macro, instead use a function pointer table to handle the writing of each table structure
- Add writing SMBIOS type2 table (similar to type1)

 arch/x86/Kconfig              |  11 ++
 arch/x86/include/asm/smbios.h | 236 ++++++++++++++++++++++++++++++++++++
 arch/x86/lib/Makefile         |   1 +
 arch/x86/lib/smbios.c         | 269 ++++++++++++++++++++++++++++++++++++++++++
 arch/x86/lib/tables.c         |   5 +
 doc/README.x86                |   2 -
 6 files changed, 522 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 arch/x86/lib/smbios.c
arch/x86/Kconfig +11 -0
index 5e42d7d..bf09b21 100644
@@ -358,6 +358,17 @@ config GENERATE_ACPI_TABLE
 	  by the operating system. It defines platform-independent interfaces
 	  for configuration and power management monitoring.
 
+config GENERATE_SMBIOS_TABLE
+	bool "Generate an SMBIOS (System Management BIOS) table"
+	default y
+	help
+	  The System Management BIOS (SMBIOS) specification addresses how
+	  motherboard and system vendors present management information about
+	  their products in a standard format by extending the BIOS interface
+	  on Intel architecture systems.
+
+	  Check http://www.dmtf.org/standards/smbios for details.
+
 endmenu
 
 config MAX_PIRQ_LINKS
arch/x86/include/asm/smbios.h new file +236 -0

236 lines not on this page · raw message

arch/x86/lib/Makefile +1 -0
index 169062e..4ac9956 100644
@@ -30,6 +30,7 @@ obj-y	+= relocate.o
 obj-y += physmem.o
 obj-$(CONFIG_X86_RAMTEST) += ramtest.o
 obj-y += sfi.o
+obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o
 obj-y	+= string.o
 obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o
 obj-y	+= tables.o
arch/x86/lib/smbios.c new file +269 -0

269 lines not on this page · raw message

arch/x86/lib/tables.c +5 -0
index f15b2e2..14b15cf 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <asm/sfi.h>
 #include <asm/mpspec.h>
+#include <asm/smbios.h>
 #include <asm/tables.h>
 #include <asm/acpi_table.h>
 
@@ -56,4 +57,8 @@ void write_tables(void)
 	rom_table_end = write_acpi_tables(rom_table_end);
 	rom_table_end = ALIGN(rom_table_end, 1024);
 #endif
+#ifdef CONFIG_GENERATE_SMBIOS_TABLE
+	rom_table_end = write_smbios_table(rom_table_end);
+	rom_table_end = ALIGN(rom_table_end, 1024);
+#endif
 }
doc/README.x86 +0 -2
index a4f5321..18fed82 100644
@@ -764,7 +764,6 @@ TODO List
 - Audio
 - Chrome OS verified boot
 - SMI and ACPI support, to provide platform info and facilities to Linux
-- Desktop Management Interface (DMI) [15] support
 
 References
 ----------
@@ -782,4 +781,3 @@ References
 [12] http://events.linuxfoundation.org/sites/events/files/slides/chromeos_and_diy_vboot_0.pdf
 [13] http://events.linuxfoundation.org/sites/events/files/slides/elce-2014.pdf
 [14] doc/device-tree-bindings/misc/intel,irq-router.txt
-[15] http://en.wikipedia.org/wiki/Desktop_Management_Interface
Signature · 1 line
1.8.2.1
author
#2 lore raw

PATCH 2/2 x86: Add SMBIOS table support

Hi Simon,

Quoted 9 lines · Bin Meng

System Management BIOS (SMBIOS) is a specification for how motherboard and system vendors present management information about their products in a standard format by extending the BIOS interface on Intel architecture systems. As of today the latest spec is 3.0 and can be downloaded from DMTF website. This commit adds a simple and minimum required implementation.

Quoted 9 lines

---

Changes in v2:
- Add comments for smbios_add_string() and smbios_string_table_len()
- Add inline function fill_smbios_header() to fill the table header
- Remove update_max() macro, instead use a function pointer table to handle the writing of each table structure
- Add writing SMBIOS type2 table (similar to type1)

This is actually the v2 series. Sorry I forgot to add a 'Series-version' ..

Quoted 10 lines
 arch/x86/Kconfig              |  11 ++
 arch/x86/include/asm/smbios.h | 236 ++++++++++++++++++++++++++++++++++++
 arch/x86/lib/Makefile         |   1 +
 arch/x86/lib/smbios.c         | 269 ++++++++++++++++++++++++++++++++++++++++++
 arch/x86/lib/tables.c         |   5 +
 doc/README.x86                |   2 -
 6 files changed, 522 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 arch/x86/lib/smbios.c

[snip]

Regards,
Bin

#3 lore raw

PATCH 2/2 x86: Add SMBIOS table support

In reply to Bin Meng

Hi Bin,

Quoted 18 lines · Bin Meng

System Management BIOS (SMBIOS) is a specification for how motherboard and system vendors present management information about their products in a standard format by extending the BIOS interface on Intel architecture systems. As of today the latest spec is 3.0 and can be downloaded from DMTF website. This commit adds a simple and minimum required implementation.

---

Changes in v2:
- Add comments for smbios_add_string() and smbios_string_table_len()
- Add inline function fill_smbios_header() to fill the table header
- Remove update_max() macro, instead use a function pointer table to handle the writing of each table structure
- Add writing SMBIOS type2 table (similar to type1)

Quoted 9 lines
 arch/x86/Kconfig              |  11 ++
 arch/x86/include/asm/smbios.h | 236 ++++++++++++++++++++++++++++++++++++
 arch/x86/lib/Makefile         |   1 +
 arch/x86/lib/smbios.c         | 269 ++++++++++++++++++++++++++++++++++++++++++
 arch/x86/lib/tables.c         |   5 +
 doc/README.x86                |   2 -
 6 files changed, 522 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 arch/x86/lib/smbios.c
#4 lore raw

PATCH 2/2 x86: Add SMBIOS table support

Quoted 31 lines · Simon Glass

Hi Bin,

Quoted 18 lines · Bin Meng

System Management BIOS (SMBIOS) is a specification for how motherboard and system vendors present management information about their products in a standard format by extending the BIOS interface on Intel architecture systems. As of today the latest spec is 3.0 and can be downloaded from DMTF website. This commit adds a simple and minimum required implementation.

---

Changes in v2:
- Add comments for smbios_add_string() and smbios_string_table_len()
- Add inline function fill_smbios_header() to fill the table header
- Remove update_max() macro, instead use a function pointer table to handle the writing of each table structure
- Add writing SMBIOS type2 table (similar to type1)

Quoted 9 lines
 arch/x86/Kconfig              |  11 ++
 arch/x86/include/asm/smbios.h | 236 ++++++++++++++++++++++++++++++++++++
 arch/x86/lib/Makefile         |   1 +
 arch/x86/lib/smbios.c         | 269 ++++++++++++++++++++++++++++++++++++++++++
 arch/x86/lib/tables.c         |   5 +
 doc/README.x86                |   2 -
 6 files changed, 522 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 arch/x86/lib/smbios.c
Quoted 1 line

Applied to u-boot-x86, thanks!

#5 lore raw

PATCH 1/2 Makefile: Generate U_BOOT_DMI_DATE for SMBIOS

In reply to Bin Meng
Quoted 6 lines · Bin Meng

Add U_BOOT_DMI_DATE (format mm/dd/yyyy) generation to be used by SMBIOS tables, as required by SMBIOS spec 3.0 [1]. See chapter 7.1, BIOS information structure offset 08h for details.

[1] http://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0.pdf

Quoted 8 lines

---

Changes in v2: None

 Makefile | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-x86, thanks!