the following patch was just integrated into master:
commit d3ed411123c9655c6013cb8ed8d3d91cc2dc8c62
Author: Rudolf Marek <r.marek(a)assembler.cz>
Date: Sat May 4 00:08:34 2013 +0200
AMD Trinity boards: Use `sizeof(var)` to get its size
Change `sizeof(type) * n`, where n is the number of array
elements, to `sizeof(variable)` to directly get the size of the
variable (struct, array). Determining the size by counting array
elements is error prone and unnecessary.
Not sure why the copy is needed instead of direct reference.
Maybe it has something to do with CAR?
These changes are based on Rudolf’s original patch »ASUS F2A85-M:
Correct and clean up PCIe config« [1], where it was just done for
the ASUS board.
[1] http://review.coreboot.org/#/c/3194/
Change-Id: I4aa4c6cde5a27b7f335a71afc21d1603f2ae814b
Signed-off-by: Rudolf Marek <r.marek(a)assembler.cz>
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/3247
Tested-by: build bot (Jenkins)
Reviewed-by: David Hubbard <david.c.hubbard+coreboot(a)gmail.com>
Reviewed-by: Bruce Griffith <Bruce.Griffith(a)se-eng.com>
See http://review.coreboot.org/3247 for details.
-gerrit
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3340
-gerrit
commit af86a02c047995b3e2867f355649bbf39621286b
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Thu May 30 14:24:26 2013 +0200
lint: Extend whitespace check to test all lines of a commit
To not break the build, the current lint whitespace check excludes
several directories/files with whitespace issues. As a result some-
times whitespace issues are missed [1].
Replace this check with the command from the sample pre-commit hook
shipped by git. The check only looks at the diff and therefore we
catch corner cases.
The check using git is faster as it only checks the diff and not the
whole tree with `find`.
I am not sure, what to do about the copyright line.
[1] http://review.coreboot.org/#/c/3319/1/src/cpu/ti/am335x/uart.h
Change-Id: I856fa43d77729cf72bf2603119b93f9b99026a97
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/lint/lint-stable-003-whitespace | 30 +++++++++---------------------
1 file changed, 9 insertions(+), 21 deletions(-)
diff --git a/util/lint/lint-stable-003-whitespace b/util/lint/lint-stable-003-whitespace
index 6869a44..205d101 100755
--- a/util/lint/lint-stable-003-whitespace
+++ b/util/lint/lint-stable-003-whitespace
@@ -18,25 +18,13 @@
#
# DESCR: Check for superfluous whitespace in the tree
-LC_ALL=C export LC_ALL
-find src util -name .svn -type d -prune -o \
- -perm +111 -prune -o \
- -name .git -type d -prune -o \
- -name README -prune -o \
- -name LICENSE -prune -o \
- -name TODO -prune -o \
- -name COPYING -prune -o \
- -name \*.txt -prune -o \
- -name \*.exe -prune -o \
- -name \*.o -prune -o \
- -name microcode-\*.h -prune -o \
- -name \*.?_shipped -prune -o \
- -name \*.[18] -prune -o \
- -name kconfig -type d -prune -o \
- -name romcc -type d -prune -o \
- -name crossgcc -type d -prune -o \
- -name vendorcode -type d -prune -o \
- -type f -exec \
- grep -l "[[:space:]][[:space:]]*$" {} + | \
- sed -e "s,^.*$,File & has lines ending with whitespace.,"
+if git rev-parse --verify HEAD >/dev/null 2>&1
+then
+ against=HEAD
+else
+ # Initial commit: diff against an empty tree object
+ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+# If there are whitespace errors, print the offending file names and fail.
+git diff-index --check --cached $against --
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3336
-gerrit
commit 6802fead04d570a404b8294180a34b8e51e620c2
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Thu May 30 00:36:29 2013 +0200
lint: Add check for non-ASCII file names
The sample pre-commit hook shipped by git includes a test for non-
ASCII file names. Use it.
This test should probably be added under `util/lint` in a separate
file.
Change-Id: Iad09ab62620b68e652cf55dc3f6d2033075989fb
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/gitconfig/pre-commit | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
index 8ab3e56..102425d 100755
--- a/util/gitconfig/pre-commit
+++ b/util/gitconfig/pre-commit
@@ -1,2 +1,34 @@
#!/bin/sh
-exec make lint-stable
+
+# If you want to allow non-ascii filenames set this variable to true.
+allownonascii=$(git config hooks.allownonascii)
+
+# Redirect output to stderr.
+exec 1>&2
+
+# Cross platform projects tend to avoid non-ascii filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if [ "$allownonascii" != "true" ] &&
+ # Note that the use of brackets around a tr range is ok here, (it's
+ # even required, for portability to Solaris 10's /usr/bin/tr), since
+ # the square bracket bytes happen to fall in the designated range.
+ test $(git diff --cached --name-only --diff-filter=A -z $against |
+ LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
+then
+ echo "Error: Attempt to add a non-ascii file name."
+ echo
+ echo "This can cause problems if you want to work"
+ echo "with people on other platforms."
+ echo
+ echo "To be portable it is advisable to rename the file ..."
+ echo
+ echo "If you know what you are doing you can disable this"
+ echo "check using:"
+ echo
+ echo " git config hooks.allownonascii true"
+ echo
+ exit 1
+fi
+
+make lint-stable
Gerd Hoffmann (kraxel(a)redhat.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3338
-gerrit
commit 366ff1e90049c7ae98d39f1d99ca67342cd1fa87
Author: Gerd Hoffmann <kraxel(a)redhat.com>
Date: Thu May 30 10:33:38 2013 +0200
console: add qemu debugcon detection
The qemu debugcon port returns 0xe9 on reads in case the device is
present. Use that for detection and write console output to the
port only in case the device is actually present.
Change-Id: I41aabcf11845d24004e4f795dfd799822fd14646
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/console/qemu_debugcon_console.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/console/qemu_debugcon_console.c b/src/console/qemu_debugcon_console.c
index 3037e36..e2591ba 100644
--- a/src/console/qemu_debugcon_console.c
+++ b/src/console/qemu_debugcon_console.c
@@ -21,13 +21,18 @@
#include <console/console.h>
#include <arch/io.h>
+static unsigned char readback;
+
static void debugcon_init(void)
{
+ readback = inb(CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
}
static void debugcon_tx_byte(unsigned char data)
{
- outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
+ if (readback == 0xe9) {
+ outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
+ }
}
static void debugcon_tx_flush(void)
Gerd Hoffmann (kraxel(a)redhat.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3337
-gerrit
commit 652038b2a30a7517f7d06af9281a7a71b2dfa608
Author: Gerd Hoffmann <kraxel(a)redhat.com>
Date: Thu May 30 10:32:31 2013 +0200
console: add qemu prefix to debugcon
Change-Id: Ibcc0a94638c022a76cd3c2e3387af6e1ab757ccb
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/console/Kconfig | 6 ++---
src/console/Makefile.inc | 2 +-
src/console/debugcon_console.c | 53 -------------------------------------
src/console/qemu_debugcon_console.c | 53 +++++++++++++++++++++++++++++++++++++
4 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 46fe2e7..dc41fd3 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -251,7 +251,7 @@ config CONSOLE_CAR_BUFFER_SIZE
saved in a CBMEM buffer. 3K bytes should be enough even for the
BIOS_SPEW level.
-config CONSOLE_DEBUGCON
+config CONSOLE_QEMU_DEBUGCON
bool "QEMU debug console output"
depends on BOARD_EMULATION_QEMU_X86
default y
@@ -262,9 +262,9 @@ config CONSOLE_DEBUGCON
-chardev file,id=debugcon,path=/dir/file.log \
-device isa-debugcon,iobase=0x402,chardev=debugcon
-config CONSOLE_DEBUGCON_PORT
+config CONSOLE_QEMU_DEBUGCON_PORT
hex "QEMU debug console port"
- depends on CONSOLE_DEBUGCON
+ depends on CONSOLE_QEMU_DEBUGCON
default 0x402
choice
diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc
index a08c8a4..ed2287e 100644
--- a/src/console/Makefile.inc
+++ b/src/console/Makefile.inc
@@ -25,7 +25,7 @@ ramstage-$(CONFIG_USBDEBUG) += usbdebug_console.c
ramstage-$(CONFIG_CONSOLE_LOGBUF) += logbuf_console.c
ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k_console.c
ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
-ramstage-$(CONFIG_CONSOLE_DEBUGCON) += debugcon_console.c
+ramstage-$(CONFIG_CONSOLE_QEMU_DEBUGCON) += qemu_debugcon_console.c
$(obj)/console/console.ramstage.o : $(obj)/build.h
diff --git a/src/console/debugcon_console.c b/src/console/debugcon_console.c
deleted file mode 100644
index a9bc7d3..0000000
--- a/src/console/debugcon_console.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2013 Red Hat Inc.
- * Written by Gerd Hoffmann <kraxel(a)redhat.com>
- *
- * 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
- */
-
-#include <console/console.h>
-#include <arch/io.h>
-
-static void debugcon_init(void)
-{
-}
-
-static void debugcon_tx_byte(unsigned char data)
-{
- outb(data, CONFIG_CONSOLE_DEBUGCON_PORT);
-}
-
-static void debugcon_tx_flush(void)
-{
-}
-
-static unsigned char debugcon_rx_byte(void)
-{
- return 0;
-}
-
-static int debugcon_tst_byte(void)
-{
- return 0;
-}
-
-static const struct console_driver debugcon_console __console = {
- .init = debugcon_init,
- .tx_byte = debugcon_tx_byte,
- .tx_flush = debugcon_tx_flush,
- .rx_byte = debugcon_rx_byte,
- .tst_byte = debugcon_tst_byte,
-};
diff --git a/src/console/qemu_debugcon_console.c b/src/console/qemu_debugcon_console.c
new file mode 100644
index 0000000..3037e36
--- /dev/null
+++ b/src/console/qemu_debugcon_console.c
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Red Hat Inc.
+ * Written by Gerd Hoffmann <kraxel(a)redhat.com>
+ *
+ * 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
+ */
+
+#include <console/console.h>
+#include <arch/io.h>
+
+static void debugcon_init(void)
+{
+}
+
+static void debugcon_tx_byte(unsigned char data)
+{
+ outb(data, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT);
+}
+
+static void debugcon_tx_flush(void)
+{
+}
+
+static unsigned char debugcon_rx_byte(void)
+{
+ return 0;
+}
+
+static int debugcon_tst_byte(void)
+{
+ return 0;
+}
+
+static const struct console_driver debugcon_console __console = {
+ .init = debugcon_init,
+ .tx_byte = debugcon_tx_byte,
+ .tx_flush = debugcon_tx_flush,
+ .rx_byte = debugcon_rx_byte,
+ .tst_byte = debugcon_tst_byte,
+};
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3336
-gerrit
commit 343c35b13b5e52a7a8a5db2a296093c9d4d7c322
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Thu May 30 00:36:29 2013 +0200
gitconfig: Add sample checks shipped by git to pre-commit hook
Several checks are listed in git’s example hook files. So use the
ones from the pre-commit hook. They check for non-ascii file names
and whitespace errors.
The `exec` calls are removed and `set -e` is added to abort the
commit, when one of the tests fails.
Please run `make gitconfig` to get the updated hooks.
Change-Id: Iad09ab62620b68e652cf55dc3f6d2033075989fb
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/gitconfig/pre-commit | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
index 8ab3e56..b258440 100755
--- a/util/gitconfig/pre-commit
+++ b/util/gitconfig/pre-commit
@@ -1,2 +1,47 @@
#!/bin/sh
-exec make lint-stable
+
+set -e
+
+if git rev-parse --verify HEAD >/dev/null 2>&1
+then
+ against=HEAD
+else
+ # Initial commit: diff against an empty tree object
+ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+# If you want to allow non-ascii filenames set this variable to true.
+allownonascii=$(git config hooks.allownonascii)
+
+# Redirect output to stderr.
+exec 1>&2
+
+# Cross platform projects tend to avoid non-ascii filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if [ "$allownonascii" != "true" ] &&
+ # Note that the use of brackets around a tr range is ok here, (it's
+ # even required, for portability to Solaris 10's /usr/bin/tr), since
+ # the square bracket bytes happen to fall in the designated range.
+ test $(git diff --cached --name-only --diff-filter=A -z $against |
+ LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
+then
+ echo "Error: Attempt to add a non-ascii file name."
+ echo
+ echo "This can cause problems if you want to work"
+ echo "with people on other platforms."
+ echo
+ echo "To be portable it is advisable to rename the file ..."
+ echo
+ echo "If you know what you are doing you can disable this"
+ echo "check using:"
+ echo
+ echo " git config hooks.allownonascii true"
+ echo
+ exit 1
+fi
+
+# If there are whitespace errors, print the offending file names and fail.
+git diff-index --check --cached $against --
+
+make lint-stable
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3336
-gerrit
commit e4f44e690db1bf451aff93af3d66c7114781ecc7
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Thu May 30 00:36:29 2013 +0200
gitconfig: Add sample checks shipped by git
Several checks are listed in git’s example hook files. So use the
ones from the pre-commit hook. They check for non-ascii file names
and whitespace errors.
Please run `make gitconfig` again to get the updated hooks.
Change-Id: Iad09ab62620b68e652cf55dc3f6d2033075989fb
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/gitconfig/pre-commit | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
index 8ab3e56..7043f42 100755
--- a/util/gitconfig/pre-commit
+++ b/util/gitconfig/pre-commit
@@ -1,2 +1,44 @@
#!/bin/sh
exec make lint-stable
+
+if git rev-parse --verify HEAD >/dev/null 2>&1
+then
+ against=HEAD
+else
+ # Initial commit: diff against an empty tree object
+ against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+# If you want to allow non-ascii filenames set this variable to true.
+allownonascii=$(git config hooks.allownonascii)
+
+# Redirect output to stderr.
+exec 1>&2
+
+# Cross platform projects tend to avoid non-ascii filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if [ "$allownonascii" != "true" ] &&
+ # Note that the use of brackets around a tr range is ok here, (it's
+ # even required, for portability to Solaris 10's /usr/bin/tr), since
+ # the square bracket bytes happen to fall in the designated range.
+ test $(git diff --cached --name-only --diff-filter=A -z $against |
+ LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
+then
+ echo "Error: Attempt to add a non-ascii file name."
+ echo
+ echo "This can cause problems if you want to work"
+ echo "with people on other platforms."
+ echo
+ echo "To be portable it is advisable to rename the file ..."
+ echo
+ echo "If you know what you are doing you can disable this"
+ echo "check using:"
+ echo
+ echo " git config hooks.allownonascii true"
+ echo
+ exit 1
+fi
+
+# If there are whitespace errors, print the offending file names and fail.
+exec git diff-index --check --cached $against --