diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2024-05-09 14:21:04 +0200 |
---|---|---|
committer | Elyes Haouas <ehaouas@noos.fr> | 2024-05-13 17:11:35 +0000 |
commit | 27becf5da6a6b61de165013e0680265a6f6fbfbb (patch) | |
tree | 011d2dc3e1b2b01066be7b00be5bec90c8046e75 /src/mainboard/intel/harcuvar | |
parent | 7809eb8db641410f54d52c31daf2ad6ebf763e5e (diff) |
mb/intel/{harcuvar,kunimitsu}: Use <spd.h> and <dram/ddr{3,4}.h>
Change-Id: I2d73f7815e83e8bf0c6d0a402d32bc99c32c7d90
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82243
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/intel/harcuvar')
-rw-r--r-- | src/mainboard/intel/harcuvar/spd/spd.c | 8 | ||||
-rw-r--r-- | src/mainboard/intel/harcuvar/spd/spd.h | 12 |
2 files changed, 5 insertions, 15 deletions
diff --git a/src/mainboard/intel/harcuvar/spd/spd.c b/src/mainboard/intel/harcuvar/spd/spd.c index e3912ec91e..d3cefa6b20 100644 --- a/src/mainboard/intel/harcuvar/spd/spd.c +++ b/src/mainboard/intel/harcuvar/spd/spd.c @@ -2,6 +2,8 @@ #include <cbfs.h> #include <console/console.h> +#include <device/dram/ddr4.h> +#include <spd.h> #include "spd.h" @@ -19,17 +21,17 @@ uint8_t *mainboard_find_spd_data(void) if (!spd_file) die("SPD data not found."); - if (spd_file_len < ((spd_index + 1) * SPD_LEN)) { + if (spd_file_len < ((spd_index + 1) * SPD_SIZE_MAX_DDR4)) { printk(BIOS_ERR, "SPD index override to 0 due to incorrect SPD index.\n"); spd_index = 0; } - if (spd_file_len < SPD_LEN) + if (spd_file_len < SPD_SIZE_MAX_DDR4) die("Missing SPD data."); /* Assume same memory in both channels */ - spd_index *= SPD_LEN; + spd_index *= SPD_SIZE_MAX_DDR4; spd_data = (uint8_t *)(spd_file + spd_index); /* Make sure a valid SPD was found */ diff --git a/src/mainboard/intel/harcuvar/spd/spd.h b/src/mainboard/intel/harcuvar/spd/spd.h index 44eec02a6b..92377fd9ac 100644 --- a/src/mainboard/intel/harcuvar/spd/spd.h +++ b/src/mainboard/intel/harcuvar/spd/spd.h @@ -5,18 +5,6 @@ #include <stdint.h> -#define SPD_LEN 512 - -#define SPD_DRAM_TYPE 2 -#define SPD_DRAM_DDR3 0x0b -#define SPD_DRAM_LPDDR3 0xf1 -#define SPD_DENSITY_BANKS 4 -#define SPD_ADDRESSING 5 -#define SPD_ORGANIZATION 7 -#define SPD_BUS_DEV_WIDTH 8 -#define SPD_PART_OFF 128 -#define SPD_PART_LEN 18 - uint8_t *mainboard_find_spd_data(void); #endif |