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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36780
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Arthur Heymans 2019-11-12 16:17:26 +01:00 committed by Patrick Georgi
parent 05d7d82d37
commit dc2e7c6e0f
35 changed files with 6 additions and 132 deletions

View File

@ -49,10 +49,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, -1 }, { 1, 0, -1 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -48,10 +48,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
/* Set GPIOs on superio, enable UART */ /* Set GPIOs on superio, enable UART */

View File

@ -52,10 +52,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
nuvoton_pnp_enter_conf_state(SIO_DEV); nuvoton_pnp_enter_conf_state(SIO_DEV);

View File

@ -48,10 +48,6 @@ void mainboard_rcba_config(void)
{ {
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
static const pnp_devfn_t GLOBAL_PSEUDO_DEV = PNP_DEV(0x2e, 0); static const pnp_devfn_t GLOBAL_PSEUDO_DEV = PNP_DEV(0x2e, 0);

View File

@ -51,10 +51,6 @@ void mainboard_rcba_config(void)
{ {
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);

View File

@ -53,10 +53,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
/* Enable UART */ /* Enable UART */

View File

@ -56,10 +56,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 0, 2, 6 } /* Port 13: Unused. Asus propietary DEBUG_PORT ??? */ { 0, 2, 6 } /* Port 13: Unused. Asus propietary DEBUG_PORT ??? */
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
/* Setup COM/UART */ /* Setup COM/UART */

View File

@ -60,10 +60,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
const u16 port = SIO_PORT; const u16 port = SIO_PORT;

View File

@ -78,10 +78,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 5, 6 }, { 1, 5, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
/* FIXME: The GA-B75M-D3V only has two DIMM slots! */ /* FIXME: The GA-B75M-D3V only has two DIMM slots! */
void mainboard_get_spd(spd_raw_data *spd, bool id_only) void mainboard_get_spd(spd_raw_data *spd, bool id_only)
{ {

View File

@ -48,10 +48,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
if (!CONFIG(NO_UART_ON_SUPERIO)) { if (!CONFIG(NO_UART_ON_SUPERIO)) {

View File

@ -112,10 +112,6 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
read_spd(&spd[2], 0x52, id_only); read_spd(&spd[2], 0x52, id_only);
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -84,10 +84,6 @@ void mainboard_rcba_config(void)
RCBA32(FD) = reg32; RCBA32(FD) = reg32;
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_fill_pei_data(struct pei_data *pei_data) void mainboard_fill_pei_data(struct pei_data *pei_data)
{ {
struct pei_data pei_data_template = { struct pei_data pei_data_template = {

View File

@ -45,10 +45,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 0, 0, 6 }, { 0, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
kbc1126_enter_conf(); kbc1126_enter_conf();

View File

@ -44,10 +44,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 6 }, { 1, 1, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
kbc1126_enter_conf(); kbc1126_enter_conf();

View File

@ -48,10 +48,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, /* docking */ { 1, 0, 6 }, /* docking */
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);

View File

@ -47,10 +47,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);

View File

@ -48,10 +48,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, /* Conn (eSATA Combo) */ { 1, 0, 6 }, /* Conn (eSATA Combo) */
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); lpc47n217_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);

View File

@ -52,10 +52,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, -1 }, { 1, 0, -1 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
if (CONFIG(CONSOLE_SERIAL)) if (CONFIG(CONSOLE_SERIAL))

View File

@ -46,10 +46,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 0, 0, 6 }, /* B1P6 */ { 0, 0, 6 }, /* B1P6 */
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
kbc1126_enter_conf(); kbc1126_enter_conf();

View File

@ -50,10 +50,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 0, 0, 6 }, /* B1P6 */ { 0, 0, 6 }, /* B1P6 */
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
kbc1126_enter_conf(); kbc1126_enter_conf();

View File

@ -52,10 +52,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 7 }, { 1, 0, 7 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
if (CONFIG(CONSOLE_SERIAL)) if (CONFIG(CONSOLE_SERIAL))

View File

@ -52,10 +52,6 @@ void mainboard_rcba_config(void)
MCHBAR32(0x0104) |= 0x00001000; MCHBAR32(0x0104) |= 0x00001000;
} }
void mainboard_early_init(int s3resume)
{
}
static const u16 hwm_initvals[] = { static const u16 hwm_initvals[] = {
HWM_BANK(0), HWM_BANK(0),
HWM_INITVAL(0xae, 0x01), /* Enable PECI Agent0 */ HWM_INITVAL(0xae, 0x01), /* Enable PECI Agent0 */

View File

@ -153,10 +153,6 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
read_spd(&spd[2], 0x52, id_only); read_spd(&spd[2], 0x52, id_only);
} }
void mainboard_early_init(int s3resume)
{
}
int mainboard_should_reset_usb(int s3resume) int mainboard_should_reset_usb(int s3resume)
{ {
return !s3resume; return !s3resume;

View File

@ -47,10 +47,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, -1 }, { 1, 0, -1 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -64,10 +64,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 6 }, { 1, 1, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -54,7 +54,3 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
memcpy(&spd[0], spd_file, spd_file_len); memcpy(&spd[0], spd_file, spd_file_len);
read_spd(&spd[2], 0x51, id_only); read_spd(&spd[2], 0x51, id_only);
} }
void mainboard_early_init(int s3resume)
{
}

View File

@ -51,10 +51,6 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
read_spd(&spd[2], 0x52, id_only); read_spd(&spd[2], 0x52, id_only);
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -104,10 +104,6 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
memcpy(&spd[2], memory, 256); memcpy(&spd[2], memory, 256);
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -91,10 +91,6 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
read_spd (&spd[2], 0x51, id_only); read_spd (&spd[2], 0x51, id_only);
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -56,10 +56,6 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
read_spd (&spd[2], 0x51, id_only); read_spd (&spd[2], 0x51, id_only);
} }
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -49,10 +49,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{1, 0, 6}, {1, 0, 6},
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -27,10 +27,6 @@ void mainboard_rcba_config(void)
RCBA32(FD) = reg32; RCBA32(FD) = reg32;
} }
void mainboard_early_init(int s3resume)
{
}
int mainboard_should_reset_usb(int s3resume) int mainboard_should_reset_usb(int s3resume)
{ {
return !s3resume; return !s3resume;

View File

@ -48,10 +48,6 @@ const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 6 }, { 1, 0, 6 },
}; };
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -30,6 +30,10 @@
#include <southbridge/intel/common/pmclib.h> #include <southbridge/intel/common/pmclib.h>
#include <elog.h> #include <elog.h>
__weak void mainboard_early_init(int s3_resume)
{
}
static void early_pch_reset_pmcon(void) static void early_pch_reset_pmcon(void)
{ {
u8 reg8; u8 reg8;

View File

@ -213,6 +213,8 @@ void northbridge_romstage_finalize(int s3resume);
void early_init_dmi(void); void early_init_dmi(void);
void pch_enable_lpc(void); 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_early_init(int s3resume);
void mainboard_config_superio(void); void mainboard_config_superio(void);
int mainboard_should_reset_usb(int s3resume); int mainboard_should_reset_usb(int s3resume);