Alex James has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32752
Change subject: [WIP] mb/gigabyte/ga-b75m-d3{h,v}: Various cleanups ......................................................................
[WIP] mb/gigabyte/ga-b75m-d3{h,v}: Various cleanups
- Unconditionally enable LPC TPM support - Remove unused Super I/O ACPI definitions - Remove duplicate chipset register initialization from mainboard_init and move mainboard.c to the common baseboard tree - Move ITE Super I/O configuration to mainboard_config_superio
TODO: - Add extracted VBTs from vendor firmware and set INTEL_GMA_HAVE_VBT - Fix mainboard_get_spd - should probably only read spd[0, 2]
Signed-off-by: Alex James theracermaster@gmail.com Change-Id: I2d11c55dc809b920bccf55f5f745d9f29b18bbb6 --- M src/mainboard/gigabyte/ga-panther-point/Kconfig M src/mainboard/gigabyte/ga-panther-point/Makefile.inc M src/mainboard/gigabyte/ga-panther-point/acpi/superio.asl A src/mainboard/gigabyte/ga-panther-point/mainboard.c M src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/devicetree.cb D src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/mainboard.c M src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/romstage.c M src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/devicetree.cb D src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/mainboard.c M src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/romstage.c 10 files changed, 80 insertions(+), 201 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/32752/1
diff --git a/src/mainboard/gigabyte/ga-panther-point/Kconfig b/src/mainboard/gigabyte/ga-panther-point/Kconfig index ce7e195..4533c55 100644 --- a/src/mainboard/gigabyte/ga-panther-point/Kconfig +++ b/src/mainboard/gigabyte/ga-panther-point/Kconfig @@ -26,7 +26,7 @@ select INTEL_INT15 select SERIRQ_CONTINUOUS_MODE select MAINBOARD_HAS_LIBGFXINIT - select MAINBOARD_HAS_LPC_TPM if BOARD_GIGABYTE_GA_B75M_D3H + select MAINBOARD_HAS_LPC_TPM
if BOARD_GIGABYTE_BASEBOARD_GA_PANTHER_POINT
diff --git a/src/mainboard/gigabyte/ga-panther-point/Makefile.inc b/src/mainboard/gigabyte/ga-panther-point/Makefile.inc index feb9532..08a9957 100644 --- a/src/mainboard/gigabyte/ga-panther-point/Makefile.inc +++ b/src/mainboard/gigabyte/ga-panther-point/Makefile.inc @@ -16,7 +16,6 @@ romstage-y += variants/$(VARIANT_DIR)/gpio.c romstage-y += variants/$(VARIANT_DIR)/romstage.c
-ramstage-y += variants/$(VARIANT_DIR)/mainboard.c ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads
subdirs-y += variants/$(VARIANT_DIR) diff --git a/src/mainboard/gigabyte/ga-panther-point/acpi/superio.asl b/src/mainboard/gigabyte/ga-panther-point/acpi/superio.asl index 78bf687..e69de29 100644 --- a/src/mainboard/gigabyte/ga-panther-point/acpi/superio.asl +++ b/src/mainboard/gigabyte/ga-panther-point/acpi/superio.asl @@ -1,19 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -/* mainboard configuration */ - -#define SIO_EC_ENABLE_PS2K // Enable PS/2 Keyboard -#define SIO_ENABLE_PS2M // Enable PS/2 Mouse diff --git a/src/mainboard/gigabyte/ga-panther-point/mainboard.c b/src/mainboard/gigabyte/ga-panther-point/mainboard.c new file mode 100644 index 0000000..d2da2c6 --- /dev/null +++ b/src/mainboard/gigabyte/ga-panther-point/mainboard.c @@ -0,0 +1,39 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * Copyright (C) 2011-2012 Google Inc. + * Copyright (C) 2014 Vladimir Serbinenko + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <device/device.h> +#include <drivers/intel/gma/int15.h> +#include <southbridge/intel/bd82x6x/pch.h> + +static void mainboard_init(struct device *dev) +{ +} + +// mainboard_enable is executed as first thing after +// enumerate_buses(). +static void mainboard_enable(struct device *dev) +{ + dev->ops->init = mainboard_init; + + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_NONE, + GMA_INT15_PANEL_FIT_DEFAULT, + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); +} + +struct chip_operations mainboard_ops = { + .enable_dev = mainboard_enable, +}; diff --git a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/devicetree.cb b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/devicetree.cb index 7a3568a..15454a5 100644 --- a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/devicetree.cb +++ b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/devicetree.cb @@ -21,11 +21,11 @@
device domain 0 on subsystemid 0x1458 0x5000 inherit - device pci 00.0 on # host bridge + device pci 00.0 on # Host bridge subsystemid 0x1458 0x5000 end device pci 01.0 on end # PCIe Bridge for discrete graphics - device pci 02.0 on # vga controller + device pci 02.0 on # Integrated VGA controller subsystemid 0x1458 0xd000 end
@@ -109,7 +109,7 @@ end
chip drivers/pc80/tpm - device pnp 0c31.0 on end + device pnp 0c31.0 on end end end device pci 1f.2 on # SATA Controller 1 diff --git a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/mainboard.c b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/mainboard.c deleted file mode 100644 index 4e8d9f5..0000000 --- a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/mainboard.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2007-2009 coresystems GmbH - * Copyright (C) 2011-2012 Google Inc. - * Copyright (C) 2014 Vladimir Serbinenko - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include <device/device.h> -#include <drivers/intel/gma/int15.h> -#include <southbridge/intel/bd82x6x/pch.h> - -static void mainboard_init(struct device *dev) -{ - RCBA32(0x38c8) = 0x00002005; - RCBA32(0x38c4) = 0x00802005; - RCBA32(0x2240) = 0x00330e71; - RCBA32(0x2244) = 0x003f0eb1; - RCBA32(0x2248) = 0x002102cd; - RCBA32(0x224c) = 0x00f60000; - RCBA32(0x2250) = 0x00020000; - RCBA32(0x2254) = 0x00e3004c; - RCBA32(0x2258) = 0x00e20bef; - RCBA32(0x2260) = 0x003304ed; - RCBA32(0x2278) = 0x001107c1; - RCBA32(0x227c) = 0x001d07e9; - RCBA32(0x2280) = 0x00e20000; - RCBA32(0x2284) = 0x00ee0000; - RCBA32(0x2288) = 0x005b05d3; - RCBA32(0x2318) = 0x04b8ff2e; - RCBA32(0x231c) = 0x03930f2e; - RCBA32(0x3808) = 0x005044a3; - RCBA32(0x3810) = 0x52410000; - RCBA32(0x3814) = 0x0000008a; - RCBA32(0x3818) = 0x00000006; - RCBA32(0x381c) = 0x0000072e; - RCBA32(0x3820) = 0x0000000a; - RCBA32(0x3824) = 0x00000123; - RCBA32(0x3828) = 0x00000009; - RCBA32(0x382c) = 0x00000001; - RCBA32(0x3834) = 0x0000061a; - RCBA32(0x3838) = 0x00000003; - RCBA32(0x383c) = 0x00000a76; - RCBA32(0x3840) = 0x00000004; - RCBA32(0x3844) = 0x0000e5e4; - RCBA32(0x3848) = 0x0000000e; -} - -// mainboard_enable is executed as first thing after -// enumerate_buses(). - -static void mainboard_enable(struct device *dev) -{ - dev->ops->init = mainboard_init; - - install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_NONE, - GMA_INT15_PANEL_FIT_DEFAULT, - GMA_INT15_BOOT_DISPLAY_CRT, 0); -} - -struct chip_operations mainboard_ops = { - .enable_dev = mainboard_enable, -}; diff --git a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/romstage.c b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/romstage.c index aa5f484..eb88d36 100644 --- a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/romstage.c +++ b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3h/romstage.c @@ -25,12 +25,6 @@ #define SIO_GPIO PNP_DEV(SUPERIO_BASE, IT8728F_GPIO) #define SERIAL_DEV PNP_DEV(SUPERIO_BASE, 0x01)
-void mainboard_rcba_config(void) -{ - /* Enable HECI */ - RCBA32(FD2) &= ~0x2; -} - void pch_enable_lpc(void) { pci_write_config16(PCH_LPC_DEV, LPC_EN, KBC_LPC_EN | @@ -40,7 +34,10 @@ pci_write_config16(PCH_LPC_DEV, LPC_IO_DEC, 0x10);
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); +}
+void mainboard_config_superio(void) +{ /* Initialize SuperIO */ ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
@@ -87,18 +84,21 @@ { 1, 5, 6 }, };
-void mainboard_get_spd(spd_raw_data *spd, bool id_only) -{ - read_spd (&spd[0], 0x50, id_only); - read_spd (&spd[1], 0x51, id_only); - read_spd (&spd[2], 0x52, id_only); - read_spd (&spd[3], 0x53, id_only); -} - void mainboard_early_init(int s3resume) { }
-void mainboard_config_superio(void) +/* FIXME: This board only has two DIMM slots! */ +void mainboard_get_spd(spd_raw_data *spd, bool id_only) { + read_spd(&spd[0], 0x50, id_only); + read_spd(&spd[1], 0x51, id_only); + read_spd(&spd[2], 0x52, id_only); + read_spd(&spd[3], 0x53, id_only); +} + +void mainboard_rcba_config(void) +{ + /* Enable HECI */ + RCBA32(FD2) &= ~0x2; } diff --git a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/devicetree.cb b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/devicetree.cb index a00e2ee..15454a5 100644 --- a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/devicetree.cb +++ b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/devicetree.cb @@ -1,4 +1,5 @@ chip northbridge/intel/sandybridge + # IGD Displays register "gfx.ndid" = "3" register "gfx.did" = "{ 0x80000100, 0x80000240, 0x80000410 }"
@@ -20,11 +21,11 @@
device domain 0 on subsystemid 0x1458 0x5000 inherit - device pci 00.0 on # host bridge + device pci 00.0 on # Host bridge subsystemid 0x1458 0x5000 end device pci 01.0 on end # PCIe Bridge for discrete graphics - device pci 02.0 on # vga controller + device pci 02.0 on # Integrated VGA controller subsystemid 0x1458 0xd000 end
@@ -106,6 +107,10 @@ device pnp 2e.7 off end # GPIO device pnp 2e.a off end # IR end + + chip drivers/pc80/tpm + device pnp 0c31.0 on end + end end device pci 1f.2 on # SATA Controller 1 subsystemid 0x1458 0xb005 diff --git a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/mainboard.c b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/mainboard.c deleted file mode 100644 index 4e8d9f5..0000000 --- a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/mainboard.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2007-2009 coresystems GmbH - * Copyright (C) 2011-2012 Google Inc. - * Copyright (C) 2014 Vladimir Serbinenko - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include <device/device.h> -#include <drivers/intel/gma/int15.h> -#include <southbridge/intel/bd82x6x/pch.h> - -static void mainboard_init(struct device *dev) -{ - RCBA32(0x38c8) = 0x00002005; - RCBA32(0x38c4) = 0x00802005; - RCBA32(0x2240) = 0x00330e71; - RCBA32(0x2244) = 0x003f0eb1; - RCBA32(0x2248) = 0x002102cd; - RCBA32(0x224c) = 0x00f60000; - RCBA32(0x2250) = 0x00020000; - RCBA32(0x2254) = 0x00e3004c; - RCBA32(0x2258) = 0x00e20bef; - RCBA32(0x2260) = 0x003304ed; - RCBA32(0x2278) = 0x001107c1; - RCBA32(0x227c) = 0x001d07e9; - RCBA32(0x2280) = 0x00e20000; - RCBA32(0x2284) = 0x00ee0000; - RCBA32(0x2288) = 0x005b05d3; - RCBA32(0x2318) = 0x04b8ff2e; - RCBA32(0x231c) = 0x03930f2e; - RCBA32(0x3808) = 0x005044a3; - RCBA32(0x3810) = 0x52410000; - RCBA32(0x3814) = 0x0000008a; - RCBA32(0x3818) = 0x00000006; - RCBA32(0x381c) = 0x0000072e; - RCBA32(0x3820) = 0x0000000a; - RCBA32(0x3824) = 0x00000123; - RCBA32(0x3828) = 0x00000009; - RCBA32(0x382c) = 0x00000001; - RCBA32(0x3834) = 0x0000061a; - RCBA32(0x3838) = 0x00000003; - RCBA32(0x383c) = 0x00000a76; - RCBA32(0x3840) = 0x00000004; - RCBA32(0x3844) = 0x0000e5e4; - RCBA32(0x3848) = 0x0000000e; -} - -// mainboard_enable is executed as first thing after -// enumerate_buses(). - -static void mainboard_enable(struct device *dev) -{ - dev->ops->init = mainboard_init; - - install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_NONE, - GMA_INT15_PANEL_FIT_DEFAULT, - GMA_INT15_BOOT_DISPLAY_CRT, 0); -} - -struct chip_operations mainboard_ops = { - .enable_dev = mainboard_enable, -}; diff --git a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/romstage.c b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/romstage.c index 035e20e..eb88d36 100644 --- a/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/romstage.c +++ b/src/mainboard/gigabyte/ga-panther-point/variants/ga-b75m-d3v/romstage.c @@ -25,12 +25,6 @@ #define SIO_GPIO PNP_DEV(SUPERIO_BASE, IT8728F_GPIO) #define SERIAL_DEV PNP_DEV(SUPERIO_BASE, 0x01)
-void mainboard_rcba_config(void) -{ - /* Enable HECI */ - RCBA32(FD2) &= ~0x2; -} - void pch_enable_lpc(void) { pci_write_config16(PCH_LPC_DEV, LPC_EN, KBC_LPC_EN | @@ -40,7 +34,10 @@ pci_write_config16(PCH_LPC_DEV, LPC_IO_DEC, 0x10);
pci_write_config32(PCH_LPC_DEV, ETR3, 0x10000); +}
+void mainboard_config_superio(void) +{ /* Initialize SuperIO */ ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
@@ -87,19 +84,21 @@ { 1, 5, 6 }, };
-/* FIXME: This board only has two DIMM slots! */ -void mainboard_get_spd(spd_raw_data *spd, bool id_only) -{ - read_spd (&spd[0], 0x50, id_only); - read_spd (&spd[1], 0x51, id_only); - read_spd (&spd[2], 0x52, id_only); - read_spd (&spd[3], 0x53, id_only); -} - void mainboard_early_init(int s3resume) { }
-void mainboard_config_superio(void) +/* FIXME: This board only has two DIMM slots! */ +void mainboard_get_spd(spd_raw_data *spd, bool id_only) { + read_spd(&spd[0], 0x50, id_only); + read_spd(&spd[1], 0x51, id_only); + read_spd(&spd[2], 0x52, id_only); + read_spd(&spd[3], 0x53, id_only); +} + +void mainboard_rcba_config(void) +{ + /* Enable HECI */ + RCBA32(FD2) &= ~0x2; }