From ff4025c5f789b80e6552dd887c34c34642a98c64 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sun, 14 Jan 2018 12:34:43 +0100 Subject: sb/intel/bd82x6x: Reduce function-disable mess MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most affected boards set the function disabled (FD) register to an arbitrary state dumped from systems running the vendor BIOS. This makes it impossible to enable the devices in devicetree and a pretty big mess of course because nobody cared to keep the register in sync with the devicetree. To get completely rid of most of the writes to FD, move setting of PCH_DISABLE_ALWAYS into the southbridge code where it belongs. Change-Id: Ia2a507cbcdf218d09738e2e16f0d3ad1dcf57b8b Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/23255 Tested-by: build bot (Jenkins) Reviewed-by: Hal Martin Reviewed-by: Stefan Reinauer Reviewed-by: Kyösti Mälkki Reviewed-by: Paul Menzel Reviewed-by: Bill XIE Reviewed-by: Arthur Heymans --- src/mainboard/lenovo/l520/romstage.c | 5 +---- src/mainboard/lenovo/s230u/romstage.c | 4 +--- src/mainboard/lenovo/t420/romstage.c | 5 ++--- src/mainboard/lenovo/t420s/romstage.c | 4 +--- src/mainboard/lenovo/t430/romstage.c | 5 +---- src/mainboard/lenovo/t430s/romstage.c | 4 +--- src/mainboard/lenovo/t520/romstage.c | 4 +--- src/mainboard/lenovo/t530/romstage.c | 4 +--- src/mainboard/lenovo/x131e/romstage.c | 3 +-- src/mainboard/lenovo/x1_carbon_gen1/romstage.c | 2 +- src/mainboard/lenovo/x220/romstage.c | 4 +--- src/mainboard/lenovo/x230/romstage.c | 4 +--- 12 files changed, 13 insertions(+), 35 deletions(-) (limited to 'src/mainboard/lenovo') diff --git a/src/mainboard/lenovo/l520/romstage.c b/src/mainboard/lenovo/l520/romstage.c index 84590ae5dc..0f6ffede3d 100644 --- a/src/mainboard/lenovo/l520/romstage.c +++ b/src/mainboard/lenovo/l520/romstage.c @@ -32,12 +32,9 @@ void pch_enable_lpc(void) pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x90, 0x00000000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable devices. */ RCBA32(0x3414) = 0x00000000; - RCBA32(0x3418) = 0x00000000; - } const struct southbridge_usb_port mainboard_usb_ports[] = { { 1, 0, -1 }, diff --git a/src/mainboard/lenovo/s230u/romstage.c b/src/mainboard/lenovo/s230u/romstage.c index 43a3d52291..b83eeaec73 100644 --- a/src/mainboard/lenovo/s230u/romstage.c +++ b/src/mainboard/lenovo/s230u/romstage.c @@ -55,12 +55,10 @@ void pch_enable_lpc(void) ec_mm_set_bit(0x3b, 4); } -void rcba_config(void) +void mainboard_rcba_config(void) { /* Disable devices. */ RCBA32(0x3414) = 0x00000020; - RCBA32(0x3418) = 0x17f41fe3; - } const struct southbridge_usb_port mainboard_usb_ports[] = { { 1, 1, 0 }, diff --git a/src/mainboard/lenovo/t420/romstage.c b/src/mainboard/lenovo/t420/romstage.c index 9f178ea741..36e83a3c72 100644 --- a/src/mainboard/lenovo/t420/romstage.c +++ b/src/mainboard/lenovo/t420/romstage.c @@ -60,12 +60,11 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x1ea51fe3; RCBA32(BUC) = 0; } + // OC3 set in bios to port 2-7, OC7 set in bios to port 10-13 const struct southbridge_usb_port mainboard_usb_ports[] = { { 1, 1, 0 }, /* P0: system port 4, OC0 */ diff --git a/src/mainboard/lenovo/t420s/romstage.c b/src/mainboard/lenovo/t420s/romstage.c index ad49637e2c..55011cf2e2 100644 --- a/src/mainboard/lenovo/t420s/romstage.c +++ b/src/mainboard/lenovo/t420s/romstage.c @@ -62,10 +62,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x1eb51fe3; RCBA32(BUC) = 0; } diff --git a/src/mainboard/lenovo/t430/romstage.c b/src/mainboard/lenovo/t430/romstage.c index eb558ac1b8..94679df0a6 100644 --- a/src/mainboard/lenovo/t430/romstage.c +++ b/src/mainboard/lenovo/t430/romstage.c @@ -57,11 +57,8 @@ void pch_enable_lpc(void) (0x0c << 16) | EC_LENOVO_PMH7_BASE | 1); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific, reserved only). - * FIXME: Test if reserved bits are read only. */ - RCBA32(FD) = PCH_DISABLE_ALWAYS | 0x10001fe0; } /* FIXME: used T530 values here */ diff --git a/src/mainboard/lenovo/t430s/romstage.c b/src/mainboard/lenovo/t430s/romstage.c index 89ef10cd2b..3f6d9f2836 100644 --- a/src/mainboard/lenovo/t430s/romstage.c +++ b/src/mainboard/lenovo/t430s/romstage.c @@ -36,10 +36,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x17e81fe3; RCBA32(BUC) = 0; } diff --git a/src/mainboard/lenovo/t520/romstage.c b/src/mainboard/lenovo/t520/romstage.c index b5ea17cbac..d6e5edd92d 100644 --- a/src/mainboard/lenovo/t520/romstage.c +++ b/src/mainboard/lenovo/t520/romstage.c @@ -76,10 +76,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x1ee51fe3; RCBA32(BUC) = 0; } diff --git a/src/mainboard/lenovo/t530/romstage.c b/src/mainboard/lenovo/t530/romstage.c index cd2e0e108c..f8bb490323 100644 --- a/src/mainboard/lenovo/t530/romstage.c +++ b/src/mainboard/lenovo/t530/romstage.c @@ -64,10 +64,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x17f81fe3; RCBA32(BUC) = 0; } diff --git a/src/mainboard/lenovo/x131e/romstage.c b/src/mainboard/lenovo/x131e/romstage.c index 707848b9b3..43e0bd7dfb 100644 --- a/src/mainboard/lenovo/x131e/romstage.c +++ b/src/mainboard/lenovo/x131e/romstage.c @@ -33,9 +33,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, LPC_GEN4_DEC, 0x000c06a1); } -void rcba_config(void) +void mainboard_rcba_config(void) { - RCBA32(FD) |= PCH_DISABLE_ALWAYS; } const struct southbridge_usb_port mainboard_usb_ports[] = { diff --git a/src/mainboard/lenovo/x1_carbon_gen1/romstage.c b/src/mainboard/lenovo/x1_carbon_gen1/romstage.c index 5f7b82e81a..029d867b74 100644 --- a/src/mainboard/lenovo/x1_carbon_gen1/romstage.c +++ b/src/mainboard/lenovo/x1_carbon_gen1/romstage.c @@ -86,7 +86,7 @@ static uint8_t *get_spd_data(int spd_index) return spd_file + spd_index * 256; } -void rcba_config(void) +void mainboard_rcba_config(void) { } diff --git a/src/mainboard/lenovo/x220/romstage.c b/src/mainboard/lenovo/x220/romstage.c index fa52778608..a6c5793359 100644 --- a/src/mainboard/lenovo/x220/romstage.c +++ b/src/mainboard/lenovo/x220/romstage.c @@ -47,10 +47,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x1fa41fe3; RCBA32(BUC) = 0; } diff --git a/src/mainboard/lenovo/x230/romstage.c b/src/mainboard/lenovo/x230/romstage.c index 4d8f330b2a..1a7decce59 100644 --- a/src/mainboard/lenovo/x230/romstage.c +++ b/src/mainboard/lenovo/x230/romstage.c @@ -50,10 +50,8 @@ void pch_enable_lpc(void) pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); } -void rcba_config(void) +void mainboard_rcba_config(void) { - /* Disable unused devices (board specific) */ - RCBA32(FD) = 0x17f81fe3; RCBA32(BUC) = 0; } -- cgit v1.2.3