nb/intel/sandybridge: Make the mainboard_rcba_config hook optional

This also changes the name to mainboard_late_rcba_config to better
reflect what it does.

This adds an empty weakly linked default. The rationale behind this
change is that without an implementation of the hook some features
might not work but that the result is likely still able to boot, so it
can be made optional.

Change-Id: I1897d0f5ca7427d304a425f5256cd43c088ff936
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36781
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:42:33 +01:00 committed by Patrick Georgi
parent 934b8da442
commit 9c538348d8
45 changed files with 23 additions and 130 deletions

View File

@ -27,7 +27,7 @@ void pch_enable_lpc(void)
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0xac, 0x80000000); pci_write_config32(PCI_DEV(0, 0x1f, 0), 0xac, 0x80000000);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* Disable devices. */ /* Disable devices. */
RCBA32(0x3414) = 0x00000020; RCBA32(0x3414) = 0x00000020;

View File

@ -27,10 +27,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 0 }, { 1, 0, 0 },
{ 1, 0, 0 }, { 1, 0, 0 },

View File

@ -31,10 +31,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 0 }, { 1, 0, 0 },
{ 1, 0, 0 }, { 1, 0, 0 },

View File

@ -44,10 +44,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
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

@ -47,10 +47,6 @@ void pch_enable_lpc(void)
CNF1_LPC_EN | KBC_LPC_EN | LPT_LPC_EN | COMA_LPC_EN); CNF1_LPC_EN | KBC_LPC_EN | LPT_LPC_EN | COMA_LPC_EN);
} }
void mainboard_rcba_config(void)
{
}
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

@ -32,10 +32,6 @@ void pch_enable_lpc(void)
KBC_LPC_EN | LPT_LPC_EN | COMA_LPC_EN); KBC_LPC_EN | LPT_LPC_EN | COMA_LPC_EN);
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 0 }, { 1, 0, 0 },
{ 1, 0, 0 }, { 1, 0, 0 },

View File

@ -34,10 +34,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
/* {enable, current, oc_pin} */ /* {enable, current, oc_pin} */
{ 1, 2, 0 }, /* Port 0: USB3 front internal header, top */ { 1, 2, 0 }, /* Port 0: USB3 front internal header, top */

View File

@ -39,7 +39,7 @@ void pch_enable_lpc(void)
#endif #endif
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
RCBA32(0x3414) = 0x00000000; RCBA32(0x3414) = 0x00000000;
} }

View File

@ -87,7 +87,7 @@ void mainboard_get_spd(spd_raw_data *spd, bool id_only)
read_spd(&spd[3], 0x53, id_only); read_spd(&spd[3], 0x53, id_only);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* Enable HECI */ /* Enable HECI */
RCBA32(FD2) &= ~0x2; RCBA32(FD2) &= ~0x2;

View File

@ -27,10 +27,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 0 }, { 1, 0, 0 },
{ 1, 0, 0 }, { 1, 0, 0 },

View File

@ -35,7 +35,7 @@ void pch_enable_lpc(void)
pci_write_config16(PCH_LPC_DEV, LPC_EN, KBC_LPC_EN | MC_LPC_EN); pci_write_config16(PCH_LPC_DEV, LPC_EN, KBC_LPC_EN | MC_LPC_EN);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
u32 reg32; u32 reg32;

View File

@ -39,7 +39,7 @@ void pch_enable_lpc(void)
GAMEL_LPC_EN | COMA_LPC_EN); GAMEL_LPC_EN | COMA_LPC_EN);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* /*
* GFX INTA -> PIRQA (MSI) * GFX INTA -> PIRQA (MSI)

View File

@ -30,7 +30,7 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
u32 reg32; u32 reg32;

View File

@ -43,7 +43,7 @@ void pch_enable_lpc(void)
CNF1_LPC_EN | FDD_LPC_EN); CNF1_LPC_EN | FDD_LPC_EN);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
u32 reg32; u32 reg32;

View File

@ -24,10 +24,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, { 1, 1, 0 },
{ 0, 1, 0 }, { 0, 1, 0 },

View File

@ -23,10 +23,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, { 1, 1, 0 },
{ 1, 1, 0 }, { 1, 1, 0 },

View File

@ -27,10 +27,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, /* USB0, eSATA */ { 1, 1, 0 }, /* USB0, eSATA */
{ 1, 0, 0 }, /* USB charger */ { 1, 0, 0 }, /* USB charger */

View File

@ -26,10 +26,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, { 1, 1, 0 },
{ 1, 1, 0 }, { 1, 1, 0 },

View File

@ -27,10 +27,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, /* Dock USB3.0 */ { 1, 1, 0 }, /* Dock USB3.0 */
{ 1, 1, 0 }, /* Conn */ { 1, 1, 0 }, /* Conn */

View File

@ -31,10 +31,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, -1 }, { 1, 0, -1 },
{ 1, 0, -1 }, { 1, 0, -1 },

View File

@ -25,10 +25,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, /* SSP1: dock */ { 1, 1, 0 }, /* SSP1: dock */
{ 1, 1, 0 }, /* SSP2: left, EHCI Debug */ { 1, 1, 0 }, /* SSP2: left, EHCI Debug */

View File

@ -28,7 +28,7 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
RCBA32(BUC) = 0x00000000; RCBA32(BUC) = 0x00000000;
} }

View File

@ -31,10 +31,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 0 }, { 1, 0, 0 },
{ 1, 0, 0 }, { 1, 0, 0 },

View File

@ -31,7 +31,7 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* Disable devices */ /* Disable devices */
RCBA32(FD) |= PCH_DISABLE_P2P | PCH_DISABLE_XHCI; RCBA32(FD) |= PCH_DISABLE_P2P | PCH_DISABLE_XHCI;

View File

@ -43,11 +43,6 @@ void pch_enable_lpc(void)
} }
} }
void mainboard_rcba_config(void)
{
southbridge_configure_default_intmap();
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
const u16 port = SIO_PORT; const u16 port = SIO_PORT;

View File

@ -43,7 +43,7 @@ void pch_enable_lpc(void)
COMA_LPC_EN | COMB_LPC_EN); COMA_LPC_EN | COMB_LPC_EN);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
u32 reg32; u32 reg32;

View File

@ -26,10 +26,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, -1 }, { 1, 0, -1 },
{ 1, 0, -1 }, { 1, 0, -1 },

View File

@ -42,7 +42,7 @@ void pch_enable_lpc(void)
ec_mm_set_bit(0x3b, 4); ec_mm_set_bit(0x3b, 4);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* Disable devices. */ /* Disable devices. */
RCBA32(BUC) = 0x00000020; RCBA32(BUC) = 0x00000020;

View File

@ -54,10 +54,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
// OC3 set in bios to port 2-7, OC7 set in bios to port 10-13 // OC3 set in bios to port 2-7, OC7 set in bios to port 10-13
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, /* P0: system port 4, OC0 */ { 1, 1, 0 }, /* P0: system port 4, OC0 */

View File

@ -54,10 +54,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 0, 1, -1 }, /* P0 empty */ { 0, 1, -1 }, /* P0 empty */
{ 1, 1, 1 }, /* P1 system port 2 (To system port) (EHCI debug), OC 1 */ { 1, 1, 1 }, /* P1 system port 2 (To system port) (EHCI debug), OC 1 */

View File

@ -53,10 +53,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
/* FIXME: used T530 values here */ /* FIXME: used T530 values here */
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, { 1, 1, 0 },

View File

@ -24,10 +24,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
void mainboard_config_superio(void) void mainboard_config_superio(void)
{ {
} }

View File

@ -56,10 +56,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 }, /* P0 left dual conn, OC 0 */ { 1, 1, 0 }, /* P0 left dual conn, OC 0 */
{ 1, 1, 1 }, /* P1 system onboard USB (eSATA), (EHCI debug), OC 1 */ { 1, 1, 1 }, /* P1 system onboard USB (eSATA), (EHCI debug), OC 1 */

View File

@ -56,10 +56,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
void mainboard_early_init(int s3resume) void mainboard_early_init(int s3resume)
{ {
hybrid_graphics_init(); hybrid_graphics_init();

View File

@ -24,10 +24,6 @@ void pch_enable_lpc(void)
{ {
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{1, 1, 0}, /* P0: USB 3.0 1 (OC0) */ {1, 1, 0}, /* P0: USB 3.0 1 (OC0) */
{1, 1, 0}, /* P1: USB 3.0 2 (OC0) */ {1, 1, 0}, /* P1: USB 3.0 2 (OC0) */

View File

@ -68,10 +68,6 @@ static uint8_t *get_spd_data(int spd_index)
return spd_file + spd_index * 256; return spd_file + spd_index * 256;
} }
void mainboard_rcba_config(void)
{
}
void mainboard_get_spd(spd_raw_data *spd, bool id_only) void mainboard_get_spd(spd_raw_data *spd, bool id_only)
{ {
uint8_t *memory; uint8_t *memory;

View File

@ -32,10 +32,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
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

@ -29,10 +29,6 @@ void pch_enable_lpc(void)
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000);
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 0, 0 }, /* P0 (left, fan side), OC 0 */ { 1, 0, 0 }, /* P0 (left, fan side), OC 0 */
{ 1, 0, 1 }, /* P1 (left touchpad side), OC 1 */ { 1, 0, 1 }, /* P1 (left touchpad side), OC 1 */

View File

@ -28,10 +28,6 @@ void pch_enable_lpc(void)
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0xa4, reg16); pci_write_config16(PCI_DEV(0, 0x1f, 0), 0xa4, reg16);
} }
void mainboard_rcba_config(void)
{
}
const struct southbridge_usb_port mainboard_usb_ports[] = { const struct southbridge_usb_port mainboard_usb_ports[] = {
{1, 0, 0}, {1, 0, 0},
{1, 0, 0}, {1, 0, 0},

View File

@ -16,7 +16,7 @@
#include <northbridge/intel/sandybridge/sandybridge.h> #include <northbridge/intel/sandybridge/sandybridge.h>
#include <southbridge/intel/bd82x6x/pch.h> #include <southbridge/intel/bd82x6x/pch.h>
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
u32 reg32; u32 reg32;

View File

@ -51,7 +51,7 @@ void pch_enable_lpc(void)
#endif #endif
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* /*
* GFX INTA -> PIRQA (MSI) * GFX INTA -> PIRQA (MSI)

View File

@ -62,7 +62,7 @@ void pch_enable_lpc(void)
#endif #endif
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* /*
* GFX INTA -> PIRQA (MSI) * GFX INTA -> PIRQA (MSI)

View File

@ -26,7 +26,7 @@ void pch_enable_lpc(void)
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0xac, 0x00010000); pci_write_config32(PCI_DEV(0, 0x1f, 0), 0xac, 0x00010000);
} }
void mainboard_rcba_config(void) void mainboard_late_rcba_config(void)
{ {
/* Disable devices. */ /* Disable devices. */
RCBA32(0x3414) = 0x00000020; RCBA32(0x3414) = 0x00000020;

View File

@ -34,6 +34,10 @@ __weak void mainboard_early_init(int s3_resume)
{ {
} }
__weak void mainboard_late_rcba_config(void)
{
}
static void early_pch_reset_pmcon(void) static void early_pch_reset_pmcon(void)
{ {
u8 reg8; u8 reg8;
@ -100,7 +104,7 @@ void mainboard_romstage_entry(void)
southbridge_configure_default_intmap(); southbridge_configure_default_intmap();
southbridge_rcba_config(); southbridge_rcba_config();
mainboard_rcba_config(); mainboard_late_rcba_config();
post_code(0x3d); post_code(0x3d);

View File

@ -72,7 +72,9 @@ int smbus_read_byte(unsigned int device, unsigned int address);
void early_thermal_init(void); void early_thermal_init(void);
void southbridge_configure_default_intmap(void); void southbridge_configure_default_intmap(void);
void southbridge_rcba_config(void); void southbridge_rcba_config(void);
void mainboard_rcba_config(void); /* Optional mainboard hook to do additional configuration
on the RCBA config space. It is called after the raminit. */
void mainboard_late_rcba_config(void);
void early_pch_init_native(void); void early_pch_init_native(void);
void early_pch_init(void); void early_pch_init(void);
void early_pch_init_native_dmi_pre(void); void early_pch_init_native_dmi_pre(void);