From 65f81a7b9024290b9b92bda6d1d67ab805fa3986 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 20 Jan 2021 22:48:50 +0100 Subject: broadwell: Flatten `mainboard_pre_raminit` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All Broadwell boards only use the `mainboard_pre_raminit` function to call `mainboard_fill_pei_data` and optionally `mainboard_fill_spd_data`. Move the declaration and weak definition of `mainboard_fill_spd_data` to platform code, replace the call to `mainboard_pre_raminit` in romstage.c with calls to `mainboard_fill_pei_data` and `mainboard_fill_spd_data`, and delete all other instances of `mainboard_pre_raminit` for Broadwell. Finally, delete now-empty romstage.c and spd.h files from mainboards. Change-Id: I3334b20bd7138bb753b996a137ff106e87c6e8a5 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/49776 Tested-by: build bot (Jenkins) Reviewed-by: Michael Niewöhner --- src/mainboard/google/auron/romstage.c | 16 ---------------- src/mainboard/google/auron/variant.h | 1 - src/mainboard/google/jecht/romstage.c | 8 -------- src/mainboard/google/jecht/spd/spd.c | 2 +- src/mainboard/google/jecht/spd/spd.h | 9 --------- src/mainboard/intel/wtm2/romstage.c | 13 ------------- src/mainboard/purism/librem_bdw/romstage.c | 11 ----------- src/soc/intel/broadwell/include/soc/romstage.h | 2 +- src/soc/intel/broadwell/romstage.c | 9 +++++++-- 9 files changed, 9 insertions(+), 62 deletions(-) delete mode 100644 src/mainboard/google/auron/romstage.c delete mode 100644 src/mainboard/google/jecht/spd/spd.h delete mode 100644 src/mainboard/intel/wtm2/romstage.c delete mode 100644 src/mainboard/purism/librem_bdw/romstage.c (limited to 'src') diff --git a/src/mainboard/google/auron/romstage.c b/src/mainboard/google/auron/romstage.c deleted file mode 100644 index a3705bc1b8..0000000000 --- a/src/mainboard/google/auron/romstage.c +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include "variant.h" - -void mainboard_pre_raminit(struct romstage_params *rp) -{ - /* Fill out PEI DATA */ - mainboard_fill_pei_data(&rp->pei_data); - mainboard_fill_spd_data(&rp->pei_data); - -} diff --git a/src/mainboard/google/auron/variant.h b/src/mainboard/google/auron/variant.h index 380a373f2d..ba4c58a9e1 100644 --- a/src/mainboard/google/auron/variant.h +++ b/src/mainboard/google/auron/variant.h @@ -11,7 +11,6 @@ int variant_smbios_data(struct device *dev, int *handle, unsigned long *current); void lan_init(void); -void mainboard_fill_spd_data(struct pei_data *pei_data); void fill_spd_for_index(uint8_t spd[], unsigned int index); #define SPD_LEN 256 diff --git a/src/mainboard/google/jecht/romstage.c b/src/mainboard/google/jecht/romstage.c index 58db3cf522..5c978baabb 100644 --- a/src/mainboard/google/jecht/romstage.c +++ b/src/mainboard/google/jecht/romstage.c @@ -8,16 +8,8 @@ #include #include #include -#include #include "onboard.h" -void mainboard_pre_raminit(struct romstage_params *rp) -{ - /* Fill out PEI DATA */ - mainboard_fill_pei_data(&rp->pei_data); - mainboard_fill_spd_data(&rp->pei_data); -} - void mainboard_post_raminit(const int s3resume) { if (CONFIG(CHROMEOS)) diff --git a/src/mainboard/google/jecht/spd/spd.c b/src/mainboard/google/jecht/spd/spd.c index 911cf604be..f4454b8fa5 100644 --- a/src/mainboard/google/jecht/spd/spd.c +++ b/src/mainboard/google/jecht/spd/spd.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include +#include /* Copy SPD data for on-board memory */ void mainboard_fill_spd_data(struct pei_data *pei_data) diff --git a/src/mainboard/google/jecht/spd/spd.h b/src/mainboard/google/jecht/spd/spd.h deleted file mode 100644 index 5ebd8c233a..0000000000 --- a/src/mainboard/google/jecht/spd/spd.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef MAINBOARD_SPD_H -#define MAINBOARD_SPD_H - -struct pei_data; -void mainboard_fill_spd_data(struct pei_data *pei_data); - -#endif diff --git a/src/mainboard/intel/wtm2/romstage.c b/src/mainboard/intel/wtm2/romstage.c deleted file mode 100644 index 1b6539b55d..0000000000 --- a/src/mainboard/intel/wtm2/romstage.c +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include - -void mainboard_pre_raminit(struct romstage_params *rp) -{ - /* Fill out PEI DATA */ - mainboard_fill_pei_data(&rp->pei_data); -} diff --git a/src/mainboard/purism/librem_bdw/romstage.c b/src/mainboard/purism/librem_bdw/romstage.c deleted file mode 100644 index 8ffd078335..0000000000 --- a/src/mainboard/purism/librem_bdw/romstage.c +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include - -void mainboard_pre_raminit(struct romstage_params *rp) -{ - /* Fill out PEI DATA */ - mainboard_fill_pei_data(&rp->pei_data); -} diff --git a/src/soc/intel/broadwell/include/soc/romstage.h b/src/soc/intel/broadwell/include/soc/romstage.h index eb51ea151e..9f4eef2316 100644 --- a/src/soc/intel/broadwell/include/soc/romstage.h +++ b/src/soc/intel/broadwell/include/soc/romstage.h @@ -11,7 +11,7 @@ struct romstage_params { struct pei_data pei_data; }; -void mainboard_pre_raminit(struct romstage_params *params); +void mainboard_fill_spd_data(struct pei_data *pei_data); void mainboard_post_raminit(const int s3resume); void raminit(struct pei_data *pei_data); diff --git a/src/soc/intel/broadwell/romstage.c b/src/soc/intel/broadwell/romstage.c index 084c3e6e99..76e1d7e47b 100644 --- a/src/soc/intel/broadwell/romstage.c +++ b/src/soc/intel/broadwell/romstage.c @@ -9,11 +9,16 @@ #include #include #include +#include #include #include #include #include +__weak void mainboard_fill_spd_data(struct pei_data *pei_data) +{ +} + __weak void mainboard_post_raminit(const int s3resume) { } @@ -45,8 +50,8 @@ void mainboard_romstage_entry(void) /* Initialize GPIOs */ init_gpios(mainboard_gpio_config); - /* Fill in mainboard pei_date. */ - mainboard_pre_raminit(&rp); + mainboard_fill_pei_data(&rp.pei_data); + mainboard_fill_spd_data(&rp.pei_data); post_code(0x32); -- cgit v1.2.3