summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | spl: atf: drop the SPL_ATF_TEXT_BASE configuration itemPhilipp Tomsich2017-11-261-6/+0
| | | | | | | | | | | | | | | | The SPL_ATF_TEXT_BASE configuration item has become obsolete. Remove it from Kconfig. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: rename config item SPL_ATF_SUPPORT to SPL_ATFPhilipp Tomsich2017-11-262-2/+2
| | | | | | | | | | | | | | | | | | Having CONFIG_SPL_ATF seems more natural. Rename it, while it it is easy and there's few boards that use it (only RK3399 and RK3368 boards). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: atf: introduce spl_invoke_atf and make bl31_entry privatePhilipp Tomsich2017-11-262-13/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new interface spl_invoke_atf() that takes a spl_image_info argument and then derives the necessary parameters for the ATF entry. Based on the additional information recorded (into /fit-images) from the FIT loadables, we can now easily locate the next boot stage. We now pass a pointer to a FDT as the platform-specific parameter pointer to ATF (so we don't run into the future headache of every board/platform defining their own proprietary tag-structure), as FDT access is already available in ATF. With the necessary infrastructure in place, we can now update the support for the ARM Trusted Firmware to dispatch into the spl_invoke_atf function only if a IH_OS_ARM_TRUSTED_FIRMWARE image is loaded. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: fit: implement recording of loadables into /fit-imagesPhilipp Tomsich2017-11-261-14/+81
| | | | | | | | | | | | | | | | | | | | | | If a FDT was loaded (e.g. to append it to U-Boot image), we store it's address and record information for all loadables into this FDT. This allows us to easily keep track of images for multiple privilege levels (e.g. with ATF) or of firmware images preloaded into temporary locations (e.g. PMU firmware that may overlap the SPL stage). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: fit: implement fdt_record_loadablePhilipp Tomsich2017-11-261-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the loading of more complex FIT images (e.g. when the invoked next stage needs to find additional firmware for a power-management core... or if there are multiple images for different privilege levels started in parallel), it is helpful to create a record of what images are loaded where: if a FDT is loaded for one of the next stages, it can be used to convey the status and location of loadables. This adds a fdt_record_loadable() function that can be invoked to record the status of each loadable below the /fit-images path. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: fit: simplify logic for FDT loading for non-OS bootsPhilipp Tomsich2017-11-261-30/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To better support bootin through an ATF or OPTEE, we need to streamline some of the logic for when the FDT is appended to an image: depending on the image type, we'd like to append the FDT not at all (the case for the OS boot), to the 'firmware' image (if it is a U-Boot) or to one of the loadables (if the 'firmware' is an ATF, an OPTEE, or some other image-type and U-Boot is listed in the loadabled). To achieve this goal, we drop the os_boot flag and track the type of image loaded. If it is of type IH_OS_U_BOOT, we append the FDT. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: York Sun <york.sun@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | image: add IH_OS_ARM_TRUSTED_FIRMWARE for ARM Trusted FirmwarePhilipp Tomsich2017-11-261-0/+1
|/ | | | | | | | | | | | | To boot on ARMv8 systems with ARM Trusted Firmware, we need to assemble an ATF-specific parameter structure and also provide the address of the images started by ATF (e.g. BL3-3, which may be the full U-Boot). To allow us to identify an ARM Trusted Firmware contained in a FIT image, this adds the necessary definitions. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* thermal: ti-bandgap: Add support for temperature sensorFaiz Abbas2017-11-211-0/+8
| | | | | | | | | | The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* malloc: don't compare pointers to 0Heinrich Schuchardt2017-11-201-5/+9
| | | | | | | | | | | | 0 is not a pointer. So do not compare pointers to 0. Do not return 0 from functions with a pointer return type. Problem identified with Coccinelle. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-11-191-1/+1
|\
| * SPL: fix printing of image nameAndré Draszik2017-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The maximum length of the name of the image is obviously not sizeof(), which is just the length of a pointer, but IH_NMLEN. fixes: 62cf11c0921a90c6bd62344f4bc069668e6c698c ("SPL: Limit image name print length") Signed-off-by: André Draszik <adraszik@tycoint.com> Acked-by: Simon Glass <sjg@chromium.org>
* | Kconfig: Introduce USE_BOOTCOMMAND and migrate BOOTCOMMANDTom Rini2017-11-171-0/+17
|/ | | | | | | | | | | We first introduce CONFIG_USE_BOOTCOMMAND, similar to CONFIG_USE_BOOTARGS. We then migrate CONFIG_BOOTCOMMAND for most CONFIG_DISTRO_DEFAULT users. In some cases platforms have a complex scheme around this usage, and these have been defered for the moment so that platform maintainers can work on a migration plan. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* Revert "console: simplify puts()"Soeren Moch2017-11-121-2/+42
| | | | | | | | | | | | | | | | This reverts commit c61d0009feb966e0e93254a8c435a1889085e6b8. A tbs2910 board user reported a very slow console frambuffer as regression in current u-boot. I could bisect this down to the above mentioned commit. This revert brings back the fast framebuffer console (one cache flush per string in puts(), not after each char). Reported-by: Uwe Scheffler <scheffler.u@web.de> Signed-off-by: Soeren Moch <smoch@web.de> Tested-by: Uwe Scheffler <scheffler.u@web.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchipKever Yang2017-11-071-1/+2
| | | | | | | | | | Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option 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>
* image-sig: use designated initializers for algorithmMasahiro Yamada2017-11-061-22/+22
| | | | | | | | Designated initializers are more readable because we do not have to check the order in the struct definitions. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* stm32: fix STMicroelectronics copyrightPatrice Chotard2017-11-061-1/+2
| | | | | | | Uniformize STMicroelectronics copyrights headers for STM32 related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* common: Remove genimg_get_image()Tuomas Tynkkynen2017-10-163-33/+0
| | | | | | | Removal of the legacy DataFlash code turned genimg_get_image() into a no-op. Drop all calls to it and the function itself. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* Drop CONFIG_HAS_DATAFLASHTuomas Tynkkynen2017-10-162-77/+0
| | | | | | | | Last user of this option went away in commit: fdc7718999 ("board: usb_a9263: Update to support DT and DM") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2017-10-121-1/+9
|\
| * spl: fix assignment of board info to global dataYork Sun2017-10-091-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 15eb1d43bf47 ("spl: reorder the assignment of board info to global data") intended to move assignment of board info earlier, into board_init_r(). However, function preload_console_init() is called either from spl_board_init() or from board_init_f(). For the latter case, the board info assignment is much earlier than proposed board_init_r(). Create a new function to fill gd->bd and call this function when needed. Signed-off-by: York Sun <york.sun@nxp.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Ravi Babu <ravibabu@ti.com> CC: Lukasz Majewski <lukma@denx.de> CC: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | fit: If no matching config is found in fit_find_config_node(), use the ↵Jean-Jacques Hiblot2017-10-051-0/+20
| | | | | | | | | | | | | | | | | | | | | | default one If board_fit_config_name_match() doesn't match any configuration node, then use the default one (if provided). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | fit: fixed bug in locate_dtb_in_fit()Jean-Jacques Hiblot2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | If the dtb is the first data of the FIT, the its offset is 0x0. Change the test to '<' instead of '<=' Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | fit: use 'const' for the input of fdt_offset() and locate_dtb_in_fit()Jean-Jacques Hiblot2017-10-051-2/+2
| | | | | | | | | | | | | | | | | | Those 2 functions don't modify their input, we can mark it const. This prevents compilation warnings when they are provided const input. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>