summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2015-02-16 08:37:22 -0500
committerTom Rini <trini@ti.com>2015-02-16 08:37:22 -0500
commit95776391852147ea5c2e8ac01613a20c6583bc33 (patch)
treecb12cf255025fc8261cc751731621f6ba0bf1711
parenteca99c02566534940b95ee77b6ea1f098da93adc (diff)
parente50ab22984ce90ffcc47bc620ed2caac0bcc02f7 (diff)
downloadu-boot-imx-95776391852147ea5c2e8ac01613a20c6583bc33.zip
u-boot-imx-95776391852147ea5c2e8ac01613a20c6583bc33.tar.gz
u-boot-imx-95776391852147ea5c2e8ac01613a20c6583bc33.tar.bz2
Merge branch 'sandbox' of git://git.denx.de/u-boot-x86
-rw-r--r--arch/sandbox/config.mk12
-rw-r--r--arch/sandbox/cpu/start.c6
-rw-r--r--arch/sandbox/cpu/state.c5
-rw-r--r--arch/sandbox/include/asm/state.h15
-rw-r--r--tools/buildman/toolchain.py9
-rw-r--r--tools/patman/gitutil.py2
-rw-r--r--tools/patman/settings.py27
7 files changed, 43 insertions, 33 deletions
diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index e38a44b..7b84f02 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -5,10 +5,16 @@ PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE
PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM -DCONFIG_SYS_GENERIC_BOARD
PLATFORM_LIBS += -lrt
+# Define this to avoid linking with SDL, which requires SDL libraries
+# This can solve 'sdl-config: Command not found' errors
+ifneq ($(NO_SDL),)
+PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL
+else
ifdef CONFIG_SANDBOX_SDL
PLATFORM_LIBS += $(shell sdl-config --libs)
PLATFORM_CPPFLAGS += $(shell sdl-config --cflags)
endif
+endif
# Support generic board on sandbox
__HAVE_ARCH_GENERIC_BOARD := y
@@ -18,9 +24,3 @@ cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \
$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
CONFIG_ARCH_DEVICE_TREE := sandbox
-
-# Define this to avoid linking with SDL, which requires SDL libraries
-# This can solve 'sdl-config: Command not found' errors
-ifneq ($(NO_SDL),)
-PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL
-endif
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 097f29a..ec01040 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -78,11 +78,13 @@ int sandbox_main_loop_init(void)
/* Execute command if required */
if (state->cmd) {
+ int retval;
+
cli_init();
- run_command_list(state->cmd, -1, 0);
+ retval = run_command_list(state->cmd, -1, 0);
if (!state->interactive)
- os_exit(state->exit_type);
+ os_exit(retval);
}
return 0;
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index ba73b7e..033958c 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -13,11 +13,6 @@
static struct sandbox_state main_state;
static struct sandbox_state *state; /* Pointer to current state record */
-void state_record_exit(enum exit_type_id exit_type)
-{
- state->exit_type = exit_type;
-}
-
static int state_ensure_space(int extra_size)
{
void *blob = state->state_fdt;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 32d55cc..a0c24ba 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -10,13 +10,6 @@
#include <stdbool.h>
#include <linux/stringify.h>
-/* How we exited U-Boot */
-enum exit_type_id {
- STATE_EXIT_NORMAL,
- STATE_EXIT_COLD_REBOOT,
- STATE_EXIT_POWER_OFF,
-};
-
/**
* Selects the behavior of the serial terminal.
*
@@ -50,7 +43,6 @@ struct sandbox_state {
const char *cmd; /* Command to execute */
bool interactive; /* Enable cmdline after execute */
const char *fdt_fname; /* Filename of FDT binary */
- enum exit_type_id exit_type; /* How we exited U-Boot */
const char *parse_err; /* Error to report from parsing */
int argc; /* Program arguments */
char **argv; /* Command line arguments */
@@ -139,13 +131,6 @@ struct sandbox_state_io {
}
/**
- * Record the exit type to be reported by the test program.
- *
- * @param exit_type Exit type to record
- */
-void state_record_exit(enum exit_type_id exit_type);
-
-/**
* Gets a pointer to the current state.
*
* @return pointer to state
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index d4c5d4a..537797a 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -197,13 +197,14 @@ class Toolchains:
Returns:
Filename of C compiler if found, else None
"""
+ fnames = []
for subdir in ['.', 'bin', 'usr/bin']:
dirname = os.path.join(path, subdir)
if verbose: print " - looking in '%s'" % dirname
for fname in glob.glob(dirname + '/*gcc'):
if verbose: print " - found '%s'" % fname
- return fname
- return None
+ fnames.append(fname)
+ return fnames
def Scan(self, verbose):
@@ -219,8 +220,8 @@ class Toolchains:
if verbose: print 'Scanning for tool chains'
for path in self.paths:
if verbose: print " - scanning path '%s'" % path
- fname = self.ScanPath(path, verbose)
- if fname:
+ fnames = self.ScanPath(path, verbose)
+ for fname in fnames:
self.Add(fname, True, verbose)
def List(self):
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index c593070..4c2c35b 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -129,7 +129,7 @@ def GetUpstream(git_dir, branch):
return upstream, msg
if remote == '.':
- return merge
+ return merge, None
elif remote and merge:
leaf = merge.split('/')[-1]
return '%s/%s' % (remote, leaf), None
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 122e8fd..ba2a68f 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -235,6 +235,31 @@ def _UpdateDefaults(parser, config):
else:
print "WARNING: Unknown setting %s" % name
+def _ReadAliasFile(fname):
+ """Read in the U-Boot git alias file if it exists.
+
+ Args:
+ fname: Filename to read.
+ """
+ if os.path.exists(fname):
+ bad_line = None
+ with open(fname) as fd:
+ linenum = 0
+ for line in fd:
+ linenum += 1
+ line = line.strip()
+ if not line or line.startswith('#'):
+ continue
+ words = line.split(' ', 2)
+ if len(words) < 3 or words[0] != 'alias':
+ if not bad_line:
+ bad_line = "%s:%d:Invalid line '%s'" % (fname, linenum,
+ line)
+ continue
+ alias[words[1]] = [s.strip() for s in words[2].split(',')]
+ if bad_line:
+ print bad_line
+
def Setup(parser, project_name, config_fname=''):
"""Set up the settings module by reading config files.
@@ -244,6 +269,8 @@ def Setup(parser, project_name, config_fname=''):
for sections named "project_section" as well.
config_fname: Config filename to read ('' for default)
"""
+ # First read the git alias file if available
+ _ReadAliasFile('doc/git-mailrc')
config = _ProjectConfigParser(project_name)
if config_fname == '':
config_fname = '%s/.patman' % os.getenv('HOME')