diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2022-12-28 12:33:58 +0100 |
---|---|---|
committer | Elyes Haouas <ehaouas@noos.fr> | 2023-01-04 12:39:32 +0000 |
commit | f82e68c900151efae572e3bc19690e978b82ca1b (patch) | |
tree | fb3709fdb6601c2417baac81219d71fe999c433f /src/device | |
parent | af6cd3f0b44a39bb6387c8218e5872afb74fcc3f (diff) |
spd.h: Move enum ddr3_module_type to ddr3.h
Move specific enum ddr3_module_type to <device/dram/ddr3.h>.
Change-Id: I8fd7892dda26158a5bdd6cd4972c7859a252153e
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71547
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/device')
-rw-r--r-- | src/device/dram/ddr3.c | 24 | ||||
-rw-r--r-- | src/device/dram/spd.c | 19 |
2 files changed, 11 insertions, 32 deletions
diff --git a/src/device/dram/ddr3.c b/src/device/dram/ddr3.c index 2bdfd46c6b..9e11ab57cc 100644 --- a/src/device/dram/ddr3.c +++ b/src/device/dram/ddr3.c @@ -533,29 +533,7 @@ enum cb_err spd_add_smbios17(const u8 channel, const u8 slot, const u16 selected dimm->dimm_num = slot; memcpy(dimm->module_part_number, info->part_number, 16); dimm->mod_id = info->manufacturer_id; - - switch (info->dimm_type) { - case SPD_DDR3_DIMM_TYPE_SO_DIMM: - dimm->mod_type = DDR3_SPD_SODIMM; - break; - case SPD_DDR3_DIMM_TYPE_72B_SO_CDIMM: - dimm->mod_type = DDR3_SPD_72B_SO_CDIMM; - break; - case SPD_DDR3_DIMM_TYPE_72B_SO_RDIMM: - dimm->mod_type = DDR3_SPD_72B_SO_RDIMM; - break; - case SPD_DDR3_DIMM_TYPE_UDIMM: - dimm->mod_type = DDR3_SPD_UDIMM; - break; - case SPD_DDR3_DIMM_TYPE_RDIMM: - dimm->mod_type = DDR3_SPD_RDIMM; - break; - case SPD_DDR3_DIMM_TYPE_UNDEFINED: - default: - dimm->mod_type = SPD_UNDEFINED; - break; - } - + dimm->mod_type = info->dimm_type; dimm->bus_width = MEMORY_BUS_WIDTH_64; // non-ECC only memcpy(dimm->serial, info->serial, MIN(sizeof(dimm->serial), sizeof(info->serial))); diff --git a/src/device/dram/spd.c b/src/device/dram/spd.c index 738c05b113..cfaf86f517 100644 --- a/src/device/dram/spd.c +++ b/src/device/dram/spd.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include <device/dram/ddr2.h> +#include <device/dram/ddr3.h> #include <device/dram/spd.h> #include <spd.h> #include <stddef.h> @@ -76,26 +77,26 @@ static void convert_ddr2_module_type_to_spd_info(enum spd_dimm_type_ddr2 module_ } } -static void convert_ddr3_module_type_to_spd_info(enum ddr3_module_type module_type, +static void convert_ddr3_module_type_to_spd_info(enum spd_dimm_type_ddr3 module_type, struct spd_info *info) { switch (module_type) { - case DDR3_SPD_RDIMM: - case DDR3_SPD_MINI_RDIMM: + case SPD_DDR3_DIMM_TYPE_RDIMM: + case SPD_DDR3_DIMM_TYPE_MINI_RDIMM: info->form_factor = MEMORY_FORMFACTOR_RIMM; info->type_detail = MEMORY_TYPE_DETAIL_REGISTERED; break; - case DDR3_SPD_UDIMM: - case DDR3_SPD_MINI_UDIMM: + case SPD_DDR3_DIMM_TYPE_UDIMM: + case SPD_DDR3_DIMM_TYPE_MINI_UDIMM: info->form_factor = MEMORY_FORMFACTOR_DIMM; info->type_detail = MEMORY_TYPE_DETAIL_UNBUFFERED; break; - case DDR3_SPD_MICRO_DIMM: + case SPD_DDR3_DIMM_TYPE_MICRO_DIMM: info->form_factor = MEMORY_FORMFACTOR_DIMM; info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN; break; - case DDR3_SPD_SODIMM: - case DDR3_SPD_72B_SO_UDIMM: + case SPD_DDR3_DIMM_TYPE_SO_DIMM: + case SPD_DDR3_DIMM_TYPE_72B_SO_UDIMM: info->form_factor = MEMORY_FORMFACTOR_SODIMM; info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN; break; @@ -216,7 +217,7 @@ static uint8_t convert_ddrx_form_factor_to_module_type(smbios_memory_type memory return SPD_DDR2_DIMM_TYPE_RDIMM; case MEMORY_FORMFACTOR_SODIMM: module_type = (memory_type == MEMORY_TYPE_DDR2) ? SPD_DDR2_DIMM_TYPE_SO_DIMM : - DDR3_SPD_SODIMM; + SPD_DDR3_DIMM_TYPE_SO_DIMM; return module_type; default: return convert_default_form_factor_to_module_type(); |