summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-09video: Tidy up a few comments in video.oSimon Glass1-2/+2
Add a little more information to one comment and update the guard comment to be more accurate. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09video: at91: Adjust vidconsole_position_cursor() to use char posSimon Glass2-1/+6
At present this function uses pixels but it seems more useful for it to position in terms of characters on the screen. This also matches the comment to the function. Update this. Unfortunately there is one user of this function (at91). Have a crack at fixing this, since I cannot test it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09sysreset: Add a way to find the last resetSimon Glass4-0/+95
We have a method to return the last reset as a string for humans, but not a method that allows it to be used programmatically. Add a new method that returns the last reset as an enum. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sysreset: Tidy up a few comments and loggingSimon Glass3-3/+6
Some comments are incorrect or missing pieces. Fix these and use logging to print the error. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09pci: Add a little more debugging to pci_romSimon Glass1-2/+2
Add some logging on failure. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-10-09fdt: Allow C++ comments in link scripts and DT filesSimon Glass2-2/+2
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09ctags: Minor changes to fix ctags outputSimon Glass2-3/+6
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09panel: Expand the backlight supportSimon Glass7-37/+274
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. Update the test to cover thes new features. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09test: panel: Add a test for the panel uclassSimon Glass6-2/+111
At present this uclass has no tests. Add a simple one which checks the PWM configuration, regulator and GPIO. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09cros_ec: Add support for v3 messages on LPCSimon Glass1-0/+33
At present version 3 messages are only supported on SPI. Add support for using LPC as well, as used on samus. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09cros_ec: Update cros_ec_read_hash() to specify the imageSimon Glass3-5/+8
Allow selection of which EC image to hash. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09x86: Update mtrr functions to allow leaving cache aloneSimon Glass4-16/+33
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>
2018-10-09cros: Update ec_commands to latest versionSimon Glass4-432/+3318
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09Rename GPT_HEADER_SIGNATURE to avoid conflictSimon Glass2-4/+4
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09Add a header file for stringsSimon Glass1-0/+1
Add a string.h header for libraries that expect this to be available, now that U-Boot's version has moved to include/linux. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09log: Add comments to the rest of the log categoriesSimon Glass1-6/+6
At present some of the log categories are missing comments. Add them. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09binman: Move to three-digit test-file numbersSimon Glass101-115/+115
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09tpm: Add a few new commands for v1Simon Glass3-18/+93
These are needed for the 2018 version of Chromium OS vboot. Add an implementation for TPM v1, with v2 to come later. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09tpm: Tidy up logging in tpm-common.cSimon Glass1-3/+7
At present this file uses logging but it should use the new macros. Update it and add a log message for an error. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09tpm: Use livetree and allow childrenSimon Glass2-1/+4
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09video: Adjust video_clear() to return an errorSimon Glass2-2/+5
All driver-model operation should return an error code. Adjust this function to do so also. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09fdt: Remove fdtdec_decode_region() functionSimon Glass2-128/+0
This function is not used in U-Boot now. Remove it along with its 'memory' version. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: spi: Add logging of some return valuesSimon Glass4-11/+11
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09cros: Adjust board_get_cros_ec_dev() to return a udeviceSimon Glass2-5/+3
Rather than returning what is effectively an internal data structure, return the cros EC device itself. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09cros: Update cros_ec code to use struct udeviceSimon Glass5-125/+122
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09fdt: Allow libfdt in TPLSimon Glass1-0/+10
In some cases (e.g. sandbox with verified boot) it is useful to support libfdt in TPL. Update the Kconfig to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09serial: Allow serial to be absent in TPLSimon Glass3-2/+17
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(). Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09tpm: Add support for SPL and TPLSimon Glass3-4/+30
At present the tpm can only be used in U-Boot proper. Updated it to work in SPL and TPL also. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09fdt: Allow indicating a node is for U-Boot proper onlySimon Glass2-1/+5
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09doc: Update docs for device tree in SPL, TPLSimon Glass2-1/+12
Make a few small updates to indicate that device tree can be used in SPL and TPL. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09fdt: Document the fact that dtc is now builtSimon Glass1-1/+5
This documentation is out of date now that U-Boot builds dtc automatically. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09rtc: Allow use of RTC in SPL and TPLSimon Glass3-1/+20
Add Kconfig options so that the RTC can be used in SPL and TPL. This is helpful for accessing the contents of CMOS RAM, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09Kconfig: Convert CONFIG_RTC_MC146818 to KconfigSimon Glass9-3/+13
Move this option to Kconfig and tidy up the two boards which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09blk: Support block drivers in TPLSimon Glass2-1/+13
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09Makefile: Add a warning if SPL/TPL cannot be builtSimon Glass1-0/+7
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09spl: input: Allow input in SPL and TPLSimon Glass3-5/+59
In some cases it is necessary to read the keyboard in early phases of U-Boot. Update the config to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sf: Avoid allocating memory on every read operationSimon Glass1-7/+2
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: core: Update ofnode to read binman-style flash entrySimon Glass7-45/+103
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. Also add a simple test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: core: Add a function to find the first inactive childSimon Glass3-0/+64
Some devices have children and want to press an existing inactive child into service when needed. Add a function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: core: Update some functions to use constSimon Glass2-24/+24
Quite a few functions do not actually modify the device that is passed in. Update the function signatures to reflect that. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: core: Alloc uclass-private data to be cache-alignedSimon Glass2-1/+5
There is no reason why this feature should not be supported for uclass- private data. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: Restore blocking I/O on exitSimon Glass3-19/+16
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: spi: Clean up detection of sandbox SPI emulatorSimon Glass2-11/+8
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: tpm: Enhance to support the latest Chromium OSSimon Glass2-15/+116
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: tpm: Tidy up enums and return valuesSimon Glass3-10/+25
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09serial: sandbox: Allow serial output without device treeSimon Glass1-0/+5
At present sandbox assumes that device-tree control is active, but this may not be the case in SPL or TPL. Add some conditions to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: Add a debug UARTSimon Glass3-0/+30
Add support for the debug UART so that sandbox provides build testing for this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: video: Speed up video outputSimon Glass5-12/+14
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>
2018-10-09sandbox: spi: Add more loggingSimon Glass3-54/+39
Add logging to aid debugging features in these drivers. Also drop some code in sandbox_spi_xfer() which is not used. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: Remove the old memory file laterSimon Glass2-6/+6
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. Signed-off-by: Simon Glass <sjg@chromium.org>