Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5872
-gerrit
commit 4ece2d640752760a5d50c8360931f94d270b8bbe
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Mon May 26 17:38:23 2014 +1000
Intel: Add common header file for CAR setup
When passing '-ffreestanding' the 'main' romstage.c may no longer
necessarily be considered the entry point.
From the C specification in 5.1.2.1 Freestanding environment;
"In a freestanding environment (in which C program execution may take
place without any benefit of an operating system), the name and type of
the function called at program startup are implementation-defined."
Clang complains about these being missing as Clang is somewhat more
strict about the spec than GNU/GCC is. An advantage here is that a
different entry-point type-signature shall now be warned about at
compile time.
Change-Id: I467001adabd47958c30c9a15e3248e42ed1151f3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/include/cpu/intel/car.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/include/cpu/intel/car.h b/src/include/cpu/intel/car.h
new file mode 100644
index 0000000..dc89ffc
--- /dev/null
+++ b/src/include/cpu/intel/car.h
@@ -0,0 +1,7 @@
+#ifndef _CPU_INTEL_CAR_H
+#define _CPU_INTEL_CAR_H
+
+/* std signature of entry-point to romstage.c */
+void main(unsigned long bist);
+
+#endif /* _CPU_INTEL_CAR_H */
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6104
-gerrit
commit b76dcad5d72fdaf11447ef024cf71ac9b3f9ef3f
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Tue Jun 24 19:15:59 2014 +1000
*/include/kconfig.h: Provides IS_{MODULE,BUILTIN}() macros
Update kconfig.h to be inline with Linux with improved documentation
clarifying the semantics of these macros.
Change-Id: I95637fc4c2dbc308868171173b7ff53e8a900ac9
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
payloads/libpayload/include/kconfig.h | 30 +++++++++++++++++++++++++++---
src/include/kconfig.h | 28 ++++++++++++++++++++++++++--
2 files changed, 53 insertions(+), 5 deletions(-)
diff --git a/payloads/libpayload/include/kconfig.h b/payloads/libpayload/include/kconfig.h
index 3d7d768..e07f015 100644
--- a/payloads/libpayload/include/kconfig.h
+++ b/payloads/libpayload/include/kconfig.h
@@ -1,7 +1,12 @@
#ifndef __KCONFIG_H__
#define __KCONFIG_H__
-#include <libpayload-config.h>
+#include <config.h>
+
+/*
+ * Helper macros to use CONFIG_ options in C/CPP expressions. Note that
+ * these only work with boolean and tristate options.
+ */
/*
* Getting something that works in C and CPP for an arg that may or may
@@ -17,5 +22,24 @@
#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0, 0)
#define ___config_enabled(__ignored, val, ...) val
-#define IS_ENABLED(option) config_enabled(option)
-#endif
+/*
+ * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
+ * 0 otherwise.
+ */
+#define IS_ENABLED(option) \
+ (config_enabled(option) || config_enabled(option##_MODULE))
+
+/*
+ * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
+ * otherwise. For boolean options, this is equivalent to
+ * IS_ENABLED(CONFIG_FOO).
+ */
+#define IS_BUILTIN(option) config_enabled(option)
+
+/*
+ * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
+ * otherwise.
+ */
+#define IS_MODULE(option) config_enabled(option##_MODULE)
+
+#endif /* __KCONFIG_H__ */
diff --git a/src/include/kconfig.h b/src/include/kconfig.h
index 73106e9..e07f015 100644
--- a/src/include/kconfig.h
+++ b/src/include/kconfig.h
@@ -4,6 +4,11 @@
#include <config.h>
/*
+ * Helper macros to use CONFIG_ options in C/CPP expressions. Note that
+ * these only work with boolean and tristate options.
+ */
+
+/*
* Getting something that works in C and CPP for an arg that may or may
* not be defined is tricky. Here, if we have "#define CONFIG_BOOGER 1"
* we match on the placeholder define, insert the "0," for arg1 and generate
@@ -17,5 +22,24 @@
#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0, 0)
#define ___config_enabled(__ignored, val, ...) val
-#define IS_ENABLED(option) config_enabled(option)
-#endif
+/*
+ * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
+ * 0 otherwise.
+ */
+#define IS_ENABLED(option) \
+ (config_enabled(option) || config_enabled(option##_MODULE))
+
+/*
+ * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
+ * otherwise. For boolean options, this is equivalent to
+ * IS_ENABLED(CONFIG_FOO).
+ */
+#define IS_BUILTIN(option) config_enabled(option)
+
+/*
+ * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
+ * otherwise.
+ */
+#define IS_MODULE(option) config_enabled(option##_MODULE)
+
+#endif /* __KCONFIG_H__ */
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6091
-gerrit
commit 288862c2b1be8ada3a90c8042ebeb898344ed7b6
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sat Jun 21 21:42:25 2014 +1000
src/console/post.c: Sanitize headers from preprocessor abuse
Continuing on from the rational given in:
a173a62 Remove guarding #includes by CONFIG_FOO combinations
Change-Id: I524713b21684f6fa99355614a1ab38aee9975790
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/console/post.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/console/post.c b/src/console/post.c
index ef1a3a5..4f2a87c 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -20,15 +20,11 @@
*/
#include <arch/io.h>
+#include <elog.h>
#include <console/console.h>
-#if CONFIG_CMOS_POST
+#include <device/device.h>
#include <pc80/mc146818rtc.h>
#include <smp/spinlock.h>
-#endif
-#if CONFIG_CMOS_POST_EXTRA
-#include <device/device.h>
-#endif
-#include <elog.h>
/* Write POST information */
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6091
-gerrit
commit 8019ff1f1f879cbb78e30f14de3e0230e1bd27ca
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sat Jun 21 21:42:25 2014 +1000
src/console/post.c: Sanitize headers from preprocessor abuse
Continuing on from the rational given in:
a173a62 Remove guarding #includes by CONFIG_FOO combinations
Change-Id: I524713b21684f6fa99355614a1ab38aee9975790
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/console/post.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/console/post.c b/src/console/post.c
index ef1a3a5..a108a7b 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -20,15 +20,15 @@
*/
#include <arch/io.h>
+#include <elog.h>
#include <console/console.h>
-#if CONFIG_CMOS_POST
#include <pc80/mc146818rtc.h>
#include <smp/spinlock.h>
-#endif
-#if CONFIG_CMOS_POST_EXTRA
+
+/* FIXME: unwrapping these header guards breaks builds due to deeper issues */
+#if !defined(__ROMCC__)
#include <device/device.h>
-#endif
-#include <elog.h>
+#endif /* __ROMCC__ */
/* Write POST information */
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6091
-gerrit
commit f0266e29baed496c794e35ee204d1c6da80aed5d
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sat Jun 21 21:42:25 2014 +1000
src/console/post.c: Sanitize headers from preprocessor abuse
Some headers could not be taken care of here yet due to deeper issues:
include/device/device.h is incompatible with ROMCC
Change-Id: I524713b21684f6fa99355614a1ab38aee9975790
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/console/post.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/console/post.c b/src/console/post.c
index ef1a3a5..a108a7b 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -20,15 +20,15 @@
*/
#include <arch/io.h>
+#include <elog.h>
#include <console/console.h>
-#if CONFIG_CMOS_POST
#include <pc80/mc146818rtc.h>
#include <smp/spinlock.h>
-#endif
-#if CONFIG_CMOS_POST_EXTRA
+
+/* FIXME: unwrapping these header guards breaks builds due to deeper issues */
+#if !defined(__ROMCC__)
#include <device/device.h>
-#endif
-#include <elog.h>
+#endif /* __ROMCC__ */
/* Write POST information */
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6102
-gerrit
commit 4b0757ec2e2fa4d8cd1404ce24436635171ae9b1
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Tue Jun 24 17:12:27 2014 +1000
console/Makefile.inc: post.c is x86 specific code without cond
Be sure not to build X86 specific code on other ISA's.
Change-Id: I8f922b436e2011c7cd94eb98db8ef1c525b3ca8d
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/console/Makefile.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc
index 435d704..44b4857 100644
--- a/src/console/Makefile.inc
+++ b/src/console/Makefile.inc
@@ -1,6 +1,6 @@
ramstage-y += vtxprintf.c printk.c vsprintf.c
ramstage-y += init.c console.c
-ramstage-y += post.c
+ramstage-$(CONFIG_ARCH_X86) += post.c
ramstage-y += die.c
smm-$(CONFIG_DEBUG_SMI) += init.c console.c vtxprintf.c printk.c