Commit f4617ef8 authored by Tom Rini's avatar Tom Rini

Merge branch 'tom' of git://git.denx.de/u-boot-x86

parents bcb879c0 097c5de5
......@@ -264,6 +264,17 @@ e.g. "make cogent_mpc8xx_config". And also configure the cogent
directory according to the instructions in cogent/README.
Sandbox Environment:
--------------------
U-Boot can be built natively to run on a Linux host using the 'sandbox'
board. This allows feature development which is not board- or architecture-
specific to be undertaken on a native platform. The sandbox is also used to
run some of U-Boot's tests.
See board/sandbox/sandbox/README.sandbox for more details.
Configuration Options:
----------------------
......
......@@ -18,3 +18,9 @@ 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
......@@ -8,4 +8,4 @@
#
obj-y += interrupts.o
obj-y += interrupts.o sandbox.o
#
# Copyright (c) 2011 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
obj-y := sandbox.o
/*
* Copyright (c) 2011 The Chromium OS Authors.
*
* SPDX-License-Identifier: GPL-2.0+
*/
Native Execution of U-Boot
==========================
The 'sandbox' architecture is designed to allow U-Boot to run under Linux on
almost any hardware. To achieve this it builds U-Boot (so far as possible)
as a normal C application with a main() and normal C libraries.
All of U-Boot's architecture-specific code therefore cannot be built as part
of the sandbox U-Boot. The purpose of running U-Boot under Linux is to test
all the generic code, not specific to any one architecture. The idea is to
create unit tests which we can run to test this upper level code.
CONFIG_SANDBOX is defined when building a native board.
The chosen vendor and board names are also 'sandbox', so there is a single
board in board/sandbox/sandbox.
CONFIG_SANDBOX_BIG_ENDIAN should be defined when running on big-endian
machines.
Note that standalone/API support is not available at present.
The serial driver is a very simple implementation which reads and writes to
the console. It does not set the terminal into raw mode, so cursor keys and
history will not work yet.
SPI Emulation
-------------
Sandbox supports SPI and SPI flash emulation.
This is controlled by the spi_sf argument, the format of which is:
bus:cs:device:file
bus - SPI bus number
cs - SPI chip select number
device - SPI device emulation name
file - File on disk containing the data
For example:
dd if=/dev/zero of=spi.bin bs=1M count=4
./u-boot --spi_sf 0:0:M25P16:spi.bin
With this setup you can issue SPI flash commands as normal:
=>sf probe
SF: Detected M25P16 with page size 64 KiB, total 2 MiB
=>sf read 0 0 10000
SF: 65536 bytes @ 0x0 Read: OK
=>
Since this is a full SPI emulation (rather than just flash), you can
also use low-level SPI commands:
=>sspi 0:0 32 9f
FF202015
This is issuing a READ_ID command and getting back 20 (ST Micro) part
0x2015 (the M25P16).
Drivers are connected to a particular bus/cs using sandbox's state
structure (see the 'spi' member). A set of operations must be provided
for each driver.
Configuration settings for the curious are:
CONFIG_SANDBOX_SPI_MAX_BUS
The maximum number of SPI buses supported by the driver (default 1).
CONFIG_SANDBOX_SPI_MAX_CS
The maximum number of chip selects supported by the driver
(default 10).
CONFIG_SPI_IDLE_VAL
The idle value on the SPI bus
Tests
-----
So far we have no tests, but when we do these will be documented here.
......@@ -1182,7 +1182,7 @@ Active powerpc ppc4xx - xilinx ppc405-generic
Active powerpc ppc4xx - xilinx ppc405-generic xilinx-ppc405-generic_flash xilinx-ppc405-generic:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC Ricardo Ribalda <ricardo.ribalda@uam.es>
Active powerpc ppc4xx - xilinx ppc440-generic xilinx-ppc440-generic xilinx-ppc440-generic:SYS_TEXT_BASE=0x04000000,RESET_VECTOR_ADDRESS=0x04100000,BOOT_FROM_XMD=1 Ricardo Ribalda <ricardo.ribalda@uam.es>
Active powerpc ppc4xx - xilinx ppc440-generic xilinx-ppc440-generic_flash xilinx-ppc440-generic:SYS_TEXT_BASE=0xF7F60000,RESET_VECTOR_ADDRESS=0xF7FFFFFC Ricardo Ribalda <ricardo.ribalda@uam.es>
Active sandbox sandbox - sandbox sandbox sandbox - Simon Glass <sjg@chromium.org>
Active sandbox sandbox - - <none> sandbox - Simon Glass <sjg@chromium.org>
Active sh sh2 - renesas rsk7203 rsk7203 - Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>:Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Active sh sh2 - renesas rsk7264 rsk7264 - Phil Edworthy <phil.edworthy@renesas.com>
Active sh sh2 - renesas rsk7269 rsk7269 - -
......
......@@ -33,6 +33,7 @@
#include <watchdog.h>
#include <linux/stddef.h>
#include <asm/byteorder.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
......@@ -846,7 +847,8 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
char buf[32];
char *addr, *cmd, *res;
ulong addr;
char *ptr, *cmd, *res;
size_t size = 0;
ssize_t len;
env_t *envp;
......@@ -891,10 +893,11 @@ NXTARG: ;
if (argc < 1)
return CMD_RET_USAGE;
addr = (char *)simple_strtoul(argv[0], NULL, 16);
addr = simple_strtoul(argv[0], NULL, 16);
ptr = map_sysmem(addr, size);
if (size)
memset(addr, '\0', size);
memset(ptr, '\0', size);
argc--;
argv++;
......@@ -902,7 +905,7 @@ NXTARG: ;
if (sep) { /* export as text file */
len = hexport_r(&env_htab, sep,
H_MATCH_KEY | H_MATCH_IDENT,
&addr, size, argc, argv);
&ptr, size, argc, argv);
if (len < 0) {
error("Cannot export environment: errno = %d\n", errno);
return 1;
......@@ -913,12 +916,12 @@ NXTARG: ;
return 0;
}
envp = (env_t *)addr;
envp = (env_t *)ptr;
if (chk) /* export as checksum protected block */
res = (char *)envp->data;
else /* export as raw binary data */
res = addr;
res = ptr;
len = hexport_r(&env_htab, '\0',
H_MATCH_KEY | H_MATCH_IDENT,
......@@ -960,7 +963,8 @@ sep_err:
static int do_env_import(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
char *cmd, *addr;
ulong addr;
char *cmd, *ptr;
char sep = '\n';
int chk = 0;
int fmt = 0;
......@@ -1004,7 +1008,8 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
if (!fmt)
printf("## Warning: defaulting to text format\n");
addr = (char *)simple_strtoul(argv[0], NULL, 16);
addr = simple_strtoul(argv[0], NULL, 16);
ptr = map_sysmem(addr, 0);
if (argc == 2) {
size = simple_strtoul(argv[1], NULL, 16);
......@@ -1012,7 +1017,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
puts("## Error: external checksum format must pass size\n");
return CMD_RET_FAILURE;
} else {
char *s = addr;
char *s = ptr;
size = 0;
......@@ -1032,7 +1037,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
if (chk) {
uint32_t crc;
env_t *ep = (env_t *)addr;
env_t *ep = (env_t *)ptr;
size -= offsetof(env_t, data);
memcpy(&crc, &ep->crc, sizeof(crc));
......@@ -1041,11 +1046,11 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
puts("## Error: bad CRC, import failed\n");
return 1;
}
addr = (char *)ep->data;
ptr = (char *)ep->data;
}
if (himport_r(&env_htab, addr, size, sep, del ? 0 : H_NOCLEAR,
0, NULL) == 0) {
if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR, 0,
NULL) == 0) {
error("Environment import failed: errno = %d\n", errno);
return 1;
}
......
......@@ -1550,7 +1550,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
return 1;
}
if (run_command(arg, flag) != 0)
if (run_command_list(arg, -1, flag) != 0)
return 1;
}
return 0;
......
This diff is collapsed.
......@@ -140,8 +140,6 @@
#define CONFIG_CROS_EC
#define CONFIG_CMD_CROS_EC
#define CONFIG_CROS_EC_SANDBOX
#define CONFIG_KEYBOARD
#define CONFIG_CROS_EC_KEYB
#define CONFIG_ARCH_EARLY_INIT_R
#define CONFIG_BOARD_LATE_INIT
......@@ -149,7 +147,12 @@
#define CONFIG_SOUND_SANDBOX
#define CONFIG_CMD_SOUND
#ifndef SANDBOX_NO_SDL
#define CONFIG_SANDBOX_SDL
#endif
/* LCD and keyboard require SDL support */
#ifdef CONFIG_SANDBOX_SDL
#define CONFIG_LCD
#define CONFIG_VIDEO_SANDBOX_SDL
#define CONFIG_CMD_BMP
......@@ -158,9 +161,18 @@
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define LCD_BPP LCD_COLOR16
#define CONFIG_CROS_EC_KEYB
#define CONFIG_KEYBOARD
#define CONFIG_EXTRA_ENV_SETTINGS "stdin=serial,cros-ec-keyb\0" \
"stdout=serial,lcd\0" \
"stderr=serial,lcd\0"
#else
#define CONFIG_EXTRA_ENV_SETTINGS "stdin=serial\0" \
"stdout=serial,lcd\0" \
"stderr=serial,lcd\0"
#endif
#define CONFIG_GZIP_COMPRESSED
#define CONFIG_BZIP2
......
......@@ -192,6 +192,7 @@ END
A sign-off is added automatically to your patches (this is
probably a bug). If you put this tag in your patches, it will
override the default signoff that patman automatically adds.
Multiple duplicate signoffs will be removed.
Tested-by: Their Name <email>
Reviewed-by: Their Name <email>
......
......@@ -29,6 +29,7 @@ class Commit:
self.tags = []
self.changes = {}
self.cc_list = []
self.signoff_set = set()
self.notes = []
def AddChange(self, version, info):
......@@ -72,3 +73,16 @@ class Commit:
cc_list: List of aliases or email addresses
"""
self.cc_list += cc_list
def CheckDuplicateSignoff(self, signoff):
"""Check a list of signoffs we have send for this patch
Args:
signoff: Signoff line
Returns:
True if this signoff is new, False if we have already seen it.
"""
if signoff in self.signoff_set:
return False
self.signoff_set.add(signoff)
return True
......@@ -11,6 +11,7 @@ import subprocess
import sys
import terminal
import checkpatch
import settings
......@@ -193,6 +194,7 @@ def ApplyPatch(verbose, fname):
Args:
fname: filename of patch file to apply
"""
col = terminal.Color()
cmd = ['git', 'am', fname]
pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
......@@ -203,8 +205,8 @@ def ApplyPatch(verbose, fname):
print line
match = re_error.match(line)
if match:
print GetWarningMsg('warning', match.group(1), int(match.group(2)),
'Patch failed')
print checkpatch.GetWarningMsg(col, 'warning', match.group(1),
int(match.group(2)), 'Patch failed')
return pipe.returncode == 0, stdout
def ApplyPatches(verbose, args, start_point):
......
......@@ -21,7 +21,7 @@ re_remove = re.compile('^BUG=|^TEST=|^BRANCH=|^Change-Id:|^Review URL:'
re_allowed_after_test = re.compile('^Signed-off-by:')
# Signoffs
re_signoff = re.compile('^Signed-off-by:')
re_signoff = re.compile('^Signed-off-by: *(.*)')
# The start of the cover letter
re_cover = re.compile('^Cover-letter:')
......@@ -159,6 +159,7 @@ class PatchStream:
commit_tag_match = re_commit_tag.match(line)
commit_match = re_commit.match(line) if self.is_log else None
cover_cc_match = re_cover_cc.match(line)
signoff_match = re_signoff.match(line)
tag_match = None
if self.state == STATE_PATCH_HEADER:
tag_match = re_tag.match(line)
......@@ -223,7 +224,7 @@ class PatchStream:
if is_blank:
# Blank line ends this change list
self.in_change = 0
elif line == '---' or re_signoff.match(line):
elif line == '---':
self.in_change = 0
out = self.ProcessLine(line)
else:
......@@ -272,6 +273,11 @@ class PatchStream:
else:
self.tags.append(line);
# Suppress duplicate signoffs
elif signoff_match:
if self.commit.CheckDuplicateSignoff(signoff_match.group(1)):
out = [line]
# Well that means this is an ordinary line
else:
pos = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment