summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* spl: Make UBI fastmap support Kconfig selectableLadislav Michl2017-07-061-1/+1
| | | | | | | | Fastmap was always enabled in ubispl, make it selectable by CONFIG_MTD_UBI_FASTMAP. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Heiko Schocher <hs@denx.de>
* powerpc: remove 4xx supportHeiko Schocher2017-07-035-132/+0
| | | | | | | | | There was for long time no activity in the 4xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 4xx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
* powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512xHeiko Schocher2017-06-162-9/+2
| | | | | | | | | There was for long time no activity in the mpx5xxx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in mpc5xxx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
* board_f: fix calculation of reloc_offLothar Waßmann2017-06-121-2/+5
| | | | | | | | | | | | | | relocate_code() calculates the relocation offset wrt. the symbol __image_copy_start which happens to have the same value as CONFIG_TEXT_BASE on most systems. When creating an i.MX boot image with an integrated IVT it is convenient to have CONFIG_TEXT_BASE point to the start of the IVT that is prepended to the actual code. Thus CONFIG_TEXT_BASE will differ from __image_copy_start, while the calculation 'gd->relocaddr - __image_copy_start' still gives the right relocation offset. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
* board_f: Use IS_ENABLED instead of #ifdef in initf_bootstage()Simon Glass2017-06-121-5/+2
| | | | | | | | | | | | | The current implementation makes it look like the 'if (from_spl)' part is dead code because these features are not enabled for sandbox. We could enable it for sandbox_spl, but this is not done yet (it requires sharing memory between SPL and U-Boot proper which is in fact supported). It is probably nicer to avoid #ifdef anyway. Change it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 163244) Fixes: 824bb1b (bootstage: Support SPL)
* edid: Use sizeof() in cea_is_hdmi_vsdb_present()Simon Glass2017-06-121-2/+2
| | | | | | | | We should not use an open-coded value here. Use sizeof() instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 163252) Fixes: 43c6bdd0 (edid: Add HDMI flag to timing info)
* powerpc, 5xx: remove support for 5xxHeiko Schocher2017-06-121-2/+1
| | | | | | | | | There was for long time no activity in the 5xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 5xx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
* powerpc, 8260: remove support for mpc8260Heiko Schocher2017-06-122-2/+2
| | | | | | | | | There was for long time no activity in the 8260 area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 8260, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
* powerpc, 8xx: remove support for 8xxHeiko Schocher2017-06-124-33/+3
| | | | | | | | | | There was for long time no activity in the 8xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 8xx, so remove it (with a heavy heart, knowing that I remove here the root of U-Boot). Signed-off-by: Heiko Schocher <hs@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2017-06-101-1/+1
|\
| * edid: Fix gcc 7.1 warningJernej Skrabec2017-06-091-1/+1
| | | | | | | | | | | | | | | | This commit fixes the warning produced by gcc 7.1. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini2017-06-101-1/+6
|\ \
| * | dm: mmc: Ensure that block device is probedSimon Glass2017-06-091-1/+6
| |/ | | | | | | | | | | | | | | Make sure that we probe the block device before using it when reading the environment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* | SPL: Add XIP booting supportVikas Manocha2017-06-093-0/+38
| | | | | | | | | | | | | | | | Enable support for XIP (execute in place) of U-Boot or kernel image. There is no need to copy image from flash to ram if flash supports execute in place. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> Reviewed-by: Alexandru Gagniuc <alex.g@adaptrum.com>
* | spl: armv7m: to keep ARM v7M in thumb mode before booting next imageVikas Manocha2017-06-081-3/+3
|/ | | | | | | | | | | | On ARM v7M, the processor will return to ARM mode when executing blx instruction with bit 0 of the address == 0. Always set it to 1 to stay in thumb mode. At present, it is applied only for raw U-Boot. This patch moves it to just before booting next image. This way armv7m will be in thumb mode for any image like raw or image with header like zImage or standard U-Boot. Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
* Merge git://git.denx.de/u-boot-usbTom Rini2017-06-051-0/+168
|\
| * fastboot: Add support for flashing zImageSam Protsenko2017-06-031-0/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for flashing zImage to the Android boot partition on eMMC. Usage: $ fastboot flash zImage <path_to_zImage> It's based on [1]. [1] http://omapzoom.org/?p=repo/u-boot.git;a=commit;h=3393b908c1e848bba3706612cbe50aa8970720b3 Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
* | malloc: Turn on DEBUG when enabling unit testsPantelis Antoniou2017-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | Unit tests require mallinfo which in turn requires DEBUG on dlmalloc to be enabled. The dependancy on CONFIG_SANDBOX is wrong. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | common/spl/Kconfig: Use 'if SPL' / 'if TPL' guardsTom Rini2017-06-051-72/+24
| | | | | | | | | | | | | | | | Much of the entries here simply depend on SPL (or TPL). Instead of this redundancy use if SPL / if TPL to guard the rest of the choices and only show them when we have the relevant option enabled. Signed-off-by: Tom Rini <trini@konsulko.com>
* | bootstage: Record time taken to set up the live device treeSimon Glass2017-06-051-2/+9
| | | | | | | | | | | | | | This time is interesting as a comparision with the flat device tree time. Add it to the record. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Support SPLSimon Glass2017-06-054-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | At present bootstage only supports U-Boot proper. But SPL can also consume boot time so it is useful to have the record start there. Add bootstage support to SPL. Also support stashing the timing information when SPL finishes so that it can be picked up and reported by U-Boot proper. This provides a full boot time record, excluding only the time taken by the boot ROM. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Adjust to use const * where possibleSimon Glass2017-06-051-6/+6
| | | | | | | | | | | | | | | | There are a few places that should use const *, such as bootstage_unstash(). Update these to make it clearer when parameters are changed. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Tidy up error return valuesSimon Glass2017-06-051-11/+11
| | | | | | | | | | | | | | We should return a proper error number instead of just -1. This helps the caller to determine what when wrong. Update a few functions to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Record the time taken to set up driver modelSimon Glass2017-06-052-0/+4
| | | | | | | | | | | | | | Driver model is set up ones before relocation and once after. Record the time taken in each case. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Init as early as possibleSimon Glass2017-06-052-3/+2
| | | | | | | | | | | | | | | | | | | | At present we don't allow use of bootstage before driver model is running. This means we cannot time the init of driver model itself. Now that bootstage requires its own board-specific timer, we can move its init to earlier in the sequence, both before and after relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Support relocating boostage dataSimon Glass2017-06-052-0/+39
| | | | | | | | | | | | | | Some boards cannot access pre-relocation data after relocation. Reserve space for this and copy it during preparation for relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Use debug() for stashing messagesSimon Glass2017-06-051-2/+2
| | | | | | | | | | | | We don't normally want to see these messages. Change them to debug-only. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Show records with a zero timeSimon Glass2017-06-051-7/+4
| | | | | | | | | | | | | | We can now use the record count to determine whether a record is valid or not. Drop the test for a zero time. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Use rec_count as the array indexSimon Glass2017-06-052-49/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present bootstage has a large array with all possible bootstage IDs recorded. It adds times to the array element indexed by the ID. This is inefficient because many IDs are not used during boot. We can save space by only recording those IDs which actually have timestamps. Update the array to use a record count, which increments with each addition of a new timestamp. This takes longer to record a time, since it may involve an array search. Such a search may be particularly expensive before relocation when the CPU is running slowly or the cache is off. But at that stage there should be very few records. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Fix up code style and commentsSimon Glass2017-06-051-2/+4
| | | | | | | | | | | | | | | | There are several code style and comment nits. Fix them and also remove the comment about passing bootstage to the kernel being TBD. This is already supported. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Convert to use malloc()Simon Glass2017-06-052-33/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present bootstage uses the data section of the image to store its information. There are a few problems with this: - It does not work on all boards (e.g. those which run from flash before relocation) - Allocated strings still point back to the pre-relocation data after relocation Now that U-Boot has a pre-relocation malloc() we can use this instead, with a pointer to the data in global_data. Update bootstage to do this and set up an init routine to allocate the memory. Now that we have a real init function, we can drop the fake 'reset' record and add a normal one instead. Note that part of the problem with allocated strings remains. They are reallocated but this will only work where pre-relocation memory is accessible after relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Change CONFIG_BOOTSTAGE_USER_COUNT to an intSimon Glass2017-06-051-1/+1
| | | | | | | | | | | | | | There is no good read to make this hex, and integer is more natural for this type of setting. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstage: Require timer_get_boot_us() to be definedSimon Glass2017-06-051-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | At present we provide a default version of this function for use by bootstage. However it uses the system timer and therefore likely requires driver model. This makes it impossible to time driver-model init. Drop the function and require boards to provide their own. Add a sandbox version also. There is a default implememtation in lib/time.c for boards which use CONFIG_SYS_TIMER_COUNTER. Signed-off-by: Simon Glass <sjg@chromium.org>
* | arm: Remove include files from common.hSimon Glass2017-06-051-0/+3
| | | | | | | | | | | | | | With a small tweak we can avoid including these files for all boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* | api: Add a header for api_init()Simon Glass2017-06-051-0/+1
| | | | | | | | | | | | Put this in its own header instead of using common.h. Signed-off-by: Simon Glass <sjg@chromium.org>
* | fs: fat: add kbuild configuration supportSekhar Nori2017-06-031-0/+1
|/ | | | | | | | | | | | | Add Kconfig symbols for various configurations supported by FAT filesystem support code. CONFIG_SUPPORT_VFAT has been left out since its force enabled in include/fat.h and probably should get removed at some point. Signed-off-by: Sekhar Nori <nsekhar@ti.com> [trini: add select FS_FAT for CMD_FAT and SPL_FAT_SUPPORT] Signed-off-by: Tom Rini <trini@konsulko.com>
* fdt: Rename a few functions in fdt_supportSimon Glass2017-06-011-13/+13
| | | | | | | | | | These two functions have an of_ prefix which conflicts with naming used in of_addr. Rename them: fdt_read_number fdt_support_bus_default_count_cells Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Update fdt_get_base_address() to use constSimon Glass2017-06-011-1/+1
| | | | | | | This function does not change the device tree so adjust it to use const for this parameter. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Build a live tree after relocationSimon Glass2017-06-011-0/+12
| | | | | | | If enabled, build a live device tree after relocation. This can then be used by driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: Don't re-init when accessing environmentSimon Glass2017-06-011-1/+2
| | | | | | | With driver model MMC is probed automatically when needed. We should not re-init MMC each time. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Use dm.h header when driver mode is usedSimon Glass2017-06-011-0/+1
| | | | | | | | This header includes things that are needed to make driver build. Adjust existing users to include that always, even if other dm/ includes are present Signed-off-by: Simon Glass <sjg@chromium.org>
* Kconfig: Finish migration of hashing commandsDaniel Thompson2017-05-311-10/+4
| | | | | | | | | | | | Currently these (board agnostic) commands cannot be selected using menuconfig and friends. Fix this the obvious way. As part of this, don't muddle the meaning of CONFIG_HASH_VERIFY to mean both 'hash -v' and "we have a hashing command" as this makes the Kconfig logic odd. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> [trini: Re-apply, add imply for a few cases, run moveconfig.py, also migrate CRC32_VERIFY] Signed-off-by: Tom Rini <trini@konsulko.com>
* env_mmc: configure environment offsets via device treePhilipp Tomsich2017-05-291-4/+27
| | | | | | | | | | | | | | | This introduces the ability to override the environment offets from the device tree by setting the following nodes in '/config': 'u-boot,mmc-env-offset' - overrides CONFIG_ENV_OFFSET 'u-boot,mmc-env-offset-redundant' - overrides CONFIG_ENV_OFFSET_REDUND To keep with the previous logic, the CONFIG_* defines still need to be available and the statically defined values become the defaults, when the corresponding properties are not set in the device-tree. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-sunxiTom Rini2017-05-221-105/+196
|\ | | | | | | | | | | | | trini: Make Kconfig SPL_xxx entires only show if SPL, so that we don't get Kconfig errors on platforms without SPL, ie sandbox (without SPL). Signed-off-by: Tom Rini <trini@konsulko.com>
| * SPL: FIT: allow loading multiple imagesAndre Przywara2017-05-171-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we were not using the FIT image format to its full potential: The SPL FIT loader was just loading the first image from the /images node plus one of the listed DTBs. Now with the refactored loader code it's easy to load an arbitrary number of images in addition to the two mentioned above. As described in the FIT image source file format description, iterate over all images listed at the "loadables" property in the configuration node and load every image at its desired location. This allows to load any kind of images: - firmware images to execute before U-Boot proper (for instance ARM Trusted Firmware (ATF)) - firmware images for management processors (SCP, arisc, ...) - firmware images for devices like WiFi controllers - bit files for FPGAs - additional configuration data - kernels and/or ramdisks The actual usage of this feature would be platform and/or board specific. Also update the FIT documentation to mention the new SPL feature and provide an example .its file to demonstrate its features. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * SPL: FIT: factor out spl_load_fit_image()Andre Przywara2017-05-171-82/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment we load two images from a FIT image: the actual U-Boot image and the .dtb file. Both times we have very similar code, that deals with alignment requirements the media we load from imposes upon us. Factor out this code into a new function, which we just call twice. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Jagan Teki <jagan@openedev.com>
| * SPL: FIT: improve error handlingAndre Przywara2017-05-171-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment we ignore any errors due to missing FIT properties, instead go ahead and calculate our addresses with the -1 return value. Fix this and bail out if any of the mandatory properties are missing. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
| * SPL: FIT: rework U-Boot image loadingAndre Przywara2017-05-171-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the SPL FIT loader always looks only for the first image in the /images node a FIT tree, which it loads and later executes. Generalize this by looking for a "firmware" property in the matched configuration subnode, or, if that does not exist, for the first string in the "loadables" property. Then using the string in that property, load the image of that name from the /images node. This still loads only one image at the moment, but refactors the code to allow extending this in a following patch. To simplify later re-usage, we also generalize the spl_fit_select_index() function to not return the image location, but just the node offset. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Jagan Teki <jagan@openedev.com>
| * SPL: FIT: refactor FDT loadingAndre Przywara2017-05-171-31/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the SPL FIT loader uses the spl_fit_select_fdt() function to find the offset to the right DTB within the FIT image. For this it iterates over all subnodes of the /configuration node in the FIT tree and compares all "description" strings therein using a board specific matching function. If that finds a match, it uses the string in the "fdt" property of that subnode to locate the matching subnode in the /images node, which points to the DTB data. Now this works very well, but is quite specific to cover this particular use case. To open up the door for a more generic usage, let's split this function into: 1) a function that just returns the node offset for the matching configuration node (spl_fit_find_config_node()) 2) a function that returns the image data any given property in a given configuration node points to, additionally using a given index into a possbile list of strings (spl_fit_select_index()) This allows us to replace the specific function above by asking for the image the _first string of the "fdt" property_ in the matching configuration subnode points to. This patch introduces no functional changes, it just refactors the code to allow reusing it later. (diff is overly clever here and produces a hard-to-read patch, so I recommend to throw a look at the result instead). Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Jagan Teki <jagan@openedev.com>
* | Kconfig: Add a CONFIG_IDE optionSimon Glass2017-05-223-1238/+4
| | | | | | | | | | | | | | | | | | | | | | At present IDE support is controlled by CONFIG_CMD_IDE. Add a separate CONFIG_IDE option so that IDE support can be enabled without requiring the 'ide' command. Update existing users and move the ide driver into drivers/block since it should not be in common/. Signed-off-by: Simon Glass <sjg@chromium.org>