Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2659
-gerrit
commit dd8d472e74753b90b77115dc23b25aeecc37f588
Author: Gabe Black <gabeblack(a)google.com>
Date: Fri Jan 18 18:24:46 2013 -0800
libpayload: If there's no IO space, complain if the serial claims to use it
Change-Id: I36c750d520ff034c9ca9b9af46bd99bd49af7355
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/serial.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/payloads/libpayload/drivers/serial.c b/payloads/libpayload/drivers/serial.c
index 0d26750..4ae3e26 100644
--- a/payloads/libpayload/drivers/serial.c
+++ b/payloads/libpayload/drivers/serial.c
@@ -97,11 +97,19 @@ void serial_init(void)
serial_is_mem_mapped =
(lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED);
- if (!serial_is_mem_mapped && (inb(IOBASE + 0x05) == 0xFF) &&
- (inb(IOBASE + 0x06) == 0xFF)) {
+ if (!serial_is_mem_mapped) {
+#ifdef CONFIG_IO_ADDRESS_SPACE
+ if ((inb(IOBASE + 0x05) == 0xFF) &&
+ (inb(IOBASE + 0x06) == 0xFF)) {
+ return;
+ }
+#else
+ printf("IO space mapped serial not supported.");
return;
+#endif
}
+
serial_hardware_is_present = 1;
#ifdef CONFIG_SERIAL_SET_SPEED
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2658
-gerrit
commit 01bdb53394cb2fad1e9223af76002e5cc00806c1
Author: Gabe Black <gabeblack(a)google.com>
Date: Fri Jan 18 15:49:00 2013 -0800
libpayload: Make whether or not there's an IO address space configurable
Default it to no to be consistent with the other architecture wide options
(endianness), and turn it on explicitly for x86 and PowerPC.
Change-Id: Idda26d580156bbbf08ea11b28abe75cfa6b594b2
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/Config.in | 5 +++++
payloads/libpayload/arch/powerpc/Config.in | 1 +
payloads/libpayload/arch/x86/Config.in | 1 +
3 files changed, 7 insertions(+)
diff --git a/payloads/libpayload/Config.in b/payloads/libpayload/Config.in
index 0a6fbe8..377b7ba 100644
--- a/payloads/libpayload/Config.in
+++ b/payloads/libpayload/Config.in
@@ -410,4 +410,9 @@ config LITTLE_ENDIAN
default n
bool
+# Whether the target system has an IO address space.
+config IO_ADDRESS_SPACE
+ default n
+ bool
+
source "arch/Config.in"
diff --git a/payloads/libpayload/arch/powerpc/Config.in b/payloads/libpayload/arch/powerpc/Config.in
index eb2faa1..f64f006 100644
--- a/payloads/libpayload/arch/powerpc/Config.in
+++ b/payloads/libpayload/arch/powerpc/Config.in
@@ -32,5 +32,6 @@ if ARCH_POWERPC
config ARCH_SPECIFIC_OPTIONS # dummy
def_bool y
select BIG_ENDIAN
+ select IO_ADDRESS_SPACE
endif
diff --git a/payloads/libpayload/arch/x86/Config.in b/payloads/libpayload/arch/x86/Config.in
index f4bd882..4a5e6bd 100644
--- a/payloads/libpayload/arch/x86/Config.in
+++ b/payloads/libpayload/arch/x86/Config.in
@@ -32,5 +32,6 @@ if ARCH_X86
config ARCH_SPECIFIC_OPTIONS # dummy
def_bool y
select LITTLE_ENDIAN
+ select IO_ADDRESS_SPACE
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/2656
-gerrit
commit 4ba39bc7acb0ccf3c510735464959fc58cb99dd4
Author: Gabe Black <gabeblack(a)google.com>
Date: Fri Jan 18 15:14:03 2013 -0800
libpayload: Remove unnecessary include of arch/msr.h
The functions defined in that header aren't used anywhere in the actual code,
and that include breaks things on ARM.
Built for ARM with COREBOOT_VIDEO_CONSOLE turned on and saw compiler
errors go away.
Change-Id: I56d6fe5e00c8fccda6e31ef8752326bd36398e74
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/video/corebootfb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/payloads/libpayload/drivers/video/corebootfb.c b/payloads/libpayload/drivers/video/corebootfb.c
index 5672d1f..faf9e2c 100644
--- a/payloads/libpayload/drivers/video/corebootfb.c
+++ b/payloads/libpayload/drivers/video/corebootfb.c
@@ -32,7 +32,6 @@
#include <coreboot_tables.h>
#include <pci.h>
#include <video_console.h>
-#include <arch/msr.h>
#include "font8x16.h"
struct video_console coreboot_video_console;
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2655
-gerrit
commit 8ffaed84d9ca16c356a55acd61cd0c98dfac934d
Author: Gabe Black <gabeblack(a)google.com>
Date: Fri Jan 18 15:04:07 2013 -0800
libpayload: Stub out time keeping functions for ARM as well
These were currently stubbed out for PowerPC but not for ARM.
Change-Id: I08f45174877bf5751d972078b8c53d82898b7f2b
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/libc/time.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/payloads/libpayload/libc/time.c b/payloads/libpayload/libc/time.c
index 91f6296..1503c45 100644
--- a/payloads/libpayload/libc/time.c
+++ b/payloads/libpayload/libc/time.c
@@ -111,9 +111,8 @@ static void gettimeofday_init(void)
(tm.tm_min * 60) + tm.tm_sec;
}
#endif // CONFIG_NVRAM
-#endif // CONFIG_ARCH_X86
-#ifdef CONFIG_ARCH_ARMV7
+#else
static void update_clock(void)
{
}
@@ -121,18 +120,7 @@ static void update_clock(void)
static void gettimeofday_init(void)
{
}
-#endif // CONFIG_ARCH_ARMV7
-
-
-#ifdef CONFIG_ARCH_POWERPC
-static void update_clock(void)
-{
-}
-
-static void gettimeofday_init(void)
-{
-}
-#endif // CONFIG_ARCH_POWERPC
+#endif
/**
* Return the current time broken into a timeval structure.
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2654
-gerrit
commit bdc3e3095c477aabeb75a55d35c98dea475d6bb1
Author: Gabe Black <gabeblack(a)google.com>
Date: Wed Jan 16 03:18:02 2013 -0800
libpayload: ARCH-$(CONFIG_ARCH_ARMV7) was defined twice, make one POWERPC
Change-Id: Ia85a7cd6a0b85119cce6b2f9c42a7fc31ffd9f97
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile
index cbfd43a..c4a77bf 100644
--- a/payloads/libpayload/Makefile
+++ b/payloads/libpayload/Makefile
@@ -100,7 +100,7 @@ ARCH-y := $(ARCHDIR-y)
# If architecture folder name is different from GCC binutils architecture name,
# override here.
ARCH-$(CONFIG_ARCH_ARMV7) := armv7
-ARCH-$(CONFIG_ARCH_ARMV7) := armv7
+ARCH-$(CONFIG_ARCH_POWERPC) := powerpc
ARCH-$(CONFIG_ARCH_X86) := i386
CC := $(CC_$(ARCH-y))
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2653
-gerrit
commit 67602843f673307645a4e5b39772e00548e14c86
Author: Gabe Black <gabeblack(a)google.com>
Date: Tue Jan 15 16:22:04 2013 -0800
libpayload: In the USBMSC read_capacity function, make buf an array of u32.
That way when it's treated as a u32 when its value is extracted for numblocks
and blocksize below, it doesn't make the compiler unhappy, and it ensures that
the buffer will be properly aligned on architectures where that sort of thing
matters.
Built and saw warnings about type punning go away.
Change-Id: I254e0b5e70847112d660675b7df0ac9cb52e4051
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/usb/usbmsc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c
index 0032f58..16af448 100644
--- a/payloads/libpayload/drivers/usb/usbmsc.c
+++ b/payloads/libpayload/drivers/usb/usbmsc.c
@@ -375,14 +375,14 @@ read_capacity (usbdev_t *dev)
cmdblock_t cb;
memset (&cb, 0, sizeof (cb));
cb.command = 0x25; // read capacity
- u8 buf[8];
+ u32 buf[2];
usb_debug ("Reading capacity of mass storage device.\n");
int count = 0, ret;
while (count++ < 20) {
switch (ret = execute_command
(dev, cbw_direction_data_in, (u8 *) &cb,
- sizeof (cb), buf, 8, 0)) {
+ sizeof (cb), (u8 *)buf, 8, 0)) {
case MSC_COMMAND_OK:
break;
case MSC_COMMAND_FAIL:
@@ -398,8 +398,8 @@ read_capacity (usbdev_t *dev)
MSC_INST (dev)->numblocks = 0xffffffff;
MSC_INST (dev)->blocksize = 512;
} else {
- MSC_INST (dev)->numblocks = ntohl (*(u32 *) buf) + 1;
- MSC_INST (dev)->blocksize = ntohl (*(u32 *) (buf + 4));
+ MSC_INST (dev)->numblocks = ntohl(buf[0]) + 1;
+ MSC_INST (dev)->blocksize = ntohl(buf[1]);
}
usb_debug (" %d %d-byte sectors (%d MB)\n", MSC_INST (dev)->numblocks,
MSC_INST (dev)->blocksize,
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2652
-gerrit
commit bc706b9b024fd3af293cd9e8249230b63028499c
Author: Gabe Black <gabeblack(a)google.com>
Date: Tue Jan 15 15:48:55 2013 -0800
libpayload: If no video drivers initialize in video_init, return 1.
Change-Id: I56f810dfa6654ac1e9d1696ad15e7f1b8bfe59bd
Signed-off-by: Gabe Black <gabeblack(a)google.com>
---
payloads/libpayload/drivers/video/video.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/payloads/libpayload/drivers/video/video.c b/payloads/libpayload/drivers/video/video.c
index 61bb02a..b8fe5d9 100644
--- a/payloads/libpayload/drivers/video/video.c
+++ b/payloads/libpayload/drivers/video/video.c
@@ -216,6 +216,7 @@ int video_init(void)
video_console_fixup_cursor();
return 0;
}
+ return 1;
}
int video_console_init(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/2651
-gerrit
commit 9f939937defc6d2fbb8ea82850454995d9e85fd0
Author: Julius Werner <jwerner(a)chromium.org>
Date: Fri Jan 11 16:25:52 2013 -0800
libpayload: Split EHCI bulk transfers on packet boundaries over qTDs
EHCI controllers see transfers as a queue of transfer descriptors
(qTDs), each of which can represent an aligned area of up to 20KB. Each
qTD is processed separately, which means that a single USB packet cannot
span multiple qTDs.
While this should not be a problem according to the specification, some
USB storage devices seem to get confused when a packet in the middle of
a transfer is smaller than the maximum packet size (512 bytes) due to
falling on a qTD boundary. This patch aligns the total transfer length
per qTD to 512 bytes to avoid that problem (any excess bytes will simply
roll over to the next qTD).
Change-Id: I0b5db07507699a3861b30c1a5ee774c45dda7fdd
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
---
payloads/libpayload/drivers/usb/ehci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index d33fec5..972962c 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -241,6 +241,10 @@ static int fill_td(qtd_t *td, void* data, int datalen)
}
datalen -= 4096;
total_len += 4096;
+
+ /* end TD at a packet boundary if transfer not complete */
+ if (page_no == 5)
+ total_len &= ~511;
}
}
td->token |= total_len << QTD_TOTAL_LEN_SHIFT;