Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36780 )
Change subject: nb/intel/sandybridge: Make the mainboard_early_init hook optional ......................................................................
nb/intel/sandybridge: Make the mainboard_early_init hook optional
This adds an empty weakly linked default. The rationale behind this change is that without the callback some features might not work but that the result is likely still able to boot, so it can be made optional.
Change-Id: I62c8010aa81fc45d208e9293feb2f45b45f34a82 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/mainboard/apple/macbookair4_2/romstage.c M src/mainboard/asrock/b75pro3-m/romstage.c M src/mainboard/asus/h61m-cs/romstage.c M src/mainboard/asus/maximus_iv_gene-z/romstage.c M src/mainboard/asus/p8h61-m_lx/romstage.c M src/mainboard/asus/p8h61-m_pro/romstage.c M src/mainboard/asus/p8z77-m_pro/romstage.c M src/mainboard/compulab/intense_pc/romstage.c M src/mainboard/gigabyte/ga-b75m-d3h/romstage.c M src/mainboard/gigabyte/ga-h61m-s2pv/romstage.c M src/mainboard/google/butterfly/romstage.c M src/mainboard/google/parrot/romstage.c M src/mainboard/hp/2570p/romstage.c M src/mainboard/hp/2760p/romstage.c M src/mainboard/hp/8460p/romstage.c M src/mainboard/hp/8470p/romstage.c M src/mainboard/hp/8770w/romstage.c M src/mainboard/hp/compaq_8200_elite_sff/romstage.c M src/mainboard/hp/folio_9470m/romstage.c M src/mainboard/hp/revolve_810_g1/romstage.c M src/mainboard/hp/z220_sff_workstation/romstage.c M src/mainboard/intel/dcp847ske/early_southbridge.c M src/mainboard/intel/emeraldlake2/romstage.c M src/mainboard/lenovo/l520/romstage.c M src/mainboard/lenovo/s230u/romstage.c M src/mainboard/lenovo/t430s/variants/t431s/romstage.c M src/mainboard/lenovo/x131e/romstage.c M src/mainboard/lenovo/x1_carbon_gen1/romstage.c M src/mainboard/lenovo/x220/romstage.c M src/mainboard/lenovo/x230/romstage.c M src/mainboard/msi/ms7707/romstage.c M src/mainboard/roda/rv11/romstage.c M src/mainboard/sapphire/pureplatinumh61/romstage.c M src/northbridge/intel/sandybridge/romstage.c M src/northbridge/intel/sandybridge/sandybridge.h 35 files changed, 6 insertions(+), 132 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/36780/1
diff --git a/src/mainboard/apple/macbookair4_2/romstage.c b/src/mainboard/apple/macbookair4_2/romstage.c index d04582d..a7c543d 100644 --- a/src/mainboard/apple/macbookair4_2/romstage.c +++ b/src/mainboard/apple/macbookair4_2/romstage.c @@ -49,10 +49,6 @@ { 1, 0, -1 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/asrock/b75pro3-m/romstage.c b/src/mainboard/asrock/b75pro3-m/romstage.c index da895b3..fe6d183 100644 --- a/src/mainboard/asrock/b75pro3-m/romstage.c +++ b/src/mainboard/asrock/b75pro3-m/romstage.c @@ -48,10 +48,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { /* Set GPIOs on superio, enable UART */ diff --git a/src/mainboard/asus/h61m-cs/romstage.c b/src/mainboard/asus/h61m-cs/romstage.c index 2064f14..37b07e5 100644 --- a/src/mainboard/asus/h61m-cs/romstage.c +++ b/src/mainboard/asus/h61m-cs/romstage.c @@ -52,10 +52,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { nuvoton_pnp_enter_conf_state(SIO_DEV); diff --git a/src/mainboard/asus/maximus_iv_gene-z/romstage.c b/src/mainboard/asus/maximus_iv_gene-z/romstage.c index fcf78d2..6cf206b 100644 --- a/src/mainboard/asus/maximus_iv_gene-z/romstage.c +++ b/src/mainboard/asus/maximus_iv_gene-z/romstage.c @@ -48,10 +48,6 @@ { }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { static const pnp_devfn_t GLOBAL_PSEUDO_DEV = PNP_DEV(0x2e, 0); diff --git a/src/mainboard/asus/p8h61-m_lx/romstage.c b/src/mainboard/asus/p8h61-m_lx/romstage.c index 09ca7db..5f94d17 100644 --- a/src/mainboard/asus/p8h61-m_lx/romstage.c +++ b/src/mainboard/asus/p8h61-m_lx/romstage.c @@ -51,10 +51,6 @@ { }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); diff --git a/src/mainboard/asus/p8h61-m_pro/romstage.c b/src/mainboard/asus/p8h61-m_pro/romstage.c index 7384828..60d311d 100644 --- a/src/mainboard/asus/p8h61-m_pro/romstage.c +++ b/src/mainboard/asus/p8h61-m_pro/romstage.c @@ -53,10 +53,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { /* Enable UART */ diff --git a/src/mainboard/asus/p8z77-m_pro/romstage.c b/src/mainboard/asus/p8z77-m_pro/romstage.c index 9c5e443..db2d303 100644 --- a/src/mainboard/asus/p8z77-m_pro/romstage.c +++ b/src/mainboard/asus/p8z77-m_pro/romstage.c @@ -56,10 +56,6 @@ { 0, 2, 6 } /* Port 13: Unused. Asus propietary DEBUG_PORT ??? */ };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { /* Setup COM/UART */ diff --git a/src/mainboard/compulab/intense_pc/romstage.c b/src/mainboard/compulab/intense_pc/romstage.c index f74e94d..8198d8a 100644 --- a/src/mainboard/compulab/intense_pc/romstage.c +++ b/src/mainboard/compulab/intense_pc/romstage.c @@ -60,10 +60,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { const u16 port = SIO_PORT; diff --git a/src/mainboard/gigabyte/ga-b75m-d3h/romstage.c b/src/mainboard/gigabyte/ga-b75m-d3h/romstage.c index ecbd393..f67d51b 100644 --- a/src/mainboard/gigabyte/ga-b75m-d3h/romstage.c +++ b/src/mainboard/gigabyte/ga-b75m-d3h/romstage.c @@ -78,10 +78,6 @@ { 1, 5, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - /* FIXME: The GA-B75M-D3V only has two DIMM slots! */ void mainboard_get_spd(spd_raw_data *spd, bool id_only) { diff --git a/src/mainboard/gigabyte/ga-h61m-s2pv/romstage.c b/src/mainboard/gigabyte/ga-h61m-s2pv/romstage.c index 8a17ac9..1df5bfd 100644 --- a/src/mainboard/gigabyte/ga-h61m-s2pv/romstage.c +++ b/src/mainboard/gigabyte/ga-h61m-s2pv/romstage.c @@ -48,10 +48,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { if (!CONFIG(NO_UART_ON_SUPERIO)) { diff --git a/src/mainboard/google/butterfly/romstage.c b/src/mainboard/google/butterfly/romstage.c index 844f754..449ccf5 100644 --- a/src/mainboard/google/butterfly/romstage.c +++ b/src/mainboard/google/butterfly/romstage.c @@ -112,10 +112,6 @@ read_spd(&spd[2], 0x52, id_only); }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/google/parrot/romstage.c b/src/mainboard/google/parrot/romstage.c index 210c7fc..8893819 100644 --- a/src/mainboard/google/parrot/romstage.c +++ b/src/mainboard/google/parrot/romstage.c @@ -84,10 +84,6 @@ RCBA32(FD) = reg32; }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_fill_pei_data(struct pei_data *pei_data) { struct pei_data pei_data_template = { diff --git a/src/mainboard/hp/2570p/romstage.c b/src/mainboard/hp/2570p/romstage.c index 6ffc340..4f7ca3a 100644 --- a/src/mainboard/hp/2570p/romstage.c +++ b/src/mainboard/hp/2570p/romstage.c @@ -45,10 +45,6 @@ { 0, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { kbc1126_enter_conf(); diff --git a/src/mainboard/hp/2760p/romstage.c b/src/mainboard/hp/2760p/romstage.c index b448f79..a696fae 100644 --- a/src/mainboard/hp/2760p/romstage.c +++ b/src/mainboard/hp/2760p/romstage.c @@ -44,10 +44,6 @@ { 1, 1, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { kbc1126_enter_conf(); diff --git a/src/mainboard/hp/8460p/romstage.c b/src/mainboard/hp/8460p/romstage.c index 72a62c9..77c355b 100644 --- a/src/mainboard/hp/8460p/romstage.c +++ b/src/mainboard/hp/8460p/romstage.c @@ -48,10 +48,6 @@ { 1, 0, 6 }, /* docking */ };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); diff --git a/src/mainboard/hp/8470p/romstage.c b/src/mainboard/hp/8470p/romstage.c index 83f382d..890e65b 100644 --- a/src/mainboard/hp/8470p/romstage.c +++ b/src/mainboard/hp/8470p/romstage.c @@ -47,10 +47,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); diff --git a/src/mainboard/hp/8770w/romstage.c b/src/mainboard/hp/8770w/romstage.c index 2bd9162..49a5b1a 100644 --- a/src/mainboard/hp/8770w/romstage.c +++ b/src/mainboard/hp/8770w/romstage.c @@ -48,10 +48,6 @@ { 1, 0, 6 }, /* Conn (eSATA Combo) */ };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); diff --git a/src/mainboard/hp/compaq_8200_elite_sff/romstage.c b/src/mainboard/hp/compaq_8200_elite_sff/romstage.c index 258eac7..90cfcc9 100644 --- a/src/mainboard/hp/compaq_8200_elite_sff/romstage.c +++ b/src/mainboard/hp/compaq_8200_elite_sff/romstage.c @@ -52,10 +52,6 @@ { 1, 0, -1 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { if (CONFIG(CONSOLE_SERIAL)) diff --git a/src/mainboard/hp/folio_9470m/romstage.c b/src/mainboard/hp/folio_9470m/romstage.c index 061a068..3f174a1 100644 --- a/src/mainboard/hp/folio_9470m/romstage.c +++ b/src/mainboard/hp/folio_9470m/romstage.c @@ -46,10 +46,6 @@ { 0, 0, 6 }, /* B1P6 */ };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { kbc1126_enter_conf(); diff --git a/src/mainboard/hp/revolve_810_g1/romstage.c b/src/mainboard/hp/revolve_810_g1/romstage.c index 5c83a91..8a40578 100644 --- a/src/mainboard/hp/revolve_810_g1/romstage.c +++ b/src/mainboard/hp/revolve_810_g1/romstage.c @@ -50,10 +50,6 @@ { 0, 0, 6 }, /* B1P6 */ };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { kbc1126_enter_conf(); diff --git a/src/mainboard/hp/z220_sff_workstation/romstage.c b/src/mainboard/hp/z220_sff_workstation/romstage.c index 6c139ed..bd0a377 100644 --- a/src/mainboard/hp/z220_sff_workstation/romstage.c +++ b/src/mainboard/hp/z220_sff_workstation/romstage.c @@ -52,10 +52,6 @@ { 1, 0, 7 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { if (CONFIG(CONSOLE_SERIAL)) diff --git a/src/mainboard/intel/dcp847ske/early_southbridge.c b/src/mainboard/intel/dcp847ske/early_southbridge.c index 9846295..7f3a58d 100644 --- a/src/mainboard/intel/dcp847ske/early_southbridge.c +++ b/src/mainboard/intel/dcp847ske/early_southbridge.c @@ -52,10 +52,6 @@ MCHBAR32(0x0104) |= 0x00001000; }
-void mainboard_early_init(int s3resume) -{ -} - static const u16 hwm_initvals[] = { HWM_BANK(0), HWM_INITVAL(0xae, 0x01), /* Enable PECI Agent0 */ diff --git a/src/mainboard/intel/emeraldlake2/romstage.c b/src/mainboard/intel/emeraldlake2/romstage.c index d56576e..e7959ef 100644 --- a/src/mainboard/intel/emeraldlake2/romstage.c +++ b/src/mainboard/intel/emeraldlake2/romstage.c @@ -153,10 +153,6 @@ read_spd(&spd[2], 0x52, id_only); }
-void mainboard_early_init(int s3resume) -{ -} - int mainboard_should_reset_usb(int s3resume) { return !s3resume; diff --git a/src/mainboard/lenovo/l520/romstage.c b/src/mainboard/lenovo/l520/romstage.c index 82f6377..fc67e5a 100644 --- a/src/mainboard/lenovo/l520/romstage.c +++ b/src/mainboard/lenovo/l520/romstage.c @@ -47,10 +47,6 @@ { 1, 0, -1 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/lenovo/s230u/romstage.c b/src/mainboard/lenovo/s230u/romstage.c index 754c49a..48d26c2 100644 --- a/src/mainboard/lenovo/s230u/romstage.c +++ b/src/mainboard/lenovo/s230u/romstage.c @@ -64,10 +64,6 @@ { 1, 1, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/lenovo/t430s/variants/t431s/romstage.c b/src/mainboard/lenovo/t430s/variants/t431s/romstage.c index e7b43db..3f62f06 100644 --- a/src/mainboard/lenovo/t430s/variants/t431s/romstage.c +++ b/src/mainboard/lenovo/t430s/variants/t431s/romstage.c @@ -54,7 +54,3 @@ memcpy(&spd[0], spd_file, spd_file_len); read_spd(&spd[2], 0x51, id_only); } - -void mainboard_early_init(int s3resume) -{ -} diff --git a/src/mainboard/lenovo/x131e/romstage.c b/src/mainboard/lenovo/x131e/romstage.c index 2a6ee27..6f176c7 100644 --- a/src/mainboard/lenovo/x131e/romstage.c +++ b/src/mainboard/lenovo/x131e/romstage.c @@ -51,10 +51,6 @@ read_spd(&spd[2], 0x52, id_only); }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/lenovo/x1_carbon_gen1/romstage.c b/src/mainboard/lenovo/x1_carbon_gen1/romstage.c index b779c4e..eb2a5b1 100644 --- a/src/mainboard/lenovo/x1_carbon_gen1/romstage.c +++ b/src/mainboard/lenovo/x1_carbon_gen1/romstage.c @@ -104,10 +104,6 @@ memcpy(&spd[2], memory, 256); }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/lenovo/x220/romstage.c b/src/mainboard/lenovo/x220/romstage.c index af92f9b..8460208 100644 --- a/src/mainboard/lenovo/x220/romstage.c +++ b/src/mainboard/lenovo/x220/romstage.c @@ -91,10 +91,6 @@ read_spd (&spd[2], 0x51, id_only); }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/lenovo/x230/romstage.c b/src/mainboard/lenovo/x230/romstage.c index 60016a4..6f10135 100644 --- a/src/mainboard/lenovo/x230/romstage.c +++ b/src/mainboard/lenovo/x230/romstage.c @@ -56,10 +56,6 @@ read_spd (&spd[2], 0x51, id_only); }
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/msi/ms7707/romstage.c b/src/mainboard/msi/ms7707/romstage.c index a797f50..8f83c86 100644 --- a/src/mainboard/msi/ms7707/romstage.c +++ b/src/mainboard/msi/ms7707/romstage.c @@ -49,10 +49,6 @@ {1, 0, 6}, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/mainboard/roda/rv11/romstage.c b/src/mainboard/roda/rv11/romstage.c index b36725c..a54a9ad 100644 --- a/src/mainboard/roda/rv11/romstage.c +++ b/src/mainboard/roda/rv11/romstage.c @@ -27,10 +27,6 @@ RCBA32(FD) = reg32; }
-void mainboard_early_init(int s3resume) -{ -} - int mainboard_should_reset_usb(int s3resume) { return !s3resume; diff --git a/src/mainboard/sapphire/pureplatinumh61/romstage.c b/src/mainboard/sapphire/pureplatinumh61/romstage.c index ff5bb70..7fcde77 100644 --- a/src/mainboard/sapphire/pureplatinumh61/romstage.c +++ b/src/mainboard/sapphire/pureplatinumh61/romstage.c @@ -48,10 +48,6 @@ { 1, 0, 6 }, };
-void mainboard_early_init(int s3resume) -{ -} - void mainboard_config_superio(void) { } diff --git a/src/northbridge/intel/sandybridge/romstage.c b/src/northbridge/intel/sandybridge/romstage.c index 55f2928..92882b4 100644 --- a/src/northbridge/intel/sandybridge/romstage.c +++ b/src/northbridge/intel/sandybridge/romstage.c @@ -30,6 +30,10 @@ #include <southbridge/intel/common/pmclib.h> #include <elog.h>
+__weak void mainboard_early_init(int s3_resume) +{ +} + static void early_pch_reset_pmcon(void) { u8 reg8; diff --git a/src/northbridge/intel/sandybridge/sandybridge.h b/src/northbridge/intel/sandybridge/sandybridge.h index 8664c5d..eae01dc 100644 --- a/src/northbridge/intel/sandybridge/sandybridge.h +++ b/src/northbridge/intel/sandybridge/sandybridge.h @@ -216,6 +216,8 @@ #endif /* !__SMM__ */
void pch_enable_lpc(void); +/* mainboard_early_init: Optional mainboard callback run after console init + but before raminit. */ void mainboard_early_init(int s3resume); void mainboard_config_superio(void); int mainboard_should_reset_usb(int s3resume);