Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46996 )
Change subject: broadwell: Clean up pei_data callbacks ......................................................................
broadwell: Clean up pei_data callbacks
None of the boards uses the romstage_params struct. Relocate common prototypes to soc code. A follow-up will clean up google/auron headers.
Change-Id: I1e255500ef56509a2b9e3f8c8d8abb8248f9612f Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/mainboard/google/auron/romstage.c M src/mainboard/google/auron/variants/auron_paine/include/variant/spd.h M src/mainboard/google/auron/variants/auron_paine/spd/spd.c M src/mainboard/google/auron/variants/auron_yuna/include/variant/spd.h M src/mainboard/google/auron/variants/auron_yuna/spd/spd.c M src/mainboard/google/auron/variants/buddy/include/variant/spd.h M src/mainboard/google/auron/variants/buddy/spd/spd.c M src/mainboard/google/auron/variants/gandof/include/variant/spd.h M src/mainboard/google/auron/variants/gandof/spd/spd.c M src/mainboard/google/auron/variants/lulu/include/variant/spd.h M src/mainboard/google/auron/variants/lulu/spd/spd.c M src/mainboard/google/auron/variants/samus/include/variant/spd.h M src/mainboard/google/auron/variants/samus/spd/spd.c M src/mainboard/google/jecht/romstage.c M src/mainboard/google/jecht/spd/spd.c D src/mainboard/google/jecht/spd/spd.h M src/mainboard/intel/wtm2/romstage.c M src/mainboard/purism/librem_bdw/romstage.c M src/soc/intel/broadwell/pei_data.c M src/soc/intel/broadwell/pei_wrapper.h M src/soc/intel/broadwell/romstage.c M src/soc/intel/broadwell/romstage.h 22 files changed, 19 insertions(+), 59 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/46996/1
diff --git a/src/mainboard/google/auron/romstage.c b/src/mainboard/google/auron/romstage.c index d3a799c..7ecddcf 100644 --- a/src/mainboard/google/auron/romstage.c +++ b/src/mainboard/google/auron/romstage.c @@ -12,14 +12,6 @@ { }
-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(struct romstage_params *rp) { /* Do variant-specific init */ diff --git a/src/mainboard/google/auron/variants/auron_paine/include/variant/spd.h b/src/mainboard/google/auron/variants/auron_paine/include/variant/spd.h index 74e3cdf..7e34ca1 100644 --- a/src/mainboard/google/auron/variants/auron_paine/include/variant/spd.h +++ b/src/mainboard/google/auron/variants/auron_paine/include/variant/spd.h @@ -20,7 +20,4 @@ #define SPD_GPIO_BIT1 9 #define SPD_GPIO_BIT2 47
-struct pei_data; -void mainboard_fill_spd_data(struct pei_data *pei_data); - #endif diff --git a/src/mainboard/google/auron/variants/auron_paine/spd/spd.c b/src/mainboard/google/auron/variants/auron_paine/spd/spd.c index b56de42..5521c3f 100644 --- a/src/mainboard/google/auron/variants/auron_paine/spd/spd.c +++ b/src/mainboard/google/auron/variants/auron_paine/spd/spd.c @@ -6,6 +6,7 @@ #include <string.h> #include <soc/intel/broadwell/pch/gpio.h> #include <soc/intel/broadwell/pei_data.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h> #include <ec/google/chromeec/ec.h> #include <mainboard/google/auron/ec.h> diff --git a/src/mainboard/google/auron/variants/auron_yuna/include/variant/spd.h b/src/mainboard/google/auron/variants/auron_yuna/include/variant/spd.h index 74e3cdf..7e34ca1 100644 --- a/src/mainboard/google/auron/variants/auron_yuna/include/variant/spd.h +++ b/src/mainboard/google/auron/variants/auron_yuna/include/variant/spd.h @@ -20,7 +20,4 @@ #define SPD_GPIO_BIT1 9 #define SPD_GPIO_BIT2 47
-struct pei_data; -void mainboard_fill_spd_data(struct pei_data *pei_data); - #endif diff --git a/src/mainboard/google/auron/variants/auron_yuna/spd/spd.c b/src/mainboard/google/auron/variants/auron_yuna/spd/spd.c index b56de42..5521c3f 100644 --- a/src/mainboard/google/auron/variants/auron_yuna/spd/spd.c +++ b/src/mainboard/google/auron/variants/auron_yuna/spd/spd.c @@ -6,6 +6,7 @@ #include <string.h> #include <soc/intel/broadwell/pch/gpio.h> #include <soc/intel/broadwell/pei_data.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h> #include <ec/google/chromeec/ec.h> #include <mainboard/google/auron/ec.h> diff --git a/src/mainboard/google/auron/variants/buddy/include/variant/spd.h b/src/mainboard/google/auron/variants/buddy/include/variant/spd.h index 5ebd8c2..7f7914d 100644 --- a/src/mainboard/google/auron/variants/buddy/include/variant/spd.h +++ b/src/mainboard/google/auron/variants/buddy/include/variant/spd.h @@ -3,7 +3,4 @@ #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/google/auron/variants/buddy/spd/spd.c b/src/mainboard/google/auron/variants/buddy/spd/spd.c index 3e605bc..e74e6b9 100644 --- a/src/mainboard/google/auron/variants/buddy/spd/spd.c +++ b/src/mainboard/google/auron/variants/buddy/spd/spd.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/intel/broadwell/pei_data.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <variant/spd.h>
/* Copy SPD data for on-board memory */ diff --git a/src/mainboard/google/auron/variants/gandof/include/variant/spd.h b/src/mainboard/google/auron/variants/gandof/include/variant/spd.h index 2263672..dfcd7cc 100644 --- a/src/mainboard/google/auron/variants/gandof/include/variant/spd.h +++ b/src/mainboard/google/auron/variants/gandof/include/variant/spd.h @@ -20,7 +20,4 @@ #define SPD_GPIO_BIT1 9 #define SPD_GPIO_BIT2 47
-struct pei_data; -void mainboard_fill_spd_data(struct pei_data *pei_data); - #endif diff --git a/src/mainboard/google/auron/variants/gandof/spd/spd.c b/src/mainboard/google/auron/variants/gandof/spd/spd.c index b56de42..5521c3f 100644 --- a/src/mainboard/google/auron/variants/gandof/spd/spd.c +++ b/src/mainboard/google/auron/variants/gandof/spd/spd.c @@ -6,6 +6,7 @@ #include <string.h> #include <soc/intel/broadwell/pch/gpio.h> #include <soc/intel/broadwell/pei_data.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h> #include <ec/google/chromeec/ec.h> #include <mainboard/google/auron/ec.h> diff --git a/src/mainboard/google/auron/variants/lulu/include/variant/spd.h b/src/mainboard/google/auron/variants/lulu/include/variant/spd.h index 903b60a..da8c387 100644 --- a/src/mainboard/google/auron/variants/lulu/include/variant/spd.h +++ b/src/mainboard/google/auron/variants/lulu/include/variant/spd.h @@ -21,7 +21,4 @@ #define SPD_GPIO_BIT2 47 #define SPD_GPIO_BIT3 8
-struct pei_data; -void mainboard_fill_spd_data(struct pei_data *pei_data); - #endif diff --git a/src/mainboard/google/auron/variants/lulu/spd/spd.c b/src/mainboard/google/auron/variants/lulu/spd/spd.c index 4f367fa..b35a57f 100644 --- a/src/mainboard/google/auron/variants/lulu/spd/spd.c +++ b/src/mainboard/google/auron/variants/lulu/spd/spd.c @@ -6,6 +6,7 @@ #include <string.h> #include <soc/intel/broadwell/pch/gpio.h> #include <soc/intel/broadwell/pei_data.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h> #include <ec/google/chromeec/ec.h> #include <mainboard/google/auron/ec.h> diff --git a/src/mainboard/google/auron/variants/samus/include/variant/spd.h b/src/mainboard/google/auron/variants/samus/include/variant/spd.h index c9b0498..79fbc1b 100644 --- a/src/mainboard/google/auron/variants/samus/include/variant/spd.h +++ b/src/mainboard/google/auron/variants/samus/include/variant/spd.h @@ -21,7 +21,4 @@ #define SPD_GPIO_BIT2 67 #define SPD_GPIO_BIT3 65
-struct pei_data; -void mainboard_fill_spd_data(struct pei_data *pei_data); - #endif diff --git a/src/mainboard/google/auron/variants/samus/spd/spd.c b/src/mainboard/google/auron/variants/samus/spd/spd.c index 055f725..a8ab2e3 100644 --- a/src/mainboard/google/auron/variants/samus/spd/spd.c +++ b/src/mainboard/google/auron/variants/samus/spd/spd.c @@ -6,6 +6,7 @@ #include <string.h> #include <soc/intel/broadwell/pch/gpio.h> #include <soc/intel/broadwell/pei_data.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h> #include <ec/google/chromeec/ec.h> #include <mainboard/google/auron/ec.h> diff --git a/src/mainboard/google/jecht/romstage.c b/src/mainboard/google/jecht/romstage.c index f28ee86..e1dacba 100644 --- a/src/mainboard/google/jecht/romstage.c +++ b/src/mainboard/google/jecht/romstage.c @@ -8,16 +8,8 @@ #include <soc/intel/broadwell/romstage.h> #include <superio/ite/common/ite.h> #include <superio/ite/it8772f/it8772f.h> -#include <mainboard/google/jecht/spd/spd.h> #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(struct romstage_params *rp) { if (CONFIG(CHROMEOS)) diff --git a/src/mainboard/google/jecht/spd/spd.c b/src/mainboard/google/jecht/spd/spd.c index 005645e..36ebd5b 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 <soc/intel/broadwell/pei_data.h> -#include <mainboard/google/jecht/spd/spd.h> +#include <soc/intel/broadwell/pei_wrapper.h>
/* 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 5ebd8c2..0000000 --- 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 index 89c1a06..b8f0c67 100644 --- a/src/mainboard/intel/wtm2/romstage.c +++ b/src/mainboard/intel/wtm2/romstage.c @@ -6,12 +6,6 @@ #include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h>
-void mainboard_pre_raminit(struct romstage_params *rp) -{ - /* Fill out PEI DATA */ - mainboard_fill_pei_data(&rp->pei_data); -} - void mainboard_post_raminit(struct romstage_params *rp) { } diff --git a/src/mainboard/purism/librem_bdw/romstage.c b/src/mainboard/purism/librem_bdw/romstage.c index 103d22d..2395ed6 100644 --- a/src/mainboard/purism/librem_bdw/romstage.c +++ b/src/mainboard/purism/librem_bdw/romstage.c @@ -4,12 +4,6 @@ #include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h>
-void mainboard_pre_raminit(struct romstage_params *rp) -{ - /* Fill out PEI DATA */ - mainboard_fill_pei_data(&rp->pei_data); -} - void mainboard_post_raminit(struct romstage_params *rp) { } diff --git a/src/soc/intel/broadwell/pei_data.c b/src/soc/intel/broadwell/pei_data.c index ec3f819..df28e21 100644 --- a/src/soc/intel/broadwell/pei_data.c +++ b/src/soc/intel/broadwell/pei_data.c @@ -11,6 +11,10 @@ console_tx_byte(b); }
+__weak void mainboard_fill_spd_data(struct pei_data *pei_data) +{ +} + void broadwell_fill_pei_data(struct pei_data *pei_data) { pei_data->pei_version = PEI_VERSION; diff --git a/src/soc/intel/broadwell/pei_wrapper.h b/src/soc/intel/broadwell/pei_wrapper.h index 01762d2..f62aafa 100644 --- a/src/soc/intel/broadwell/pei_wrapper.h +++ b/src/soc/intel/broadwell/pei_wrapper.h @@ -29,4 +29,7 @@ void broadwell_fill_pei_data(struct pei_data *pei_data); void mainboard_fill_pei_data(struct pei_data *pei_data);
+/* Optional */ +void mainboard_fill_spd_data(struct pei_data *pei_data); + #endif diff --git a/src/soc/intel/broadwell/romstage.c b/src/soc/intel/broadwell/romstage.c index f9242fd..ce77159 100644 --- a/src/soc/intel/broadwell/romstage.c +++ b/src/soc/intel/broadwell/romstage.c @@ -7,6 +7,7 @@ #include <elog.h> #include <romstage_handoff.h> #include <soc/intel/broadwell/pch/pm.h> +#include <soc/intel/broadwell/pei_wrapper.h> #include <soc/intel/broadwell/romstage.h> #include <stdint.h> #include <timestamp.h> @@ -44,8 +45,9 @@ /* Initialize GPIOs */ init_gpios(mainboard_gpio_config);
- /* Fill in mainboard pei_date. */ - mainboard_pre_raminit(&rp); + /* Fill in mainboard pei_data */ + mainboard_fill_pei_data(&rp.pei_data); + mainboard_fill_spd_data(&rp.pei_data);
post_code(0x32);
diff --git a/src/soc/intel/broadwell/romstage.h b/src/soc/intel/broadwell/romstage.h index 2e72a2f..0d00acc 100644 --- a/src/soc/intel/broadwell/romstage.h +++ b/src/soc/intel/broadwell/romstage.h @@ -12,7 +12,7 @@ struct pei_data pei_data; };
-void mainboard_pre_raminit(struct romstage_params *params); +void mainboard_pre_raminit(struct pei_data *pei_data); void mainboard_post_raminit(struct romstage_params *params);
void raminit(struct pei_data *pei_data);