aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2020-09-21Merge branch 'master' into nextTom Rini
Merge in v2020.10-rc5
2020-09-11Fix data abort caused by mis-aligning FIT dataReuben Dowle
Attempting to place device tree immediately after an image in memory can lead to mis-aligned data accesses if that image size is not divisible by the alignment requirements of the architecture. Data aborts caused by this were observed on a custom Marvel A388 based system, where the image was a uboot FIT file. The total size varies depending on the uboot device tree size, which does not always lead to correct alignment. The minimum alignment specified for ARM [1] and ARM64 [2] linux booting has been used [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm/booting.rst#n126 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.rst#n45 Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2020-09-11bootm: update image OS image size when decompressingHeinrich Schuchardt
In bootm_load_os() the OS image is decompressed. In later stages of the boot process we need the decompressed size of the image. Update images->os.image_len after decompression. Passing the correct size is necessary if we want to check loaded EFI binararies for file truncation by comparing the loaded size to the header field SizeOfImage. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-09-11common: Kconfig: Add dependency for default variables stringsMichal Simek
Kconfig provides several config options for setting up default variables but these are unused when variables are passed to U-Boot via file. That's why cover this dependency in Kconfig. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-09-07Merge branch 'remove-config-nr-dram-banks-v9-2020-08-26' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-marvell into next
2020-09-01sdp: call board_usb_init at spl_sdp_load_imageFrank Li
Need initialize UDC before run sdp download Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-09-01dfu: fix dfu tftp on sandboxHeinrich Schuchardt
The environment variable loadaddr is in the virtual address space of the sandbox. To get the actual memory address where the FIT image has been loaded we have to convert this address according to the memory mapping of the sandbox. Equally the addresses in the *.its file have to be converted when used in the dfu_ram driver. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-09-01dfu: fix typo parameteresHeinrich Schuchardt
%s/parameteres/parameters/g Even if a line exceeds 80 characters we should not split output strings to make debugging easier. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-27image: don't exceed gd->ram_top in bootm_sizeBaruch Siach
When board_get_usable_ram_top() limits gd->ram_top, env_get_bootm_size() must not exceed that limit. Otherwise, boot_relocate_fdt() might put fdt out of the allowed RAM range. The similar commit 8ce1f10cf2b1 ("ARM: bootm: take into account gd->ram_top") exposed this bug. This fixes boot on Armada 8040 based Clearfog GT-8K where ram_top is set to 0x80000000 (2GB), but bi_dram[0].size might be up to 0xc0000000 (3GB). Note the relocated fdt address (0xbfff4000) in the console output listed below: Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 62 bytes read in 21 ms (2 KiB/s) 1: linux Retrieving file: /extlinux/Image 13740544 bytes read in 1266 ms (10.4 MiB/s) Retrieving file: /extlinux/armada-8040-clearfog-gt-8k.dtb 33368 bytes read in 31 ms (1 MiB/s) Booting using the fdt blob at 0x4f00000 Loading Device Tree to 00000000bfff4000, end 00000000bffff257 ... "Synchronous Abort" handler, esr 0x96000045 elr: 000000000006e1cc lr : 0000000000068fd8 (reloc) elr: 000000007ffa91cc lr : 000000007ffa3fd8 x0 : ffffffffffffffff x1 : 00000000bfffc258 x2 : 0000000000000000 x3 : ffffffffffff7da7 x4 : 0000000004f08258 x5 : 00000000bfff4000 x6 : 00000000bfff4000 x7 : 000000000000000f x8 : 000000007fb23bf8 x9 : 0000000000000008 x10: 00000000bffff257 x11: 00000000bffff257 x12: 0000000000000000 x13: fffffffffffff000 x14: 00000000bfff4000 x15: 0000000000000021 x16: 000000007ff7bc38 x17: 0000000000000000 x18: 000000007fb2add0 x19: 00000000bfff4000 x20: 0000000004f00000 x21: 000000000000b258 x22: 0000000058820000 x23: 0000000000000010 x24: 000000007ffe3c40 x25: 000000007fb23cb8 x26: 00000000c0000000 x27: 0000000000000000 x28: 000000007fc3fd50 x29: 000000007fb23bd0 Code: 54000061 aa0603e0 d65f03c0 38606882 (38206822) Resetting CPU ... Thanks to Patrice CHOTARD who directed me to the right way. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-08-26board_f: Add default values for bi_dram[] in dram_init_banksize()Stefan Roese
Remove the bi_memstart / bi_memsize assignment in setup_bdinfo() and make sure, that bd_dram[] is always configured in the weak default implementation of dram_init_banksize(), when CONFIG_SYS_SDRAM_BASE is not set. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-26image: Use gd->ram_base/_size in env_get_bootm_size()Stefan Roese
Use only gd->ram_base/_size in env_get_bootm_size() instead of bi_dram[] in some cases and bi_memstart in others. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-26CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always definedStefan Roese
Since commit 86cf1c82850f ("configs: Migrate CONFIG_NR_DRAM_BANKS") & commit 999a772d9f24 ("Kconfig: Migrate CONFIG_NR_DRAM_BANKS"), CONFIG_NR_DRAM_BANKS is always defined with a value (4 is default). It makes no sense to still carry code that is guarded with "#ifndef CONFIG_NR_DRAM_BANKS" (and similar). This patch removes all these unreferenced code paths. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Pali Rohár <pali@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-08-24avb: Make AVB independent of fastbootUsama Arif
AVB only uses CONFIG_FASTBOOT_BUF_ADDR from fastboot for memory. This memory is used for assigning temporary buffers. This can be assigned a new variable and used as CONFIG_AVB_BUF_ADDR. This is to support future boards that support AVB but dont support USB and therefore dont support FASTBOOT. Signed-off-by: Usama Arif <usama.arif@arm.com> Cc: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Igor Opaniuk <igor.opaniuk@gmail.com> [trini: Change defaults] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-23Merge tag 'dm-pull-22aug20' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-dm replace devfdt_get_addr_ptr() with dev_read_addr_ptr() binman fixes for portage various minor fixes 'bind' command improvements
2020-08-23stdio: Tidy up the coding styleSimon Glass
Bring the coding style in this file up to the current level. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-23stdio: Drop brackets around &devs.listSimon Glass
These brackets are not needed. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-23stdio: Update to use compiler for Kconfig checksSimon Glass
Drop use of the preprocessor where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-23stdio: Tidy up use of CONFIG_SYS_DEVICE_NULLDEVSimon Glass
Now that this is in Kconfig we can move the logic at the top of the file to Kconfig, and use if() instead of #if. Update the file with these changes. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-23Convert CONFIG_SYS_DEVICE_NULLDEV to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_SYS_DEVICE_NULLDEV Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-22board_f: Remove dead code from init_func_i2cOvidiu Panait
Since commit 69153988a6f4 ("i2c: Finish dropping use of CONFIG_I2C_HARD") init_func_i2c is wrapped only by "#if defined(CONFIG_SYS_I2C)". Because of this, the second ifdef within becomes pointless: #if defined(CONFIG_SYS_I2C) static int init_func_i2c(void) <snip> #ifdef CONFIG_SYS_I2C ... #else ... #endif <snip> } #endif Remove the dead #else preprocessor code. Fixes: 69153988a6f ("i2c: Finish dropping use of CONFIG_I2C_HARD") Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-14xen: pvblock: Add initial support for para-virtualized block driverAnastasiia Lukianenko
Add initial infrastructure for Xen para-virtualized block device. This includes compile-time configuration and the skeleton for the future driver implementation. Add new class UCLASS_PVBLOCK which is going to be a parent for virtual block devices. Add new interface type IF_TYPE_PVBLOCK. Implement basic driver setup by reading XenStore configuration. Signed-off-by: Andrii Anisov <andrii_anisov@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
2020-08-14xen: Port Xen hypervisor related code from mini-osOleksandr Andrushchenko
Port hypervisor related code from Mini-OS. This is referencing the code of Mini-OS from [1] by Huang Shijie and Volodymyr Babchuk which is for ARM64. Update essential arch code to support required bit operations, memory barriers etc. Copyright for the bits ported belong to at least the following authors, please see related files for details: Copyright (c) 2002-2003, K A Fraser Copyright (c) 2005, Grzegorz Milos, gm281@cam.ac.uk,Intel Research Cambridge Copyright (c) 2014, Karim Allah Ahmed <karim.allah.ahmed@gmail.com> [1] - https://github.com/zyzii/mini-os.git Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> [trini: Drop wmb() from musb-net/linux-compat.h now] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-14common/board_f: make sure to call fix_fdt() before reserve_fdt()Pragnesh Patel
There may be a chance that board specific fix_fdt() will change the size of FDT blob so it's safe to call reserve_fdt() after fix_fdt() otherwise global data (gd) will overwrite with FDT blob values. Fixes: a8492e25ac71 ("riscv: Expand the DT size before copy reserved memory node") Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-08-11spl: usb: Only init usb onceFaiz Abbas
usb_init() may be called multiple times for fetching multiple images from SPL. Skip reinitializing USB if its already been done Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2020-08-11spl: usb: Create an API spl_usb_load()Faiz Abbas
Create a new API spl_usb_load() that takes the filename as a parameter instead of taking the default U-boot PAYLOAD_NAME Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2020-08-07fs/squashfs: new filesystemJoao Marcos Costa
Add support for SquashFS filesystem. Right now, it does not support compression but support for zlib will be added in a follow-up commit. Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2020-08-07console: Always define the console-recording functionsSimon Glass
On boards without console recording these function are currently missing. It is more convenient for them to be present but to return dummy values. That way if we know that a test needs recording, we can check if it is available, and skip the test if not, while avoiding #ifdefs. Update the header file according and adjust console_record_reset_enable() to return an error if recording is not available. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-06common/board_r: Move blkcache_init call earlier in the boot sequenceOvidiu Panait
blkcache_init manually relocates blkcache list pointers when CONFIG_NEEDS_MANUAL_RELOC is enabled. However, it is called very late in the boot sequence, which could be a problem if previous boot calls execute blkcache operations with the non-relocated pointers. For example, mmc is initialized earlier and might call blkcache_invalidate (in mmc_select_hwpart()) when trying to load the environment from mmc via env_load(). To fix this issue, move blkcache_init boot call earlier, before mmc gets initialized. Acked-by: Angelo Dureghello <angelo.dureghello@timesys.com> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06blkcache: Extend blkcache_init to cover CONFIG_NEEDS_MANUAL_RELOCOvidiu Panait
Extend manual relocation of block_cache list pointers to all platforms that enable CONFIG_NEEDS_MANUAL_RELOC. Remove m68k-specific checks and provide a single implementation that adds gd->reloc_off to the pre-relocation pointers. Acked-by: Angelo Dureghello <angelo.dureghello@timesys.com> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Eric Nelson <eric@nelint.com> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> [trini: Add guard around DECLARE_GLOBAL_DATA_PTR to avoid size growth] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-06common/board_r: Remove initr_serial wrapperOvidiu Panait
Remove the initr_serial->serial_initialize indirection and call serial_initialize directly. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: Remove setup_board_part1Ovidiu Panait
Now that all arch specific code was converted to setup_bdinfo, we can remove setup_board_part1. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: ppc: Factor out ppc-specific bdinfo setupOvidiu Panait
Factor out ppc-specific bdinfo setup from generic init sequence to arch_setup_bdinfo in arch/powerpc/lib/bdinfo.c. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: m68k: Factor out m68k-specific bdinfo setupOvidiu Panait
Factor out m68k-specific bdinfo setup to arch_setup_bdinfo in arch/m68k/lib/bdinfo.c. Also, use if(IS_ENABLED()) instead of #ifdef where possible. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: Move sram bdinfo assignments to generic codeOvidiu Panait
Move sram related bdinfo from arch-specific setup_board_part1 to generic code in setup_bdinfo. Also use "if (IS_ENABLED(CONFIG_SYS_HAS_SRAM))" instead of "#ifdef CONFIG_SYS_SRAM_BASE". Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfoOvidiu Panait
Move all assignments to gd->bd->bi_mem{start,size} to generic code in setup_bdinfo. Xtensa architecture is special in this regard as it defines its own handling of gd->bd->bi_mem{start,size} fields. In order to avoid defining a weak SDRAM function, let arch_setup_bdinfo overwrite the generic flags. For ARC architecture, remove ARCH_EARLY_INIT_R from Kconfig since it is not needed anymore. Also, use gd->ram_base to populate bi_memstart to avoid an ifdef. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Acked-by: Alexey Brodkin <abrokdin@synopsys.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-06board_f: Introduce arch_setup_bdinfo initcallOvidiu Panait
Certain architectures (ppc, mips, sh, m68k) use setup board_part1 and setup_board_part2 calls during pre-relocation init to populate gd->bd boardinfo fields. This makes the generic init sequence cluttered with arch-specific ifdefs. In order to clean these arch-specific sequences from generic init, introduce arch_setup_bdinfo weak initcall so that everyone can define their own bdinfo setup routines. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: Introduce setup_bdinfo initcallOvidiu Panait
Introduce setup_bdinfo initcall as a generic routine to populate bdinfo fields. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-04arm: move CONFIG_PREBOOT="usb start" to KConfigJonas Smedegaard
This commit moves CONFIG_PREBOOT="usb start" to common/KConfig for all boards also declaring USB_KEYBOARD. Besides simplifying defconfig files, this also enables support for board-specific CONFIG_PREBOOT for sunxi boards: commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT. Signed-off-by: Jonas Smedegaard <dr@jones.dk> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Series-Cc: Jagan Teki <jagan@amarulasolutions.com> Series-Cc: Lukasz Majewski <lukma@denx.de> Series-Cc: Andre Przywara <andre.przywara@arm.com>
2020-08-03spi: Allow separate control of SPI_FLASH_TINY for SPL/TPLSimon Glass
In some cases SPL needs to be able to erase but TPL just needs to read. Allow these to have separate settings for SPI_FLASH_TINY. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-28find dtb in android boot image with header version 2 during bootmchenshuo
This patch is about bootm process, android boot image and device tree. Android 10 updates the boot image header to version 2, which includes a section to store the device tree blob (DTB) image. include/android_image.h has updated the struct andr_img_hdr, but not used in bootm process. This patch avoid reporting "Device tree not found or missing FDT support" when bootm a correctly constructed android boot image. Signed-off-by: chenshuo <chenshuo@eswin.com>
2020-07-28Convert CONFIG_SYS_MMCSD_FS_BOOT_PARTITION to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_SYS_MMCSD_FS_BOOT_PARTITION Signed-off-by: Adam Ford <aford173@gmail.com>
2020-07-28Convert CONFIG_SPL_NAND_BASE et al to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_SPL_NAND_BASE CONFIG_SPL_NAND_IDENT Signed-off-by: Adam Ford <aford173@gmail.com>
2020-07-28Convert CONFIG_SPL_NAND_DRIVERS et al to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_SPL_NAND_DRIVERS CONFIG_SPL_NAND_ECC CONFIG_SPL_NAND_SIMPLE Signed-off-by: Adam Ford <aford173@gmail.com>
2020-07-27Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
- Bug fixes and updates on ls2088a,ls1028a, ls1046a, ls1043a, ls1012a - lx2-watchdog support - layerscape: pci-endpoint support, spin table relocation fixes and cleanups - fsl-crypto: RNG support and bug fixes
2020-07-27pci_ep: Add the init functionXiaowei Bao
Some EP deivces need to initialize before RC scan it, e.g. NXP layerscape platform, so add the init function in pci_ep uclass. Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2020-07-25fdt_support: skip MTD node with "disabled" in fdt_fixup_mtdparts()Masahiro Yamada
Currently, fdt_fixup_mtdparts() only checks the compatible property. It is pointless to fix up the disabled node. Skip the node if it has the property: status = "disabled" Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-25fdt_support: call mtdparts_init() after finding MTD node to fix upMasahiro Yamada
Platform code can call fdt_fixup_mtdparts() in order to hand U-Boot's MTD partitions over to the Linux device tree. Currently, fdt_fixup_mtdparts() calls mtdparts_init() in its entry. If no target MTD device is found, an error message like follows is displayed: Device nand0 not found! This occurs when the same code (e.g. arch/arm/mach-uniphier/fdt-fixup.c) is shared among several boards, but not all of them support an MTD device. Parse the DT first, then call mtdparts_init() only when the target MTD node is found. Yet, you still need to call mtdparts_init() before device_find(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-25fdt_support: add static to fdt_node_set_part_info()Masahiro Yamada
This function is only called from fdt_fixup_mtdpart() in the same file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-25lib: libfdt: fdt_region: avoid NULL pointer accessPhilippe Reynes
The function fdt_find_regions look in the exclude list for each property, even if the name is NULL. It could happen if the fit image is corrupted. On sandbox, it generates a segfault. To avoid this issue, if the name of a property is NULL, we report an error and avoid looking in the exclude list. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-24Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscvTom Rini
- Fix SiFive HiFive Unleashed board booting failure problem. - Enable SiFive fu540 PWM driver. - Support SiFive fu540: SPI boot. - Update OpenSBI used for RISC-V CI testing. - Revert "riscv: Allow use of reset drivers". - Revert "Revert "riscv: sifive: fu540: Add gpio-restart support"". - sysreset: syscon: - Don't assume default value for offset and mask property. - Support value property. - qemu: Add syscon reboot and poweroff support. - Fix SIFIVE debug serial dependency. - Fix linking error when building u-boot-spl with no SMP support. - AE350 use fdtdec_get_addr_size_auto_noparent to parse smc reg. - Make memory node available to SPL in hifive-unleashed-a00-u-boot.dtsi - SiFive fu540 avoid using hardcoded ram base and size.