Stefan Tauner (stefan.tauner(a)gmx.at) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/9305
-gerrit
commit 7b88baa66f7d0bf0c75872dee1a2fe59e6fb3040
Author: Stefan Tauner <stefan.tauner(a)gmx.at>
Date: Mon May 2 23:16:57 2016 +0200
utils: introduce find_usbdebug.sh to help find USB debug ports
Carl-Daniel made this script a long time ago but it never was picked up
in the tree. Now that USB debugging is way more common it makes
sense to include it.
I have made a number of changes to the original version:
* -h help text
* check for running as root
* enhanced readability (test -> if)
* new execution flow and refined output that better shows the device(s)
attached to the debug port(s)
* handling of Intel rate-matching hubs
* hiding of (bogus) error messages from lspci and lsusb
Signed-off-by: Stefan Tauner <stefan.tauner(a)gmx.at>
Change-Id: Iadf775e990f5c5f91a28d57e3331d1f59acee305
---
util/find_usbdebug/find_usbdebug.sh | 169 ++++++++++++++++++++++++++++++++++++
1 file changed, 169 insertions(+)
diff --git a/util/find_usbdebug/find_usbdebug.sh b/util/find_usbdebug/find_usbdebug.sh
new file mode 100755
index 0000000..30bf86f
--- /dev/null
+++ b/util/find_usbdebug/find_usbdebug.sh
@@ -0,0 +1,169 @@
+#!/bin/bash
+
+# Copyright 2008 Carl-Daniel Hailfinger
+# Copyright 2015 Stefan Tauner
+#
+# 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.
+
+LANG=C
+# Some tools emmit errors that don't matter (bugs in lspci/PCI firmware and lsusb).
+# To shown them anyway (e.g. for debugging) comment next line.
+exec 2>/dev/null
+
+if [ "$1" = "-h" ]; then
+ printf "Usage: $0 [-h | path to dmesg log]
+
+This script tries to find USB ports compatible with USB2/EHCI debug devices and
+helps you to find their physical locations. To that end, attach at least one
+uniquely identifiable device to a USB port and run this script. The device needs
+to be visible in the output of \"lsusb -t\" (debug devices are often *not*!).
+
+After determining compatibility of the USB controllers the script will print the
+devices attached to the debug port as shown by lsusb. If nothing shows up simply
+switch ports and repeat the process.
+
+Note: usually only one port is supported for debugging.\n"
+ exit 0
+fi
+uid=`id -u`
+if [ "$uid" -ne 0 ]; then
+ echo "Must be run as root. Exiting."
+ exit 1
+fi
+dmesgfile=$1
+
+find_devs_in_tree () {
+ bus=$1
+ port=$2
+ busstr=`printf "Bus %02d" "$bus"`
+ portstr="Port $port"
+
+ hubs_to_ignore="8087:0020 8087:0024"
+ reqlvl=1
+
+ found=
+ # Iterate over the output of lsusb -t because it contains the physical port numbers
+ while IFS='' read -r line; do
+ # We need to keep track of the current bus "branch"
+ # Look out for lines starting with /: (that indicate a bus)
+ if [ "${line#*/:}" != "$line" ]; then
+ if [ "${line#*$busstr}" != "$line" ]; then
+ cur_bus=$busstr
+ else
+ cur_bus=
+ fi
+ continue
+ fi
+
+ # Skip all lines not belonging to the wanted bus number
+ if [ "$cur_bus" != "$busstr" ]; then
+ continue
+ fi
+
+ # Calculate current USB tier/level
+ spaces="${line%%[!' ']*}"
+ curlvl=$((${#spaces} / 4))
+ if [ $curlvl -ne $reqlvl ]; then
+ continue
+ fi
+
+ # Fetch USB IDs of the current device
+ dev=`echo ${line#*Dev } | cut -d ',' -f 1`
+ lsusbline=`lsusb -s "$bus":"$dev"`
+ if [[ ! "$lsusbline" =~ .*([[:xdigit:]]{4}:[[:xdigit:]]{4}) ]]; then
+ printf "Unexpected output from \"%s\": \"%s\"\n" "lsusb -s $bus:$dev" "$usbline"
+ exit 1
+ fi
+ ids=${BASH_REMATCH[1]}
+
+ # Skip over rate matching hubs
+ if [[ "$hubs_to_ignore" == *"$ids"* ]]; then
+ ((reqlvl += 1))
+ continue
+ fi
+
+ # Check for matching physical USB port
+ if [ "${line#*$portstr}" != "$line" ]; then
+ echo "$lsusbline"
+ return
+ fi
+ done<< EOF
+$(lsusb -t)
+EOF
+ if [ -z "$found" ]; then
+ echo "none"
+ fi
+}
+
+debug_lspci_devs=`lspci -nvvD |
+ grep -i "^[0-9a-f]\|debug port" |
+ grep -iB1 --no-group-separator "debug port" |
+ grep -vi "debug port" |
+ cut -f 1 -d" " |
+ sort |
+ xargs echo`
+
+if [ -z "$debug_lspci_devs" ]; then
+ printf "No USB controller with debug capability found by lspci.\n
+Possible reasons: lspci too old, USB controller does not support a debug device, ... Exiting.\n"
+ exit 1
+fi
+printf "The following PCI devices support a USB debug port (says lspci): $debug_lspci_devs\n"
+
+debug_dmesg_devs_with_port=`( test -z "$dmesgfile" &&
+ dmesg ||
+ cat "$dmesgfile") |
+ grep -i "ehci.*debug port" |
+ sed "s/.* \([0-9a-f]*:*[0-9a-f]\{2\}:[0-9a-f]\{2\}\.[0-9a-f]\).*ebug port /\1 /" |
+ sort`
+
+debug_dmesg_devs=`echo "$debug_dmesg_devs_with_port" |
+ cut -f 1 -d" " |
+ xargs echo`
+
+if [ -z "$debug_dmesg_devs" ]; then
+ printf "dmesg does not show any supported ports.\n
+Possible reasons: dmesg scrolled off, kernel too old, USB controller does not support a debug device, ... Exiting.\n
+Note: You can specify a file containing kernel messages as an argument to this program (e.g. /var/log/dmesg)."
+ exit 1
+fi
+
+if [ "$debug_lspci_devs" != "$debug_dmesg_devs" ]; then
+ echo "lspci and the kernel do not agree on USB debug device support. Exiting."
+ exit 1
+fi
+
+printf "and the kernel agrees, good.\n\n"
+
+while true; do
+ for dev in $debug_dmesg_devs; do
+ bus=`lsusb -v |
+ grep "^Bus\|iSerial.*" |
+ grep -B1 --no-group-separator "iSerial.*$dev" |
+ grep "^Bus" |
+ sed "s/Bus *0*\([0-9a-f]*\).*/\1/"`
+ port=`echo "$debug_dmesg_devs_with_port" |
+ grep "^$dev" |
+ cut -f 2 -d" "`
+
+ echo "Device(s) currently connected to the debug-capable port $port on PCI device $dev, USB bus $bus:"
+
+ find_devs_in_tree "$bus" "$port"
+ echo
+ done
+
+ echo "Enter 'q' to abort or anything else to repeat"
+ read -r r
+ if [ $? -ne 0 -o "$r" = "q" ]; then
+ break;
+ fi
+done
+
+exit 0
Alexandru Gagniuc (alexandrux.gagniuc(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14574
-gerrit
commit 478fa3850956111f68bbad48c74984be0f8a8315
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Mon May 2 13:40:15 2016 -0700
soc/apollolake/romstage: Do not cast const to non-const pointers
That was a workaround for the MRC cache API, which has since been
reworked. The workaround is no longer needed.
Change-Id: I1c1883f3ea37245615248459cd993ed774bf92de
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/soc/intel/apollolake/romstage.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c
index 9dcb26a..42af6c0 100644
--- a/src/soc/intel/apollolake/romstage.c
+++ b/src/soc/intel/apollolake/romstage.c
@@ -79,7 +79,8 @@ static void disable_watchdog(void)
asmlinkage void car_stage_entry(void)
{
- void *hob_list_ptr, *mrc_data;
+ void *hob_list_ptr;
+ const void *mrc_data;
struct range_entry fsp_mem, reg_car;
struct postcar_frame pcf;
size_t mrc_data_size;
@@ -116,8 +117,7 @@ asmlinkage void car_stage_entry(void)
/* Save MRC Data to CBMEM */
if (IS_ENABLED(CONFIG_CACHE_MRC_SETTINGS))
{
- /* TODO: treat MRC data as const */
- mrc_data = (void*) fsp_find_nv_storage_data(&mrc_data_size);
+ mrc_data = fsp_find_nv_storage_data(&mrc_data_size);
if (mrc_data && mrc_cache_stash_data(mrc_data, mrc_data_size) < 0)
printk(BIOS_ERR, "Failed to stash MRC data\n");
}
Alexandru Gagniuc (alexandrux.gagniuc(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14574
-gerrit
commit 695028a101f93bb4c0fde31e1557a85d352acf3f
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Mon May 2 13:40:15 2016 -0700
soc/apollolake/romstage: Do not cast const to non-const pointers
That was a workaround for the MRC cache API, which has since been
reworked. The workaround is no longer needed.
Change-Id: I1c1883f3ea37245615248459cd993ed774bf92de
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/soc/intel/apollolake/romstage.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c
index 9dcb26a..62c5787 100644
--- a/src/soc/intel/apollolake/romstage.c
+++ b/src/soc/intel/apollolake/romstage.c
@@ -79,7 +79,8 @@ static void disable_watchdog(void)
asmlinkage void car_stage_entry(void)
{
- void *hob_list_ptr, *mrc_data;
+ void *hob_list_ptr;
+ const void *mrc_data;
struct range_entry fsp_mem, reg_car;
struct postcar_frame pcf;
size_t mrc_data_size;
@@ -117,7 +118,7 @@ asmlinkage void car_stage_entry(void)
if (IS_ENABLED(CONFIG_CACHE_MRC_SETTINGS))
{
/* TODO: treat MRC data as const */
- mrc_data = (void*) fsp_find_nv_storage_data(&mrc_data_size);
+ mrc_data = fsp_find_nv_storage_data(&mrc_data_size);
if (mrc_data && mrc_cache_stash_data(mrc_data, mrc_data_size) < 0)
printk(BIOS_ERR, "Failed to stash MRC data\n");
}
David Hendricks (dhendrix(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14523
-gerrit
commit 40a303ab68b802c5acd3bbe9b55d953ae4e305c6
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Tue Apr 26 14:07:42 2016 -0700
board_status: Allow for parsing longopts
This converts the argument parsing to allow us to add longopts
using GNU getopt(1).
Shortopts should be reserved for general parameters. Longopts can be
used to tweak specific behaviors. For example, we might wish to add
options to set SSH port, timeout, and authentication parameters
with "--ssh-port", "--ssh-timeout", "--ssh-identity", etc.
This is virtually untested, it would be nice if someone else can
hijack this patch to test and clean it up where necessary.
Change-Id: Idee5579079dbbb7296ad98f5d6025b01aab55452
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
---
util/board_status/board_status.sh | 48 ++++++++++++++++++++++++++++-----------
1 file changed, 35 insertions(+), 13 deletions(-)
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index b315be1..6106589 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -188,31 +188,53 @@ Options
"
}
-while getopts "Chi:r:s:S:u" opt; do
- case "$opt" in
- h)
+getopt -T
+if [ $? -ne 4 ]; then
+ echo "GNU-compatible getopt(1) required."
+ exit $EXIT_FAILURE
+fi
+
+# TODO: add longopts in the quotes after -l
+ARGS=$(getopt -o Chi:r:s:S:u -l "" -n "$0" -- "$@");
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+eval set -- "$ARGS"
+while true ; do
+ case "$1" in
+ -h)
show_help
exit $EXIT_SUCCESS
;;
- C)
+ -C)
CLOBBER_OUTPUT=1
;;
- i)
- COREBOOT_IMAGE="$OPTARG"
+ -i)
+ shift
+ COREBOOT_IMAGE="$1"
;;
- r)
- REMOTE_HOST="$OPTARG"
+ -r)
+ shift
+ REMOTE_HOST="$1"
;;
- s)
- SERIAL_DEVICE="$OPTARG"
+ -s)
+ shift
+ SERIAL_DEVICE="$1"
;;
- S)
- SERIAL_PORT_SPEED="$OPTARG"
+ -S)
+ shift
+ SERIAL_PORT_SPEED="$1"
;;
- u)
+ -u)
UPLOAD_RESULTS=1
;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ echo "error processing options at '$1'"
+ exit $EXIT_FAILURE
esac
+ shift
done
grep -rH 'coreboot.org' .git/config >/dev/null 2>&1
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14355
-gerrit
commit c3d7e519ea853397c9caa65892f46bb64da57ca3
Author: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Date: Wed Apr 13 16:23:48 2016 -0700
Point to the correct libpayload path
libpayload is not standalone, so assume it lives under coreboot
to make out of the box builds easier.
Change-Id: Ib6240e7459a7e56f911c01e1ebe9f535cc0e50ad
Signed-off-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
---
Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index aae5db0..051af05 100644
--- a/Makefile
+++ b/Makefile
@@ -26,10 +26,14 @@ export obj := $(src)/build
export objk := $(src)/build/util/kconfig
ifndef LIBCONFIG_PATH
- LIBCONFIG_PATH := $(src)/../libpayload
+LIBCONFIG_PATH := $(src)/../coreboot/payloads/libpayload
endif
export LIBCONFIG_PATH
+ifeq ($(wildcard $(LIBCONFIG_PATH)/*),)
+$(error Could not find libpayload at $(LIBCONFIG_PATH))
+endif
+
export KERNELVERSION := $(PROGRAM_VERSION)
export KCONFIG_AUTOHEADER := $(obj)/config.h
export KCONFIG_AUTOCONFIG := $(obj)/auto.conf
the following patch was just integrated into master:
commit eee0e229764e965996479d7eb07e6086176b8bf0
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Fri Mar 11 07:55:24 2016 -0800
soc/intel/quark: Remove UPD parameters
Remove the UPD parameters to match QuarkFsp code.
TEST=Build and run on Galileo Gen2
Change-Id: Ie4639d1f087cc2bc4387aa691eb66b640fe8faf9
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
Reviewed-on: https://review.coreboot.org/14451
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/14451 for details.
-gerrit