From dc584c3f221bb59ee6b89e5517617b9d1d74bcf3 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 12 Nov 2019 20:37:21 +0100 Subject: nb/intel/i945: Move boilerplate romstage to a common location This adds callbacks for mainboard specific init. Change-Id: Ib67bc492a7b7f02f9b57a52fd6730e16501b436e Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/36787 Reviewed-by: HAOUAS Elyes Tested-by: build bot (Jenkins) --- src/mainboard/getac/p470/romstage.c | 61 +++---------------------------------- 1 file changed, 4 insertions(+), 57 deletions(-) (limited to 'src/mainboard/getac') diff --git a/src/mainboard/getac/p470/romstage.c b/src/mainboard/getac/p470/romstage.c index 8c41190b02..2da9d06ff9 100644 --- a/src/mainboard/getac/p470/romstage.c +++ b/src/mainboard/getac/p470/romstage.c @@ -16,22 +16,16 @@ #include #include -#include #include #include #include -#include -#include #include #include -#include #include -#include #include -#include #include "option_table.h" -static void setup_special_ich7_gpios(void) +void mainboard_pre_raminit_config(int s3_resume) { u32 gpios; @@ -52,7 +46,7 @@ static void setup_special_ich7_gpios(void) } /* Override the default lpc decode ranges */ -static void mb_lpc_decode(void) +void mainboard_lpc_decode(void) { int lpt_en = 0; if (read_option(lpt, 0) != 0) @@ -81,7 +75,7 @@ static void pnp_exit_ext_func_mode(pnp_devfn_t dev) outb(0xaa, port); } -static void early_superio_config(void) +void mainboard_superio_config(void) { pnp_devfn_t dev; @@ -126,7 +120,7 @@ static void early_superio_config(void) pnp_exit_ext_func_mode(dev); } -static void rcba_config(void) +void mainboard_late_rcba_config(void) { /* Set up virtual channel 0 */ //RCBA32(0x0014) = 0x80000001; @@ -158,50 +152,3 @@ static void rcba_config(void) RCBA32(0x1e9c) = 0x000200f0; RCBA32(0x1e98) = 0x000c0801; } - -void mainboard_romstage_entry(void) -{ - int s3resume = 0; - - enable_lapic(); - - i82801gx_lpc_setup(); - mb_lpc_decode(); - early_superio_config(); - - /* Set up the console */ - console_init(); - - if (MCHBAR16(SSKPD) == 0xCAFE) { - system_reset(); - } - - /* Perform some early chipset initialization required - * before RAM initialization can work - */ - i82801gx_early_init(); - i945_early_initialization(); - - setup_special_ich7_gpios(); - - s3resume = southbridge_detect_s3_resume(); - - /* Enable SPD ROMs and DDR-II DRAM */ - enable_smbus(); - - if (CONFIG(DEBUG_RAM_SETUP)) - dump_spd_registers(); - - sdram_initialize(s3resume ? 2 : 0, NULL); - - /* This should probably go away. Until now it is required - * and mainboard specific - */ - rcba_config(); - - /* Chipset Errata! */ - fixup_i945_errata(); - - /* Initialize the internal PCIe links before we go into stage2 */ - i945_late_initialization(s3resume); -} -- cgit v1.2.3