summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* tftp: update: Include missing cfi_flash.h headerMarek Vasut2018-02-131-0/+1
| | | | | | | | Add the missing header, otherwise CONFIG_SYS_MAX_FLASH_BANKS may be undeclared. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
* cmd: fitupd: Convert CONFIG_UPDATE_TFTP and co.Marek Vasut2018-02-131-0/+21
| | | | | | | Convert the CONFIG_UPDATE_TFTP and related symbols to Kconfig. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
* spl: fit: move fdt_record_loadable out of ARCH_FIXUP_FDT_MEMORY guardPhilipp Tomsich2018-02-131-39/+39
| | | | | | | | | | | | | | | The fdt_record_loadable()-function was wedged between other functions that were guarded by ARCH_FIXUP_FDT_MEMORY. This could lead to linker errors on some configurations. With this change, fdt_record_loadable() is moved out of the ARCH_FIXUP_FDT_MEMORY guard (plus I tried to retain alphabetical ordering for functions by placing it appropriately). References: 9f45aeb ("spl: fit: implement fdt_record_loadable") Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reported-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Michal Simek <michal.simek@xilinx.com>
* spl: eMMC/SD: Provide one __weak spl_boot_mode() functionLukasz Majewski2018-02-071-0/+11
| | | | | | | | | | | | | | | | | The goal of this patch is to clean up the code related to choosing SPL MMC boot mode. The spl_boot_mode() now is called only in spl_mmc_load_image() function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT is enabled. To achieve the goal, all per mach/arch implementations eligible for unification has been replaced with one __weak implementation. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Stefano Babic <sbabic@denx.de> Acked-by: Michal Simek <michal.simek@xilinx.com> (For ZynqMP) Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
* parse the second area of android imageBin Chen2018-02-071-0/+19
| | | | | | | | | | | | | | | The second area of android image was intended to put a 2nd stage bootloader but in practice were rarely used (in my knowledge). An proposal was made to the AOSP to (re)use the second area as the dtb[1], This patch itself doesn't depend on that proposal being accepted but it won't be that helpful as well if that proposal won't be accepted. But don't do any harm as well. [1] https://android-review.googlesource.com/#/c/417447/ Signed-off-by: Bin Chen <bin.chen@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* log: add category LOGC_EFIHeinrich Schuchardt2018-02-031-0/+1
| | | | | | | | | The EFI implementation does not fit into any of the existing categories. Provide LOGC_EFI so that EFI related message can be filtered. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* log: Add a way to log error-return valuesSimon Glass2018-02-031-0/+13
| | | | | | | | | | | | | | | | | | | | When functions return an error it propagates up the stack to the point where it is reported. Often the error code provides enough information about the root cause of the error that this is obvious what went wrong. However in some cases the error may be hard to trace. For example if a driver uses several devices to perform an operation, it may not be obvious which one failed. Add a log_ret() macro to help with this. This can be used to wrap any error-return value. The logging system will then output a log record when the original error is generated, making it easy to trace the call stack of the error. This macro can significantly impact code size, so its use is controlled by a Kconfig option, which is enabled for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* log: Update log_console to honour the log formatSimon Glass2018-02-031-1/+26
| | | | | | | At present this just outputs the message. Update it to output whatever the format requests. Signed-off-by: Simon Glass <sjg@chromium.org>
* log: Add control over log formattingSimon Glass2018-02-031-0/+1
| | | | | | | | | It is useful to be able to control the output format of log records on the console. As a starting point, add definitions for controlling which elements of the log record are displayed. Use function and message as the default, since these are the most useful fields. Signed-off-by: Simon Glass <sjg@chromium.org>
* log: Add functions to convert IDs to/from namesSimon Glass2018-02-031-0/+67
| | | | | | | | | | | | | | Category and level both use an enum for their ID values. Add functions to convert these IDs to strings and vice versa. This will allow the log to output the strings instead of the (inscrutable) values. At the same time, add a new 'driver-model' category, to cover core driver-model functions and fix an incorrect value for LOGL_MAX. Tests will be added with the new 'log' subcommands. Signed-off-by: Simon Glass <sjg@chromium.org> (Updated to correct clang warnings)
* spl: include timezone in bannerKlaus Goger2018-01-291-1/+1
| | | | | | | | Include the timezone in the SPL banner so the timestamp matches with that from u-boot proper. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* flash: Fix spelling of "ERR_TIMOUT"Mario Six2018-01-291-2/+2
| | | | | | | | | checkpatch.pl complains about the spelling of ERR_TIMOUT. Since the error is only used in a handful of files, we rename the error to ERR_TIMEOUT. Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Stefan Roese <sr@denx.de>
* Merge git://git.denx.de/u-boot-rockchipTom Rini2018-01-281-1/+2
|\
| * spl: atf: pass NULL for bl32_ep pcKever Yang2018-01-281-1/+2
| | | | | | | | | | | | | | | | | | ATF use bl32_ep_info->pc to decide if thre is an available bl32, let's mark it as NULL first. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* | spl: add option to disable SPL banner outputAnatolij Gustschin2018-01-282-0/+9
| | | | | | | | | | | | | | | | | | Selecting this option will reduce SPL boot time by approx. 6 ms (e. g. with 70 bytes long banner string at 115200 baud). Signed-off-by: Anatolij Gustschin <agust@denx.de> Tested-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* | spl: use different BOARD_INIT MACRO for spl and tplKever Yang2018-01-282-1/+8
| | | | | | | | | | | | | | SPL and TPL may not always need spl_board_init() at the same time. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* | common: board_r: Fix style violationsMario Six2018-01-281-13/+14
| | | | | | | | | | | | | | Fix some style violations in the board_r file. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
* | common: board_f: Fix style violationsMario Six2018-01-281-4/+4
| | | | | | | | | | | | | | Fix some style violations in the board_f file. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
* | Initialize SHA buffer size var in passwd_abortMartin Etnestad2018-01-281-1/+1
|/ | | | | | | | | | The call to hash_block in passwd_abort fails with error ENOSPC on some systems. The reason is that the variable which specifies the size of the buffer to contain the computed hash does not get initialized. This patch initializes the variable with the size of the buffer. Signed-off-by: Martin Etnestad <martin.etnestad@appeartv.com>
* Merge branch 'master' of git://git.denx.de/u-boot-coldfireTom Rini2018-01-242-3/+2
|\
| * common/board_f.c: align m68k arch to use CONFIG_DISPLAY_CPUINFOAngelo Dureghello2018-01-232-3/+2
| | | | | | | | | | | | | | | | | | | | Change all coldfire arch files to use CONFIG_DISPLAY_CPUINFO. Signed-off-by: Angelo Dureghello <angelo@sysam.it> Reviewed-by: Tom Rini <trini@konsulko.com> --- Changes for v2: - update common/Kconfig to add M68K to the default y list
* | crypto/fsl: Fix HW accelerated hash commandsBreno Lima2018-01-231-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash command function were not flushing the dcache before passing data to CAAM/DMA and not invalidating the dcache when getting data back. Due the data cache incoherency, HW accelerated hash commands used to fail with CAAM errors like "Invalid KEY Command". Check if pbuf and pout buffers are properly aligned to the cache line size and flush/invalidate the memory regions to address this issue. This solution is based in a previous work from Clemens Gruber in commit 598e9dccc75d ("crypto/fsl: fix BLOB encapsulation and decapsulation") Reported-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Breno Lima <breno.lima@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* | common: board_f: vid: Add VID specific API to adjust core voltageRajesh Bhagat2018-01-231-0/+10
|/ | | | | | | | | | | | Adds a VID specific API in init_sequence_f and spl code flow namely init_func_vid which is required to adjust core voltage. VID specific code is required in spl, hence moving flag CONFIG_VID out of spl flags. Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* board_r: remove superfluous #ifdef CONFIG_PRAMHeinrich Schuchardt2018-01-191-2/+0
| | | | | | | | | | | | initr_mem() is already enclosed by #if defined(CONFIG_PRAM) #endif So there is no need to check CONFIG_PRAM again inside the function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* fix incorrect usage of DT node unit address in commentsAndre Przywara2018-01-152-9/+9
| | | | | | | | | | The DT spec demands a unit-address in a node name to match the "reg" property in that node. Newer dtc versions will throw warnings if this is not the case. Fix all occurences in the tree where node names were mentioned in comments, to not give bad examples to the reader. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* Merge git://git.denx.de/u-boot-mmcTom Rini2018-01-142-0/+11
|\
| * mmc: add a Kconfig option to enable the support for MMC write operationsJean-Jacques Hiblot2018-01-121-0/+9
| | | | | | | | | | | | | | | | This allows using CONFIG_IS_ENABLED(MMC_WRITE) to compile out code needed only if write support is required. The option is added for u-boot and for SPL Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
| * common: do not compile common fastboot code when building the SPLJean-Jacques Hiblot2018-01-121-0/+2
| | | | | | | | | | | | This is not required as fastboot can't be started from SPL. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* | riscv: Modify generic codes to support RISC-VRick Chen2018-01-122-3/+3
|/ | | | | | | | | | Support common commands bdinfo and image format, also modify common generic flow for RISC-V. Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com> Signed-off-by: Greentime Hu <green.hu@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: atf: add SPL_ATF_NO_PLATFORM_PARAM optionPhilipp Tomsich2018-01-032-3/+27
| | | | | | | | | | | | | | | | | | | | While we expect to call a pointer to a valid FDT (or NULL) as the platform parameter to an ATF, some ATF versions are not U-Boot aware and have an insufficiently robust (or an overzealour) parameter validation: either way, this may cause a hard-stop with uncooperative ATF versions. This change adds the option to suppress passing a platform parameter and will always pass NULL. Debug output from ATF w/ this option disabled (i.e. default): INFO: plat_param_from_bl2: 0x291450 Debug output from ATF w/ this option enabled: INFO: plat_param_from_bl2: 0 Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* common: Fix-up MAC addr in dts by fetching env variable seriallyPrabhakar Kushwaha2017-12-241-4/+21
| | | | | | | | | | | | | | The MAC addresses get fixed in the device tree for "ethernet" nodes is by using trailing number behind "ethernet" found in "/aliases". It may not be necessary for the "ethernet" nodes to be sequential. There can be gaps in between or any node disabled So provide a support to fetch MAC addr sequentially from env and apply them to "ethernet" nodes in the order they appear in device tree only if "ethernet" is not "disabled" Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* common: image.c: Fix CACHE: Misaligned operation outputHeiko Schocher2017-12-181-1/+2
| | | | | | | | | | | | | | When booting a itb file with a Ramdisk on a imx6 based board, U-Boot drops the warning: Loading Kernel Image ... OK Loading Ramdisk to 4ecf1000, end 4ef8b11f ... \ CACHE: Misaligned operation at range [4ecf1000, 4ef8b11f] Fix it! Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Ayoub Zaki <hs@denx.de>
* Merge tag 'xilinx-for-v2018.01-rc2-v2' of ↵Tom Rini2017-12-182-5/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://www.denx.de/git/u-boot-microblaze Xilinx changes for v2018.01-rc2-v2 fpga: - Enable loading bitstream via fit image for !xilinx platforms zynq: - Fix SPL SD boot mode zynqmp: - Not not reset in panic - Do not use simple allocator because of fat changes - Various dt chagnes - modeboot variable setup - Fix fpga loading on automotive devices - Fix coverity issues test: - Fix env test for !hush case - Stephen's patch
| * fpga: allow programming fpga from FIT image for all FPGA driversGoldschmidt Simon2017-12-142-5/+3
| | | | | | | | | | | | | | | | | | | | | | This drops the limit that fpga is only loaded from FIT images for Xilinx. This is done by moving the 'partial' check from 'common/image.c' to 'drivers/fpga/xilinx.c' (the only driver supporting partial images yet) and supplies a weak default implementation in 'drivers/fpga/fpga.c'. Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com> Tested-by: Michal Simek <michal.simek@xilinx.com> (On zcu102) Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* | Merge git://git.denx.de/u-boot-dmTom Rini2017-12-142-6/+29
|\ \ | |/ |/|
| * binman: Add binman support to spl_ram.cSimon Glass2017-12-121-4/+15
| | | | | | | | | | | | | | | | SPL supports reading U-Boot from a RAM location. At present this is hard-coded to the U-Boot text base address. Use binman to allow this to come from the image file, if binman is used. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add binman symbol support to SPLSimon Glass2017-12-121-2/+14
| | | | | | | | | | | | | | | | Allow SPL to access binman symbols and use this to get the address of U-Boot. This falls back to CONFIG_SYS_TEXT_BASE if the binman symbol is not available. Signed-off-by: Simon Glass <sjg@chromium.org>
* | SPL: Add FIT data-position property supportPeng Fan2017-12-122-2/+34
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | For external data, FIT has a optional property "data-position" which can set the external data to a fixed offset to FIT beginning. Add the support for this property in SPL FIT. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tomas Melin <tomas.melin@vaisala.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: "Andrew F. Davis" <afd@ti.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Andre Przywara <andre.przywara@arm.com> Cc: York Sun <york.sun@nxp.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: "Cooper Jr., Franklin" <fcooper@ti.com> Cc: George McCollister <george.mccollister@gmail.com> Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Rick Altherr <raltherr@google.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: York Sun <york.sun@nxp.com>
* log: Plumb logging into the init sequenceSimon Glass2017-12-073-1/+7
| | | | | | | Set up logging both before and after relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* log: Add a test commandSimon Glass2017-12-071-0/+10
| | | | | | Add a command which exercises the logging system. Signed-off-by: Simon Glass <sjg@chromium.org>
* log: Add a console driverSimon Glass2017-12-073-0/+44
| | | | | | | | | | | It is useful to display log messages on the console. Add a simple driver to handle this. Note that this driver outputs to the console, which may be serial or video. It does not specifically select serial output. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* log: Add an implementation of loggingSimon Glass2017-12-073-0/+301
| | | | | | | Add the logging header file and implementation with some configuration options to control it. Signed-off-by: Simon Glass <sjg@chromium.org>
* Drop the log bufferSimon Glass2017-12-074-56/+2
| | | | | | | | This does not appear to be used by any boards. Before introducing a new log system, remove this old one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* usb: Correct use of debug()Simon Glass2017-12-071-3/+1
| | | | | | | | With clang this gives a warning because hubsts appears to be used before it is set, even if ultimately it is not used. Simplify the code to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
* Revert "sandbox: Drop special case console code for sandbox"Simon Glass2017-12-071-0/+7
| | | | | | | | | | | | | While sandbox works OK without the special-case code, it does result in console output being stored in the pre-console buffer while sandbox starts up. If there is a crash or a problem then there is no indication of what is going on. For ease of debugging it seems better to revert this change also. This reverts commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: command: tempory buffer should have size of command line bufHeinrich Schuchardt2017-11-291-1/+1
| | | | | | | | | When copying the command line buffer the target array should at least have the same size. Cf. definition of console_buffer in common/cli_readline.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge git://git.denx.de/u-boot-usbTom Rini2017-11-281-2/+2
|\
| * usb: hub: identify the hub-device to usb_hub_reset_devicesPhilipp Tomsich2017-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When usb_hub_reset_devices is called, it should be passed both an indicator which hub it should operate on and what port number (local to that hub) should be reset. Previously, the usb_hub.c code did not include such context and always started resets from port number 1, performing multiple reset-requests for the same devices: /* * Reset any devices that may be in a bad state when applying * the power. This is a __weak function. Resetting of the devices * should occur in the board file of the device. */ for (i = 0; i < dev->maxchild; i++) usb_hub_reset_devices(i + 1); This adds an additional 'hub' parameter to usb_hub_reset_devices that provides the context to fully qualify the port-number in. Existing implementations are changed to accept and ignore the new parameter. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
* | spl: TI: Do not default to SPL_FIT_IMAGE_TINY being enabledTom Rini2017-11-271-1/+0
| | | | | | | | | | | | | | | | This option prevents booting on am335x_evm at least along with most likely other platforms. Fixes: 337bbb629777 ("spl: fit: add SPL_FIT_IMAGE_TINY config to reduce code-size") Signed-off-by: Tom Rini <trini@konsulko.com>
* | spl: fit: add SPL_FIT_IMAGE_TINY config to reduce code-sizePhilipp Tomsich2017-11-262-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A minor code-size increase from the changes for tracking the os-type of FIT images and from infrastructure for recording the loadables into the the loaded FDT, broke the builds for sun50i and some OMAP2+ devices. This change adds a new config option (enabled by default for MACH_SUN50I, MACH_SUN50I_H5 and ARCH_OMAP2PLUS) that does skips these processing steps (bringing code size down to below the limit again). The os-type is not evaluated, but assumed to be IH_OS_UBOOT (i.e. taking the code-paths intended for backward-compatibility). Note that enabling this config option precludes any useful downstream processing, such as utilising a special calling convention for ATF or OPTEE, based on the os-type of the loadables. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>