summaryrefslogtreecommitdiff
path: root/src/mainboard/intel/kunimitsu/spd
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-05-04 17:06:06 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-05-07 15:57:05 +0000
commit9b5b9e46b9342500a411514e62032fa3edb565a2 (patch)
tree9f1e4a214b9ff34686744e69ff0be2822afb035e /src/mainboard/intel/kunimitsu/spd
parent66318aad07e6810065bc0668f4a1f34b7cb77687 (diff)
mb/intel/kunimitsu: Refactor to get rid of `pei_data`
The SoC specific `struct pei_data` was filled with values that were later only consumed by the mainboard code again. Avoid jumping through this hoop and fill FSP UPDs directly. Change-Id: Ibc013ccea9f83ef29f22fe2da4c0d12096308636 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32590 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/mainboard/intel/kunimitsu/spd')
-rw-r--r--src/mainboard/intel/kunimitsu/spd/spd.c20
-rw-r--r--src/mainboard/intel/kunimitsu/spd/spd.h2
-rw-r--r--src/mainboard/intel/kunimitsu/spd/spd_util.c2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/mainboard/intel/kunimitsu/spd/spd.c b/src/mainboard/intel/kunimitsu/spd/spd.c
index 8656d4bc17..bebb544a4d 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd.c
+++ b/src/mainboard/intel/kunimitsu/spd/spd.c
@@ -16,8 +16,9 @@
#include <arch/byteorder.h>
#include <console/console.h>
-#include <soc/pei_data.h>
+#include <fsp/soc_binding.h>
#include <soc/romstage.h>
+#include <stdint.h>
#include <string.h>
#include "spd.h"
@@ -73,20 +74,19 @@ static void mainboard_print_spd_info(uint8_t spd[])
}
}
-/* Copy SPD data for on-board memory */
-void mainboard_fill_spd_data(struct pei_data *pei_data)
+/* Fill SPD pointers for on-board memory */
+void spd_memory_init_params(MEMORY_INIT_UPD *memory_params)
{
uintptr_t spd_data;
spd_data = mainboard_get_spd_data();
- memcpy(pei_data->spd_data[0][0], (void *)spd_data, SPD_LEN);
-
- if (mainboard_has_dual_channel_mem())
- memcpy(pei_data->spd_data[1][0], (void *)spd_data, SPD_LEN);
-
/* Make sure a valid SPD was found */
- if (pei_data->spd_data[0][0][0] == 0)
+ if (*(uint8_t *)spd_data == 0)
die("Invalid SPD data.");
- mainboard_print_spd_info(pei_data->spd_data[0][0]);
+ memory_params->MemorySpdPtr00 = spd_data;
+ if (mainboard_has_dual_channel_mem())
+ memory_params->MemorySpdPtr10 = spd_data;
+
+ mainboard_print_spd_info((uint8_t *)spd_data);
}
diff --git a/src/mainboard/intel/kunimitsu/spd/spd.h b/src/mainboard/intel/kunimitsu/spd/spd.h
index f53c9ec9fa..22d371f4bc 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd.h
+++ b/src/mainboard/intel/kunimitsu/spd/spd.h
@@ -16,6 +16,7 @@
#ifndef MAINBOARD_SPD_H
+#include <fsp/soc_binding.h>
#include <gpio.h>
#include "../gpio.h"
@@ -53,6 +54,7 @@ static inline int get_spd_index(void) {
};
return (gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)));
}
+void spd_memory_init_params(MEMORY_INIT_UPD *memory_params);
void mainboard_fill_dq_map_data(void *dq_map_ptr);
void mainboard_fill_dqs_map_data(void *dqs_map_ptr);
void mainboard_fill_rcomp_res_data(void *rcomp_ptr);
diff --git a/src/mainboard/intel/kunimitsu/spd/spd_util.c b/src/mainboard/intel/kunimitsu/spd/spd_util.c
index fc0581cb24..b173628e29 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd_util.c
+++ b/src/mainboard/intel/kunimitsu/spd/spd_util.c
@@ -17,8 +17,6 @@
#include <console/console.h>
#include <stdint.h>
#include <string.h>
-#include <soc/pei_data.h>
-#include <soc/pei_wrapper.h>
#include "boardid.h"
#include "spd.h"