Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4194
-gerrit
commit 5d31e2501bebfde2a4c2cd7db529827d9a1858ec
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri May 24 13:40:51 2013 -0500
libpayload: expose cbfs ram functions
The ram_media.c file is being compiled, however the
global functions were not exposed through a header.
Change-Id: I4588fbe320c29051566cef277bf4d20a83abf853
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56642
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-by: Stefan Reinauer <reinauer(a)google.com>
---
payloads/libpayload/include/cbfs_ram.h | 61 +++++++++++++++++++++++++++++++++
payloads/libpayload/libcbfs/ram_media.c | 4 +--
2 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/payloads/libpayload/include/cbfs_ram.h b/payloads/libpayload/include/cbfs_ram.h
new file mode 100644
index 0000000..defe823
--- /dev/null
+++ b/payloads/libpayload/include/cbfs_ram.h
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the libpayload project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ *
+ * This file is dual-licensed. You can choose between:
+ * - The GNU GPL, version 2, as published by the Free Software Foundation
+ * - The revised BSD license (without advertising clause)
+ *
+ * ---------------------------------------------------------------------------
+ * 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
+ * ---------------------------------------------------------------------------
+ * 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.
+ * ---------------------------------------------------------------------------
+ */
+
+#ifndef _CBFS_RAM_H_
+#define _CBFS_RAM_H_
+
+#include <stdint.h>
+
+struct cbfs_media;
+
+/* The following functions return 0 for success. None-zero on error. */
+int init_cbfs_ram_media(struct cbfs_media *media, void *start, size_t size);
+int setup_cbfs_from_ram(void *start, uint32_t size);
+int setup_cbfs_from_flash(void);
+
+#endif /* _CBFS_RAM_H_ */
diff --git a/payloads/libpayload/libcbfs/ram_media.c b/payloads/libpayload/libcbfs/ram_media.c
index 9f11a31..a260b05 100644
--- a/payloads/libpayload/libcbfs/ram_media.c
+++ b/payloads/libpayload/libcbfs/ram_media.c
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
#include <cbfs.h>
+#include <cbfs_ram.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -77,7 +78,6 @@ static int ram_close(struct cbfs_media *media) {
return 0;
}
-int init_cbfs_ram_media(struct cbfs_media *media, void *start, size_t size);
int init_cbfs_ram_media(struct cbfs_media *media, void *start, size_t size) {
// TODO Find a way to release unused media. Maybe adding media->destroy.
struct ram_media *m = (struct ram_media*)malloc(sizeof(*m));
@@ -96,7 +96,6 @@ int init_cbfs_ram_media(struct cbfs_media *media, void *start, size_t size) {
static int is_default_cbfs_media_initialized;
static struct cbfs_media default_cbfs_media;
-int setup_cbfs_from_ram(void *start, uint32_t size);
int setup_cbfs_from_ram(void *start, uint32_t size) {
int result = init_cbfs_ram_media(&default_cbfs_media, start, size);
if (result == 0)
@@ -105,7 +104,6 @@ int setup_cbfs_from_ram(void *start, uint32_t size) {
}
extern int libpayload_init_default_cbfs_media(struct cbfs_media *media);
-int setup_cbfs_from_flash(void);
int setup_cbfs_from_flash(void) {
int result = libpayload_init_default_cbfs_media(&default_cbfs_media);
if (result == 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/4198
-gerrit
commit de955224ae9458ad94969fcd9b279a861570aa8d
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue May 28 08:32:21 2013 -0700
falco: Update DIMM SPD table
RAM_ID indices have been changed and settled on a 2GB config
that will be the same DRAM chips but only used in one channel.
Change-Id: I444e655883ae045622ab3dfb964da4d7f86e1c0d
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56810
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/mainboard/google/falco/Makefile.inc | 9 ++++++---
src/mainboard/google/falco/romstage.c | 6 ++++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/mainboard/google/falco/Makefile.inc b/src/mainboard/google/falco/Makefile.inc
index e19db11..edb8cf6 100644
--- a/src/mainboard/google/falco/Makefile.inc
+++ b/src/mainboard/google/falco/Makefile.inc
@@ -28,9 +28,12 @@ smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
SPD_BIN = $(obj)/spd.bin
# Order of names in SPD_SOURCES is important!
-SPD_SOURCES = Hynix_HMT425S6AFR6A
-SPD_SOURCES += Micron_4KTF25664HZ
-SPD_SOURCES += Elpida_EDJ4216EFBG
+SPD_SOURCES = Micron_4KTF25664HZ # 4GB / CH0 + CH1
+SPD_SOURCES += Hynix_HMT425S6AFR6A # 4GB / CH0 + CH1
+SPD_SOURCES += Elpida_EDJ4216EFBG # 4GB / CH0 + CH1
+SPD_SOURCES += Micron_4KTF25664HZ # 2GB / CH0 only
+SPD_SOURCES += Hynix_HMT425S6AFR6A # 2GB / CH0 only
+SPD_SOURCES += Elpida_EDJ4216EFBG # 2GB / CH0 only
SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/$(f).spd.hex)
diff --git a/src/mainboard/google/falco/romstage.c b/src/mainboard/google/falco/romstage.c
index 3bf1dbd..ef6a849 100644
--- a/src/mainboard/google/falco/romstage.c
+++ b/src/mainboard/google/falco/romstage.c
@@ -91,6 +91,12 @@ static void copy_spd(struct pei_data *peid)
if (spd_file->len < sizeof(peid->spd_data[0]))
die("Missing SPD data.");
+ /* Index 0-2 are 4GB config with both CH0 and CH1
+ * Index 3-5 are 2GB config with CH0 only
+ */
+ if (spd_index > 2)
+ peid->dimm_channel1_disabled = 3;
+
memcpy(peid->spd_data[0],
((char*)CBFS_SUBHEADER(spd_file)) +
spd_index * sizeof(peid->spd_data[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/4199
-gerrit
commit 98ecda6aae3cee877ba24fd0b9145cc98e877aa0
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/4156
-gerrit
commit 5a29ad2e2939de28bb2db2ff916fc7c8188b9292
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 be6d38520fa3839f5a4aa143d91d54693443f56a
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