summaryrefslogtreecommitdiff
path: root/src/mainboard/intel/kunimitsu/spd
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2024-05-09 14:21:04 +0200
committerElyes Haouas <ehaouas@noos.fr>2024-05-13 17:11:35 +0000
commit27becf5da6a6b61de165013e0680265a6f6fbfbb (patch)
tree011d2dc3e1b2b01066be7b00be5bec90c8046e75 /src/mainboard/intel/kunimitsu/spd
parent7809eb8db641410f54d52c31daf2ad6ebf763e5e (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/kunimitsu/spd')
-rw-r--r--src/mainboard/intel/kunimitsu/spd/spd.h13
-rw-r--r--src/mainboard/intel/kunimitsu/spd/spd_util.c9
2 files changed, 6 insertions, 16 deletions
diff --git a/src/mainboard/intel/kunimitsu/spd/spd.h b/src/mainboard/intel/kunimitsu/spd/spd.h
index c53c6e4379..0b4d0e26ef 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd.h
+++ b/src/mainboard/intel/kunimitsu/spd/spd.h
@@ -8,19 +8,6 @@
#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
#define SAMSUNG_SINGLE_CHAN 0x4
#define MIC_SINGLE_CHAN 0x5
diff --git a/src/mainboard/intel/kunimitsu/spd/spd_util.c b/src/mainboard/intel/kunimitsu/spd/spd_util.c
index 8c1407adc6..e79759cced 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd_util.c
+++ b/src/mainboard/intel/kunimitsu/spd/spd_util.c
@@ -1,8 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <cbfs.h>
#include <console/console.h>
+#include <device/dram/ddr3.h>
+#include <spd.h>
#include <stdint.h>
#include <string.h>
+
#include "boardid.h"
#include "spd.h"
@@ -72,16 +75,16 @@ uintptr_t mainboard_get_spd_data(void)
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_SIZE_MAX_DDR3)
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_SIZE_MAX_DDR3)) {
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_SIZE_MAX_DDR3;
return (uintptr_t)(spd_file + spd_span);
}