summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-08-07mkimage: fit: fix import of external dataPatrick Oppenlander1-2/+2
The external data is located after the mmapped FDT pointed to by 'old_fdt', not in the newly created FDT we are importing into at 'fdt'. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
2020-08-07mkimage: fit: include image cipher in configuration signaturePatrick Oppenlander1-0/+17
This patch addresses issue #2 for signed configurations. -----8<----- Including the image cipher properties in the configuration signature prevents an attacker from modifying cipher, key or iv properties. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-08-07mkimage: fit: don't cipher ciphered dataPatrick Oppenlander1-1/+14
Previously, mkimage -F could be run multiple times causing already ciphered image data to be ciphered again. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-08-07mkimage: fit: handle FDT_ERR_NOSPACE when cipheringPatrick Oppenlander1-9/+10
Also replace fdt_delprop/fdt_setprop with fdt_setprop as fdt_setprop can replace an existing property value. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-08-07mkimage: fit: only process one cipher nodePatrick Oppenlander1-35/+22
Previously mkimage would process any node matching the regex cipher.* and apply the ciphers to the image data in the order they appeared in the FDT. This meant that data could be inadvertently ciphered multiple times. Switch to processing a single cipher node which exactly matches FIT_CIPHER_NODENAME. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-08-07Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini4-25/+24
- XHCI updates to support MIPS better
2020-08-07Merge branch '2020-08-06-Kconfig-sram-options'Tom Rini21-112/+155
- Migrate a few SRAM related options to Kconfig, related cleanups.
2020-08-07common/board_r: Move blkcache_init call earlier in the boot sequenceOvidiu Panait1-3/+3
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-07blkcache: Extend blkcache_init to cover CONFIG_NEEDS_MANUAL_RELOCOvidiu Panait2-7/+10
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 Panait1-7/+1
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-06drivers: serial: Make serial_initialize return intOvidiu Panait3-4/+6
serial_initialize is called only during the common init sequence, after relocation (in common/board_r.c). Because it has a void return value, it has to wrapped in initr_serial. In order to be able to get rid of this indirection, make serial_initialize return int. Remove extern from prototype in order to silence the following checkpatch warning: check: extern prototypes should be avoided in .h files Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06dm: blk: Use IS_ENABLED() instead of #ifdefs in blk_post_probeOvidiu Panait1-4/+5
Use IS_ENABLED() instead of #ifdef in blk_post_probe function. No functional change intended. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> [trini: Fix thinko and use CONFIG_HAVE_BLOCK_DEVICE in IS_ENABLED()] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-06board_f: Remove setup_board_part1Ovidiu Panait1-11/+1
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 Panait2-34/+27
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 Panait2-15/+25
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 Panait1-5/+5
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 Panait6-18/+28
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 Panait2-1/+18
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 Panait2-0/+16
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-06cmd: bdinfo: Move sram info prints to generic codeOvidiu Panait3-8/+4
bi_sramstart and bi_sramsize are generic members of the bd_info structure, so move the m68k/powerpc-specific prints to generic code. Also, print them only if SRAM support is enabled via CONFIG_SYS_HAS_SRAM. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06Kconfig: Remove CONFIG_SYS_SRAM_STARTOvidiu Panait4-7/+2
Remove ad-hoc CONFIG_SYS_SRAM_START and use CONFIG_SYS_SRAM_BASE instead. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06Kconfig: Convert CONFIG_SYS_SRAM_SIZE to KconfigOvidiu Panait5-5/+7
This converts ad-hoc CONFIG_SYS_SRAM_SIZE to Kconfig. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06Kconfig: Convert CONFIG_SYS_SRAM_BASE to KconfigOvidiu Panait3-2/+5
This converts ad-hoc CONFIG_SYS_SRAM_BASE to Kconfig. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06Kconfig: Introduce CONFIG_SYS_HAS_SRAMOvidiu Panait1-0/+11
In order to be able to replace "#ifdef CONFIG_SYS_SRAM_BASE" sequences with the IS_ENABLED() equivalent, introduce a new boolean Kconfig option that signals whether the platform has SRAM support. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvellTom Rini19-28/+719
- Cleanup in Marvell bubt cmd (Tom & Jagan) - Add a series of MikroTik CRS3xx, 98DX3236 based switches (Luka)
2020-08-06mvebu: bubt: Drop dead codeTom Rini1-15/+0
The code around CONFIG_SYS_MMC_ENV_PART has been untested since merge. This can be seen by it referencing 'mmc->part_num' which was migrated elsewhere prior to this code being merged. Cc: Joel Johnson <mrjoel@lixil.net> Cc: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Stefan Roese <sr@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06arm: mvebu: Update CRS305-1G-4S board flash layoutLuka Kovacic2-6/+13
Update the MikroTik CRS305-1G-4S flash layout to support redundant UBI partitions. Additionally enable the UBI commands in crs305-1g-4s_defconfig. Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Jakov Petrina <jakov.petrina@sartura.hr> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06arm: mvebu: crs3xx-98dx3236: Add a maintainerLuka Kovacic1-0/+1
Add Luka Perkov to CRS3xx-98DX3236 MAINTAINERS. Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Jakov Petrina <jakov.petrina@sartura.hr> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06arm: mvebu: Add CRS328-4C-20S-4S boardLuka Kovacic8-0/+302
MikroTik CRS328-4C-20S-4S board has a switch chip with an integrated Marvell Prestera 98DX3236 CPU. This commit includes two board variants, namely the factory default one and a Bit variant. The Bit board variant has a bigger Macronix flash. Add basic U-Boot, UART and SPI flash support. Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Jakov Petrina <jakov.petrina@sartura.hr> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06arm: mvebu: Add CRS326-24G-2S boardLuka Kovacic8-0/+302
MikroTik CRS326-24G-2S board has a switch chip with an integrated Marvell Prestera 98DX3236 CPU. This commit includes two board variants, namely the factory default one and a Bit variant. The Bit board variant has a bigger Macronix flash. Add basic U-Boot, UART and SPI flash support. Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Jakov Petrina <jakov.petrina@sartura.hr> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06arm: mvebu: Add CRS305-1G-4S Bit boardLuka Kovacic4-0/+101
MikroTik CRS305-1G-4S Bit board has a switch chip with an integrated Marvell Prestera 98DX3236 CPU. The Bit board variant is added, which has a bigger Macronix flash. Add basic U-Boot, UART and Winbond SPI flash support. Signed-off-by: Luka Kovacic <luka.kovacic@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Jakov Petrina <jakov.petrina@sartura.hr> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06cmd: mvebu/bubt: Drop unused SPI_FLASH_PROTECTIONJagan Teki1-7/+0
SPI_FLASH_PROTECTION config item is never used in anywhere in the U-Boot tree. Drop it. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06Azure/Travis: Update to latest Docker imageTom Rini2-2/+2
- New bionic snapshot - Updated sbsigntool - Include SH4 in qemu Signed-off-by: Tom Rini <trini@konsulko.com>
2020-08-05Merge https://gitlab.denx.de/u-boot/custodians/u-boot-shTom Rini4-4/+41
- r2dplus updates
2020-08-05Merge branch '2020-08-05-misc-fixes'Tom Rini44-128/+421
- A large number of assorted fixes and minor improvements
2020-08-05tools: env: Avoid an uninited warning with was_lockedSimon Glass1-1/+1
Set this variable to 0 to avoid a warning about an unused variable. This happens on gcc 7.5.0 for me. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-05tools: env: Fix printf() warning in fw_envSimon Glass1-2/+2
The printf() string produces a warning about %d not matching size_t. Fix it and put the format string on one line to avoid a checkpatch warning. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-05ARM: add Kconfig option for PSCI 0.1Icenowy Zheng1-0/+4
We still have some platforms that only implements functionalities in PSCI 0.1 (e.g. Allwinner ARMv7 SoCs). Add a Kconfig option for exporting only PSCI 0.1. The code to export PSCI 0.1 is still available and gets activated by this patch. In addition, default ARCH_SUNXI U-Boot PSCI implementation to export PSCI 0.1, to fix poweroff/reboot regression on Allwinner multi-core ARMv7 SoCs. Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2020-08-05cmd: bdinfo: cleanup phys_addr_t outputHeinrich Schuchardt1-3/+4
We currently print the memory size with at least 8 hexadecimal digits. This creates a ragged output on 64 bit boards, e.g. on a Kendryte K210: DRAM bank = 0x0000000000000002 -> start = 0x0000000080600000 -> size = 0x0000000000200000 memstart = 0x0000000000000000 memsize = 0x00000000 flashstart = 0x0000000000000000 flashsize = 0x0000000000000000 flashoffset = 0x0000000000000000 All other numbers are printed with the number of digits needed for the type ulong. So use this value as minimum number of digits (precision) for printing physical addresses. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-05cmd: bootz: fix device-tree overlap testBaruch Siach1-1/+1
The address of the kernel image is stored in images->ep. zi_start is the offset of execution entry in the image, which is usually 0 for ARM zImage. Fixes boot error when ftd is stored near RAM address 0x0: ERROR: FDT image overlaps OS image (OS=0x0..0x5fd608) Fixes: fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image") Cc: Tero Kristo <t-kristo@ti.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-08-05fit_image: Use calloc() to fix reproducibility issueFabio Estevam1-4/+4
Vagrant Cascadian reported that mx6cuboxi target no longer builds reproducibility on Debian. One example of builds mismatches: 00096680: 696e 6700 736f 756e 642d 6461 6900 6465 ing.sound-dai.de -00096690: 7465 6374 2d67 7069 6f73 0000 tect-gpios.. +00096690: 7465 6374 2d67 7069 6f73 0061 tect-gpios.a This problem happens because all the buffers in fit_image.c are allocated via malloc(), which does not zero out the allocated buffer. Using calloc() fixes this unpredictable behaviour as it guarantees that the allocated buffer are zero initialized. Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org> Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Tested-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
2020-08-05usb: xhci: Add virt_to_phys() to support mapped platformsStefan Roese3-16/+14
Some platforms, like MIPS Octeon, use mapped addresses (virtual address != physical address). On these platforms we need to make sure, that the local virtual addresses are converted to physical (DMA) addresses for the xHCI controller. This patch adds the missing virt_to_phys() calls, so that the correct addresses are used. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Marek Vasut <marex@denx.de>
2020-08-05usb: usb-uclass.c: Drop le16_to_cpu() as values are already swappedStefan Roese1-4/+4
These values are already swapped to CPU endianess, so swapping them again is a bug. Let's remove the swap here instead. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Marek Vasut <marex@denx.de>
2020-08-05usb: xhci: xhci_mem_init: Use cpu_to_le64() and not xhci_writeq()Stefan Roese1-1/+1
xhci_writeq() makes the CPU->LE swapping only when addressing registers in the xHCI controller address range and not in the local memory (RAM). We need to use cpu_to_le64() here to ensure that the conversion is done correctly. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Marek Vasut <marex@denx.de>
2020-08-05usb: xhci: Add missing endian conversions (cpu_to_leXX / leXX_to_cpu)Stefan Roese1-4/+5
While trying to use the U-Boot xHCI driver on the MIPS Octeon platform, which is big endian, I noticed that the driver is missing a few endian conversion calls. This patch adds these missing endian conversion calls. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Marek Vasut <marex@denx.de>
2020-08-05arm: Add SPL build check to SPL early bss clearBrian Moyer1-5/+5
SPL_CLEAR_BSS is called regardless of build type if CONFIG_SPL_EARLY_BSS is defined. Add a guard for CONFIG_SPL_BUILD to fix. Signed-off-by: Brian Moyer <bdm310@gmail.com>
2020-08-05doc: move Clang documentation to HTMLHeinrich Schuchardt3-55/+77
* Move README.clang to doc/build/clang.rst and reformat as reStructeredText. * Indicate that -ffixed-r9 and -ffixed-x18 are used to reserve registers for gd. * Minor editing. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-05pinctrl: aspeed: Fix Kconfig entry indentationMichal Simek1-7/+7
Fix Kconfig entry indentation for Aspeed ast2500 pin control driver. Fixes: 4f0e44e46615 ("aspeed: AST2500 Pinctrl Driver") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-05Makefile.lib: Build all DTS with -@ if OF_LIBFDT_OVERLAY is enabledMichal Simek1-1/+1
The commit 47818e23a228 ("Makefile.lib: include /__symbols__ in dtb if SPL_LOAD_FIT_APPLY_OVERLAY is enabled") enables DT building as overlays based on symbols which depends on SPL. But there is already an option to apply overlays in full U-Boot too. And there are platforms which are not using SPL and there is no option to build DTs with -@ parameter. That's why change dependency on OF_LIBFDT_OVERLAY which is already symbol which is selected when SPL_LOAD_FIT_APPLY_OVERLAY is enabled but also adding support for platforms which don't enable SPL and want to work with overlays on U-Boot prompt. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-05dt-bindings: Sync include/dt-bindings/phy/phy.h from LinuxMichal Simek1-0/+4
Add 4 new phy types which are present in Linux kernel. DP and SGMII types are used on Xilinx ZynqMP devices. Signed-off-by: Michal Simek <michal.simek@xilinx.com>