the following patch was just integrated into master:
commit 320647abdad1ea6cdceb834933507677020ea388
Author: Daisuke Nojiri <dnojiri(a)chromium.org>
Date: Thu Jun 19 19:09:47 2014 -0700
vboot2: add verstage
Verstage will host vboot2 for firmware verification.
It's a stage in the sense that it has its own set of toolchains, compiler flags,
and includes. This allows us to easily add object files as needed. But
it's directly linked to bootblock. This allows us to avoid code
duplication for stage loading and jumping (e.g. cbfs driver) for the boards
where bootblock has to run in a different architecture (e.g. Tegra124).
To avoid name space conflict, verstage symbols are prefixed with verstage_.
TEST=Built with VBOOT2_VERIFY_FIRMWARE on/off. Booted Nyan Blaze.
BUG=None
BRANCH=none
Original-Signed-off-by: Daisuke Nojiri <dnojiri(a)chromium.org>
Original-Change-Id: Iad57741157ec70426c676e46c5855e6797ac1dac
Original-Reviewed-on: https://chromium-review.googlesource.com/204376
Original-Reviewed-by: Randall Spangler <rspangler(a)chromium.org>
(cherry picked from commit 27940f891678dae975b68f2fc729ad7348192af3)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I42b2b3854a24ef6cda2316eb741ca379f41516e0
Reviewed-on: http://review.coreboot.org/8159
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/8159 for details.
-gerrit
the following patch was just integrated into master:
commit 337de4c0e539d3d055b916f40fc44067d1a13cd7
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Jun 16 23:02:03 2014 -0700
cbmem: Add support for new 'coreboot' compatible device tree binding
This patch brings the cbmem utility in line with the recent change to
coreboot's device tree binding. Since trying to find the right node to
place this binding has been so hard (and still isn't quite agreed upon),
and because it's really the more correct thing to do, this code searches
through the device tree for the 'coreboot' compatible property instead
of looking up a hardcoded path. It also provides bullet-proof
'#address-cells' handling that should work for any endianness and size.
BUG=chrome-os-partner:29311
TEST=Ran cbmem -c and cbmem -t on Nyan_Big. Also straced the to make
sure everything looks as expected. 'time cbmem -t' = ~35ms shows that
there is no serious performance problem from the more thorough lookup
code.
Original-Change-Id: I806a21270ba6cec6e81232075749016eaf18508b
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/204274
Original-Reviewed-by: Vadim Bendebury <vbendeb(a)chromium.org>
(cherry picked from commit 3e64e28f684e60e8b300906c1abffee75ec6a5c2)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I0a0a4f69330d3d8c5c3ea92b55f5dde4d43fca65
Reviewed-on: http://review.coreboot.org/8141
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
See http://review.coreboot.org/8141 for details.
-gerrit
the following patch was just integrated into master:
commit b3e0202fd45f415b4e92ad824e28d79fb9b33abf
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Jun 27 15:28:39 2014 -0500
cbfs: add cbfs_read()
Allow for reading from cbfs media without having a handle
to a non-CBFS_DEFAULT_MEDIA cbfs_media. In conjunction with
cbfs_locate_file() one can locate and cbfs_read() a file
without bringing the entire file through a potentially
temporary buffer (non-memory-mappable cbfs media platforms).
BUG=chrome-os-partner:29922
BRANCH=None
TEST=Built.
Original-Change-Id: Ib5d965334bce1267650fc23c9e9f496675cf8450
Original-Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/205991
Original-Reviewed-by: Furquan Shaikh <furquan(a)chromium.org>
(cherry picked from commit 85200f28863e5ea8888322f5787dc6de9a2999f0)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I25e3221beefd0155305ad63da6be9f47e756f7d0
Reviewed-on: http://review.coreboot.org/8181
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
See http://review.coreboot.org/8181 for details.
-gerrit
the following patch was just integrated into master:
commit b312b7f4660d6e32d08659ebb5fe0d3bb5635916
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Jun 27 15:06:02 2014 -0500
cbfs: add cbfs_locate_file()
cbfs_locate_file() can be used to locate the data within the
cbfs file. Based on the offset and length of the file it can
then be read into any address without bringing the contents
into another buffer (platforms without memory-mapped access
to entire contents of cbfs at once).
BUG=chrome-os-partner:29922
BRANCH=None
TEST=Built and booted rush into romstage (stage load still works).
Original-Change-Id: I2932f66478c74511ec1c876b09794d9a22a526b3
Original-Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/206000
Original-Reviewed-by: Furquan Shaikh <furquan(a)chromium.org>
(cherry picked from commit 56c958facd379ca0eeebe1b689e3b80d5e692699)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I0c4964132af615a069258c0eb37153bd84fbbfae
Reviewed-on: http://review.coreboot.org/8180
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
See http://review.coreboot.org/8180 for details.
-gerrit
the following patch was just integrated into master:
commit 01f5396bdce2cd69e91c54ef120b11e457ab2694
Author: Furquan Shaikh <furquan(a)google.com>
Date: Wed Jun 25 17:50:28 2014 -0700
cbfstool: Remove arch check for different stages
Remove the arch check for each stage as the arch for different stages can be
different based on the SoC. e.g.: Rush has arm32-based romstage whereas
arm64-based ramstage
BUG=None
BRANCH=None
TEST=Compiles successfully for nyan, link and rush
Original-Change-Id: I561dab5a5d87c6b93b8d667857d5e181ff72e35d
Original-Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/205761
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Commit-Queue: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-by: Ronald Minnich <rminnich(a)chromium.org>
(cherry picked from commit 6a6a87b65fcab5a7e8163258c7e8d704fa8d97c3)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: Ic412d60d8a72dac4f9807cae5d8c89499a157f96
Reviewed-on: http://review.coreboot.org/8179
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
See http://review.coreboot.org/8179 for details.
-gerrit
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8210
-gerrit
commit 50ca10d60273d6c85e12d90fb786d91790c26a89
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Tue Jan 13 14:11:43 2015 -0600
util: Add script and to extract drm_dp_helper form linux sources
<NOTFOTMERGE>
Feel free to edit commit msg and merge if you really want this.
This gets the job mostly done. There are still some minor details to
work out, but I wanted to publish this in case there are any
interested parties.
</NOTFOTMERGE>
There already is a version of the drm_dp_helper in the intel gma
driver, but that one is a severely gilded version. Most importantly,
it's missing the I2C over AUX helpers, which we plan to use for
radeon native init.
The semantic patch introduced in this allows extracting those helpers
without removing too much functionality. It converts include
directives to point to files in our path, and modifies the i2c message
structure to match the one e use in coreboot.
The result is pretty close to something that compiles out-of-the box,
tough minor manual editing may still be needed (emphasis on minor).
Change-Id: Ia8c9879595528b6fd63437fed3b555e9e47ecf7f
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
.../drm_dp_helper/dp_helper.spatch | 191 +++++++++++++++++++++
.../drm_dp_helper/extract_dp_helper.sh | 30 ++++
util/linux_source_extractors/drm_dp_helper/moo.h | 16 ++
3 files changed, 237 insertions(+)
diff --git a/util/linux_source_extractors/drm_dp_helper/dp_helper.spatch b/util/linux_source_extractors/drm_dp_helper/dp_helper.spatch
new file mode 100644
index 0000000..0a1b962
--- /dev/null
+++ b/util/linux_source_extractors/drm_dp_helper/dp_helper.spatch
@@ -0,0 +1,191 @@
+/*
+ * Convert drm_dp_helpers in linux from linux-centric to coreboot friendly.
+ *
+ * Note: You want to run the extract_dp_helper.sh script. It's much friendlier,
+ * and does almost everything for you.
+ */
+
+/* We don't use these ever */
+@ remove_bad_funcs @
+identifier func =~ "drm_dp_aux_unregister|drm_dp_aux_register|drm_dp_i2c_functionality";
+@@
+
+- func(...)
+- {
+- ...
+- }
+
+@ remove_export_symbol @
+declarer name EXPORT_SYMBOL;
+@@
+
+- EXPORT_SYMBOL(...);
+
+/* Some functions are found in coreboot headers */
+@ convert_includes_to_coreboot @
+@@
+
+(
+- #include <linux/types.h>
++ #include <stdbool.h>
++ #include <stddef.h>
++ #include <stdint.h>
++ #include <unistd.h>
+|
+- #include <linux/delay.h>
++ #include <delay.h>
+|
+- #include <drm/drm_dp_helper.h>
++ #include "drm_dp_helper.h"
+)
+
+/* The remaining linux includes, we don't give care about */
+@ kill_linux_includes @
+@@
+
+(
+- #include <linux/...>
+|
+- #include <drm/drmP.h>
+)
+
+/* Hey, what do you know! We only use u8. */
+@ convert_to_stdint @
+typedef u8;
+typedef uint8_t;
+typedef uint32_t;
+@@
+
+(
+- u8
++ uint8_t
+|
+/* A character is not an integer!!! God damn programmers */
+- unsigned char
++ uint8_t
+|
+/* How big is a long? Is it 32-bits, is it 64? Fuck that! Use a better type */
+- unsigned long
++ uint32_t
+)
+
+/* We don't use usleep_range() */
+@ usleep_to_delay @
+constant t1, t2;
+@@
+
+- usleep_range(t1, t2);
++ udelay(t1);
+
+@ remove_locks @
+expression lock;
+identifier s, memb;
+@@
+
+(
+- mutex_lock(lock);
+|
+- mutex_unlock(lock);
+|
+- mutex_init(lock);
+|
+struct s {
+...
+- struct mutex memb;
+...
+};
+)
+
+@ remove_superflous_i2c_structs @
+identifier s;
+identifier memb;
+@@
+
+struct s {
+...
+- struct i2c_adapter memb;
+...
+};
+
+/*
+ * This is bad. We might want to change this into the future, but for now,
+ * it allows us to easily integrate this helper into coreboot.
+ */
+@ change_dp_aux_context_type @
+identifier s, dev;
+@@
+
+struct s {
+...
+- struct device *dev;
++ void *parent;
+...
+};
+
+
+@ attribute_packed_fix @
+identifier s;
+//name __packed;
+@@
+
+struct s {
+...
+}
+- __packed
++ __attribute__((packed))
+;
+
+@ remove_bad_structs @
+identifier n;
+@@
+
+- static const struct i2c_algorithm n = {
+- ...
+- };
+
+@ convert_to_coreboot_i2c_struct @
+identifier func, adapter;
+identifier aux;
+@@
+
+func(...,
+- struct i2c_adapter *adapter
++ struct drm_dp_aux *aux
+,...)
+{
+...
+- struct drm_dp_aux *aux = adapter->algo_data;
+...
+}
+
+@ convert_to_coreboot_i2c_msg @
+identifier func, msgs;
+expression i;
+@@
+
+func(...,
+- struct i2c_msg *msgs
++ struct i2c_seg *msgs
+,...)
+{
+<...
+(
+- msgs[i].addr
++ msgs[i].chip
+|
+- msgs[i].flags & I2C_M_RD
++ msgs[i].read
+)
+...>
+}
+
+/* So, this rule doesn't add the prototype. hint: FIXME */
+@ make_i2c_non_static @
+identifier func =~ "drm_dp_i2c_xfer";
+@@
+
+- static
+func(...)
+{
+...
+}
diff --git a/util/linux_source_extractors/drm_dp_helper/extract_dp_helper.sh b/util/linux_source_extractors/drm_dp_helper/extract_dp_helper.sh
new file mode 100644
index 0000000..323ac07
--- /dev/null
+++ b/util/linux_source_extractors/drm_dp_helper/extract_dp_helper.sh
@@ -0,0 +1,30 @@
+#! /bin/bash
+
+#
+# Extract the drm_dp_helper.[ch] files from a linux tree
+# and convert them to a format usable in userspace or coreboot.
+#
+# Usage
+# sh extract_dp_helper.sh <path/to/linux/sources>
+#
+# It outputs the drm_dp_helper file in the working directory.
+#
+
+DEST=$(pwd)
+HEADER=drm_dp_helper.h
+SOURCE=drm_dp_helper.c
+
+HOME=$(dirname "${BASH_SOURCE[0]}")
+
+SPATCH=spatch
+
+echo Hello
+
+cp $1/include/drm/$HEADER $DEST
+cp $1/drivers/gpu/drm/$SOURCE $DEST
+
+$SPATCH -sp_file $HOME/dp_helper.spatch \
+ --macro-file-builtins $HOME/moo.h \
+ -in_place $DEST/$SOURCE $DEST/$HEADER
+
+echo $PWD
diff --git a/util/linux_source_extractors/drm_dp_helper/moo.h b/util/linux_source_extractors/drm_dp_helper/moo.h
new file mode 100644
index 0000000..6a4b11f
--- /dev/null
+++ b/util/linux_source_extractors/drm_dp_helper/moo.h
@@ -0,0 +1,16 @@
+/*
+ * Empty macro file for our semantic patches. The default macro file is stupid.
+ * It's so stupid in fact, that it defines as nothing things we want to remove.
+ * That prevents us from renaming macros like "__packed". To make sure the
+ * semantic patch works as expected, we override the built-in macro file.
+ *
+ * The cow is here to make sure we don't provide a completely useless file.
+ */
+
+#define __MOO \
+ " (__) \n" \
+ " (oo) \n" \
+ " /------\/ \n" \
+ " / | || \n" \
+ " * /\---/\ \n" \
+ " ~~ ~~ \n"
the following patch was just integrated into master:
commit fa6bd71bddca404e99e4ab119b890020c0fda998
Author: Martin Roth <gaumless(a)gmail.com>
Date: Sun Jan 11 11:34:36 2015 -0700
vendorcode/intel: remove DebugDeadLoop() from fsptypes.h
When included for the CAR transition, this was causing the error:
error: invalid storage class for function 'DebugDeadLoop'
Change-Id: Idf37a8104b4468b40c29c8cbe9a40f7a357a4f17
Signed-off-by: Martin Roth <gaumless(a)gmail.com>
Reviewed-on: http://review.coreboot.org/8193
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/8193 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/8209
-gerrit
commit 1c63cdc4df6f7fd8f6b66d0397b026ce3bb49563
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Wed Jan 14 02:14:21 2015 +1100
drivers/i2c/w83795: Fix tautology from wrong return type
The correct type-signature of 'do_smbus_write_byte' is:
int do_smbus_write_byte(u32 smbus_io_base, u32 device, u32 address, u8 val)
and so storing the return type in a 'u32' is inappropriate, leading
to a tautological compare of 'ret < 0' and 'err < 0'.
Change-Id: I65486df7156c70af84fa00c336142d9a45998620
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/drivers/i2c/w83795/w83795.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/drivers/i2c/w83795/w83795.c b/src/drivers/i2c/w83795/w83795.c
index 569fe5a..397c22c 100644
--- a/src/drivers/i2c/w83795/w83795.c
+++ b/src/drivers/i2c/w83795/w83795.c
@@ -24,14 +24,14 @@
#include "southbridge/amd/cimx/sb700/smbus.h" /*SMBUS_IO_BASE*/
#include "w83795.h"
-static u32 w83795_set_bank(u8 bank)
+static int w83795_set_bank(u8 bank)
{
return do_smbus_write_byte(SMBUS_IO_BASE, W83795_DEV, W83795_REG_BANKSEL, bank);
}
static u8 w83795_read(u16 reg)
{
- u32 ret;
+ int ret;
ret = w83795_set_bank(reg >> 8);
if (ret < 0) {
@@ -45,7 +45,7 @@ static u8 w83795_read(u16 reg)
static u8 w83795_write(u16 reg, u8 value)
{
- u32 err;
+ int err;
err = w83795_set_bank(reg >> 8);
if (err < 0) {