summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* dm: Tidy up four minor code nitsSimon Glass2014-06-20-6/+28
| | | | | | | | | | | | There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation. Fix these problems. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
* tegra: Enable driver modelSimon Glass2014-06-20-0/+3
| | | | | | | Enable driver model for Tegra boards. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
* tegra: dts: Bring in GPIO bindings from linuxSimon Glass2014-06-20-28/+155
| | | | | | | These files are taken from Linux 3.14. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
* dm: Fix printf() strings in the 'dm' commandSimon Glass2014-06-20-4/+4
| | | | | | | The values here are int, but the map_to_sysmem() call can return a long. Add a cast to deal with this. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Allow driver model tests only for sandboxSimon Glass2014-06-20-2/+11
| | | | | | | The GPIO tests require the sandbox GPIO driver, so cannot be run on other platforms. Similarly for the 'dm test' command. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Cast away the const-ness of the global_data pointerSimon Glass2014-06-20-4/+8
| | | | | | | In a very few cases we need to adjust the driver model root device, such as when setting it up at initialisation. Add a macro to make this easier. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add missing header files in lists and rootSimon Glass2014-06-20-0/+2
| | | | | | | These files don't compile in some architectures. Fix it by adding the missing headers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Use case-insensitive comparison for GPIO banksSimon Glass2014-06-20-1/+1
| | | | | | | We want 'N0' and 'n0' to mean the same thing, so ensure that case is not considered when naming GPIO banks. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Update README to encourage conversion to driver modelSimon Glass2014-06-20-0/+5
| | | | | | Add a note to encourage people to convert drivers to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename struct device_id to udevice_idSimon Glass2014-06-20-9/+9
| | | | | | | It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Support include files for .dts filesSimon Glass2014-06-20-0/+5
| | | | | | | | | | | | Linux supports this, and if we are to have compatible device tree files, U-Boot should also. Avoid giving the device tree files access to U-Boot's include/ directory. Only include/dt-bindings is accessible. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* sandbox: Support iotrace featureSimon Glass2014-06-20-0/+13
| | | | | | | Support the iotrace feature for sandbox, and enable it, using some dummy I/O access methods. Signed-off-by: Simon Glass <sjg@chromium.org>
* arm: Support iotrace featureSimon Glass2014-06-20-0/+3
| | | | | | Support the iotrace feature for ARM, when enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add an I/O tracing featureSimon Glass2014-06-20-0/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging drivers it is useful to see what I/O accesses were done and in what order. Even if the individual accesses are of little interest it can be useful to verify that the access pattern is consistent each time an operation is performed. In this case a checksum can be used to characterise the operation of a driver. The checksum can be compared across different runs of the operation to verify that the driver is working properly. In particular, when performing major refactoring of the driver, where the access pattern should not change, the checksum provides assurance that the refactoring work has not broken the driver. Add an I/O tracing feature and associated commands to provide this facility. It works by sneaking into the io.h heder for an architecture and redirecting I/O accesses through its tracing mechanism. For now no commands are provided to examine the trace buffer. The format is fairly simple, so 'md' is a reasonable substitute. Note: The checksum feature is only useful for I/O regions where the contents do not change outside of software control. Where this is not suitable you can fall back to manually comparing the addresses. It might be useful to enhance tracing to only checksum the accesses and not the data read/written. Signed-off-by: Simon Glass <sjg@chromium.org>
* cosmetic: autoboot: update old style GNU struct initJeroen Hofstee2014-06-19-4/+4
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* cmd_md5sum.c: remove dead code / fix warningJeroen Hofstee2014-06-19-1/+0
| | | | | | | | | | | | commit ecd729500 "Add parameter to md5sum to save the md5 sum" adds support to build a string to be saved in the env and tries to zero end it with str_ptr = '\0'; This does actually set the pointer to the end of the buffer itself to zero. Since the string was already zero terminated by the sprintf before it, just remove the line, preventing a clang warning. cc: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Remove nios-32 arch remnantsVasili Galka2014-06-19-335/+0
| | | | | | | | nios-32 arch was removed back in 2010 (1117cbf). Code depending on its headers (nios.h, nios-io.h) can't possibly compile since then. As it wasn't fixed till now it is safe to remove. Signed-off-by: Vasili Galka <vvv444@gmail.com>
* m68k: Remove CONFIG_CMD_BEDBUG related codeVasili Galka2014-06-19-8/+0
| | | | | | | | This flag does not compile on m68k since 2003 (8bde7f7) when a required "cmd_bedbug.h" header was removed. Eleven years passed, lets clean up a little... Signed-off-by: Vasili Galka <vvv444@gmail.com>
* pmic: tps65090: correct checking i2c busJeroen Hofstee2014-06-19-1/+1
| | | | | | | | | | The function tps65090_init checks the i2c bus of p->bus. However the pointer p is not intialiased at this point. Check the local variable bus instead. cc: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org>
* fix: CONFIG_NETCONSOLE start/handle this stuff only outside SPLHannes Petermaier2014-06-19-2/+2
| | | | | | | SPL stage does not support various networking things, and therefore CONFIG_NETCONSOLE cannot be built within SPL. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
* includes: move openssl headers to include/u-bootJeroen Hofstee2014-06-19-31/+30
| | | | | | | | | | | | commit 18b06652cd "tools: include u-boot version of sha256.h" unconditionally forced the sha256.h from u-boot to be used for tools instead of the host version. This is fragile though as it will also include the host version. Therefore move it to include/u-boot to join u-boot/md5.h etc which were renamed for the same reason. cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* test: vboot: explicitly request bashStephen Warren2014-06-19-1/+1
| | | | | | | | vboot_test.sh uses Bashisms. Explicitly use #!/bin/bash so the script doesn't fail if /bin/sh isn't Bash. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* Add documentation for verified boot on Beaglebone BlackSimon Glass2014-06-19-0/+608
| | | | | | | | As an example of an end-to-end process for using verified boot in U-Boot, add a detailed description of the steps to be used for a Beaglebone Black. Signed-off-by: Simon Glass <sjg@chromium.org>
* Enhance fit_check_sign to check all imagesSimon Glass2014-06-19-7/+96
| | | | | | | | | At present this tool only checks the configuration signing. Have it also look at each of the images in the configuration and confirm that they verify. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de> (v1)
* bootm: Move decompression code into its own functionSimon Glass2014-06-19-27/+48
| | | | | | | This makes it possible to decompress an image without it being a kernel and without intending to boot it (as it needed for host tools, for example). Signed-off-by: Simon Glass <sjg@chromium.org>
* Allow compiling common/bootm.c on with HOSTCCSimon Glass2014-06-19-4/+15
| | | | | | | We want to use some of the functionality in this file, so make it build on the host. Signed-off-by: Simon Glass <sjg@chromium.org>
* Avoid including config.h in command.hSimon Glass2014-06-19-1/+0
| | | | | | This is not necessary and prevents using this header when building tools. Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix small 'case' typo in image-fit.cSimon Glass2014-06-19-1/+1
| | | | | | This typo makes the comment confusing. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootm: Support android boot on sandboxSimon Glass2014-06-19-1/+2
| | | | | | A small change allows this to operate on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Remove the fit_load_image() property parameterSimon Glass2014-06-19-7/+33
| | | | | | | This can be obtained by looking up the image type, so is redundant. It is better to centralise this lookup to avoid errors. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootm: Split out code from cmd_bootm.cSimon Glass2014-06-19-1338/+1356
| | | | | | | | | | | | | | | | | This file has code in three different categories: - Command processing - OS-specific boot code - Locating images and setting up to boot Only the first category really belongs in a file called cmd_bootm.c. Leave the command processing code where it is. Split out the OS-specific boot code into bootm_os.c. Split out the other code into bootm.c Header files and extern declarations are tidied but otherwise no code changes are made, to make it easier to review. Signed-off-by: Simon Glass <sjg@chromium.org>
* Reverse the meaning of the fit_config_verify() return codeSimon Glass2014-06-19-6/+5
| | | | | | | It is more common to have 0 mean OK, and -ve mean error. Change this function to work the same way to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: Check arguments in fit_check_sign/fit_infoSimon Glass2014-06-19-0/+21
| | | | | | | These tools crash if no arguments are provided. Add checks to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
* fdt: Rename the DEV_TREE_BIN Makefile flag to to EXT_DTBSimon Glass2014-06-19-5/+5
| | | | | | | This seems like a better name. This is a patch-up to the earlier commit 63b4b5b, and also removes a redundant Makefile change. Signed-off-by: Simon Glass <sjg@chromium.org>
* mkimage: Automatically expand FDT in more casesSimon Glass2014-06-19-10/+21
| | | | | | | The original code did not cover every case and there was a missing negative sign in one case. Expand the coverage and fix the bug. Signed-off-by: Simon Glass <sjg@chromium.org>
* hash: Use uint8_t in preference to u8Simon Glass2014-06-19-7/+8
| | | | | | This type is more readily available on the host compiler, so use it instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* am335x_evm: Only enable OF_CONTROL/OF_SEPARATE on VBOOT for nowTom Rini2014-06-19-3/+3
| | | | | | | | We don't make use of the device tree otherwise yet (and will need to think how to not break the current multi-board support) and this causes further breakage with additional changes. Signed-off-by: Tom Rini <trini@ti.com>
* .gitignore: drop include/asm/proc from ignore patternMasahiro Yamada2014-06-19-1/+0
| | | | | | | | | | Commit 7d89982b stopped creating symbolic link arch/${arch}/include/asm/proc. arch/.gitignore should be updated. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Vasili Galka <vvv444@gmail.com>
* fs: ext4: fix writing zero-length filesStephen Warren2014-06-19-3/+1
| | | | | | | | | | | | | ext4fs_allocate_blocks() always allocates at least one block for a file. If the file size is zero, this causes total_remaining_blocks to underflow, which then causes an apparent hang while 2^32 blocks are allocated. To solve this, check that total_remaining_blocks is non-zero as part of the loop condition (i.e. before each loop) rather than at the end of the loop. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* fdt_support: correct the return condition of fdt_initrd()Masahiro Yamada2014-06-19-4/+4
| | | | | | | | | | | | Before this commit, fdt_initrd() just returned if initrd start address is zero. But it is possible if the RAM is located at address 0. This commit makes the return condition more reasonable: Just return if the size of initrd is zero. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: fix an endian bug of fdt_initrd()Masahiro Yamada2014-06-19-21/+20
| | | | | | | | | | | | | | | Data written to DTB must be converted to big endian order. It is usually done by using cpu_to_fdt32(), cpu_to_fdt64(), etc. fdt_initrd() invoked write_cell(), which always swaps byte order. It means the function only worked on little endian architectures. (On big endian architectures, the byte order should be kept as it is) This commit uses cpu_to_fdt32() and cpu_to_fdt64() and deletes write_cell(). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: fix an endian bug of fdt_fixup_memory_banksMasahiro Yamada2014-06-19-12/+30
| | | | | | | | | | | | | | | Data written to DTB must be converted to big endian order. It is usually done by using cpu_to_fdt32(), cpu_to_fdt64(), etc. fdt_fixup_memory_banks() invoked write_cell(), which always swaps byte order. It means the function only worked on little endian architectures. This commit adds and uses a new helper function, fdt_pack_reg(), which works on both big endian and little endian architrectures. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: add 'const' qualifier for unchanged argumentMasahiro Yamada2014-06-19-2/+2
| | | | | | | | | | | | | In the next commit, I will add a new function, fdt_pack_reg() which uses get_cells_len(). Beforehand, this commit adds 'const' qualifier to get_cells_len(). Otherwise, a warning message will appear: warning: passing argument 1 of 'get_cells_len' discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: refactor fdt_fixup_stdout() functionMasahiro Yamada2014-06-19-43/+42
| | | | | | | | | | | | | | | | | | | - Do not use a deep indentation. We have only 80-character on each line and 1 indentation consumes 8 spaces. Before the code moves far to the right, you should consider to fix your code. See Linux Documentation/CodingStyle. - Add CONFIG_OF_STDOUT_VIA_ALIAS and OF_STDOUT_PATH macros only to their definition. Do not add them to both callee and caller. This is a tip to avoid using #ifdef everywhere. - OF_STDOUT_PATH and CONFIG_OF_STDOUT_VIA_ALIAS are exclusive. If both are defined, the former takes precedence. Do not try to fix-up "linux,stdout-path" property twice. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: delete force argument of fdt_chosen()Masahiro Yamada2014-06-19-29/+15
| | | | | | | | | | | | After all, we have realized "force" argument is completely useless. fdt_chosen() was always called with force = 1. We should always want to do the same thing (set appropriate value to the property) even if the property already exists. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: delete force argument of fdt_initrd()Masahiro Yamada2014-06-19-24/+19
| | | | | | | | | | | | After all, we have realized "force" argument is completely useless. fdt_initrd() was always called with force = 1. We should always want to do the same thing (set appropriate value to the property) even if the property already exists. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: refactor with fdt_find_or_add_subnode helper funcMasahiro Yamada2014-06-19-35/+36
| | | | | | | | | | | Some functions in fdt_support.c do the same routine: search a node with a given name ("chosen", "memory", etc.) or newly create it if it does not exist. So this commit makes that routine to a helper function. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt_support: delete unnecessary DECLARE_GLOBAL_DATA_PTRMasahiro Yamada2014-06-19-5/+0
| | | | | | | gd->bd is not used in fdt_support.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* freescale: m5253demo: fix unused-but-set-variable warningsMasahiro Yamada2014-06-19-4/+2
| | | | | | | | | | | | Fix the following warning messages: In function 'flash_erase': 180:21: warning: variable 'last' set but not used [-Wunused-but-set-variable] In function 'write_buff': 322:10: warning: variable 'port_width' set but not used [-Wunused-but-set-variable] Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
* libfdt: Fix segfault when calling fit_check_format() on corrupt FIT imagesJon Nalley2014-06-19-1/+1
| | | | | | | | | | | It has been observed that fit_check_format() will fail when passed a corrupt FIT image. This was tracked down to _fdt_string_eq(): return (strlen(p) == len) && (memcmp(p, s, len) == 0); In the case of a corrupt FIT image one can't depend on 'p' being NULL terminated. I changed it to use strnlen() to fix the issue. Signed-off-by: Tom Rini <trini@ti.com>