Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6890
-gerrit
commit ab403aef46bd6e21df20cddcdb9f6e337829023e
Author: Gabe Black <gabeblack(a)google.com>
Date: Sat Nov 23 00:54:40 2013 -0800
libpayload: Add wrappers for malloc which check its return value.
The xmalloc wrapper checks whether the malloc succeeded, and if not stops
execution and prints a message. xmalloc always returns a valid pointer. The
xzalloc wrapper does the same thing, but also zeroes the memory before
returning it.
Old-Change-Id: I00e7de04a5c368ab3603530b98bd3e3596e10632
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/178001
Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit 4029796d4f66601e33ae3038dbfc3299f56baf89)
libpayload: malloc: Fix xmalloc() for zero byte allocations
The C standard considers it legal to return a NULL pointer for zero
length memory allocations, and our malloc implementation does in fact
make use of that. xmalloc() and xzmalloc() should therefore not consider
this case a failure.
Also fixed a minor formatting issue.
Old-Change-Id: Ib9b75df9458ce2ba75fd0bc0af9814a3323298eb
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/178725
Reviewed-by: Mike Frysinger <vapier(a)chromium.org>
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
(cherry picked from commit 3033437e9d89c6072464860ea50ea27dcb76fe54)
Squashed 2 libpayload malloc related commits.
Change-Id: I682ef5f4aad58c93ae2be40e2edc1fd29e5d0438
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
payloads/libpayload/include/stdlib.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/payloads/libpayload/include/stdlib.h b/payloads/libpayload/include/stdlib.h
index 1ed92d5..7113b6f 100644
--- a/payloads/libpayload/include/stdlib.h
+++ b/payloads/libpayload/include/stdlib.h
@@ -2,6 +2,7 @@
* This file is part of the libpayload project.
*
* Copyright (C) 2008 Advanced Micro Devices, Inc.
+ * Copyright 2013 Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,7 +31,9 @@
#ifndef _STDLIB_H
#define _STDLIB_H
+#include <die.h>
#include <stddef.h>
+#include <string.h>
/**
* @defgroup malloc Memory allocation functions
@@ -145,6 +148,27 @@ void *dma_memalign(size_t align, size_t size);
void init_dma_memory(void *start, u32 size);
int dma_initialized(void);
int dma_coherent(void *ptr);
+
+static inline void *xmalloc_work(size_t size, const char *file,
+ const char *func, int line)
+{
+ void *ret = malloc(size);
+ if (!ret && size) {
+ die_work(file, func, line, "Failed to malloc %zu bytes.\n",
+ size);
+ }
+ return ret;
+}
+#define xmalloc(size) xmalloc_work((size), __FILE__, __FUNCTION__, __LINE__)
+
+static inline void *xzalloc_work(size_t size, const char *file,
+ const char *func, int line)
+{
+ void *ret = xmalloc_work(size, file, func, line);
+ memset(ret, 0, size);
+ return ret;
+}
+#define xzalloc(size) xzalloc_work((size), __FILE__, __FUNCTION__, __LINE__)
/** @} */
/**
the following patch was just integrated into master:
commit 8eb7c7d0a76c5586beed33fa57f38d5e4e335ca1
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Sun Aug 31 02:10:34 2014 +0200
sch: make separate copy of nvs.h
Change-Id: Ie3a843a76ebf9f5d825e14c4359fb3ecaa052e38
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
Reviewed-on: http://review.coreboot.org/6809
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
See http://review.coreboot.org/6809 for details.
-gerrit
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6891
-gerrit
commit c20cd3cf3821f524ac57e1711cd7ab607b08024d
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sat Sep 13 03:43:49 2014 +1000
Kconfig: Allow native vga init to be selectable for SeaBIOS payload
Change-Id: I1508f3d3c56cb9afbf4a23355831549552a62866
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/Kconfig | 10 ++++++++++
src/arch/x86/Makefile.inc | 1 +
2 files changed, 11 insertions(+)
diff --git a/src/Kconfig b/src/Kconfig
index 97a4799..505f3cb 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -623,6 +623,16 @@ config SEABIOS_THREAD_OPTIONROMS
variations during option ROM code execution. It is not
known if all option ROMs will behave properly with this option.
+config SEABIOS_VGA_COREBOOT
+ prompt "Provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs" if PAYLOAD_SEABIOS
+ default n
+ bool
+ help
+ Coreboot can initialize the GPU of some mainboards.
+
+ After initializing the GPU, the information about it is passed to the payload.
+
+
choice
prompt "GRUB2 version"
default GRUB2_MASTER
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 036dc1a..32fc52e 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -349,6 +349,7 @@ seabios:
CONFIG_SEABIOS_MASTER=$(CONFIG_SEABIOS_MASTER) \
CONFIG_SEABIOS_STABLE=$(CONFIG_SEABIOS_STABLE) \
CONFIG_SEABIOS_THREAD_OPTIONROMS=$(CONFIG_SEABIOS_THREAD_OPTIONROMS) \
+ CONFIG_SEABIOS_VGA_COREBOOT=$(CONFIG_SEABIOS_VGA_COREBOOT) \
CONFIG_CONSOLE_SERIAL=$(CONFIG_CONSOLE_SERIAL) \
CONFIG_TTYS0_BASE=$(CONFIG_TTYS0_BASE) \
OUT=$(abspath $(obj)) IASL="$(IASL)"
Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6890
-gerrit
commit 49f6a522608193b9b29d220d43bbc4a5fb7c7150
Author: Gabe Black <gabeblack(a)google.com>
Date: Sat Nov 23 00:54:40 2013 -0800
libpayload: Add wrappers for malloc which check its return value.
The xmalloc wrapper checks whether the malloc succeeded, and if not stops
execution and prints a message. xmalloc always returns a valid pointer. The
xzalloc wrapper does the same thing, but also zeroes the memory before
returning it.
Old-Change-Id: I00e7de04a5c368ab3603530b98bd3e3596e10632
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/178001
Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit 4029796d4f66601e33ae3038dbfc3299f56baf89)
libpayload: malloc: Fix xmalloc() for zero byte allocations
The C standard considers it legal to return a NULL pointer for zero
length memory allocations, and our malloc implementation does in fact
make use of that. xmalloc() and xzmalloc() should therefore not consider
this case a failure.
Also fixed a minor formatting issue.
Old-Change-Id: Ib9b75df9458ce2ba75fd0bc0af9814a3323298eb
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/178725
Reviewed-by: Mike Frysinger <vapier(a)chromium.org>
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
(cherry picked from commit 3033437e9d89c6072464860ea50ea27dcb76fe54)
Squashed 2 libpayload malloc related commits.
Change-Id: I682ef5f4aad58c93ae2be40e2edc1fd29e5d0438
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
payloads/libpayload/include/stdlib.h | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/payloads/libpayload/include/stdlib.h b/payloads/libpayload/include/stdlib.h
index 1ed92d5..7113b6f 100644
--- a/payloads/libpayload/include/stdlib.h
+++ b/payloads/libpayload/include/stdlib.h
@@ -2,6 +2,7 @@
* This file is part of the libpayload project.
*
* Copyright (C) 2008 Advanced Micro Devices, Inc.
+ * Copyright 2013 Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,7 +31,9 @@
#ifndef _STDLIB_H
#define _STDLIB_H
+#include <die.h>
#include <stddef.h>
+#include <string.h>
/**
* @defgroup malloc Memory allocation functions
@@ -145,6 +148,27 @@ void *dma_memalign(size_t align, size_t size);
void init_dma_memory(void *start, u32 size);
int dma_initialized(void);
int dma_coherent(void *ptr);
+
+static inline void *xmalloc_work(size_t size, const char *file,
+ const char *func, int line)
+{
+ void *ret = malloc(size);
+ if (!ret && size) {
+ die_work(file, func, line, "Failed to malloc %zu bytes.\n",
+ size);
+ }
+ return ret;
+}
+#define xmalloc(size) xmalloc_work((size), __FILE__, __FUNCTION__, __LINE__)
+
+static inline void *xzalloc_work(size_t size, const char *file,
+ const char *func, int line)
+{
+ void *ret = xmalloc_work(size, file, func, line);
+ memset(ret, 0, size);
+ return ret;
+}
+#define xzalloc(size) xzalloc_work((size), __FILE__, __FUNCTION__, __LINE__)
/** @} */
/**
the following patch was just integrated into master:
commit 5fcae806531a0c4a9a8216c2a1a16d326eb2a1db
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Tue Jul 29 14:42:26 2014 +1000
lenovo/t530: Use native LVDS gfx init
As introduced in:
1783a3c ivybridge: LVDS gfx init.
The panel on the T530 is a AUO B156HW01 V.4, 40 pin LVDS (2 ch, 6-bit).
Tx parameters derived from datasheet table.
Change-Id: I2e3b56a2a3d1ede08a704b839cc11fe6d685cf5b
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-on: http://review.coreboot.org/6395
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <gaumless(a)gmail.com>
Reviewed-by: Vladimir Serbinenko <phcoder(a)gmail.com>
See http://review.coreboot.org/6395 for details.
-gerrit
the following patch was just integrated into master:
commit 1633261979a9cdec4e6b0ebeb12dac361d3cd8a4
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Tue Jul 29 14:09:27 2014 +1000
lenovo/t530: Use native raminit over MRC blob
We now have Native raminit for both sandy/ivybridge introduced in:
7686a56 sandy/ivybridge: Native raminit.
Let us make good use of this support over using the Intel MRC blob to
initialise memory.
USB RCBA configuration data taken between base of 0x3500 up to 0x3600
from `inteltool -r`.
Remark: Note the current port is poorly tested at the moment and I am the
sole maintainer, however one less blob invites more interest for better
support. More to come hopefully.
Change-Id: I41d0ef8303dfd369c5565b823e68a6bee09c44f5
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-on: http://review.coreboot.org/6394
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <gaumless(a)gmail.com>
See http://review.coreboot.org/6394 for details.
-gerrit
the following patch was just integrated into master:
commit de40e0dd1172f6091fbc4b9bc7b0d9825ff532ba
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Sep 12 04:00:44 2014 +1000
lenovo/t530: Remove empty mainboard.asl
Change-Id: Iaccaf5246e7ac5da2b51dd915c3f3ef807fc6467
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-on: http://review.coreboot.org/6875
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Martin Roth <gaumless(a)gmail.com>
Reviewed-by: Vladimir Serbinenko <phcoder(a)gmail.com>
See http://review.coreboot.org/6875 for details.
-gerrit
Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6889
-gerrit
commit bf93c709b962c151e082c50dec08c468a205d8a9
Author: Gabe Black <gabeblack(a)google.com>
Date: Sat Nov 23 00:38:49 2013 -0800
libpayload: Add a new "die" function to fatally signal programming errors.
If a programming error is detected, die can be used to print a message and
stop execution similar to failing an assert. There's also a "die_if" function
which is conditional.
die functions, like asserts, should be used to trap programming errors and not
when the hardware does something wrong. If all code was written perfectly, no
die function would ever be called. In other words, it would be appropriate to
use die if a function was called with a value that was out of bounds or if
malloc failed. It wouldn't be appropriate if an external device doesn't
respond.
In the future, the die family of functions might print a stack trace or show
other debugging info.
Old-Change-Id: I653fc8cb0b4e459522f1b86f7fac280836d57916
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/178000
Reviewed-by: Gabe Black <gabeblack(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit 59df109d56a0f5346562de9b3124666a4443adf0)
libpayload: Fix the license in some files which were accidentally made GPL.
Some files were accidentally made GPL when they were added to libpayload. This
change changes them over to a BSD license to be in line with the intended
license of libpayload.
Old-Change-Id: Ia95ac4951b173dcb93cb489705680e7313df3c92
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/182202
Reviewed-by: Ronald Minnich <rminnich(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit 5f47600e50e82de226f2fa6ea81d4a3d1c56277b)
Squashed the initial patch for "die" functions and a later update to
the license header.
Change-Id: I3a62cd820e676f4458e61808733d81edd3d76e87
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
payloads/libpayload/include/die.h | 45 ++++++++++++++++++++++++++++++++
payloads/libpayload/include/endian.h | 39 +++++++++++++++------------
payloads/libpayload/include/ipchksum.h | 39 +++++++++++++++------------
payloads/libpayload/include/libpayload.h | 1 +
payloads/libpayload/libc/Makefile.inc | 1 +
payloads/libpayload/libc/die.c | 42 +++++++++++++++++++++++++++++
6 files changed, 135 insertions(+), 32 deletions(-)
diff --git a/payloads/libpayload/include/die.h b/payloads/libpayload/include/die.h
new file mode 100644
index 0000000..6dff6a8
--- /dev/null
+++ b/payloads/libpayload/include/die.h
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the libpayload project.
+ *
+ * Copyright (C) 2013 coresystems GmbH
+ *
+ * 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 __DIE_H__
+#define __DIE_H__
+
+void die_work(const char *file, const char *func, const int line,
+ const char *fmt, ...)
+ __attribute__((format (printf, 4, 5)))
+ __attribute__((noreturn));
+
+#define die(fmt, args...) \
+ do { die_work(__FILE__, __FUNCTION__, __LINE__, fmt, ##args); } \
+ while (0)
+
+#define die_if(condition, fmt, args...) \
+ do { if (condition) die(fmt, ##args); } while (0)
+
+#endif /* __DIE_H__ */
diff --git a/payloads/libpayload/include/endian.h b/payloads/libpayload/include/endian.h
index ada6bc6..dd4d9fa 100644
--- a/payloads/libpayload/include/endian.h
+++ b/payloads/libpayload/include/endian.h
@@ -1,23 +1,30 @@
/*
- * Copyright (c) 2012 The Chromium OS Authors.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
+ * This file is part of the libpayload project.
*
- * 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; either version 2 of
- * the License, or (at your option) any later version.
+ * Copyright (c) 2012 The Chromium OS Authors.
*
- * 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.
+ * 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.
*
- * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * 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 _ENDIAN_H_
diff --git a/payloads/libpayload/include/ipchksum.h b/payloads/libpayload/include/ipchksum.h
index b7ded08..1ce13cd 100644
--- a/payloads/libpayload/include/ipchksum.h
+++ b/payloads/libpayload/include/ipchksum.h
@@ -1,23 +1,30 @@
/*
- * Copyright (c) 2012 The Chromium OS Authors.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
+ * This file is part of the libpayload project.
*
- * 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; either version 2 of
- * the License, or (at your option) any later version.
+ * Copyright (c) 2012 The Chromium OS Authors.
*
- * 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.
+ * 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.
*
- * 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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * 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 __IPCHKSUM_H__
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 48a034b..3e48650 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -45,6 +45,7 @@
#include <libpayload-config.h>
#include <ctype.h>
+#include <die.h>
#include <ipchksum.h>
#include <stddef.h>
#include <stdio.h>
diff --git a/payloads/libpayload/libc/Makefile.inc b/payloads/libpayload/libc/Makefile.inc
index 53f3c9b..e2eee15 100644
--- a/payloads/libpayload/libc/Makefile.inc
+++ b/payloads/libpayload/libc/Makefile.inc
@@ -36,6 +36,7 @@ libc-$(CONFIG_LP_LIBC) += args.c strings.c
libc-$(CONFIG_LP_LIBC) += strlcpy.c
libc-$(CONFIG_LP_LIBC) += qsort.c
libc-$(CONFIG_LP_LIBC) += hexdump.c
+libc-$(CONFIG_LP_LIBC) += die.c
# should be moved to coreboot directory
libc-$(CONFIG_LP_LAR) += lar.c
diff --git a/payloads/libpayload/libc/die.c b/payloads/libpayload/libc/die.c
new file mode 100644
index 0000000..62e98b3
--- /dev/null
+++ b/payloads/libpayload/libc/die.c
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libpayload project.
+ *
+ * Copyright 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.
+ */
+
+#include <libpayload.h>
+
+void die_work(const char *file, const char *func, const int line,
+ const char *fmt, ...)
+{
+ va_list args;
+
+ printf("%s:%d %s(): ", file, line, func);
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+ abort();
+}
the following patch was just integrated into master:
commit 47d37b9ab255fded3df1163b126397b4ee6d9830
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Thu Aug 28 01:14:00 2014 +0200
ec/lenovo/h8: return correctly typed package if battery is absent
Fixes "Discharge rate invalid message" and fwts error.
Change-Id: I51f9d819f164552567d75f83c95ba7523e97343e
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
Reviewed-on: http://review.coreboot.org/6793
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
See http://review.coreboot.org/6793 for details.
-gerrit
Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6888
-gerrit
commit befc1ee3fe3e2347a7bf55ddb6cf99d6dead4888
Author: Julius Werner <jwerner(a)chromium.org>
Date: Wed Nov 13 16:06:34 2013 -0800
arm: Remove CAR_MIGRATE Kconfig and associated cruft
This is essentially a revert of commit 10bd772d. The CAR_MIGRATE
mechanism is only useful to migrate variables from a special region
(e.g. cache as RAM) into DRAM-backed CBMEM between different parts of
the romstage (it does not persist into ramstage). Since ARM devices use
SRAM for which there is no reason to become inaccessible in later parts
of the romstage, this mechanism isn't useful for them. Removing it makes
the romstage.ld script much simpler, which has the nice side-effect of
putting the BSS at the end of the memory image (so that cbfstool can
actually figure out that it doesn't need to be part of the ROM image).
Old-Change-Id: I50e91d8bd51b5deb19446d9da48699edecbef6ea
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176761
Reviewed-by: David Hendricks <dhendrix(a)chromium.org>
(cherry picked from commit ebfd698e57c902e2f39a0cfc1bc2b02665e47ec6)
console: Make cbmem depend on x86.
The cbmem implementation isn't supported on anything other than x86 right now
and actually causes memory corruption on ARM machines. Until that's fixed, this
will prevent people from turning it on and causing hard to track down errors.
Old-Change-Id: I00e8aacf008acfe2f76d4eab82570f7c1cc89cab
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/191107
Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit e54f16e346a7f2c66d802fb78a6b24e53b732b83)
Squashed two related commits for cbmem support on arm.
Change-Id: I2be48cea348ee5dc8ca3632d743500aa111bab08
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
src/arch/arm/include/arch/early_variables.h | 27 -------------------------
src/arch/arm/romstage.ld | 31 +----------------------------
src/console/Kconfig | 1 +
src/cpu/x86/Makefile.inc | 2 ++
4 files changed, 4 insertions(+), 57 deletions(-)
diff --git a/src/arch/arm/include/arch/early_variables.h b/src/arch/arm/include/arch/early_variables.h
index cec0a46..041d0ae 100644
--- a/src/arch/arm/include/arch/early_variables.h
+++ b/src/arch/arm/include/arch/early_variables.h
@@ -20,40 +20,13 @@
#ifndef ARCH_EARLY_VARIABLES_H
#define ARCH_EARLY_VARIABLES_H
-#ifdef __PRE_RAM__
-#define CAR_GLOBAL __attribute__((section(".car.global_data")))
-#define CAR_CBMEM __attribute__((section(".car.cbmem_console")))
-#else
#define CAR_GLOBAL
#define CAR_CBMEM
-#endif
-
-#if defined(__PRE_RAM__)
-#define CAR_MIGRATE_ATTR __attribute__ ((used,section (".car.migrate")))
-
-/* Call migrate_fn_() when CAR globals are migrated. */
-#define CAR_MIGRATE(migrate_fn_) \
- static void (* const migrate_fn_ ## _ptr)(void) CAR_MIGRATE_ATTR = \
- migrate_fn_;
-
-/* Get the correct pointer for the CAR global variable. */
-void *car_get_var_ptr(void *var);
-/* Get and set a primitive type global variable. */
-#define car_get_var(var) \
- *(typeof(var) *)car_get_var_ptr(&(var))
-#define car_set_var(var, val) \
- do { car_get_var(var) = (val); } while(0)
-
-/* Migrate the CAR variables to memory. */
-void car_migrate_variables(void);
-
-#else
#define CAR_MIGRATE(migrate_fn_)
static inline void *car_get_var_ptr(void *var) { return var; }
#define car_get_var(var) (var)
#define car_set_var(var, val) do { (var) = (val); } while (0)
static inline void car_migrate_variables(void) { }
-#endif
#endif
diff --git a/src/arch/arm/romstage.ld b/src/arch/arm/romstage.ld
index 65b133a..750525b 100644
--- a/src/arch/arm/romstage.ld
+++ b/src/arch/arm/romstage.ld
@@ -35,7 +35,6 @@ PHDRS
SECTIONS
{
- /* TODO make this a configurable option (per chipset). */
. = CONFIG_ROMSTAGE_BASE;
.romtext . : {
@@ -50,11 +49,7 @@ SECTIONS
*(.rodata);
*(.machine_param);
*(.data);
- . = ALIGN(16);
- _car_migrate_start = .;
- *(.car.migrate);
- _car_migrate_end = .;
- . = ALIGN(16);
+ . = ALIGN(8);
_erom = .;
}
@@ -72,32 +67,8 @@ SECTIONS
_ebss = .;
- .car.data . : {
- . = ALIGN(8);
- _car_data_start = .;
- *(.car.global_data);
- . = ALIGN(8);
- /* The cbmem_console section comes last to take advantage of
- * a zero-sized array to hold the memconsole contents that
- * grows to a bound of CONFIG_CONSOLE_CAR_BUFFER_SIZE. However,
- * collisions within the cache-as-ram region cannot be
- * statically checked because the cache-as-ram region usage is
- * cpu/chipset dependent. */
- *(.car.cbmem_console);
- _car_data_end = .;
- }
-
_end = .;
- /* TODO: check if we are running out of SRAM. Below check is not good
- * enough though because SRAM has different size on different CPUs
- * and not all SRAM is available to the romstage. On Exynos, some is
- * used for BL1, the bootblock and the stack.
- *
- * _bogus = ASSERT((_end - _start + EXPECTED_CBMEM_CONSOLE_SIZE <= \
- * 0x54000), "SRAM area is too full");
- */
-
/* Discard the sections we don't need/want */
/DISCARD/ : {
*(.comment)
diff --git a/src/console/Kconfig b/src/console/Kconfig
index c7c3ea5..701ed7f 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -168,6 +168,7 @@ config CONSOLE_NE2K_IO_PORT
boundary, qemu needs broader align)
config CONSOLE_CBMEM
+ depends on ARCH_X86
bool "Send console output to a CBMEM buffer"
default n
help
diff --git a/src/cpu/x86/Makefile.inc b/src/cpu/x86/Makefile.inc
index a05c723..418b5d7 100644
--- a/src/cpu/x86/Makefile.inc
+++ b/src/cpu/x86/Makefile.inc
@@ -1,5 +1,7 @@
+ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y)
romstage-$(CONFIG_EARLY_CBMEM_INIT) += car.c
romstage-$(CONFIG_BROKEN_CAR_MIGRATE) += car.c
+endif
subdirs-$(CONFIG_PARALLEL_MP) += name
ramstage-$(CONFIG_PARALLEL_MP) += mp_init.c