the following patch was just integrated into master:
commit 502533f656d41632f3b8ec19c385e8efa8c264a6
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Mon Feb 25 10:39:48 2013 -0700
Revert "AMD S3: Program the flash in a bigger data packet"
This reverts commit ca6e1f6c04c96c435bdbf30a1b88cab0e5be330b.
The packet size changes ends up corrupting the flash when booting
Persimmon. I did figure out that the maximum number of bytes that
can be sent is actually 8 bytes according to the sb800 spec. There
must be additional problems beyond that since setting the packet
size to 8 still causes problems.
Change-Id: Ieb24247cf79e95bb0e548c83601dfddffbf6be59
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/2509
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-by: Zheng Bao <zheng.bao(a)amd.com>
Build-Tested: build bot (Jenkins) at Mon Feb 25 18:59:24 2013, giving +1
Reviewed-By: Zheng Bao <zheng.bao(a)amd.com> at Tue Feb 26 03:33:48 2013, giving +2
See http://review.coreboot.org/2509 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/2522
-gerrit
commit 1262d0e0493d24a6230ddfef14e3883963b2eae4
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Nov 21 02:16:13 2012 -0800
libpayload: Check for completion more often in ehci_set_periodic_schedule.
This function was using mdelay in a loop to check for the completion of an USB
controller operation. Since we're busy waiting anyway, we might as well wait
only 1 us before checking again and potentially seeing the completion 999 us
earlier than we would otherwise.
Change-Id: I177b303c5503a0078c608d5f945c395691d4bd8a
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/usb/ehci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 3e57902..ec33b18 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -157,10 +157,10 @@ static int ehci_set_periodic_schedule(ehci_t *ehcic, int enable)
* This shouldn't take too long, but we should timeout nevertheless.
*/
enable = enable ? HC_OP_PERIODIC_SCHED_STAT : 0;
- int timeout = 100; /* time out after 100ms */
+ int timeout = 100000; /* time out after 100ms */
while (((ehcic->operation->usbsts & HC_OP_PERIODIC_SCHED_STAT) != enable)
&& timeout--)
- mdelay(1);
+ udelay(1);
if (timeout < 0) {
usb_debug("ehci periodic schedule status change timed out.\n");
return 1;
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2521
-gerrit
commit 0930c8acc9df77916ce0bd651178dcc52e3e66c1
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Nov 21 01:52:27 2012 -0800
libpayload: Correct a constant used for scanning for USB controllers.
When checking to see if a PCI device exists at a particular bus/dev/func,
libpayload was checking the vendor and device id fields together against a 16
bit 0xffff. The two fields together are 32 bits, however, so the check was
never true, and all dev/func combinations on a particular bus would be
checked. That was slightly wasteful, but had relatively small impact.
Change-Id: Iad537295c33083243940b18e7a99af92857e1ef2
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/usb/usbinit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c
index 2e466d3..74358bb 100644
--- a/payloads/libpayload/drivers/usb/usbinit.c
+++ b/payloads/libpayload/drivers/usb/usbinit.c
@@ -123,7 +123,7 @@ static void usb_scan_pci_bus(int bus)
u8 header_type;
pcidev_t addr = PCI_DEV(bus, dev, 0);
/* Check if there's a device here at all. */
- if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffff)
+ 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. */
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2520
-gerrit
commit a41ab1f7bd81dee45bcf5470b950e01ec1900a85
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Nov 21 01:01:50 2012 -0800
libpayload: Change the measurement interval for get_cpu_speed to 2 ms.
The interval used to be about 55 ms which is excessively long. Coreboot only
waits for 2 ms and gets a reasonable answer. That should be good enough for us
as well.
Change-Id: I4d4e8b25b6ba540c9e9839ed0bbaa1f04f67cce1
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/arch/x86/timer.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/payloads/libpayload/arch/x86/timer.c b/payloads/libpayload/arch/x86/timer.c
index ae288eb..40e81c4 100644
--- a/payloads/libpayload/arch/x86/timer.c
+++ b/payloads/libpayload/arch/x86/timer.c
@@ -49,6 +49,8 @@ u32 cpu_khz;
unsigned int get_cpu_speed(void)
{
unsigned long long start, end;
+ const uint32_t clock_rate = 1193182; // 1.193182 MHz
+ const uint16_t interval = (2 * clock_rate) / 1000; // 2 ms
/* Set up the PPC port - disable the speaker, enable the T2 gate. */
outb((inb(0x61) & ~0x02) | 0x01, 0x61);
@@ -56,9 +58,9 @@ unsigned int get_cpu_speed(void)
/* Set the PIT to Mode 0, counter 2, word access. */
outb(0xB0, 0x43);
- /* Load the counter with 0xffff. */
- outb(0xff, 0x42);
- outb(0xff, 0x42);
+ /* Load the interval into the counter. */
+ outb(interval & 0xff, 0x42);
+ outb((interval >> 8) & 0xff, 0x42);
/* Read the number of ticks during the period. */
start = rdtsc();
@@ -66,11 +68,11 @@ unsigned int get_cpu_speed(void)
end = rdtsc();
/*
- * The clock rate is 1193180 Hz, the number of milliseconds for a
- * period of 0xffff is 1193180 / (0xFFFF * 1000) or .0182.
- * Multiply that by the number of measured clocks to get the kHz value.
+ * The number of milliseconds for a period is
+ * clock_rate / (interval * 1000). Multiply that by the number of
+ * measured clocks to get the kHz value.
*/
- cpu_khz = (unsigned int)((end - start) * 1193180U / (1000 * 0xffff));
+ cpu_khz = (end - start) * clock_rate / (1000 * interval);
return cpu_khz;
}
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 a61b7e41c6cbdf01a8e459e3715520de27d2b720
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 | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c
index 2e466d3..36cf5e4 100644
--- a/payloads/libpayload/drivers/usb/usbinit.c
+++ b/payloads/libpayload/drivers/usb/usbinit.c
@@ -126,14 +126,6 @@ static void usb_scan_pci_bus(int bus)
if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffff)
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);
- continue;
- }
/*
* EHCI is defined by standards to be at a higher function
* than the USB1 controllers. We don't want to init USB1 +
@@ -141,11 +133,22 @@ static void usb_scan_pci_bus(int bus)
* comes first.
*/
/* Check for a multifunction device. */
+ int top_func = 0;
if (header_type & HEADER_TYPE_MULTIFUNCTION)
- for (func = 7; func > 0; func--)
+ top_func = 7;
+ for (func = top_func; func >= 0; func--) {
+ addr = PCI_DEV(bus, dev, func);
+ header_type = pci_read_config8(addr, REG_HEADER_TYPE);
+ /* If this is a bridge, scan 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);
+ } 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/2516
-gerrit
commit 2746947a006993d6d2e3b574f302abb83d8539b1
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Nov 8 17:26:29 2012 -0600
xcompile: use LINKER_SUFFIX for x-compiling
The LINKER_SUFFIX environment variable was introduced but never actually
used. Actually use it.
Change-Id: I9edb8b63b5742e13dbf0e7b6034814acea11fc52
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
util/xcompile/xcompile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index ea975ec..5d6d858 100644
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -118,7 +118,7 @@ report_arch_toolchain() {
# elf${TWIDTH}-${TBFDARCH} toolchain (${GCCPREFIX}gcc)
CC_${TARCH}:=${GCCPREFIX}gcc ${CFLAGS}
AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS}
-LD_${TARCH}:=${GCCPREFIX}ld ${LDFLAGS}
+LD_${TARCH}:=${GCCPREFIX}ld${LINKER_SUFFIX} ${LDFLAGS}
NM_${TARCH}:=${GCCPREFIX}nm
OBJCOPY_${TARCH}:=${GCCPREFIX}objcopy
OBJDUMP_${TARCH}:=${GCCPREFIX}objdump
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2514
-gerrit
commit a35a2f918c5b9275d31ac61c2e2895dd03af8610
Author: Marc Jones <marc.jones(a)se-eng.com>
Date: Mon Nov 5 17:25:52 2012 -0700
Mainboard SMI S state handler was using the wrong defines
The PCH register bit definition for sleep type is a little confusing.
For example, 7 is S5. To make this simpler for the mainbaord developer,
the mainboard smi sleep hander is called as mainboard_sleep(slp_typ-2).
A couple mainboard SMI handlers were using the PCH define for slp_ty,
so S3 code would be run for S5 and S5 code would never be run.
Change-Id: Iaecf96bfd48cf00153600cd119760364fbdfc29e
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
---
src/mainboard/intel/emeraldlake2/smihandler.c | 6 +++---
src/mainboard/samsung/stumpy/smihandler.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/mainboard/intel/emeraldlake2/smihandler.c b/src/mainboard/intel/emeraldlake2/smihandler.c
index 03c505b..acc1fde 100644
--- a/src/mainboard/intel/emeraldlake2/smihandler.c
+++ b/src/mainboard/intel/emeraldlake2/smihandler.c
@@ -59,11 +59,11 @@ void mainboard_smi_sleep(u8 slp_typ)
u8 reg8;
switch (slp_typ) {
- case SLP_TYP_S3:
- case SLP_TYP_S4:
+ case 3:
+ case 4:
break;
- case SLP_TYP_S5:
+ case 5:
/* Turn off LED */
reg8 = inb(SIO_GPIO_BASE_SET4);
reg8 |= (1 << 5);
diff --git a/src/mainboard/samsung/stumpy/smihandler.c b/src/mainboard/samsung/stumpy/smihandler.c
index 660bb31..5eda0a1 100644
--- a/src/mainboard/samsung/stumpy/smihandler.c
+++ b/src/mainboard/samsung/stumpy/smihandler.c
@@ -62,8 +62,8 @@ void mainboard_smi_sleep(u8 slp_typ)
u8 reg8;
switch (slp_typ) {
- case SLP_TYP_S3:
- case SLP_TYP_S4:
+ case 3:
+ case 4:
/* Blink LED */
it8772f_enter_conf();
it8772f_sio_write(IT8772F_CONFIG_REG_LDN, IT8772F_GPIO);
@@ -79,7 +79,7 @@ void mainboard_smi_sleep(u8 slp_typ)
it8772f_exit_conf();
break;
- case SLP_TYP_S5:
+ case 5:
/* Turn off LED */
reg8 = inb(SIO_GPIO_BASE_SET4);
reg8 |= (1 << 5);