treewide: replace GPLv2 long form headers with SPDX header
[coreboot.git] / src / include / dimm_info_util.h
blob4622c1f81f05d9468b49782f25b6c50430303930
1 /* This file is part of the coreboot project. */
2 /* SPDX-License-Identifier: GPL-2.0-only */
4 #ifndef _DIMM_INFO_UTIL_H_
5 #define _DIMM_INFO_UTIL_H_
7 #include <smbios.h>
8 #include <stdint.h>
10 /**
11 * Convert the SMBIOS bit widths into an SPD encoded width.
13 * Use this when setting dimm_info.bus_width if the raw SPD values are not
14 * available.
16 uint8_t smbios_bus_width_to_spd_width(uint16_t total_width,
17 uint16_t data_width);
19 /**
20 * Convert the SMBIOS size values into the total number of MiB.
22 * Use this when setting dimm_info.dimm_size.
24 uint32_t smbios_memory_size_to_mib(uint16_t memory_size,
25 uint32_t extended_size);
27 /**
28 * Convert the SMBIOS form factor to the SPD module type.
30 * Use this when setting dimm_info.mod_type.
32 uint8_t
33 smbios_form_factor_to_spd_mod_type(smbios_memory_form_factor form_factor);
35 #endif