summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/opregion.c
diff options
context:
space:
mode:
authorAbhay Kumar <abhay.kumar@intel.com>2016-11-23 10:56:48 -0800
committerAaron Durbin <adurbin@chromium.org>2016-12-02 21:51:01 +0100
commitb1feb5189b2e8955a9b945e6dfc8e92eb044b66c (patch)
tree261a6981693a17016adc67c314fe9525f0bc60b1 /src/soc/intel/common/opregion.c
parent35d7d586cd7a2a350d813697813ff8496edc1353 (diff)
downloadcoreboot-b1feb5189b2e8955a9b945e6dfc8e92eb044b66c.tar.xz
soc/intel/common: Add suppport for Extended VBT
With addition of new features in VBT its size got increased more than 6k and was unable to pass using mailbox 4 hence pass using mailbox 3 to kernel. BRANCH=none BUG=chrome-os-partner:60026 TEST=firmware screen and Chrome OS screen should come up. Change-Id: I359cf9bc402881161c9623cada689496716e04a5 Signed-off-by: Abhay Kumar <abhay.kumar@intel.com> Reviewed-on: https://review.coreboot.org/17585 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/common/opregion.c')
-rw-r--r--src/soc/intel/common/opregion.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/soc/intel/common/opregion.c b/src/soc/intel/common/opregion.c
index 44c27fb8fa..fe85d3d263 100644
--- a/src/soc/intel/common/opregion.c
+++ b/src/soc/intel/common/opregion.c
@@ -15,6 +15,7 @@
#include <console/console.h>
#include <string.h>
+#include <cbmem.h>
#include "gma.h"
#include "opregion.h"
@@ -24,6 +25,7 @@ int init_igd_opregion(igd_opregion_t *opregion)
{
struct region_device vbt_rdev;
optionrom_vbt_t *vbt;
+ optionrom_vbt_t *ext_vbt;
if (locate_vbt(&vbt_rdev) == CB_ERR) {
printk(BIOS_ERR, "VBT not found\n");
@@ -43,8 +45,22 @@ int init_igd_opregion(igd_opregion_t *opregion)
sizeof(opregion->header.signature));
memcpy(opregion->header.vbios_version, vbt->coreblock_biosbuild,
ARRAY_SIZE(vbt->coreblock_biosbuild));
- memcpy(opregion->vbt.gvd1, vbt, MIN(vbt->hdr_vbt_size,
- sizeof(opregion->vbt.gvd1)));
+ /* Extended VBT support */
+ if (vbt->hdr_vbt_size > sizeof(opregion->vbt.gvd1)) {
+ ext_vbt = cbmem_add(CBMEM_ID_EXT_VBT, vbt->hdr_vbt_size);
+
+ if (ext_vbt == NULL) {
+ printk(BIOS_ERR, "Unable to add Ext VBT to cbmem!\n");
+ return 0;
+ }
+
+ memcpy(ext_vbt, vbt, vbt->hdr_vbt_size);
+ opregion->mailbox3.rvda = (uintptr_t)ext_vbt;
+ opregion->mailbox3.rvds = vbt->hdr_vbt_size;
+ } else {
+ /* Raw VBT size which can fit in gvd1 */
+ memcpy(opregion->vbt.gvd1, vbt, vbt->hdr_vbt_size);
+ }
/* 8KiB */
opregion->header.size = sizeof(igd_opregion_t) / KiB;