summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* env: Switch env_nand, env_mmc and env_ubi to env_import_redundFiach Antaw2017-07-223-110/+16
| | | | | | | | | | The env_nand, env_mmc and env_ubi implementations all implement redundancy using an identical serial-number scheme. This commit migrates them to use the implementation in env_common, which is functionally identical. Signed-off-by: Fiach Antaw <fiach.antaw@uqconnect.edu.au> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Add generic redundant environment implementationFiach Antaw2017-07-221-0/+51
| | | | | | | | | | | All current environments that implement redundancy use almost identical implementations. This patch implements the env_nand implementation as a function in env_common, and updates the env_export function to export an env_nand-style 'flags' field by default. Signed-off-by: Fiach Antaw <fiach.antaw@uqconnect.edu.au> Reviewed-by: Tom Rini <trini@konsulko.com>
* mmc: add static to spl_mmc_get_device_index()Masahiro Yamada2017-07-191-1/+1
| | | | | | | | This function is only used in common/spl/spl_mmc.c[ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* common: use get_nand_dev_by_index()Grygorii Strashko2017-07-112-3/+4
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* common: env_nand: use get_nand_dev_by_index()Grygorii Strashko2017-07-111-12/+21
| | | | | | | | As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
* sandbox: Drop special case console code for sandboxSimon Glass2017-07-111-13/+0
| | | | | | | | | | | | At present sandbox has a special case where it directly calls os_putc() when it does not have a console yet. Now that we have the pre-console buffer enabled we can drop this. Any early characters will be buffered and output later. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* sandbox: Enable more console optionsSimon Glass2017-07-111-1/+1
| | | | | | | | | | Enable the pre-console buffer, displaying the model and post-relocation console announce on sandbox. Also add a model name to the device tree. This allows testing of these features. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* console: Use map_sysmem() for the pre-relocation consoleSimon Glass2017-07-111-2/+9
| | | | | | | | | | At present this feature casts the address to a pointer. Use the map_sysmem() function so that it will work correctly on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* Allow displaying the U-Boot banner on a video displaySimon Glass2017-07-112-4/+14
| | | | | | | | | | | | | | At present the U-Boot banner is only displayed on the serial console. If this is not visible to the user, the banner does not show. Some devices have a video display which can usefully display this information. Add a banner which is printed after relocation only on non-serial devices if CONFIG_DISPLAY_BOARDINFO_LATE is defined. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* dm: scsi: Document and rename the scsi_scan() parameterSimon Glass2017-07-111-1/+1
| | | | | | | | | The 'mode' parameter is actually a flag to determine whether to display a list of devices found during the scan. Rename it to reflect this, add a function comment and adjust callers to use a boolean. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: scsi: Drop the ccb typedefSimon Glass2017-07-111-22/+22
| | | | | | | | | We should not be using typedefs in U-Boot and 'ccb' is a pretty short name. It is also used with variables. Drop the typedef and use 'struct' instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* scsi: Move drivers into new drivers/scsi directorySimon Glass2017-07-112-692/+0
| | | | | | | | | At present we have the SCSI drivers in the drivers/block and common/ directories. It is better to split them out into their own place. Use drivers/scsi which is what Linux does. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* sata: Move drivers into new drivers/ata directorySimon Glass2017-07-112-118/+0
| | | | | | | | | At present we have the SATA and PATA drivers mixed up in the drivers/block directory. It is better to split them out into their own place. Use drivers/ata which is what Linux does. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Kconfig: Add CONFIG_SATA to enable SATASimon Glass2017-07-112-2/+2
| | | | | | | | | At present CONFIG_CMD_SATA enables the 'sata' command which also brings in SATA support. Some boards may wish to enable SATA without the command. Add a separate CONFIG to permit this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* scsi: Drop scsi_print_error()Simon Glass2017-07-111-0/+5
| | | | | | | | | This function is only defined by one driver and is empty. Move it into the SCSI implementation itself. We could remove it, but it should be useful for debugging. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* scsi: Drop sym53c8xx driverSimon Glass2017-07-111-8/+1
| | | | | | | | This driver is for a PowerPC board that will likely be removed soon. Rather than converting it to driver model, drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* board_f: Add new function to allow runtime DTB selectionCooper Jr., Franklin2017-07-102-0/+12
| | | | | | | | | | | | Runtime U-boot dtb selection is generally a two step process. First step is to simply use an initial generic dtb. The second step is to select the dtb and perhaps execute additional code ones U-boot knows what board it is running on. Embedded_dtb_select handles the second step by allowing board specific code to run and perform what ever necessary configuration that is needed. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* boot_fit: Create helper functions that can be used to select DTB out of FITCooper Jr., Franklin2017-07-103-0/+88
| | | | | | | | Some platforms may append a FIT image to the U-boot image. This function aids in parsing the FIT image and selecting the correct DTB at runtime. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: fit: Break out some functions into a common fileCooper Jr., Franklin2017-07-103-53/+64
| | | | | | | | | | | | | Some of the functions within spl_fit will be used for non spl purposes. Instead of duplicating functions simply break the functions to be reused into its own file. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Only add the new define to image.h, otherwise we see breakage due to massive include leakage into host tools in some cases] Signed-off-by: Tom Rini <trini@konsulko.com>
* avr32: Retire AVR32 for goodAndy Shevchenko2017-07-061-10/+3
| | | | | | | | | | | | | | AVR32 is gone. It's already more than two years for no support in Buildroot, even longer there is no support in GCC (last version is heavily patched 4.2.4). Linux kernel v4.12 got rid of it (and v4.11 didn't build successfully). There is no good point to keep this support in U-Boot either. Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* 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>