summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* arm: Move check_cache_range() into a common placeSimon Glass2016-07-14-51/+24
| | | | | | | This code is common, so move it into a common file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* board_f: prevent misleading "Watchdog enabled" outputAnatolij Gustschin2016-07-14-1/+1
| | | | | | | Output the "Watchdog enabled" message only if hw_watchdog_init() call really happened. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* board_f: init designware watchdog if CONFIG_DESIGNWARE_WATCHDOG=yAnatolij Gustschin2016-07-14-0/+1
| | | | | | | The designware watchdog init is skipped even if CONFIG_DESIGNWARE_WATCHDOG is enabled. Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de>
* configs: da850evm: enable bootz commandSekhar Nori2016-07-14-0/+1
| | | | | | | | | | Enable bootz command on Texas Instruments DA850 EVM board. This helps it boot zImage with device-tree blob passed. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Kevin Hilman <khilman@baylibre.com>
* ARM: OMAP5+: Enable errata i727Lokesh Vutla2016-07-14-3/+3
| | | | | | | | Errata i727 is applicable on all OMAP5 and DRA7 variants but enabled only on OMAP5 ES1.0. So, enable it on all platforms. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: fix missing break for -p switchTeddy Reed2016-07-14-0/+1
| | | | | | Signed-off-by: Teddy Reed <teddy.reed@gmail.com> Reported-by: Coverity (CID: 150277) Reviewed-by: Tom Rini <trini@konsulko.com>
* bootm: fixup silent Linux out of BOOTM_STATE_LOADOS stateHector Palacios2016-07-14-5/+7
| | | | | | | | | | | | | | The function fixup_silent_linux() is called in status BOOTM_STATE_LOADOS to silence Linux if variable 'silent' is set. Currently only the 'bootm' command state machine contains BOOTM_STATE_LOADOS, but others like 'booti' or 'bootz' commands do not. This means silent Linux does not work with these commands. This patch moves the fixup_silent_linux() call out of the BOOTM_STATE_LOADOS state and into BOOTM_STATE_OS_PREP, to silence Linux independently of the used command (booti, bootm or bootz). Signed-off-by: Hector Palacios <hector.palacios@digi.com>
* stm32: Change USART port to USART6 for stm32f746 discovery boardToshifumi NISHINAGA2016-07-14-7/+11
| | | | | | | | | | | | | This change is to remove a halt at about 200KiB while sending a large(1MiB) binary to a micro controller using USART1. USART1 is connected to a PC via an on-board ST-Link debugger that also functions as a USB-Serial converter. However, it seems to loss some data occasionally. So I changed the serial port to USART6 and connected it to the PC using an FTDI USB-Serial cable, therefore the transmission was successfully completed. Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
* stm32: Add SDRAM support for stm32f746 discovery boardToshifumi NISHINAGA2016-07-14-14/+357
| | | | | | | | | | This patch adds SDRAM support for stm32f746 discovery board. This patch depends on previous patch. This patch is based on STM32F4 and emcraft's[1]. [1]: https://github.com/EmcraftSystems/u-boot Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
* stm32: clk: Add 200MHz clock configuration for stm32f746 discovery boardToshifumi NISHINAGA2016-07-14-3/+319
| | | | | | | | | This patch adds 200MHz clock configuration for stm32f746 discovery board. This patch is based on STM32F4 and emcraft's[1]. [1]: https://github.com/EmcraftSystems/u-boot Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
* dragonboard410c: adding missing default addr for script and pxe bootRicardo Salveti de Araujo2016-07-14-0/+2
| | | | | Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Signed-off-by: Ricardo Salveti <rsalveti@rsalveti.net>
* dragonboard410c: prefer sdcard boot over emmcRicardo Salveti de Araujo2016-07-14-1/+1
| | | | | | | | | | | | Make the external devices the preferred ones when booting the system (usb is already the first option). This allows users to easily boot custom distributions without requiring them to reflash/customize u-boot. Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Signed-off-by: Ricardo Salveti <rsalveti@rsalveti.net> Reviewed-by: Andreas Färber <afaerber@suse.de> Tested-by: Andreas Färber <afaerber@suse.de> Acked-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
* test: Convert the vboot test to test/pySimon Glass2016-07-14-155/+185
| | | | | | | | Now that we have a suitable test framework we should move all tests into it. The vboot test is a suitable candidate. Rewrite it in Python and move the data files into an appropriate directory. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: Correct error handling in fit_image_process_hash()Simon Glass2016-07-14-6/+8
| | | | | | | | | | | | | | | | We should not be returning -1 as an error code. This can mask a situation where we run out of space adding things to the FIT. By returning the correct error in this case (-ENOSPC) it can be handled by the higher-level code. This may fix the error reported by Tom Van Deun here: https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html although I am not sure as I cannot actually repeat it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Van Deun <tom.vandeun@wapice.com> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* tools: Add an error code when fit_handle_file() failsSimon Glass2016-07-14-2/+2
| | | | | | | | The error code may provide useful information for debugging. Add it to the error string. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test/py: Add a helper to run a list of U-Boot commandsSimon Glass2016-07-14-0/+16
| | | | | | | Some tests want to execute a sequence of commands. Add a helper for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test/py: Provide a way to check that a command failsSimon Glass2016-07-14-0/+22
| | | | | | | | Sometimes we want to run a command and check that it fails. Add a function to handle this. It can check the return code and also make sure that the output contains a given error message. Signed-off-by: Simon Glass <sjg@chromium.org>
* test/py: Add an option to execute a string containing a commandSimon Glass2016-07-14-0/+12
| | | | | | | | It is sometimes inconvenient to convert a string into a list for execution with run_and_log(). Provide a helper function to do this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test/py: Return output from run_and_log()Simon Glass2016-07-14-2/+3
| | | | | | | | It is useful to be able to obtain the output from a command. Return it from this function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test/py: Provide output from exceptions with RunAndLog()Simon Glass2016-07-14-0/+7
| | | | | | | | | | | | Tests may want to look at the output from running a command, even if it fails (e.g. with a non-zero return code). Provide a means to obtain this. Another approach would be to return a class object containing both the output and the exception, but I'm not sure if that would result in a lot of refactoring. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test/py: Allow RunAndLog() to return the outputSimon Glass2016-07-14-1/+2
| | | | | | | | Tests may want to look at the output from running a command. Return it so that this is possible. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test/py: Allow tests to control the sandbox device-tree fileSimon Glass2016-07-14-1/+2
| | | | | | | | | | | | Normally tests will run with the test.dtb file designed for this purpose. However, the verified boot tests need to run with their own device-tree file, containing a public key. Make the device-tree file a config option so that it can be adjusted by tests. The default is to keep the current behaviour. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* sandbox: Don't exit when bootm completesSimon Glass2016-07-14-1/+2
| | | | | | | | | | | | | | | At present sandbox exits when the 'bootm' command completes, since it is not actually able to run the OS that is loaded. Normally 'bootm' failure is considered a fatal error in U-Boot. However this is annoying for tests, which may want to examine the state after a test is complete. In any case there is a 'reset' command which can be used to exit, if required. Change the behaviour to return normally from the 'bootm' command on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test: Add a simple script to run tests on sandboxSimon Glass2016-07-14-0/+15
| | | | | | | | | | | | | | | A common check before sending patches is to run all available tests on sandbox. But everytime I do this I have to look up the README. This presents quite a barrier to actually doing this. Add a shell script to help. To run the tests, type: test/run in the U-Boot directory, which should be easy to remember. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* test: Add a READMESimon Glass2016-07-14-0/+82
| | | | | | | Add a few notes about how testing works in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
* tools: Allow building with debug enabledSimon Glass2016-07-14-1/+11
| | | | | | | | | Sometimes it is useful to build tools with debugging information included so that line-number information is available when run under gdb. Add a Kconfig option to support this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Show item lists for all categoriesSimon Glass2016-07-14-3/+9
| | | | | | | | | Update the error-handling code for -A, -C and -O to show a list of valid options when an invalid one is provided. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Vinoth Eswaran <evinoth1206@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Use generic code for showing an 'image type' errorSimon Glass2016-07-14-43/+2
| | | | | | | | | | | | | The existing error code only displays image types which are claimed by a particular U_BOOT_IMAGE_TYPE() driver. But this does not seem correct. The mkimage tool should support all image types, so it makes sense to allow creation of images of any type with the tool. When an incorrect image type is provided, use generic code to display the error. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Allow display of a list of any image header categorySimon Glass2016-07-14-0/+43
| | | | | | | | | Add a generic function which can display a list of items in any category. This will allow displaying of images for the -A, -C, -O and -T flags. At present only -T is supported. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* image: Add functions to obtain category informationSimon Glass2016-07-14-0/+102
| | | | | | | | | | | | Add generic functions which can look up information about a category: - the number of items in the category - the category description - an item long time - an item short time Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* image: Add a name for invalid typesSimon Glass2016-07-14-3/+3
| | | | | | | | At present the name is NULL, which prevents qsort() fromp being used. Use the name "invalid" instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* image: Create a table of information for each categorySimon Glass2016-07-14-0/+22
| | | | | | | | | Add a table that contains the category name, the number of items in each category and a pointer to the table of items. This will allow us to use generic code to deal with the categories. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* image: Convert the IH_... values to enumsSimon Glass2016-07-14-86/+101
| | | | | | | | | We need to know the number of values of each category (architecture, compression, OS and image type). To make this value easier to maintain, convert all values to enums. The count is then automatic. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* image: Correct auto-fit architecture property nameSimon Glass2016-07-14-1/+2
| | | | | | | | | The fit_write_images() function incorrectly uses the long name for the architecture. This cannot be parsed with the FIT is read. Fix this by using the short name instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Drop blank line before main()Simon Glass2016-07-14-1/+0
| | | | | | | This is not needed. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Drop premature setting of params.fit_image_typeSimon Glass2016-07-14-1/+0
| | | | | | | | There is no need to set params.fit_image_type while parsing the arguments. It is set up later anyway. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Require a data file when auto-fit is usedSimon Glass2016-07-14-0/+2
| | | | | | | | | When auto-fit is used, it is not valid to create a FIT without an image file. Add a check for this to avoid a very confusing error message later ("Can't open (null): Bad address"). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Explain the auto-fit imagefile special caseSimon Glass2016-07-14-0/+1
| | | | | | | | There is a special case in the code when auto-fit is used. Add a comment to make it easier to understand why this is needed. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* mkimage: Honour the default image type with auto-fitSimon Glass2016-07-14-1/+1
| | | | | | | | The default image type is supposed to be IH_TYPE_KERNEL, as set in the 'params' variable. Honour this with auto-fit also. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* linux/io.h: add generic ioremap()/iounmap() definesMasahiro Yamada2016-07-14-0/+20
| | | | | | | | | | | | | | | | | For most of architectures in U-Boot, virtual address is straight mapped to physical address. So, it makes sense to have generic defines of ioremap and friends in <linux/io.h>. All of them are just empty and will disappear at compile time, but they will be helpful to implement drivers which are counterparts of Linux ones. I notice MIPS already has its own implementation, so I added a Kconfig symbol CONFIG_HAVE_ARCH_IOREMAP which MIPS (and maybe Sandbox as well) can select. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* arm, nds32, sh: remove useless ioremap()/iounmap() definesMasahiro Yamada2016-07-14-101/+0
| | | | | | | These defines are valid only when iomem_valid_addr is defined, but I do not see such defines anywhere. Remove. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* types.h: move and redefine resource_size_tMasahiro Yamada2016-07-14-1/+4
| | | | | | | | | | | | | | Currently, this is only defined in arch/arm/include/asm/types.h, so move it to include/linux/types.h to make it available for all architectures. I defined it with phys_addr_t as Linux does. I needed to surround the define with #ifdef __KERNEL__ ... #endif to avoid build errors in tools building. (Host tools should not include <linux/types.h> in the first place, but this is already messy in U-Boot...) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: Update info on using secure devices from TIAndreas Dannenberg2016-07-14-54/+123
| | | | | | | | | | | Adds information regarding SPL handling the loading and processing of secured u-boot images as part of the second stage boot the SPL does. Introduces the description of a new interface script in the TI SECDEV Package which handles the creation and prep of secured binary images. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* arm: am4x: add U-Boot FIT signing and SPL image post-processingMadan Srinivas2016-07-14-0/+10
| | | | | | | | | | | | | | | Modify the SPL build procedure for AM437x high-security (HS) device variants to create a secure u-boot_HS.img FIT blob that contains U-Boot and DTB artifacts signed (and optionally encrypted) with a TI-specific process based on the CONFIG_TI_SECURE_DEVICE config option and the externally-provided image signing tool. Also populate the corresponding FIT image post processing call to be performed during SPL runtime. Signed-off-by: Madan Srinivas <madans@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* arm: omap5: add U-Boot FIT signing and SPL image post-processingAndreas Dannenberg2016-07-14-0/+22
| | | | | | | | | | | | | | | Modify the SPL build procedure for AM57xx and DRA7xx high-security (HS) device variants to create a secure u-boot_HS.img FIT blob that contains U-Boot and DTB artifacts signed with a TI-specific process based on the CONFIG_TI_SECURE_DEVICE config option and the externally-provided image signing tool. Also populate the corresponding FIT image post processing call to be performed during SPL runtime. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: fit: add support for post-processing of imagesDaniel Allred2016-07-14-5/+47
| | | | | | | | | | | | | | | | | | The next stage boot loader image and the selected FDT can be post- processed by board/platform/device-specific code, which can include modifying the size and altering the starting source address before copying these binary blobs to their final destination. This might be desired to do things like strip headers or footers attached to the images before they were packaged into the FIT, or to perform operations such as decryption or authentication. Introduce new configuration option CONFIG_SPL_FIT_IMAGE_POST_PROCESS to allow controlling this feature. If enabled, a platform-specific post-process function must be provided. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* arm: omap-common: Update to generate secure U-Boot FIT blobAndreas Dannenberg2016-07-14-14/+61
| | | | | | | | | | | | | | Adds commands so that when a secure device is in use and the SPL is built to load a FIT image (with combined U-Boot binary and various DTBs), these components that get fed into the FIT are all processed to be signed/encrypted/etc. as per the operations performed by the secure-binary-image.sh script of the TI SECDEV package. Furthermore, perform minor comments cleanup to make better use of the available space. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* arm: omap-common: secure ROM signature verify APIAndreas Dannenberg2016-07-14-0/+97
| | | | | | | | | | | Adds an API that verifies a signature attached to an image (binary blob). This API is basically a entry to a secure ROM service provided by the device and accessed via an SMC call, using a particular calling convention. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* arm: omap-common: add secure rom call API for secure devicesAndreas Dannenberg2016-07-14-0/+74
| | | | | | | | | | | | | Adds a generic C-callable API for making secure ROM calls on OMAP and OMAP-compatible devices. This API provides the important function of flushing the ROM call arguments to memory from the cache, so that the secure world will have a coherent view of those arguments. Then is simply calls the omap_smc_sec routine. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* arm: omap-common: add secure smc entryDaniel Allred2016-07-14-9/+42
| | | | | | | | | | | Add an interface for calling secure ROM APIs across a range of OMAP and OMAP compatible high-security (HS) device variants. While at it, also perform minor cleanup/alignment without any change in functionality. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>