[coreboot-gerrit] Change in coreboot[master]: drv/intel/gma/opregion: Add function to set ASLS register

Patrick Rudolph (Code Review) gerrit at coreboot.org
Tue Jun 20 18:44:53 CEST 2017


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/20281


Change subject: drv/intel/gma/opregion: Add function to set ASLS register
......................................................................

drv/intel/gma/opregion: Add function to set ASLS register

Add a new method to set ASLS register that holds the
ACPI OpRegion base address.

Change-Id: I4850500ac6d58f80b0eddc81514053c87774405c
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/drivers/intel/gma/Makefile.inc
A src/drivers/intel/gma/opregion.c
M src/drivers/intel/gma/opregion.h
3 files changed, 44 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/20281/1

diff --git a/src/drivers/intel/gma/Makefile.inc b/src/drivers/intel/gma/Makefile.inc
index 43779a5..50494e1 100644
--- a/src/drivers/intel/gma/Makefile.inc
+++ b/src/drivers/intel/gma/Makefile.inc
@@ -19,6 +19,7 @@
 ramstage-$(CONFIG_INTEL_INT15) += int15.c
 endif
 ramstage-$(CONFIG_INTEL_GMA_ACPI) += acpi.c
+ramstage-$(CONFIG_INTEL_GMA_ACPI) += opregion.c
 
 
 ifeq ($(CONFIG_MAINBOARD_USE_LIBGFXINIT),y)
diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c
new file mode 100644
index 0000000..5cd04ae
--- /dev/null
+++ b/src/drivers/intel/gma/opregion.c
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Patrick Rudolph <siro at das-labor.org>
+ *
+ * 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, or (at your option)
+ * any later verion 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 <device/pci.h>
+#include <device/pci_ids.h>
+#include <device/pci_ops.h>
+#include "opregion.h"
+
+/* Write ASLS PCI register and enables SWSCI. */
+void
+intel_gma_opregion_register(uintptr_t opregion)
+{
+	device_t igd;
+	u16 reg16;
+
+	igd = dev_find_slot(0, PCI_DEVFN(0x2, 0));
+	if (!igd || !igd->enabled)
+		return;
+
+	pci_write_config32(igd, ASLS, (u32)opregion);
+
+	/* Intel's Windows driver relies on this: */
+	reg16 = pci_read_config16(igd, SWSCI);
+	reg16 &= ~GSSCIE;
+	reg16 |= SMISCISEL;
+	pci_write_config16(igd, SWSCI, reg16);
+}
diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h
index 3f94380..c590805 100644
--- a/src/drivers/intel/gma/opregion.h
+++ b/src/drivers/intel/gma/opregion.h
@@ -245,4 +245,6 @@
 	u8	coreblock_biossignon[155];
 } __attribute__((packed)) optionrom_vbt_t;
 
+void intel_gma_opregion_register(uintptr_t opregion);
+
 #endif /* _COMMON_GMA_H_ */

-- 
To view, visit https://review.coreboot.org/20281
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4850500ac6d58f80b0eddc81514053c87774405c
Gerrit-Change-Number: 20281
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170620/0c3f4d04/attachment.html>


More information about the coreboot-gerrit mailing list