Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2990
-gerrit
commit 9cb3cfcc7446fefd2819c240a2a708ba385566ba
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Sat Mar 30 12:04:23 2013 +0100
Intel: Return on missing microcode file to fix null pointer dereference
Selecting `CPU_MICROCODE_IN_CBFS` in Kconfig but not having the
microcode blob `cpu_microcode_blob.bin` in CBFS results in a
null pointer dereference later on resulting in a crash.
for(c = microcode_updates; m->hdrver; m = (const struct microcode *)c) {
Fix this by returning if `microcode_updates` is `NULL`, that means
no file is found.
This patch is successfully tested on the Lenovo X201.
Change-Id: I6e18fd37256910bf047061e4633a66cf29ad7b69
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/cpu/intel/microcode/microcode.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/cpu/intel/microcode/microcode.c b/src/cpu/intel/microcode/microcode.c
index d908c25..1991ed8 100644
--- a/src/cpu/intel/microcode/microcode.c
+++ b/src/cpu/intel/microcode/microcode.c
@@ -21,6 +21,7 @@
/* Microcode update for Intel PIII and later CPUs */
#include <stdint.h>
+#include <stddef.h>
#if !defined(__ROMCC__)
#include <console/console.h>
#endif
@@ -131,7 +132,7 @@ const void *intel_microcode_find(void)
#endif
if (!microcode_updates)
- return microcode_updates;
+ return NULL;
/* CPUID sets MSR 0x8B iff a microcode update has been loaded. */
msr.lo = 0;
@@ -202,6 +203,13 @@ void intel_update_microcode(const void *microcode_updates)
const char *c;
msr_t msr;
+ if (!microcode_updates) {
+#if !defined(__ROMCC__)
+ printk(BIOS_WARNING, "No microcode updates found.\n");
+#endif
+ return;
+ }
+
/* CPUID sets MSR 0x8B iff a microcode update has been loaded. */
msr.lo = 0;
msr.hi = 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/3033
-gerrit
commit 816c6bce99efa6eaadb24007317e2d2d0f615017
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Fri Apr 5 13:51:11 2013 -0700
Fix read_option invocation in uart8250mem.c
read_option was unified between ramstage and romstage a while ago.
However, it seems some invocations were not fixed accordingly.
This patch switches uart8250mem.c to use the new scheme.
Change-Id: I03cef4f6ee9188a6412c61d7ed34fbaff808a32b
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/lib/uart8250mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/uart8250mem.c b/src/lib/uart8250mem.c
index b98cb0e..8224843 100644
--- a/src/lib/uart8250mem.c
+++ b/src/lib/uart8250mem.c
@@ -116,7 +116,7 @@ u32 uart_mem_init(void)
static const unsigned baud[8] = { 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1200 };
unsigned b_index = 0;
#if defined(__PRE_RAM__)
- b_index = read_option(CMOS_VSTART_baud_rate, CMOS_VLEN_baud_rate, 0);
+ b_index = read_option(baud_rate, 0);
b_index &= 7;
uart_baud = baud[b_index];
#else
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3032
-gerrit
commit f3a50986fea88b65334a36d83a1c0b5d93021d46
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Fri Apr 5 13:49:55 2013 -0700
Fix compilation when coverage debugging is enabled
With CONFIG_DEBUG_COVERAGE enabled, the build currently fails with
src/lib/gcov-glue.c: In function 'fseek':
src/lib/gcov-glue.c:87:2: error: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Werror=format]
src/lib/gcov-glue.c:87:2: error: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Werror=format]
Change-Id: Iddaa601748c210d9dad06ae9dab2a3deaa635b2c
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
---
src/lib/gcov-glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 7c069cb..4e2b290 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -84,7 +84,7 @@ static int fseek(FILE *stream, long offset, int whence)
* to a freshly opened file. */
gcc_assert (offset == 0 && whence == SEEK_SET);
#if CONFIG_DEBUG_COVERAGE
- printk(BIOS_DEBUG, "fseek %s offset=%d whence=%d\n",
+ printk(BIOS_DEBUG, "fseek %s offset=%ld whence=%d\n",
stream->filename, offset, whence);
#endif
return 0;
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3031
-gerrit
commit 3eaa4269ef0e5ac732865b96ddc77d6fbeda1c93
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Fri Apr 5 13:35:29 2013 -0700
exynos5250: add a chip.h file for the display register settings
Display hardware is part of this SOC, and we need to be able
to set certain variables in devicetree.cb. This chip file
contains the initial things we think we need to set.
Change-Id: I16f2d4228c87116dbeb53a3c9f3f359a6444f552
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/cpu/samsung/exynos5250/chip.h | 40 +++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/src/cpu/samsung/exynos5250/chip.h b/src/cpu/samsung/exynos5250/chip.h
new file mode 100644
index 0000000..798cd26
--- /dev/null
+++ b/src/cpu/samsung/exynos5250/chip.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2013 Google Inc.
+ *
+ * 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 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef CPU_SAMSUNG_EXYNOS5250_H
+#define CPU_SAMSUNG_EXYNOS5250_H
+
+struct cpu_samsung_exynos5250_config {
+ /* special magic numbers! */
+ int clkval_f;
+ int upper_margin;
+ int lower_margin;
+ int vsync;
+ int left_margin;
+ int right_margin;
+ int hsync;
+
+ int xres;
+ int yres;
+ int bpp;
+
+ u32 lcdbase;
+};
+
+#endif /* CPU_SAMSUNG_EXYNOS5250_H */
the following patch was just integrated into master:
commit 6ccb1abfd4aff94711b9950f75b0eb6758c4f4d1
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed Apr 3 09:57:53 2013 -0500
mtrr: add rom caching comment about hyperthreads
Explicitly call out the effects of hyperthreads running the
MTRR code and its impact on the enablement of ROM caching.
Change-Id: I14b8f3fdc112340b8f483f2e554c5680576a8a7c
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: http://review.coreboot.org/3018
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Wed Apr 3 20:48:31 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Fri Apr 5 20:41:54 2013, giving +2
See http://review.coreboot.org/3018 for details.
-gerrit
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2517
-gerrit
commit ac24401af7c73862bf5a9b499c22a8d31c7ae9d0
Author: Gabe Black <gabeblack(a)google.com>
Date: Thu Nov 8 19:31:23 2012 -0800
libpayload: Handle multifunction bridge devices better.
This change modifies the code in libpayload that scans the PCI hierarchy for
USB controllers. Previously, if a devices primary function (function 0) was a
bridge, then none of the other functions, if any, would be looked at. If one
of the other functions was a bridge, that wouldn't be handled either. The new
version looks at each function that's present no matter what, and if it
discovers that it's a bridge it scans the other side.
Change-Id: I37f269a4fe505fd32d9594e2daf17ddd78609c15
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/usb/usbinit.c | 56 +++++++++++++++++--------------
1 file changed, 31 insertions(+), 25 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c
index 74358bb..76653ff 100644
--- a/payloads/libpayload/drivers/usb/usbinit.c
+++ b/payloads/libpayload/drivers/usb/usbinit.c
@@ -47,12 +47,12 @@ static int usb_controller_initialize(int bus, int dev, int func)
u32 class;
u32 devclass;
u32 prog_if;
- pcidev_t addr;
+ pcidev_t pci_device;
u32 pciid;
- addr = PCI_DEV (bus, dev, func);
- class = pci_read_config32(addr, 8);
- pciid = pci_read_config32(addr, 0);
+ pci_device = PCI_DEV (bus, dev, func);
+ class = pci_read_config32(pci_device, 8);
+ pciid = pci_read_config32(pci_device, 0);
devclass = class >> 16;
prog_if = (class >> 8) & 0xff;
@@ -63,9 +63,9 @@ static int usb_controller_initialize(int bus, int dev, int func)
if (devclass == 0xc03) {
u32 pci_command;
- pci_command = pci_read_config32(addr, PCI_COMMAND);
+ pci_command = pci_read_config32(pci_device, PCI_COMMAND);
pci_command |= PCI_COMMAND_MASTER;
- pci_write_config32(addr, PCI_COMMAND, pci_command);
+ pci_write_config32(pci_device, PCI_COMMAND, pci_command);
usb_debug("%02x:%02x.%x %04x:%04x.%d ", bus, dev, func,
pciid >> 16, pciid & 0xFFFF, func);
@@ -73,7 +73,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
case 0x00:
#ifdef CONFIG_USB_UHCI
usb_debug("UHCI controller\n");
- uhci_init (addr);
+ uhci_init (pci_device);
#else
usb_debug("UHCI controller (not supported)\n");
#endif
@@ -82,7 +82,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
case 0x10:
#ifdef CONFIG_USB_OHCI
usb_debug("OHCI controller\n");
- ohci_init(addr);
+ ohci_init(pci_device);
#else
usb_debug("OHCI controller (not supported)\n");
#endif
@@ -91,7 +91,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
case 0x20:
#ifdef CONFIG_USB_EHCI
usb_debug("EHCI controller\n");
- ehci_init(addr);
+ ehci_init(pci_device);
#else
usb_debug("EHCI controller (not supported)\n");
#endif
@@ -100,7 +100,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
case 0x30:
#ifdef CONFIG_USB_XHCI
usb_debug("xHCI controller\n");
- xhci_init(addr);
+ xhci_init(pci_device);
#else
usb_debug("xHCI controller (not supported)\n");
#endif
@@ -121,31 +121,37 @@ static void usb_scan_pci_bus(int bus)
int dev, func;
for (dev = 0; dev < 32; dev++) {
u8 header_type;
- pcidev_t addr = PCI_DEV(bus, dev, 0);
+ pcidev_t pci_device = PCI_DEV(bus, dev, 0);
+
/* Check if there's a device here at all. */
- if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffffffff)
- continue;
- header_type = pci_read_config8(addr, REG_HEADER_TYPE);
- /* If this is a bridge, scan the bus on the other side. */
- if ((header_type & ~HEADER_TYPE_MULTIFUNCTION) ==
- HEADER_TYPE_BRIDGE) {
- int sub_bus =
- pci_read_config8(addr, REG_SECONDARY_BUS);
- usb_scan_pci_bus(sub_bus);
+ if (pci_read_config32(pci_device, REG_VENDOR_ID) == 0xffffffff)
continue;
- }
+
/*
* EHCI is defined by standards to be at a higher function
* than the USB1 controllers. We don't want to init USB1 +
* devices just to "steal" those for USB2, so make sure USB2
- * comes first.
+ * comes first by scanning multifunction devices from 7 to 0.
*/
+
/* Check for a multifunction device. */
+ header_type = pci_read_config8(pci_device, REG_HEADER_TYPE);
if (header_type & HEADER_TYPE_MULTIFUNCTION)
- for (func = 7; func > 0; func--)
+ func = 7;
+ else
+ func = 0;
+
+ for (; func >= 0; func--) {
+ pci_device = PCI_DEV(bus, dev, func);
+ header_type = pci_read_config8(pci_device, REG_HEADER_TYPE);
+ /* If this is a bridge, scan the other side. */
+ if ((header_type & ~HEADER_TYPE_MULTIFUNCTION) ==
+ HEADER_TYPE_BRIDGE)
+ usb_scan_pci_bus(pci_read_config8(pci_device,
+ REG_SECONDARY_BUS));
+ else
usb_controller_initialize(bus, dev, func);
- /* Initialize function 0. */
- usb_controller_initialize(bus, dev, 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/2991
-gerrit
commit 6a762b8c0fd53424454763f44731611b730b6833
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Sat Mar 30 12:15:12 2013 +0100
util/cbmem: Don't output trailing garbage for cbmemc
Current code outputs the whole cbmemc buffer even if only part of
it is really used. Fix it to output only the used part and notify
the user if the buffer was too small for the required data.
Change-Id: I68c1970cf84d49b2d7d6007dae0679d7a7a0cb99
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
util/cbmem/cbmem.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index bc6bd6b..f3f5add 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -314,6 +314,7 @@ static void dump_console(void)
void *console_p;
char *console_c;
uint32_t size;
+ uint32_t cursor;
if (console.tag != LB_TAG_CBMEM_CONSOLE) {
fprintf(stderr, "No console found in coreboot table.\n");
@@ -328,6 +329,12 @@ static void dump_console(void)
* Hence we have to add 8 to get to the actual console string.
*/
size = *(uint32_t *)console_p;
+ cursor = *(uint32_t *) (console_p + 4);
+ /* Cursor continues to go on even after no more data fits in
+ * the buffer but the data is dropped in this case.
+ */
+ if (size > cursor)
+ size = cursor;
console_c = malloc(size + 1);
if (!console_c) {
fprintf(stderr, "Not enough memory for console.\n");
@@ -337,7 +344,10 @@ static void dump_console(void)
memcpy(console_c, console_p + 8, size);
console_c[size] = 0;
- printf("%s", console_c);
+ printf("%s\n", console_c);
+ if (size < cursor)
+ printf("%d %s lost\n", cursor - size,
+ (cursor - size) == 1 ? "byte":"bytes");
free(console_c);