summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fdt: parse "reserved-memory" for memory reservationSimon Goldschmidt2019-01-162-8/+46
| | | | | | | | | | | | boot_fdt_add_mem_rsv_regions() adds reserved memory sections to an lmb struct. Currently, it only parses regions described by /memreserve/ entries. Extend this to the more commonly used scheme of the "reserved-memory" node. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* lib: lmb: reserving overlapping regions should failSimon Goldschmidt2019-01-162-15/+91
| | | | | | | | | | | | | | | | | | | | lmb_add_region handles overlapping regions wrong: instead of merging or rejecting to add a new reserved region that overlaps an existing one, it just adds the new region. Since internally the same function is used for lmb_alloc, change lmb_add_region to reject overlapping regions. Also, to keep reserved memory correct after 'free', reserved entries created by allocating memory must not set their size to a multiple of alignment but to the original size. This ensures the reserved region is completely removed when the caller calls 'lmb_free', as this one takes the same size as passed to 'lmb_alloc' etc. Add test to assert this. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* lmb: fix allocation at end of address rangeSimon Goldschmidt2019-01-162-20/+38
| | | | | | | | | | | | The lmb code fails if base + size of RAM overflows to zero. Fix this by calculating end as 'base + size - 1' instead of 'base + size' where appropriate. Added tests to assert this is fixed. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* test: add test for lib/lmb.cSimon Goldschmidt2019-01-162-0/+298
| | | | | | | | Add basic tests for the lmb memory allocation code used to reserve and allocate memory during boot. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* env: add spi_flash_read_env functionHoratiu Vultur2019-01-161-11/+45
| | | | | | | | | | | | | | The spi_flash_read_env function is a wrapper over spi_flash_read, which enables the env to read multiple flash page size from flash until '\0\0' is read or the end of env partition is reached. Instead of reading the entire env size. When it reads '\0\0', it stops reading further the env and assumes that the rest of env is '\0'. This is an optimization for large environments that contain few bytes environment variables. In this case it doesn't need to read the entire environment and only few pages. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
* mtd: nand: raw: allow to disable unneeded ECC layoutsStefan Agner2019-01-162-0/+11
| | | | | | | | | | Each ECC layout consumes about 2984 bytes in the .data section. Allow to disable the default ECC layouts if a driver is known to provide its own ECC layout. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
* Merge tag 'dm-pull-15jan19' of git://git.denx.de/u-boot-dmTom Rini2019-01-1525-96/+174
|\ | | | | | | | | | | | | | | Fix recent changes to serial API for driver model Buildman clang support and a few fixes Small fixes to 'dm tree' and regmap test Improve sandbox build compatibility A few other minor fixes
| * lib: fdtdec: fdtdec_get_addr_size_fixed remove checksKeerthy2019-01-141-10/+0
| | | | | | | | | | | | | | | | With 8 bytes addressing even on 32 bit machines these checks are no longer valid. Remove them. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * sandbox: i2c_emul_find() No emulators for device 'rtc@43'Heinrich Schuchardt2019-01-142-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when running the date command on sandbox_defconfig an error occurs: ./u-boot -D u-boot.dtb => date i2c_emul_find() No emulators for device 'rtc@43' ## Get date failed Correct the references to the emulator devices in the sandbox device trees using test.dts as a reference. Fixes: 031a650e1309 ("dm: sandbox: i2c: Use new emulator parent uclass") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Dropped unnecessary #address/size-cells property in i2c_emul: Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: serial: Tidy up header file commentsSimon Glass2019-01-141-3/+31
| | | | | | | | | | | | | | | | The getconfig() comment is out of date. Fix this and add comments for recently added functions. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * dm: serial: Adjust serial_getinfo() to use proper APISimon Glass2019-01-144-14/+12
| | | | | | | | | | | | | | | | All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * dm: serial: Adjust serial_setconfig() to use proper APISimon Glass2019-01-143-11/+11
| | | | | | | | | | | | | | | | All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * dm: serial: Adjust serial_getconfig() to use proper APISimon Glass2019-01-144-10/+10
| | | | | | | | | | | | | | | | All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * serial: Move new functions to serial.hSimon Glass2019-01-142-5/+4
| | | | | | | | | | | | | | | | We should not be adding new functions to common.h. Move these recently added functions to serial.h. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
| * buildman: Fix tabs in GetWrapper()Simon Glass2019-01-141-2/+2
| | | | | | | | | | | | This function has tabs instead of spaces. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * net: Fix error handling in sb_eth_raw_ofdata_to_platdata()Simon Glass2019-01-141-5/+4
| | | | | | | | | | | | | | | | At present this stores the error number in an unsigned int so an error is never detected. Use the existing signed variable instead. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
| * travis: Use buildman for building with clangSimon Glass2019-01-141-10/+3
| | | | | | | | | | | | | | Now that buildman supports clang, use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * buildman: Add support for building with clangSimon Glass2019-01-145-5/+48
| | | | | | | | | | | | Add a -O option which allows building with clang. Signed-off-by: Simon Glass <sjg@chromium.org>
| * log: Check printf() argumentsSimon Glass2019-01-141-1/+2
| | | | | | | | | | | | | | At present logging does not check printf() arguments. Now that all users have been corrected, enable this to prevent further problems. Signed-off-by: Simon Glass <sjg@chromium.org>
| * efi_loader: Add a wchar_t cast in efi_file_open()Simon Glass2019-01-141-2/+2
| | | | | | | | | | | | | | The printf() string here is not actually correct. Add a cast to avoid a warning when checking is enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Correct SDL build flagsSimon Glass2019-01-142-3/+1
| | | | | | | | | | | | | | | | The check for CONFIG_SANDBOX_SDL in config.mk does not work since the build config is not available by the time that file is included. Remove it so that we always call sdl-config except when NO_SDL is used. Signed-off-by: Simon Glass <sjg@chromium.org>
| * buildman: Deal nicely with invalid build-status fileSimon Glass2019-01-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. This error is then persistent, since even if disk space is reclaimed and the build retries, the empty file causes an exception in the builder thread. Deal with this silently by doing a rebuild. Signed-off-by: Simon Glass <sjg@chromium.org>
| * test: dm: regmap: Fix the long test delaySimon Glass2019-01-142-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present one of the regmap tests takes 5 seconds to run since it waits for a timeout. This should be handled using sandbox_timer_add_offset() which advances time for test purposes. This requires a little change to make the regmap_read_poll_timeout() testable. Update the macro and the test. Fixes: ebe3497c9c ("test: regmap: add regmap_read_poll_timeout test") Signed-off-by: Simon Glass <sjg@chromium.org>
| * common: fdt_support: print hexadecimal numbers in debugSekhar Nori2019-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | We usually deal with hexadecimal addresses and sizes in device-tree. Its much easier if debug logs print hexadecimal values too. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * dm: Tidy up 'dm tree' output when there are many devicesSimon Glass2019-01-142-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the 'Index' column assumes there is only one digit. But on some devices (e.g. snow) there are a lot of regulators and GPIO banks. Adjust the output to allow for two digits without messing up the display. Also capatalise the heading to match. Fixes: 5197dafc42 (dm: core: Widen the dump tree to show more of the driver's name.) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Liviu Dudau <liviu.dudau@foss.arm.com>
| * buildman: Drop comment about Ctrl-C problemSimon Glass2019-01-141-2/+0
| | | | | | | | | | | | This bug is now fixed, so drop this comment. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: add memset_io(..), memcpy_fromio(..) and memcpy_toio(..)Christian GMEINER2019-01-141-0/+12
| | | | | | | | | | | | | | These functions could be used by drivers. Signed-off-by: Christian GMEINER <christian.GMEINER@bachmann.info> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini2019-01-156-5/+358
|\ \
| * | i2c: Reflect correct dependency for !DM cadence driverMichal Simek2019-01-151-0/+1
| | | | | | | | | | | | | | | | | | Setup proper DM_I2C dependency. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| * | i2c: mux: Covert to livetree functionsMichal Simek2019-01-152-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Updates i2c muxes drivers to support livetree. Similar changes were done by: "net: zynq_gem: convert to use livetree" (sha1: 26026e695afa794ac018a09e79a48120d322b60d) Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| * | i2c: i2c-cdns: Use proper input frequencyTomasz Gorochowik2019-01-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | This is needed to properly calculate i2c bus speed divisors. Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com> Signed-off-by: Wojciech Tatarski <wtatarski@antmicro.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| * | i2c: xiic: Add Xilinx AXI I2C driverMarek Vasut2019-01-153-0/+347
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Xilinx AXI I2C controller driver based on the Linux i2c-xiic driver. This driver is stripped of all the IRQ handling and uses pure polling, yet tries to retain most of the structure of the Linux driver to make backporting of fixes easy. Note that the IP has a known limitation on 255 bytes read and write, according to xilinx this is still being worked on [1]. [1] https://forums.xilinx.com/t5/Embedded-Processor-System-Design/AXI-IIC-V2-0-I2C-Master-Reading-multiple-bytes-from-I2C-slave/m-p/854419/highlight/true#M39387 Signed-off-by: Marek Vasut <marex@denx.de> Cc: Michal Simek <monstr@monstr.eu> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Heiko Schocher <hs@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
* | Merge git://git.denx.de/u-boot-riscvTom Rini2019-01-157-56/+49
|\ \ | | | | | | | | | | | | 1. Improve cache implementation. 2. Fix and improve standalone applications
| * | riscv: qemu: define standalone load addressLukas Auer2019-01-152-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to define the standalone load address to use standalone application on qemu-riscv. Define it and set it equal to CONFIG_SYS_LOAD_ADDR. To not overwrite it, change the assigned of CONFIG_STANDALONE_LOAD_ADDR in arch/riscv/config.mk to a conditional one. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | riscv: support standalone applications on RV64I systemsLukas Auer2019-01-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add an implementation of EXPORT_FUNC() for RV64I systems to support them in standalone applications. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | riscv: replace use of callee-saved register in standaloneLukas Auer2019-01-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register x19 (s3) is a callee-saved register. It must not be used to load and jump to exported functions without saving it beforehand. Replace it with t0, a temporary and caller-saved register. Change the code comment to reflect this and fix it to correctly list gp as the register with the pointer to global data. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | riscv: remove RISC-V standalone linker scriptLukas Auer2019-01-152-41/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standalone applications do not require a separate linker script and can use the default linker script of the compiler instead. Remove the RISC-V standalone linker script. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
| * | riscv: use invalidate/flush_*cache_range functions in cache.cLukas Auer2019-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flush_cache() function in lib/cache.c ignores its arguments and flushes the complete data and instruction caches. Use the invalidate/flush_*cache_range() functions instead to only flush the requested memory region. This patch does not change the current behavior of U-Boot, since the implementation of the invalidate/flush_*cache_range() functions flush the complete data and instruction caches. It is in preparation for CPUs with the necessary functionality for flushing a selectable memory range. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * | riscv: move the AX25-specific implementation of flush_dcache_allLukas Auer2019-01-152-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fence instruction is used to enforce device I/O and memory ordering constraints in RISC-V. It can not be relied on to directly affect the data cache on every CPU. Andes' AX25 does not have a coherence agent. Its fence instruction flushes the data cache and is used to keep data in the system coherent. The implementation of flush_dcache_all in lib/cache.c is therefore specific to the AX25. Move it into the AX25-specific cache.c in cpu/ax25/. This also adds a missing new line between flush_dcache_all and flush_dcache_range in lib/cache.c. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * | riscv: clarify error message on undefined exceptionsLukas Auer2019-01-151-1/+2
| |/ | | | | | | | | | | | | | | | | | | Undefined exceptions are treated as reserved. This is not clearly communicated to the user. Adjust the error message to clarify that a reserved exception has occurred and add additional details. Fixes: e8b522b ("riscv: treat undefined exception codes as reserved") Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | Merge branch '2019-01-14-master-imports'Tom Rini2019-01-15104-715/+4450
|\ \ | |/ |/| | | | | | | | | | | | | | | - MediaTek improvements (eth support) - DM conversion for HI6220 - ISEE, Toby Churchill, other platform updates - Various format code printf fixes - Build race fixes - Command repeat functionality enhanced, command autocomplete support enhanced.
| * common: command: Add support for $ auto-completionBoris Brezillon2019-01-154-13/+77
| | | | | | | | | | | | | | | | | | | | | | Add the dollar_complete() function to auto-complete arguments starting with a '$' and use it in the cmd_auto_complete() path such that all args starting with a $ can be auto-completed based on the available env vars. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> [trini: Fix some linking problems] Signed-off-by: Tom Rini <trini@konsulko.com>
| * misc: fs_loader: Switching private data allocation to DM auto allocationTien Fong Chee2019-01-153-119/+56
| | | | | | | | | | | | | | | | | | Switching private data manual allocation to driver model auto allocation so users no longer need to deallocate themself because this would be deallocated by driver model when the device is no longer required. Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * cmd: adc: Use the sub-command infrastructureBoris Brezillon2019-01-151-28/+5
| | | | | | | | | | | | | | And you get sub-command auto-completion for free. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commandsBoris Brezillon2019-01-151-181/+267
| | | | | | | | | | | | | | | | It's way simpler this way, and we also gain auto-completion support for free (MTD name auto-completion has been added with mtd_name_complete()) Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * command: commands: Add macros to declare commands with subcmdsBoris Brezillon2019-01-151-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most cmd/xxx.c source files expose several commands through a single entry point. Some of them are doing the sub-command parsing manually in their do_<cmd>() function, others are declaring a table of sub-commands and then use find_cmd_tbl() to delegate the request to the sub command handler. In either case, the amount of code to do that is not negligible and repetitive, not to mention that almost no commands are implementing the auto-completion hook, which means most u-boot commands lack auto-completion. Provide several macros to easily define commands exposing sub-commands. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * common: command: Rework the 'cmd is repeatable' logicBoris Brezillon2019-01-155-12/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The repeatable property is currently attached to the main command and sub-commands have no way to change the repeatable value (the ->repeatable field in sub-command entries is ignored). Replace the ->repeatable field by an extended ->cmd() hook (called ->cmd_rep()) which takes a new int pointer to store the repeatable cap of the command being executed. With this trick, we can let sub-commands decide whether they are repeatable or not. We also patch mmc and dtimg who are testing the ->repeatable field directly (they now use cmd_is_repeatable() instead), and fix the help entry manually since it doesn't use the U_BOOT_CMD() macro. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * common: command: Expose a generic helper to auto-complete sub commandsBoris Brezillon2019-01-152-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | Some commands have a table of sub-commands. With minor adjustments, complete_cmdv() is able to provide auto-completion for sub-commands (it's just about passing the table of commands instead of taking the global one). We rename this function into complete_subcmd() and implement complete_cmdv() as a wrapper around complete_subcmdv(). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * common: command: Fix command auto-completionBoris Brezillon2019-01-151-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | When auto-completing command arguments, the last argument is not necessarily the one we need to auto-complete. When the last character is a space, a tab or '\0' what we want instead is list all possible values, or if there's only one possible value, place this value on the command line instead of trying to suffix the last valid argument with missing chars. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * blk: Increase cache element sizeMarek Vasut2019-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache up to 4 kiB entries. 4 kiB is the default block size on ext4, yet the underlying block layer devices usually report support for 512B . In most cases, the 512B support is emulated (ie. SD cards, SSDs, USB sticks etc.) and the real block size of those devices is much bigger. To avoid performance degradation with such devices and FS setup, bump the maximum cache entry size to 4 kiB. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>