coreboot/src/arch/x86
Subrata Banik 6de8b42482 arch/x86: Refactor the SMBIOS type 17 write function
List of changes:
1. Create Module Type macros as per Memory Type
(i.e. DDR2/DDR3/DDR4/DDR5/LPDDR4/LPDDR5) and fix compilation
issue due to renaming of existing macros due to scoping the Memory
Type.
2. Use dedicated Memory Type and Module type for `Form Factor`
and `TypeDetail` conversion using `get_spd_info()` function.
3. Create a new API (convert_form_factor_to_module_type()) for
`Form Factor` to 'Module type' conversion as per `Memory Type`.
4. Add new argument as `Memory Type` to
smbios_form_factor_to_spd_mod_type() so that it can internally
call convert_form_factor_to_module_type() for `Module Type`
conversion.
5. Update `test_smbios_form_factor_to_spd_mod_type()` to
accommodate different memory types.
6. Skip fixed module type to form factor conversion using DDR2 SPD4
specification (inside dimm_info_fill()).

Refer to datasheet SPD4.1.2.M-1 for LPDDRx and SPD4.1.2.L-3 for DDRx.

BUG=b:194659789
TEST=Refer to dmidecode -t 17 output as below:
Without this code change:

Handle 0x0012, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 16 bits
        Data Width: 16 bits
        Size: 2048 MB
        Form Factor: Unknown
        ....

With this code change:

Handle 0x0012, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 16 bits
        Data Width: 16 bits
        Size: 2048 MB
        Form Factor: Row Of Chips
        ....

Change-Id: Ia337ac8f50b61ae78d86a07c7a86aa9c248bad50
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56628
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 09:10:10 +00:00
..
acpi ACPI: Drop commented-out DSDT DefinitionBlock instances 2020-07-09 23:55:06 +00:00
include Rename ECAM-specific MMCONF Kconfigs 2021-11-10 17:24:16 +00:00
acpi.c src: Make HAVE_CF9_RESET set the FADT reset register 2020-07-20 13:23:13 +00:00
acpi_bert_storage.c arch/x86/acpi_bert_storage: unbreak BERT support 2021-06-08 18:23:40 +00:00
acpi_s3.c ACPI: Final APM_CNT_GNVS_UPDATE cleanup 2021-01-04 23:16:03 +00:00
assembly_entry.S arch/x86/assembly_entry: Remove cpu_info 2021-10-18 12:36:57 +00:00
boot.c arch/x86/boot: Add missing include 2021-09-13 14:18:43 +00:00
bootblock.ld arch/x86/bootblock.ld: Align the bottom of the bootblock to 64 bytes 2021-06-24 11:22:54 +00:00
bootblock_normal.c cbfs: Remove prog_locate() for stages and rmodules 2021-03-16 21:45:34 +00:00
c_exit.S arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
c_start.S arch/x86,cpu/x86: Fix 64-bit CPU_INFO_V2 build errors 2021-10-21 17:36:09 +00:00
car.ld memlayout: Store region sizes as separate symbols 2021-02-19 08:39:26 +00:00
cf9_reset.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
cpu.c arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
cpu_common.c arch/x86: Skip returning default leaf value as 0 2021-09-03 19:14:16 +00:00
ebda.c src/arch: Remove unused <console/console.h> 2021-02-15 10:48:12 +00:00
exception.c arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
exit_car.S arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
gdt_init.S arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
id.S arch/x86/id.S: Remove unneeded whitespace before tab 2021-02-11 10:22:07 +00:00
idt.S arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
ioapic.c arch/x86: fix a wrong variable in ioapic_set_max_vectors() 2021-10-23 16:33:58 +00:00
Kconfig arch/x86: Add X86_CUSTOM_BOOTMEDIA 2021-07-02 23:11:16 +00:00
Makefile.inc arch/x86/Makefile: Align VGA_BIOS to 64 bytes when using AMD LPC SPI DMA 2021-11-04 10:35:10 +00:00
memcpy.c arch/x86: Use ENV_X86_64 instead of _x86_64_ 2021-07-06 06:09:13 +00:00
memlayout.ld arch/x86: Top-align .init in bootblock 2021-01-28 08:54:21 +00:00
memmove.c arch/x86: Add support for ASan to memory functions 2020-08-21 07:46:04 +00:00
memset.c arch/x86: Add support for ASan to memory functions 2020-08-21 07:46:04 +00:00
mmap_boot.c coreboot tables: Add SPI flash memory map windows to coreboot tables 2020-12-08 22:56:09 +00:00
mpspec.c arch/x86/mptable: Add smp_write_ioapic_from_hw() 2021-06-12 15:49:35 +00:00
pirq_routing.c src/arch: Drop unneeded empty lines 2020-08-24 09:16:19 +00:00
post.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
postcar.c ach/x86/postcar.c: Avoid double CBMEM initialization 2021-01-21 11:03:04 +00:00
postcar_loader.c cbfs: Remove prog_locate() for stages and rmodules 2021-03-16 21:45:34 +00:00
rdrand.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
smbios.c arch/x86: Refactor the SMBIOS type 17 write function 2021-11-11 09:10:10 +00:00
smbios_defaults.c arch/x86/smbios: Add support for wake-up type in smbios type 1 2021-10-21 20:06:59 +00:00
tables.c arch/x86: Increase MAX_SMBIOS_SIZE 2021-10-19 14:40:09 +00:00
thread.c arch/x86/thread: Add #error when compiling for x86_64 2021-07-29 09:12:24 +00:00
thread_switch.S arch/x86/thread: Add #error when compiling for x86_64 2021-07-29 09:12:24 +00:00
timestamp.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
verstage.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
wakeup.S arch/x86: Save resume vector to stack in x86_64 mode 2021-07-07 14:54:56 +00:00
walkcbfs.S arch/x86/walkcbfs.S: Fix the cbfs base addr for some fmap 2021-06-17 10:00:45 +00:00