[coreboot] Patch set updated: f8059c6 i945 GMA: restore tft brightness from cmos

Sven Schnelle (svens@stackframe.org) gerrit at coreboot.org
Wed Jun 15 16:10:02 CEST 2011


Sven Schnelle (svens at stackframe.org) just uploaded a new patch set to gerrit, which you can find at
http://review.coreboot.org/24

-gerrit

commit f8059c6546bfbed2f122c90c5a33096afedd6a02
Author: Sven Schnelle <svens at stackframe.org>
Date:   Sun Jun 12 14:30:10 2011 +0200

    i945 GMA: restore tft brightness from cmos
    
    Change-Id: Iaf10f125425a1abcf17ffca1d6e246f955f941cc
    Signed-off-by: Sven Schnelle <svens at stackframe.org>
---
 src/mainboard/lenovo/t60/devicetree.cb |    2 +-
 src/mainboard/lenovo/t60/romstage.c    |    2 --
 src/mainboard/lenovo/x60/devicetree.cb |    2 +-
 src/mainboard/lenovo/x60/romstage.c    |    2 --
 src/northbridge/intel/i945/chip.h      |    1 +
 src/northbridge/intel/i945/gma.c       |   13 ++++++++++++-
 6 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/mainboard/lenovo/t60/devicetree.cb b/src/mainboard/lenovo/t60/devicetree.cb
index 5419d71..73b9a9f 100644
--- a/src/mainboard/lenovo/t60/devicetree.cb
+++ b/src/mainboard/lenovo/t60/devicetree.cb
@@ -21,7 +21,7 @@
 ##
 
 chip northbridge/intel/i945
-
+	register "tft_present" = "1"
 	device lapic_cluster 0 on
 		chip cpu/intel/socket_mFCPGA478
 			device lapic 0 on end
diff --git a/src/mainboard/lenovo/t60/romstage.c b/src/mainboard/lenovo/t60/romstage.c
index aa92765..252ae40 100644
--- a/src/mainboard/lenovo/t60/romstage.c
+++ b/src/mainboard/lenovo/t60/romstage.c
@@ -336,6 +336,4 @@ void main(unsigned long bist)
 		pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
 	}
 #endif
-	/* Set legacy Brightness control to full brightness */
-	pci_write_config8(PCI_DEV(0, 2, 1), 0xf4, 0xff);
 }
diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb
index 42a45d1..887a6db 100644
--- a/src/mainboard/lenovo/x60/devicetree.cb
+++ b/src/mainboard/lenovo/x60/devicetree.cb
@@ -21,7 +21,7 @@
 ##
 
 chip northbridge/intel/i945
-
+	register "tft_present" = "1"
 	device lapic_cluster 0 on
 		chip cpu/intel/socket_mFCPGA478
 			device lapic 0 on end
diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c
index c993a35..2aa506f 100644
--- a/src/mainboard/lenovo/x60/romstage.c
+++ b/src/mainboard/lenovo/x60/romstage.c
@@ -338,6 +338,4 @@ void main(unsigned long bist)
 		pci_write_config32(PCI_DEV(0, 0x00, 0), SKPAD, SKPAD_ACPI_S3_MAGIC);
 	}
 #endif
-	/* Set legacy Brightness control to full brightness */
-	pci_write_config8(PCI_DEV(0, 2, 1), 0xf4, 0xff);
 }
diff --git a/src/northbridge/intel/i945/chip.h b/src/northbridge/intel/i945/chip.h
index 6c51394..80b4202 100644
--- a/src/northbridge/intel/i945/chip.h
+++ b/src/northbridge/intel/i945/chip.h
@@ -18,6 +18,7 @@
  */
 
 struct northbridge_intel_i945_config {
+	int tft_present;
 };
 
 extern struct chip_operations northbridge_intel_i945_ops;
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index a43ef25..30f8340 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -21,6 +21,8 @@
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
+#include <pc80/mc146818rtc.h>
+#include "chip.h"
 
 static void gma_func0_init(struct device *dev)
 {
@@ -35,13 +37,22 @@ static void gma_func0_init(struct device *dev)
 
 static void gma_func1_init(struct device *dev)
 {
+	struct northbridge_intel_i945_config *config = dev->chip_info;
 	u32 reg32;
+	u8 val;
 
 	/* IGD needs to be Bus Master, also enable IO accesss */
 	reg32 = pci_read_config32(dev, PCI_COMMAND);
 	pci_write_config32(dev, PCI_COMMAND, reg32 |
 			PCI_COMMAND_MASTER | PCI_COMMAND_IO);
-}
+
+	if (config && config->tft_present) {
+		if (!get_option(&val, "tft_brightness"))
+			pci_write_config8(dev, 0xf4, val);
+		else
+			pci_write_config8(dev, 0xf4, 0xff);
+		}
+	}
 
 static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device)
 {




More information about the coreboot mailing list