Simon Glass [Mon, 1 Oct 2018 18:22:43 +0000 (12:22 -0600)]
fdt: Allow C++ comments in link scripts and DT files
At present // in a device-tree file or link script causes a warning. But
this is used in the standard license header. Update the compiler flags to
use C99, which permits this.
Simon Glass [Mon, 1 Oct 2018 18:22:42 +0000 (12:22 -0600)]
ctags: Minor changes to fix ctags output
At present ctags emits lines with unmatched quotes which means that the
output file is invalid. This is with exuberant-ctags version 5.9~svn201103
but I also see it with plain ctags. I am not sure that it is a bug though.
Make a few minor changes in the source code to fix this problem.
Simon Glass [Mon, 1 Oct 2018 18:22:41 +0000 (12:22 -0600)]
panel: Expand the backlight support
At present the panel can be turned on but not off, and the brightness
cannot be controlled at run-time. Add a new API function to both the panel
and backlight uclasses to handle this. Enhance the PWM backlight driver
to deal with custom levels properly and allow the backlight to be turned
on and off.
Simon Glass [Mon, 1 Oct 2018 18:22:37 +0000 (12:22 -0600)]
x86: Update mtrr functions to allow leaving cache alone
At present the mtrr functions disable the cache before making changes and
enable it again afterwards. This is fine in U-Boot, but does not work if
running in CAR (such as we are in SPL).
Update the functions so that the caller can request that caches be left
alone.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass [Mon, 1 Oct 2018 18:22:36 +0000 (12:22 -0600)]
cros: Update ec_commands to latest version
This file has changed quite a bit in the last 5 years as the capabilities
of the ECs have grown. Sync it up with the copy in coreboot commit b9141f2215.
The only change is the addition of EC_VBNV_BLOCK_SIZE_V2. This is needed
because U-Boot uses the new v2 vboot API and this is not currently fully
supported by Chromium OS firmware.
Simon Glass [Mon, 1 Oct 2018 18:22:35 +0000 (12:22 -0600)]
Rename GPT_HEADER_SIGNATURE to avoid conflict
The current name conflicts with the Chrome OS verified boot library, which
prevents it being built. That library uses a string whereas U-Boot uses a
64-bit hex value. Rename this in U-Boot.
Simon Glass [Mon, 1 Oct 2018 18:22:30 +0000 (12:22 -0600)]
binman: Move to three-digit test-file numbers
We now have 99 tests. Before adding any more, rename everything to three
digits. This helps to preserve the ordering of tests and makes it easier
to find things.
Simon Glass [Mon, 1 Oct 2018 18:22:27 +0000 (12:22 -0600)]
tpm: Use livetree and allow children
Adjust the TPM drivers to use livetree (only one does not). Also,
sometimes TPMs can have child devices if they provide a service to the
system (such as storing secure data), so permit that.
Simon Glass [Mon, 1 Oct 2018 18:22:24 +0000 (12:22 -0600)]
dm: spi: Add logging of some return values
When SPI flash operations fail it is helpful to be able to see the error
codes and where they are generated. Add logging to capture this
information for read operations.
Simon Glass [Mon, 1 Oct 2018 18:22:22 +0000 (12:22 -0600)]
cros: Update cros_ec code to use struct udevice
At present we pass around a private pointer to specify the cros_ec device.
With driver model it makes more sense to pass the device. Update the code
to do this.
Simon Glass [Mon, 1 Oct 2018 18:22:20 +0000 (12:22 -0600)]
serial: Allow serial to be absent in TPL
At present this option applies to SPL, but it should be available in TPL
also, and separately. Change to using CONFIG_IS_ENABLED(), add a new
Kconfig option and fix up hang().
Simon Glass [Mon, 1 Oct 2018 18:22:18 +0000 (12:22 -0600)]
fdt: Allow indicating a node is for U-Boot proper only
At present it is not possible to specify that a node should be used before
relocation (in U-Boot proper) without it also ending up in SPL and TPL
device trees. Add a new "u-boot,dm-pre-proper" boolean property for this.
Simon Glass [Mon, 1 Oct 2018 18:22:13 +0000 (12:22 -0600)]
blk: Support block drivers in TPL
At present it is not possible to enable/disable block drivers in TPL. This
is needed to provide sandbox support. Add a Kconfig option and adjust the
Makefile.
Simon Glass [Mon, 1 Oct 2018 18:22:11 +0000 (12:22 -0600)]
Makefile: Add a warning if SPL/TPL cannot be built
At present the build fails in strange ways if CONFIG_SPL is defined by
CONFIG_SUPPORT_SPL is not. Add a warning for this case as it can be very
confusing to debug.
Simon Glass [Mon, 1 Oct 2018 18:22:09 +0000 (12:22 -0600)]
sf: Avoid allocating memory on every read operation
At present spi_flash_cmd_read_ops() allocates and frees a few bytes of
memory every time it is called. It is faster to use the stack for this
and this is now supported by the minimum GCC version required by U-Boot.
Remove the allocation and use a variable-sized array instead.
Simon Glass [Mon, 1 Oct 2018 18:22:08 +0000 (12:22 -0600)]
dm: core: Update ofnode to read binman-style flash entry
At present ofnode_read_fmap_entry() reads a flash map entry in a format
which is not supported by binman. To allow use to use binman-format
descriptions, update this function.
Simon Glass [Mon, 1 Oct 2018 17:55:20 +0000 (11:55 -0600)]
sandbox: Restore blocking I/O on exit
At present sandbox sets non-blocking I/O as soon as any input is read
from the terminal. However it does not restore the previous state on
exit. Fix this and drop the old os_read_no_block() function.
This means that we always enable blocking I/O in sandbox (if input is a
terminal) whereas previously it would only happen on the first call to
tstc() or getc(). However, the difference is likely not important.
Simon Glass [Mon, 1 Oct 2018 17:55:19 +0000 (11:55 -0600)]
dm: spi: Clean up detection of sandbox SPI emulator
Now that we don't have to deal with the command-line flag we can simplify
the code for detecting the emulator. Remove the lookup based on the SPI
specification, relying just on the device tree to locate the emulator.
Simon Glass [Mon, 1 Oct 2018 17:55:18 +0000 (11:55 -0600)]
sandbox: tpm: Enhance to support the latest Chromium OS
This driver was originally written against Chromium OS circa 2012. A few
new features have been added. Enhance the TPM driver to match. This mostly
includes a few new messages and properly modelling whether a particular
'space' is present or not.
Simon Glass [Mon, 1 Oct 2018 17:55:17 +0000 (11:55 -0600)]
sandbox: tpm: Tidy up enums and return values
Use an enum for command values instead of open-coding them. This removes
the need for comments. Also make sure the driver returns proper error
numbers instead of -1.
Simon Glass [Mon, 1 Oct 2018 17:55:14 +0000 (11:55 -0600)]
sandbox: video: Speed up video output
At present there are many situations where sandbox syncs the display to
the SDL frame buffer. This is a very expensive operation but is only
needed every now and then. Update video_sync() so that we can specify
whether this operation is really needed.
At present this flag is not used on other architectures. It could also
be used for reducing writeback-cache flushes but the benefit of that would
need to be investigated.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
Simon Glass [Mon, 1 Oct 2018 17:55:12 +0000 (11:55 -0600)]
sandbox: Remove the old memory file later
When debugging sandbox it is sometimes annoying that the memory file is
deleted early on. If sandbox later crashes or we quit (using the
debugger), it is not possible to run it again with the same state since
the memory file is gone.
Remove the old memory file when sandbox exits, instead. Also add debugging
showing the memory filename.
Simon Glass [Mon, 1 Oct 2018 17:55:11 +0000 (11:55 -0600)]
sandbox: Add a flag to set the default log level
It is useful to be able to set the default log level from the command line
when running sandbox. Add a new -L command-line flag for this. The log
level is set using the enum log_level_t in log.h. At present a number must
be specified, e.g. -L7 for debug.
Simon Glass [Mon, 1 Oct 2018 17:55:09 +0000 (11:55 -0600)]
sandbox: spi: Drop command-line SPI option
At present we support specifying SPI flash devices to use in the device
tree and on the command line. Drop the second option, since it is a pain
to support nicely with driver model, and unnecessary.
Simon Glass [Mon, 1 Oct 2018 17:55:08 +0000 (11:55 -0600)]
sandbox: Add a way to write data to the host filesystem
For debugging it is sometimes useful to write out data for inspection
using an external tool. Add a function which can write this data to a
given file.
but many files use the same category throughout. Also it is helpful to
shorten the length of log names, providing helpers for common logging
levels. Add some macros so that it is possible to do:
(top of file, before #includes)
#define LOG_CATEGORY UCLASS_SPI
(later in the file)
log_info("message1");
log_debug("message2");
log_err("message3");
Marek Vasut [Mon, 1 Oct 2018 10:37:20 +0000 (12:37 +0200)]
ofnode: Add missing address translation into ofnode_get_addr_size()
Of CONFIG_OF_TRANSLATE is enabled, this function still returns
untranslated bogus results. Add the missing translation.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Marek Vasut [Mon, 1 Oct 2018 10:37:19 +0000 (12:37 +0200)]
ofnode: Replace of_n_addr_cells with of_n_size_cells
The size should be decoded using of_n_size_cells(), make it so.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 2 Oct 2018 03:12:47 +0000 (21:12 -0600)]
binman: Run tests concurrently
At present the tests run one after the other using a single CPU. This is
not very efficient. Bring in the concurrencytest module and run the tests
concurrently, using one process for each CPU by default. A -P option
allows this to be overridden, which is necessary for code-coverage to
function correctly.
This requires fixing a few tests which are currently not fully
independent.
At some point we might consider doing this across all pytests in U-Boot.
There is a pytest version that supports specifying the number of processes
to use, but it did not work for me.
Simon Glass [Tue, 2 Oct 2018 03:12:46 +0000 (21:12 -0600)]
test: Reduce the number of tests run with sandbox_flattree
We only need to run driver-model tests with this config, since this is the
only thing that is different when CONFIG_OF_LIVE is not defined. Filter
out the other tests to same time.
Simon Glass [Tue, 2 Oct 2018 03:12:45 +0000 (21:12 -0600)]
patman: Don't clear progress in tout unless it was used
At present calling Uninit() always called ClearProgress() which outputs
a \r character as well as spaces to remove any progress information on the
line. This can mess up the normal output of binman and other tools. Fix
this by outputing this only when progress information has actually been
previous written.
Simon Glass [Tue, 2 Oct 2018 03:12:42 +0000 (21:12 -0600)]
binman: Separate out testSplBssPad()
At present this test runs binman twice, which means that the temporary
files from the first run do not get cleaned up. Split this into two tests
to fix this problem.
Simon Glass [Tue, 2 Oct 2018 03:12:41 +0000 (21:12 -0600)]
binman: Fix up removal of temporary directories
At present 'make check' leaves some temporary directories around. Part of
this is because we call tools.PrepareOutputDir() twice in some cases,
without calling tools.FinaliseOutputDir() in between.
Simon Glass [Tue, 2 Oct 2018 03:12:40 +0000 (21:12 -0600)]
binman: Add a default path to libfdt.py
This module is often available in the sandbox_spl build created by
'make check'. Use this as a default path so that just typing 'binman -t'
(without setting PYTHONPATH) will generally run the tests.
Simon Glass [Tue, 2 Oct 2018 03:12:39 +0000 (21:12 -0600)]
test: Tidy up comments and variable name
The 'result' variable counts the number of failures in running the tests.
Rename it to 'failures' to make this more obvious. Also tidy up a few
comments.
Simon Glass [Tue, 2 Oct 2018 03:12:38 +0000 (21:12 -0600)]
test: Print the name of each test before running it
At present the tests are run without any indication of what is running.
For the tests which start with a build this is pretty obvious, but for
tools it is not.
Add a name for each test we run, and print it before starting the test. Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 2 Oct 2018 03:12:36 +0000 (21:12 -0600)]
Makefile: Add a 'check' target for make
At present we use 'make tests' to run the tests. For many projects
'make check' is more common, so support that as well. Also add some help
to 'make help'.
Simon Glass [Tue, 2 Oct 2018 03:12:35 +0000 (21:12 -0600)]
buildman: Make the toolchain test more forgiving
The filenames of the toolchains on kernel.org changes every now and then.
Fix it for the current change, and make the test use a regex so that it
has a better chance of passing with future changes too.
Simon Glass [Tue, 2 Oct 2018 03:12:33 +0000 (21:12 -0600)]
patman: Handle unicode in _ProjectConfigParser tests
With Python 2.7.15rc1, ConfigParser.SafeConfigParser has unfortunately
started returning unicode, for unknown reasons. Adjust the code to handle
this by converting everything to unicode. We cannot convert things to
ASCII since email addresses may be encoded with UTF-8.
Simon Glass [Tue, 2 Oct 2018 03:12:32 +0000 (21:12 -0600)]
sandbox: Unprotect DATA regions in bus tests
On my Ubuntu 18.04.1 machine two driver-model bus tests have started
failing recently. The problem appears to be that the DATA region of the
executable is protected. This does not seem correct, but perhaps there
is a reason.
To work around it, unprotect the regions in these tests before accessing
them.
test_avb: Update pymark.buildconfigspec information for the AVB tests
Update the pymark.buildconfigspec to depend on 'cmd_mmc' in addition to
'cmd_avb' for those tests that needs more a more complete MMC
implementation or the "mmc" command.
Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[trini: initialize session to 0 in dm_test_tee] Signed-off-by: Tom Rini <trini@konsulko.com>
Adds a sandbox tee driver which emulates a generic TEE with the OP-TEE
AVB TA.
Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix printf warnings in ta_avb_invoke_func, slots is uint] Signed-off-by: Tom Rini <trini@konsulko.com>
Adds configuration option OPTEE_TA_AVB and a header file describing the
interface to the Android Verified Boot 2.0 (AVB) trusted application
provided by OP-TEE.
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Targets ARM and ARM64
* Supports using any U-Boot memory as shared memory
* Probes OP-TEE version using SMCs
* Uses OPTEE message protocol version 2 to communicate with secure world
Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Adds a uclass to interface with a TEE (Trusted Execution Environment).
A TEE driver is a driver that interfaces with a trusted OS running in
some secure environment, for example, TrustZone on ARM cpus, or a
separate secure co-processor etc.
The TEE subsystem can serve a TEE driver for a Global Platform compliant
TEE, but it's not limited to only Global Platform TEEs.
The over all design is based on the TEE subsystem in the Linux kernel,
tailored for U-Boot.
Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Prior to this patch was do_avb_write_rb() reading supplied rb_idx as a
hexadecimal number while do_avb_read_rb() printed the read out rb_idx as
decimal number. For consistency change do_avb_read_rb() to print rb_idx
as a hexadecimal number too.
Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Michal Simek [Thu, 4 Oct 2018 07:29:20 +0000 (09:29 +0200)]
spl: ram: Fix u_boot_pos calculation
The patch:
"spl: Weed out CONFIG_SYS_TEXT_BASE usage"
(sha1: 04ce5427bd3914cab8be78513275a20ab878520a)
introduced bug where assigning to u_boot_pos variable wasn't done
which end up in situation where SPL wasn't able to find out
image on the selected address.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
With there now being four device tree files, and 4 separate
defconfig files, the code necessary to determine which board is
being used is no longer necessary as the corresponding pin-muxing
and board names are determined by the device tree.
Adam Ford [Sat, 29 Sep 2018 19:10:18 +0000 (14:10 -0500)]
ARM: DTS: Add Logic PD OMAP35/DM37 SOM-LV and OMAP35 Torpedo
With the device trees doing most of the work of pin-muxing and
DM doing much of the peripheral initialization, this creates
new defconfig files for each of the Logic PD variants with
proper register settings/pin-muxing.
Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Update MAINTAINERS entry] Signed-off-by: Tom Rini <trini@konsulko.com>
Adam Ford [Sat, 29 Sep 2018 19:10:17 +0000 (14:10 -0500)]
ARM: DTS: Add support for Logic PD OMAP35 Torpedo & SOM-LV
The baseboards and SOM's are virtually identical to their DM37
counterparts, but OMAP36/37 and OMAP3 have some minor register
differences. With the boards being mostly driven by device trees
now, this synchronizes their respective device trees with linux-omap
for-next branch destined for 4.20 (or whatever the version after 4.19
will be called)
Adam Ford [Sat, 29 Sep 2018 19:10:16 +0000 (14:10 -0500)]
ARM: DTS: Remove unnecessary u-boot.dtsi options from omap3/36xx
With the introduction of the omap serial driver, the need for some
of these U-Boot specific modifications is gone. This cleans up
this unnneeded stuff.
misc: Add support for the Arm Versatile Express config bus
Add support for the Arm Versatile Express config bus that is
being used for exposing various subsystems via a generic
configuration bus. This driver adds support for generating
transactions on this configuration bus and can be used by
other drivers to abstract the communication with the actual
function providers.