Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4199
-gerrit
commit d46404497e38dfcd815571ef83add04d37e8586c
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue May 28 09:25:32 2013 -0500
libpayload: provide missing cbfs symbol
The generic cbfs code relies on the libpayload_init_default_cbfs_media
symbol. However, none was provided for ARM. Provide an empty
implementation that returns an error as there is no generic way
to locate the default cbfs media.
Change-Id: Ie0d06fbe6fc790c9d92434cd2d60922908acdc69
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56805
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
---
payloads/libpayload/arch/armv7/Makefile.inc | 1 +
payloads/libpayload/arch/armv7/dummy_media.c | 42 ++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/payloads/libpayload/arch/armv7/Makefile.inc b/payloads/libpayload/arch/armv7/Makefile.inc
index 9c7fe83..e8ca109 100644
--- a/payloads/libpayload/arch/armv7/Makefile.inc
+++ b/payloads/libpayload/arch/armv7/Makefile.inc
@@ -34,3 +34,4 @@ libc-y += virtual.c
libc-y += memcpy.S memset.S
libc-y += exception_asm.S exception.c
libc-y += cache.c
+libc-y += dummy_media.c
diff --git a/payloads/libpayload/arch/armv7/dummy_media.c b/payloads/libpayload/arch/armv7/dummy_media.c
new file mode 100644
index 0000000..7926976
--- /dev/null
+++ b/payloads/libpayload/arch/armv7/dummy_media.c
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libpayload project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#define LIBPAYLOAD
+
+#include <cbfs.h>
+#include <string.h>
+
+/* The generic cbfs code relies on the libpayload_init_default_cbfs_media
+ * symbol. Therefore, provide an implementation that just throws an error. */
+
+int libpayload_init_default_cbfs_media(struct cbfs_media *media);
+
+int libpayload_init_default_cbfs_media(struct cbfs_media *media)
+{
+ 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/4225
-gerrit
commit 716809248bdeeabb90ca4d8981617cf8b5dba94b
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu Jun 6 16:14:21 2013 -0500
libpayload: usb mass storage detect empty media
There is currently a hard-coded 30 sec delay in the mass storage
driver while waiting for each device to become ready. However, mass
storage card readers that are empty return an error code on the
TEST UNIT READY command. A REQUEST SENSE command then needs to be
issued and interrogate the data to determine if no media is present.
If no media determination is found to be true the USB device is no
longer considered a candidate to be a disk.
This code does lead to the fact that the media card reader needs to be
populated at enumeration time. I suspect this is not an issue as it
appears the storage stack in libpayload can't handle removable media
coming online later.
Booted recovery and dev modes. Noted that removable mass storage
devices with no media were ignored without any boot delay.
Change-Id: Ida7a45614d97c6e6fbfc9bb099765aad4df550fd
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57828
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
---
payloads/libpayload/drivers/usb/usbmsc.c | 35 ++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c
index ad7e82f..ffb1c93 100644
--- a/payloads/libpayload/drivers/usb/usbmsc.c
+++ b/payloads/libpayload/drivers/usb/usbmsc.c
@@ -123,6 +123,8 @@ enum {
static int
request_sense (usbdev_t *dev);
+static int
+request_sense_no_media (usbdev_t *dev);
static int
reset_transport (usbdev_t *dev)
@@ -256,6 +258,11 @@ execute_command (usbdev_t *dev, cbw_direction dir, const u8 *cb, int cblen,
if (cb[0] == 0x03)
/* requesting sense failed, that's bad */
return MSC_COMMAND_FAIL;
+ else if (cb[0] == 0)
+ /* If command was TEST UNIT READY determine if the
+ * device is of removable type indicating no media
+ * found. */
+ return request_sense_no_media (dev);
/* error "check condition" or reserved error */
ret = request_sense (dev);
/* return fail or the status of request_sense if it's worse */
@@ -350,6 +357,34 @@ request_sense (usbdev_t *dev)
sizeof (cb), buf, 19, 1);
}
+static int request_sense_no_media(usbdev_t *dev)
+{
+ u8 buf[19];
+ int ret;
+ cmdblock6_t cb;
+ memset (&cb, 0, sizeof (cb));
+ cb.command = 0x3;
+
+ ret = execute_command (dev, cbw_direction_data_in, (u8 *) &cb,
+ sizeof (cb), buf, 19, 1);
+
+ if (ret)
+ return ret;
+
+ /* Check if sense key is set to NOT READY. */
+ if ((buf[2] & 0xf) != 2)
+ return MSC_COMMAND_FAIL;
+
+ /* Check if additional sense code is 0x3a. */
+ if (buf[12] != 0x3a)
+ return MSC_COMMAND_FAIL;
+
+ /* No media is present. Return MSC_COMMAND_DETACHED so as not to use
+ * this device any longer. */
+ usb_debug("Empty media found.\n");
+ return MSC_COMMAND_DETACHED;
+}
+
static int
test_unit_ready (usbdev_t *dev)
{
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4156
-gerrit
commit efeb1be591dfdb1156bd60bf02c22808c5d822c2
Author: Stefan Reinauer <reinauer(a)chromium.org>
Date: Thu May 2 14:02:28 2013 -0700
Make ssize_t an actual ssize_t
In the process of getting rid of compiler includes during in coreboot
and libpayload, we defined size_t and ssize_t ourselves, using a GCC
macro for size_t: __SIZE_TYPE__. Unfortunately, there is no
__SSIZE_TYPE__, so we temporarily redefine unsigned to signed to make
__SIZE_TYPE__ __SSIZE_TYPE__.
Signed-off-by: Stefan Reinauer <reinauer(a)google.com>
Change-Id: I4cf4eb0fdaa4db64277c2585fe2c1bdc0acdf02b
Reviewed-on: https://gerrit.chromium.org/gerrit/49947
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Commit-Queue: Stefan Reinauer <reinauer(a)google.com>
Tested-by: Stefan Reinauer <reinauer(a)google.com>
---
payloads/libpayload/include/stddef.h | 8 +++++++-
src/include/stddef.h | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h
index 91ae782..f9deaeb 100644
--- a/payloads/libpayload/include/stddef.h
+++ b/payloads/libpayload/include/stddef.h
@@ -5,7 +5,13 @@
#define __SIZE_TYPE__ unsigned long
#endif
typedef __SIZE_TYPE__ size_t;
-typedef long ssize_t;
+/* There is a GCC macro for a size_t type, but not
+ * for a ssize_t type. Below construct tricks GCC
+ * into making __SIZE_TYPE__ signed.
+ */
+#define unsigned signed
+typedef __SIZE_TYPE__ ssize_t;
+#undef unsigned
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER)
diff --git a/src/include/stddef.h b/src/include/stddef.h
index 5b51c00..d0dad62 100644
--- a/src/include/stddef.h
+++ b/src/include/stddef.h
@@ -6,7 +6,13 @@ typedef long ptrdiff_t;
#define __SIZE_TYPE__ unsigned long
#endif
typedef __SIZE_TYPE__ size_t;
-typedef long ssize_t;
+/* There is a GCC macro for a size_t type, but not
+ * for a ssize_t type. Below construct tricks GCC
+ * into making __SIZE_TYPE__ signed.
+ */
+#define unsigned signed
+typedef __SIZE_TYPE__ ssize_t;
+#undef unsigned
typedef int wchar_t;
typedef unsigned int wint_t;
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4159
-gerrit
commit caab2a2c71aef108da23a96574a574d3500f95b4
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue May 7 10:56:16 2013 -0500
x86: call cbfstool update-fit when fit selected
In order for the FIT entries to be populated in the table the
update-fit command needs to be done on the coreboot image. That
way the microcode entries are added to the table properly.
Change-Id: I44595aee1ca710f4f04d482d8900cf95fbc1797f
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50317
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/arch/x86/Makefile.inc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index dee56c5..3939122 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -130,6 +130,12 @@ endif
ifeq ($(CONFIG_PXE_ROM),y)
$(CBFSTOOL) $@.tmp add -f $(CONFIG_PXE_ROM_FILE) -n pci$(CONFIG_PXE_ROM_ID).rom -t raw
endif
+ifeq ($(CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE),y)
+ifeq ($(CONFIG_CPU_MICROCODE_IN_CBFS),y)
+ @printf " UPDATE-FIT \n"
+ $(CBFSTOOL) $@.tmp update-fit -n cpu_microcode_blob.bin -x $(CONFIG_CPU_INTEL_NUM_FIT_ENTRIES)
+endif
+endif
mv $@.tmp $@
@printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n"
$(CBFSTOOL) $@ print