Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1282
-gerrit
commit d4fe2ff5ff318f6125f3aa23d862e37d554f6ff3
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Wed Jun 13 13:12:19 2012 -0700
chromeos: Pass pointer to ChromeOS ACPI structure instead of VB Shared Data
coreboot used to pass some information to u-boot in the coreboot table
and other information in a modified flat device tree. Since the FDT code
was never upstreamed and removed from our tree, u-boot was changed to
get the information it needs from the coreboot table alone. However,
in the process of this change only the vboot shared data structure was
passed on by coreboot, so when u-boot tried to update the ChromeOS
specific ACPI entries, it would accidently overwrite the vboot data.
This patch passes on the ChromeOS specific ACPI data structure instead
of the vboot shared data. Another change to u-boot will teach it how
to get to the vboot shared data from there.
Change-Id: Ifbb64eafc0d9967887b4cdeebf97d0c4ce019290
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/arch/x86/include/arch/acpi.h | 4 ----
src/vendorcode/google/chromeos/gnvs.c | 9 ++++++++-
src/vendorcode/google/chromeos/gnvs.h | 1 +
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 8c8106d..0b2cbf4 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -523,8 +523,4 @@ void generate_cpu_entries(void);
#endif /* CONFIG_GENERATE_ACPI_TABLES */
-#if CONFIG_CHROMEOS
-void acpi_get_vdat_info(void **vdat_addr, uint32_t *vdat_size);
-#endif /* CONFIG_CHROMEOS */
-
#endif /* __ASM_ACPI_H */
diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c
index 024dbf8..aaca95a 100644
--- a/src/vendorcode/google/chromeos/gnvs.c
+++ b/src/vendorcode/google/chromeos/gnvs.c
@@ -23,7 +23,7 @@
#include <console/console.h>
#include "gnvs.h"
-chromeos_acpi_t *vboot_data;
+chromeos_acpi_t *vboot_data = NULL;
static u32 me_hash_saved[8];
void chromeos_init_vboot(chromeos_acpi_t *chromeos)
@@ -41,7 +41,14 @@ void chromeos_set_me_hash(u32 *hash, int len)
/* Copy to NVS or save until it is ready */
if (vboot_data)
+ /* This does never happen! */
memcpy(vboot_data->mehh, hash, len*sizeof(u32));
else
memcpy(me_hash_saved, hash, len*sizeof(u32));
}
+
+void acpi_get_vdat_info(void **vdat_addr, uint32_t *vdat_size)
+{
+ *vdat_addr = vboot_data;
+ *vdat_size = sizeof(*vboot_data);
+}
diff --git a/src/vendorcode/google/chromeos/gnvs.h b/src/vendorcode/google/chromeos/gnvs.h
index 6dd740f..4067494 100644
--- a/src/vendorcode/google/chromeos/gnvs.h
+++ b/src/vendorcode/google/chromeos/gnvs.h
@@ -64,5 +64,6 @@ typedef struct {
extern chromeos_acpi_t *vboot_data;
void chromeos_init_vboot(chromeos_acpi_t *chromeos);
void chromeos_set_me_hash(u32*, int);
+void acpi_get_vdat_info(void **vdat_addr, uint32_t *vdat_size);
#endif
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1281
-gerrit
commit 9853ad32f03481fad470412470684730678cc689
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Mon Jun 11 15:38:15 2012 -0700
Make ACPI code detect Sandy/Ivy Bridge dynamically
On systems with socketed CPUs we want to be able to
drop in a Sandy Bridge or Ivy Bridge CPU without recompiling the
firmware. Hence, detect the north bridge dynamically. In order
for this to work, we need Ivy Bridge MRC and coreboot configured
for Ivy Bridge.
Change-Id: I635bef2c61d47d36a3fdd87f8ecb6e69097ba969
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/northbridge/intel/sandybridge/acpi.c | 4 +++-
src/northbridge/intel/sandybridge/sandybridge.h | 8 ++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/northbridge/intel/sandybridge/acpi.c b/src/northbridge/intel/sandybridge/acpi.c
index d1174d6..10b1a68 100644
--- a/src/northbridge/intel/sandybridge/acpi.c
+++ b/src/northbridge/intel/sandybridge/acpi.c
@@ -36,7 +36,9 @@ unsigned long acpi_fill_mcfg(unsigned long current)
u32 pciexbar_reg;
int max_buses;
- dev = dev_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_NB, 0);
+ dev = dev_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_SB, 0);
+ if (!dev)
+ dev = dev_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_IB, 0);
if (!dev)
return current;
diff --git a/src/northbridge/intel/sandybridge/sandybridge.h b/src/northbridge/intel/sandybridge/sandybridge.h
index 7e12416..f8617de 100644
--- a/src/northbridge/intel/sandybridge/sandybridge.h
+++ b/src/northbridge/intel/sandybridge/sandybridge.h
@@ -199,12 +199,8 @@ struct ied_header {
u8 reserved[34];
} __attribute__ ((packed));
-#if CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE
-#define PCI_DEVICE_ID_NB 0x0104
-#endif
-#if CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE
-#define PCI_DEVICE_ID_NB 0x0154
-#endif
+#define PCI_DEVICE_ID_SB 0x0104
+#define PCI_DEVICE_ID_IB 0x0154
#ifdef __SMM__
void intel_sandybridge_finalize_smm(void);
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1279
-gerrit
commit a68e3d1880817916d1f58413340d672cf8341dd9
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Mon Jun 11 14:13:09 2012 -0700
Fix ME hash functions on Panther Point/Cougar Point
- On Cougar Point there may have been stack corruption during the
ME hash verification
- On Panther Point the ME firmware hash was not passed on to the
OS
Change-Id: I73fc10db63ecff939833fb856a6da1e394155043
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/southbridge/intel/bd82x6x/me.c | 2 +-
src/southbridge/intel/bd82x6x/me_8.x.c | 16 +++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/southbridge/intel/bd82x6x/me.c b/src/southbridge/intel/bd82x6x/me.c
index a1ae06d..1b7b262 100644
--- a/src/southbridge/intel/bd82x6x/me.c
+++ b/src/southbridge/intel/bd82x6x/me.c
@@ -621,7 +621,7 @@ static int intel_mei_setup(device_t dev)
static int intel_me_extend_valid(device_t dev)
{
struct me_heres status;
- u32 extend[] = {0};
+ u32 extend[8] = {0};
int i, count = 0;
pci_read_dword_ptr(dev, &status, PCI_ME_HERES);
diff --git a/src/southbridge/intel/bd82x6x/me_8.x.c b/src/southbridge/intel/bd82x6x/me_8.x.c
index 1bb2ce3..c7a69fe 100644
--- a/src/southbridge/intel/bd82x6x/me_8.x.c
+++ b/src/southbridge/intel/bd82x6x/me_8.x.c
@@ -49,6 +49,7 @@
#if CONFIG_CHROMEOS
#include <vendorcode/google/chromeos/chromeos.h>
+#include <vendorcode/google/chromeos/gnvs.h>
#endif
#ifndef __SMM__
@@ -622,7 +623,7 @@ static int intel_mei_setup(device_t dev)
static int intel_me_extend_valid(device_t dev)
{
struct me_heres status;
- u32 extend;
+ u32 extend[8] = {0};
int i, count = 0;
pci_read_dword_ptr(dev, &status, PCI_ME_HERES);
@@ -651,16 +652,17 @@ static int intel_me_extend_valid(device_t dev)
return -1;
}
- /*
- * TODO(dlaurie) Verify the hash against a saved good value.
- */
-
for (i = 0; i < count; ++i) {
- extend = pci_read_config32(dev, PCI_ME_HER(i));
- printk(BIOS_DEBUG, "%08x", extend);
+ extend[i] = pci_read_config32(dev, PCI_ME_HER(i));
+ printk(BIOS_DEBUG, "%08x", extend[i]);
}
printk(BIOS_DEBUG, "\n");
+#if CONFIG_CHROMEOS
+ /* Save hash in NVS for the OS to verify */
+ chromeos_set_me_hash(extend, count);
+#endif
+
return 0;
}
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1277
-gerrit
commit 07e941bfd3b775f6f3f03768d886a6b735d73d2d
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Wed Jun 6 13:24:32 2012 -0700
Fix MRC cache update delays
When no valid MRC cache area is found, the mrc_cache data structure
was used without prior initialization. This sometimes caused a long
delay when booting because compute_ip_checksum would checksum up to
4GB of memory.
Change-Id: I6a0ca1aa618838bbc3d042be425700fc34b427f2
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/northbridge/intel/sandybridge/Kconfig | 18 +++++++++++++
src/northbridge/intel/sandybridge/mrccache.c | 36 ++++++++++++++++----------
2 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/src/northbridge/intel/sandybridge/Kconfig b/src/northbridge/intel/sandybridge/Kconfig
index 67b3def..7dfd10d 100644
--- a/src/northbridge/intel/sandybridge/Kconfig
+++ b/src/northbridge/intel/sandybridge/Kconfig
@@ -78,6 +78,24 @@ config CACHE_MRC_SIZE_KB
int
default 512
+# FIXME: build from rom size
+config MRC_CACHE_BASE
+ hex
+ default 0xff800000
+
+config MRC_CACHE_LOCATION
+ hex
+ default 0x370000
+
+config MRC_CACHE_SIZE
+ hex
+ default 0x10000
+
+config MRC_CACHE_ALIGNMENT
+ hex
+ default 0x1000
+
+
config DCACHE_RAM_BASE
hex
default 0xff7e0000
diff --git a/src/northbridge/intel/sandybridge/mrccache.c b/src/northbridge/intel/sandybridge/mrccache.c
index d774ff0..00b3bdd 100644
--- a/src/northbridge/intel/sandybridge/mrccache.c
+++ b/src/northbridge/intel/sandybridge/mrccache.c
@@ -118,17 +118,22 @@ struct mrc_data_container *find_current_mrc_cache(void)
* from having no cache area at all
*/
return mrc_cache;
- } else {
- /* Search for the last filled entry in the region */
- while (is_mrc_cache(mrc_next)) {
- entry_id++;
- mrc_cache = mrc_next;
- mrc_next = next_mrc_block(mrc_cache);
- /* Stay in the mrc data region */
- if ((void*)mrc_next >= (void*)(mrc_region + region_size))
- break;
- }
- entry_id--;
+ }
+
+ /* Search for the last filled entry in the region */
+ while (is_mrc_cache(mrc_next)) {
+ entry_id++;
+ mrc_cache = mrc_next;
+ mrc_next = next_mrc_block(mrc_cache);
+ /* Stay in the mrc data region */
+ if ((void*)mrc_next >= (void*)(mrc_region + region_size))
+ break;
+ }
+ entry_id--;
+
+ if (entry_id == -1) {
+ printk(BIOS_ERR, "%s: No valid MRC cache found.\n", __func__);
+ return NULL;
}
/* Verify checksum */
@@ -150,6 +155,7 @@ struct mrc_data_container *find_current_mrc_cache(void)
#if !defined(__PRE_RAM__)
void update_mrc_cache(void)
{
+ printk(BIOS_DEBUG, "Updating MRC cache data.\n");
struct mrc_data_container *current = cbmem_find(CBMEM_ID_MRCDATA);
if (!current) {
printk(BIOS_ERR, "No MRC cache in cbmem. Can't update flash.\n");
@@ -166,12 +172,14 @@ void update_mrc_cache(void)
// 0. compare MRC data to last mrc-cache block (exit if same)
struct mrc_data_container *cache;
if ((cache = find_current_mrc_cache()) == NULL) {
- printk(BIOS_DEBUG, "Failure looking for current last block\n");
+ printk(BIOS_DEBUG, "Failure looking for current last block.\n");
return;
}
- if ((cache->mrc_data_size == current->mrc_data_size) && (memcmp(cache, current, cache->mrc_data_size) == 0)) {
- printk(BIOS_DEBUG, "MRC data in flash is up to date. No update.\n");
+ if ((cache->mrc_data_size == current->mrc_data_size) &&
+ (memcmp(cache, current, cache->mrc_data_size) == 0)) {
+ printk(BIOS_DEBUG,
+ "MRC data in flash is up to date. No update.\n");
return;
}
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1276
-gerrit
commit 3f49a21848c62581852fe5de99a65a094c92c212
Author: Ronald G. Minnich <rminnich(a)chromium.org>
Date: Tue Jun 5 14:08:10 2012 -0700
Remove code that enables/disables VMX in coreboot on chromebooks.
There are several reasons for this:
1. It's a core setting, not a platform setting, which is bizarre. But,
we disable vmx via an SMI, and that only happens on core 0.
Hence, the code did not correctly make the same settings on all cores-
one had them disabled, the others were in an unknown state.
When (e.g.) kvm started on a vmx-enabled core, then moved to a
vmx-disabled core, the processor would reset *very* quickly.
Changing this would be messy.
2. On the CPU on link, there is something about trying to set the lock
bit that is getting a GPF.
3. It's the wrong place and time to set it. Once controlled, they can't
be changed in the kernel. The kernel is what should control this
feature, not the BIOS, as we have learned time and time again. If
somebody is in as root and can start a VM, you have a lot more to
worry about than someone starting a guest virtual machine.
Change-Id: I4f36093f1b68207251584066ccb9a6bcfeec767e
Signed-off-by: Ronald G. Minnich <rminnich(a)chromium.org>
---
src/cpu/intel/model_206ax/Kconfig | 4 ---
src/cpu/intel/model_206ax/finalize.c | 1 -
src/cpu/intel/model_206ax/model_206ax_init.c | 38 --------------------------
3 files changed, 0 insertions(+), 43 deletions(-)
diff --git a/src/cpu/intel/model_206ax/Kconfig b/src/cpu/intel/model_206ax/Kconfig
index 1b1b8ee..6c70993 100644
--- a/src/cpu/intel/model_206ax/Kconfig
+++ b/src/cpu/intel/model_206ax/Kconfig
@@ -21,10 +21,6 @@ config SMM_TSEG_SIZE
hex
default 0x800000
-config ENABLE_VMX
- bool "Enable VMX for virtualization"
- default n
-
endif
if CPU_INTEL_MODEL_206AX
diff --git a/src/cpu/intel/model_206ax/finalize.c b/src/cpu/intel/model_206ax/finalize.c
index 9de94c4..68cef8d 100644
--- a/src/cpu/intel/model_206ax/finalize.c
+++ b/src/cpu/intel/model_206ax/finalize.c
@@ -43,7 +43,6 @@ static void msr_set_bit(unsigned reg, unsigned bit)
void intel_model_206ax_finalize_smm(void)
{
- msr_set_bit(IA32_FEATURE_CONTROL, 0);
msr_set_bit(MSR_PMG_CST_CONFIG_CONTROL, 15);
/* Lock AES-NI only if supported */
diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c
index d60c237..b88d7d4 100644
--- a/src/cpu/intel/model_206ax/model_206ax_init.c
+++ b/src/cpu/intel/model_206ax/model_206ax_init.c
@@ -119,41 +119,6 @@ static const uint32_t microcode_updates[] = {
#include "x06_microcode.h"
};
-static void enable_vmx(void)
-{
- struct cpuid_result regs;
- msr_t msr;
- int enable = CONFIG_ENABLE_VMX;
-
- msr = rdmsr(IA32_FEATURE_CONTROL);
-
- if (msr.lo & (1 << 0)) {
- printk(BIOS_ERR, "VMX is locked, so enable_vmx will do nothing\n");
- /* VMX locked. If we set it again we get an illegal
- * instruction
- */
- return;
- }
-
- regs = cpuid(1);
- printk(BIOS_DEBUG, "%s VMX\n", enable ? "Enabling" : "Disabling");
- if (regs.ecx & CPUID_VMX) {
- if (enable)
- msr.lo |= (1 << 2);
- else
- msr.lo &= ~(1 << 2);
-
- if (regs.ecx & CPUID_SMX) {
- if (enable)
- msr.lo |= (1 << 1);
- else
- msr.lo &= ~(1 << 1);
- }
- }
-
- wrmsr(IA32_FEATURE_CONTROL, msr);
-}
-
/* Convert time in seconds to POWER_LIMIT_1_TIME MSR value */
static const u8 power_limit_time_sec_to_msr[] = {
[0] = 0x00,
@@ -456,9 +421,6 @@ static void model_206ax_init(device_t cpu)
enable_lapic_tpr();
setup_lapic();
- /* Enable virtualization if enabled in CMOS */
- enable_vmx();
-
/* Configure C States */
configure_c_states();
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1275
-gerrit
commit 104f85537f63a2ace2176c70cdc1b6a4ae6f2334
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Wed Jun 6 13:43:52 2012 -0700
malloc/memalign: Remove unneeded linker check
This check got in the code when some Linux distros shipped broken linkers
around 1999.
Since then, the code around that check was changed, and it does not make
sense anymore to have this check.
Change-Id: I37c6b690d72f55c18ba4c34e8541a6a441e5e67a
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/lib/malloc.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/src/lib/malloc.c b/src/lib/malloc.c
index bf8a15a..d2011a1 100644
--- a/src/lib/malloc.c
+++ b/src/lib/malloc.c
@@ -21,10 +21,6 @@ void *memalign(size_t boundary, size_t size)
MALLOCDBG("%s Enter, boundary %zu, size %zu, free_mem_ptr %p\n",
__func__, boundary, size, free_mem_ptr);
- /* Overzealous linker check */
- if (free_mem_ptr <= 0)
- die("Error! memalign: Free_mem_ptr <= 0");
-
free_mem_ptr = (void *)ALIGN((unsigned long)free_mem_ptr, boundary);
p = free_mem_ptr;