summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2017-02-08common: env_sf: Use CONFIG_SF_DEFAULT_xxx as the default value for ↵Jean-Jacques Hiblot
CONFIG_ENV_SPI_xxx The default values for the configuration defines CONFIG_ENV_SPI_xxx are arbitrary values. It makes more sense to set them to the values used by the sf command. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-02-06x86: Do relocation before clearing BSSSimon Glass
The BSS region may overlap with relocations. If we clear BSS we will overwrite the start of the relocation area. This doesn't matter when running from SPI flash, since it is read-only. But when relocating 64-bit U-Boot from one place in RAM to another, relocation will fail because some of its relocations have been zeroed. To fix this, put the ELF fixup call before the BSS clearing call. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06x86: board_r: Set the global data pointer after relocationSimon Glass
Since 'gd' is just a normal variable on 64-bit x86, it is relocated by the time we get to board_init_r(). The old 'gd' variable is passed in as parameter to board_init_r(), presumably for this situation. Assign it on 64-bit x86 so that gd points to the correct data. Options to improve this: - Make gd a fixed register and remove the board_init_r() parameter - Make all archs use this board_init_r() parameter The second has a TODO in the code. The first has a TODO in a future commit ('x86: Support global_data on x86_64') Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06board_f/r: Use static const for the init sequencesSimon Glass
These tables should be declared static const. Unfortunately the table in board_r is updated on machines with manual relocation. Update them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06x86: board_f: Update init sequence for 64-bit startupSimon Glass
Adjust the code so that 64-bit startup works. Since we don't need to do CAR changes in U-Boot proper anymore (they are done in SPL) we can simplify the flow and return normally from board_init_f(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06spl: Allow PCH drivers to be used in SPLSimon Glass
Add an option for building Platorm Controller Hub drivers in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06spl: Allow timer drivers to be used in SPLSimon Glass
Add a new Kconfig option to allow timer drivers to be used in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06spl: Allow RTC drivers to be used in SPLSimon Glass
Add a new Kconfig option to allow RTC drivers to be used in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06spl: Allow PCI drivers to be used in SPLSimon Glass
Add a new Kconfig option to allow PCI drivers to be used in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06spl: Allow CPU drivers to be used in SPLSimon Glass
Add a new Kconfig option to allow CPU drivers to be used in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06spl: spi: Add a debug message if loading failsSimon Glass
This currently fails silently. Add a debug message to aid debugging. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-06console: Don't enable CONFIG-CONSOLE_MUX, etc. in SPLSimon Glass
CONFIG_CONSOLE_MUX and CONFIG_SYS_CONSOLE_IS_IN_ENV are not applicable for SPL. Update the console code to use CONFIG_IS_ENABLED(), so that these options will be inactive in SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-01-29ARM: uniphier: change CONFIG_SPL_PAD_TO to 128KBMasahiro Yamada
The Boot ROM supports authentication feature to prevent malformed software from being run on products. The signature is added at the tail of the second stage loader (= SPL in U-boot terminology). The size of the second stage loader was 64KB, and it was consistent across SoCs. The situation changed when LD20 SoC appeared; it loads 80KB second stage loader, and it is the only exception. Currently, CONFIG_SPL_PAD_TO is set to 64KB and U-Boot proper is loaded from the 64KB offset of non-volatile devices. This means the signature of LD20 SoC (located at 80KB offset) corrupts the U-Boot proper image. Let's move the U-Boot proper image to 128KB offset. It uses 48KB for nothing but padding, and we could actually locate the U-Boot proper at 80KB offset. However, the power of 2 generally seems a better choice for the offset address. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-01-28Revert "armv8: release slave cores from CPU_RELEASE_ADDR"Masahiro Yamada
This reverts commit 8c36e99f211104fd7dcbf0669a35a47ce5e154f5. There is misunderstanding in commit 8c36e99f2111 ("armv8: release slave cores from CPU_RELEASE_ADDR"). How to bring the slave cores into U-Boot proper is platform-specific. So, it should be cared in SoC/board files instead of common/spl/spl.c. As you see SPL is the acronym of Secondary Program Loader, there is generally something that runs before SPL (the First one is usually Boot ROM). How to wake up slave cores from the Boot ROM is really SoC specific. So, the intention for the spin table support is to bring the slave cores into U-Boot proper in an SoC specific manner. (this must be done after relocation. see below.) If you bring the slaves into SPL, it is SoC own code responsibility to transfer them to U-Boot proper. The Spin Table defines the interface between a boot-loader and Linux kernel. It is unrelated to the interface between SPL and U-Boot proper. One more thing is missing in the commit; spl_image->entry_point points to the entry address of U-Boot *before* relocation. U-Boot relocates itself between board_init_f() and board_init_r(). This means the master CPU sees the different copy of the spin code than the slave CPUs enter. The spin_table_update_dt() protects the code *after* relocation. As a result, the slave CPUs spin in unprotected code, which leads to unstable behavior. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-28spl: Remove overwrite of relocated malloc limitAndrew F. Davis
spl_init on some boards is called after stack and heap relocation, on some platforms spl_relocate_stack_gd is called to handle setting the limit to its value CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN when simple SPL malloc is enabled during relocation. spl_init should then not re-assign the old pre-relocation limit when this is defined. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-28malloc_simple: Add debug statements to memalign_simpleAndrew F. Davis
Add debug statements to memalign_simple to match malloc_simple. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-28disk: convert CONFIG_EFI_PARTITION to KconfigPatrick Delaunay
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
2017-01-28disk: convert CONFIG_DOS_PARTITION to KconfigPatrick Delaunay
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
2017-01-25Drop CONFIG_CMD_DOCSimon Glass
This is not used in U-Boot, and the only usage calls a non-existent function. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Drop prt_mpc5xxx_clks() in favour of print_cpuinfo()Simon Glass
Rather than having an arch-specific function, use the existing generic one. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Drop the static inline print_cpuinfo()Simon Glass
This is only called from one place and the function cannot be inlined. Convert it to a normal function. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Drop CONFIG_WINBOND_83C553Simon Glass
This is not used in U-Boot. Drop this option and associated dead code. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25powerpc: Drop CONFIG_SYS_ALLOC_DPRAMSimon Glass
This is not defined anywhere in U-Boot. Drop this dead code. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25powerpc: Drop probecpu() in favour of arch_cpu_init()Simon Glass
To avoid an unnecessary arch-specific call in board_init_f(), rename this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Convert CONFIG_ARCH_MISC_INIT to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_ARCH_MISC_INIT Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Convert CONFIG_BOARD_EARLY_INIT_F to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_BOARD_EARLY_INIT_F Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-25Convert CONFIG_ARCH_EARLY_INIT_R to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_ARCH_EARLY_INIT_R Signed-off-by: Simon Glass <sjg@chromium.org>
2017-01-24Kconfig: Migrate BOARD_LATE_INIT to a selectTom Rini
This option should not really be user selectable. Note that on PowerPC we currently only need BOARD_LATE_INIT when CHAIN_OF_TRUST is enabled so be conditional on that. Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> (for UniPhier)
2017-01-21status_led: Kconfig migrationUri Mashiach
Move all of the status LED feature to drivers/led/Kconfig. The LED status definitions were moved from the board configuration files to the defconfig files. TBD: Move all of the definitions in the include/status_led.h to the relevant board's defconfig files. Tested boards: CL-SOM-AM57x, CM-T335 Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
2017-01-21common: Kconfig: Add BOARD_LATE_INIT entryJagan Teki
This patch add Kconfig entry for CONFIG_BOARD_LATE_INIT Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Jagan Teki <jagan@openedev.com>
2017-01-20bootm: qnx: Disable data cache before booting QNX imageEmmanuel Vadot
Instead of disabling the data cache in the bootelf command, disabling it in the do_bootm_qnxelf function. Some ELF binary might want the cache enabled. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
2017-01-20board_init.c: Always use memset()Tom Rini
We can make the code read more easily here by simply using memset() always as when we don't have an optimized version of the function we will still have a version of this function around anyhow. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-20ARM: Default to using optimized memset and memcpy routinesTom Rini
We have long had available optimized versions of the memset and memcpy functions that are borrowed from the Linux kernel. We should use these in normal conditions as the speed wins in many workflows outweigh the relatively minor size increase. However, we have a number of places where we're simply too close to size limits in SPL and must be able to make the size vs performance trade-off in those cases. Cc: Philippe Reynes <tremyfr@yahoo.fr> Cc: Eric Jarrige <eric.jarrige@armadeus.org> Cc: Heiko Schocher <hs@denx.de> Cc: Magnus Lilja <lilja.magnus@gmail.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: Chander Kashyap <k.chander@samsung.com> Cc: Akshay Saraswat <akshay.s@samsung.com> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-20spl: Add some missing newlinesAndrew F. Davis
Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Lokesh Vutla <lokeshvutla@ti.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
2017-01-20spl: Remove inline ifdef check for EXT and FAT supportAndrew F. Davis
These files are only included for build by the make system when CONFIG_SPL_{EXT,FAT}_SUPPORT is enabled, remove the unneed checks for these in the source files. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-20common/image.c: Use correct suffixes for binary sizesxypron.glpk@gmx.de
IEC 80000-13:2008 Quantities and units Part 13: Information science and technology defines the prefixes to use for binary multiples. So instead of writing Data Size: 6726132 Bytes = 6568.49 kB = 6.41 MB in dumpimage we should write Data Size: 6726132 Bytes = 6568.49 KiB = 6.41 MiB. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-01-20bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH setRick Altherr
In 35fc84f, bootm was refactored so plain 'bootm' and 'bootm <subcommand>' shared a common implementation. The 'bootm ramdisk' command implementation is now part of the common implementation but not invoke by plain 'bootm' since the original implementation never did ramdisk relocation. Instead, ramdisk relocation happened in image_setup_linux() which is typically called during the OS portion of 'bootm'. On ARM, parameters to the Linux kernel can either be passed by FDT or ATAGS. When using FDT, image_setup_linux() is called which also triggers ramdisk relocation. When using ATAGS, image_setup_linux() is _not_ called because it mostly does FDT setup. Instead of calling image_setup_linux() in both FDT and ATAGS cases, include BOOTM_STATE_RAMDISK in the requested states during a plain 'bootm' if CONFIG_SYS_BOOT_RAMDISK_HIGH is set and remove the ramdisk relocation from image_setup_linux(). This causes ramdisk relocation to happen on any system where CONFIG_SYS_BOOT_RAMDISK_HIGH regardless of the OS being booted. Also remove IMAGE_ENABLE_RAMDISK_HIGH as it was only used by the now-removed code from image_setup_linux(). Signed-off-by: Rick Altherr <raltherr@google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joel Stanley <joel@jms.id.au>
2017-01-17Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2017-01-17usb: storage: Show number of storage devices detected for DM_USBMichal Simek
By enabling DM_USB information about number of storage devices was lost. Get this information back simply by printing number of devices detected via BLK uclass. For example: scanning bus 0 for devices... 7 USB Device(s) found scanning usb for storage devices... 3 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2017-01-17Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini
2017-01-14armv8: release slave cores from CPU_RELEASE_ADDROded Gabbay
When using ARMv8 with ARMV8_SPIN_TABLE=y, we want the slave cores to wait on spin_table_cpu_release_addr, until the Linux kernel will "wake" them by writing to that location. The address of spin_table_cpu_release_addr is transferred to the kernel using the device tree that is updated by spin_table_update_dt(). However, if we also use SPL, then the slave cores are stuck at CPU_RELEASE_ADDR instead and as a result, never wake up. This patch releases the slave cores by writing spl_image->entry_point to CPU_RELEASE_ADDR location before the end of the SPL code (at jump_to_image_no_args()). That way, the slave cores will start to execute the u-boot and will get to the spin-table code and wait on the correct address (spin_table_cpu_release_addr). Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-14spl: move RAM boot support in separate fileStefan Agner
Add a new top-level config option so support booting an image stored in RAM. This allows to move the RAM boot support into a sparate file and having a single condition to compile that file. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-01-14Convert CONFIG_SPL_RAM_DEVICE to defconfigStefan Agner
This converts the following to Kconfig: CONFIG_SPL_RAM_DEVICE Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-01-14Kconfig: CONFIG_OF_PLATDATA doesn't really existTom Rini
There is no CONFIG_OF_PLATDATA, only CONFIG_SPL_OF_PLATDATA, so rename the two references to CONFIG_OF_PLATDATA to CONFIG_SPL_OF_PLATDATA. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-01-13splash: fix splash source flags checktomas.melin@vaisala.com
SPLASH_STORAGE_RAW is defined as 0, so a check against & will never be true. These flags are never combined so do a check against == instead. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-01-13splash: add support for loading splash from a FIT imagetomas.melin@vaisala.com
Enable support for loading a splash image from within a FIT image. The image is assumed to be generated with mkimage -E flag to hold the data external to the FIT. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2017-01-13splash: sort include filestomas.melin@vaisala.com
Sort include files in accordance to U-Boot coding style. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
2017-01-10Merge git://git.denx.de/u-boot-dmTom Rini
2017-01-09scsi: dm: Unbind all scsi based block devices before new scanMichal Simek
New scan should unbind all block devices not to be listed again. Without this patch if scsi reset or scan is called new block devices are created which point to the same id and lun. For example: ZynqMP> scsi scan scsi_scan: if_type=2, devnum=0: sdhci@ff170000.blk, 6, 0 scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 0 scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 1 scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 2 scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 3 scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 4 scanning bus for devices... Device 0: (1:0) Vendor: ATA Prod.: KINGSTON SVP200S Rev: 501A Type: Hard Disk Capacity: 57241.8 MB = 55.9 GB (117231408 x 512) Reported-by: Ken Ma <make@marvell.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-01-04SPL: make struct spl_image 64-bit safeAndre Przywara
Since entry_point and load_addr are addresses, they should be represented as longs to cover the whole address space and to avoid warning when compiling the SPL in 64-bit. Also adjust debug prints to add the 'l' specifier, where needed. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>