Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69274 )
Change subject: mb/intel/{harcuvar,kunimitsu}: Use <spd_bin.h> ......................................................................
mb/intel/{harcuvar,kunimitsu}: Use <spd_bin.h>
Change-Id: I9b9686eac60618d96b890128ce996c53ff10418e Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/mainboard/intel/harcuvar/spd/spd.h M src/mainboard/intel/kunimitsu/romstage.c M src/mainboard/intel/kunimitsu/spd/spd.h M src/mainboard/intel/kunimitsu/spd/spd_util.c 4 files changed, 18 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/69274/1
diff --git a/src/mainboard/intel/harcuvar/spd/spd.h b/src/mainboard/intel/harcuvar/spd/spd.h index 44eec02..d44dfd6 100644 --- a/src/mainboard/intel/harcuvar/spd/spd.h +++ b/src/mainboard/intel/harcuvar/spd/spd.h @@ -3,20 +3,11 @@ #ifndef MAINBOARD_SPD_H #define MAINBOARD_SPD_H
+#include <spd_bin.h> #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 diff --git a/src/mainboard/intel/kunimitsu/romstage.c b/src/mainboard/intel/kunimitsu/romstage.c index f6bd5c2..0497ab9 100644 --- a/src/mainboard/intel/kunimitsu/romstage.c +++ b/src/mainboard/intel/kunimitsu/romstage.c @@ -21,5 +21,5 @@ mem_cfg->MemorySpdPtr00 = mainboard_get_spd_data(); if (mainboard_has_dual_channel_mem()) mem_cfg->MemorySpdPtr10 = mem_cfg->MemorySpdPtr00; - mem_cfg->MemorySpdDataLen = SPD_LEN; + mem_cfg->MemorySpdDataLen = SPD_PAGE_LEN; } diff --git a/src/mainboard/intel/kunimitsu/spd/spd.h b/src/mainboard/intel/kunimitsu/spd/spd.h index c53c6e4..723eaf5 100644 --- a/src/mainboard/intel/kunimitsu/spd/spd.h +++ b/src/mainboard/intel/kunimitsu/spd/spd.h @@ -1,24 +1,14 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#ifndef MAINBOARD_SPD_H +#define MAINBOARD_SPD_H
#include <fsp/soc_binding.h> #include <gpio.h> +#include <spd_bin.h> + #include "../gpio.h"
-#define MAINBOARD_SPD_H - -#define SPD_LEN 256 - -#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 #define SPD_MANU_OFF 148
#define HYNIX_SINGLE_CHAN 0x1 diff --git a/src/mainboard/intel/kunimitsu/spd/spd_util.c b/src/mainboard/intel/kunimitsu/spd/spd_util.c index 8674512..a3f9bd4 100644 --- a/src/mainboard/intel/kunimitsu/spd/spd_util.c +++ b/src/mainboard/intel/kunimitsu/spd/spd_util.c @@ -73,16 +73,16 @@ die("SPD data not found.");
/* make sure we have at least one SPD in the file. */ - if (spd_file_len < SPD_LEN) + if (spd_file_len < SPD_PAGE_LEN) die("Missing SPD data.");
/* Make sure we did not overrun the buffer */ - if (spd_file_len < ((spd_index + 1) * SPD_LEN)) { + if (spd_file_len < ((spd_index + 1) * SPD_PAGE_LEN)) { printk(BIOS_ERR, "SPD index override to 0 - old hardware?\n"); spd_index = 0; }
- spd_span = spd_index * SPD_LEN; + spd_span = spd_index * SPD_PAGE_LEN; return (uintptr_t)(spd_file + spd_span); }