summaryrefslogtreecommitdiff
path: root/src/drivers/intel
diff options
context:
space:
mode:
authorMeera Ravindranath <meera.ravindranath@intel.com>2021-07-09 12:40:28 +0530
committerPatrick Georgi <pgeorgi@google.com>2021-07-15 14:04:11 +0000
commit92637df79ab14cca151af00b8ab2de4dd9a98a68 (patch)
treebe3d4b29899a688eaa11fdcc16f878a5e01dd87f /src/drivers/intel
parent7d3e57d7a39de2122cbb6102fbc17c3d32e590ef (diff)
drivers/intel/gma: Restructure Opregion version info code
Define a structure for opregion version information to align with spec/kernel. BUG=b:190019970 BRANCH=None Signed-off-by: Meera Ravindranath <meera.ravindranath@intel.com> Change-Id: I93a9f2df186002a4e38caa910f867bce0b97ac2b Reviewed-on: https://review.coreboot.org/c/coreboot/+/56168 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/drivers/intel')
-rw-r--r--src/drivers/intel/gma/opregion.c29
-rw-r--r--src/drivers/intel/gma/opregion.h8
2 files changed, 15 insertions, 22 deletions
diff --git a/src/drivers/intel/gma/opregion.c b/src/drivers/intel/gma/opregion.c
index 799c7fdfaf..13850923eb 100644
--- a/src/drivers/intel/gma/opregion.c
+++ b/src/drivers/intel/gma/opregion.c
@@ -255,6 +255,12 @@ static enum cb_err find_vbt_location(struct region_device *rdev)
return CB_ERR;
}
+/* Function to get the IGD Opregion version */
+static struct opregion_version opregion_get_version(void)
+{
+ return (struct opregion_version) { .major = 2, .minor = 0 };
+}
+
/*
* Function to determine if we need to use extended VBT region to pass
* VBT pointer. If VBT size > 6 KiB then we need to use extended VBT
@@ -333,29 +339,12 @@ enum cb_err intel_gma_init_igd_opregion(void)
rdev_munmap(&rdev, vbt);
+ /* Get the opregion version information */
+ opregion->header.opver = opregion_get_version();
+
/* 8kb */
opregion->header.size = sizeof(igd_opregion_t) / 1024;
- /*
- * Left-shift version field to accommodate Intel Windows driver quirk
- * when not using a VBIOS.
- * Required for Legacy boot + NGI, UEFI + NGI, and UEFI + GOP driver.
- *
- * Tested on: (platform, GPU, windows driver version)
- * samsung/stumpy (SNB, GT2, 9.17.10.4459)
- * google/link (IVB, GT2, 15.33.4653)
- * google/wolf (HSW, GT1, 15.40.36.4703)
- * google/panther (HSW, GT2, 15.40.36.4703)
- * google/rikku (BDW, GT1, 15.40.36.4703)
- * google/lulu (BDW, GT2, 15.40.36.4703)
- * google/chell (SKL-Y, GT2, 15.45.21.4821)
- * google/sentry (SKL-U, GT1, 15.45.21.4821)
- * purism/librem13v2 (SKL-U, GT2, 15.45.21.4821)
- *
- * No adverse effects when using VBIOS or booting Linux.
- */
- opregion->header.version = IGD_OPREGION_VERSION << 24;
-
// FIXME We just assume we're mobile for now
opregion->header.mailboxes = MAILBOXES_MOBILE;
diff --git a/src/drivers/intel/gma/opregion.h b/src/drivers/intel/gma/opregion.h
index 879017b6a2..e363921d66 100644
--- a/src/drivers/intel/gma/opregion.h
+++ b/src/drivers/intel/gma/opregion.h
@@ -17,7 +17,12 @@
typedef struct {
u8 signature[16]; /* Offset 0 OpRegion signature */
u32 size; /* Offset 16 OpRegion size */
- u32 version; /* Offset 20 OpRegion structure version */
+ struct opregion_version {
+ u8 rsvd;
+ u8 revision;
+ u8 minor;
+ u8 major;
+ } opver; /* Offset 20 OpRegion version structure */
u8 sbios_version[32]; /* Offset 24 System BIOS build version */
u8 vbios_version[16]; /* Offset 56 Video BIOS build version */
u8 driver_version[16]; /* Offset 72 Graphic drvr build version */
@@ -29,7 +34,6 @@ typedef struct {
} __packed opregion_header_t;
#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
-#define IGD_OPREGION_VERSION 2
#define IGD_MBOX1 (1 << 0)
#define IGD_MBOX2 (1 << 1)