summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-17efi_loader: fix possible buffer overflowMasahisa Kojima
Variable "final" will have SHA512 digest, but currently the array size is not sufficient. Let's fix it. Signed-off-by: Masahisa Kojima <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2021-04-17efi_loader: memory leak in efi_capsule_scan_dir()Heinrich Schuchardt
If realloc() fails, we should free the old buffer. Fixes: c74cd8bd08d1: ("efi_loader: capsule: add capsule_on_disk support") Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-04-17efi_loader: esrt: Remove incorrect invocations of EFI_CALL macroSughosh Ganu
Remove function invocations using the EFI_CALL macro for those functions that do not have an EFI_ENTRY call in their definition. Such functions can use u-boot api's which rely on u-boot global data(gd) pointer. The Arm and RiscV architectures maintain a separate gd pointer, one for u-boot, and a separate gd for the efi application. Calling a function through the EFI_CALL macro changes the gd pointer to that used for the efi application, with u-boot gd being unavailable. Any function then trying to dereference u-boot's gd will result in an abort. Fix this issue by removing the EFI_CALL macro for all of such functions which do not begin by an EFI_ENTRY function call. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2021-04-17doc: duplicate target 'youtube'Heinrich Schuchardt
Two external references cannot have the same name: doc/chromium/overview.rst:5: WARNING: Duplicate explicit target name: "youtube" Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-04-17doc: fatinfo man-pageHeinrich Schuchardt
Provide a man-page for the fatinfo command. Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-04-17doc: imx: psb: fix footnotesHeinrich Schuchardt
In reStructured text footnotes are referenced like [1]_. Add missing underscores. Signed-off-by: Heinrich Schuchardt <[email protected]> Acked-by: Marek Vasut <[email protected]>
2021-04-17board: toradex: apalis-imx8x: fix build warningHeinrich Schuchardt
The length of an underline must match the length of the header. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Oleksandr Suvorov <[email protected]>
2021-04-16env: sf: remove the static env_flash variablePatrick Delaunay
As the the SPI flash is probed and is released in each ENV sf function the env_flash no more need to be static. This patch move this device handle as local variable of each function and simplify the associated code (env_flash is never == NULL when setup_flash_device is called). Signed-off-by: Patrick Delaunay <[email protected]>
2021-04-16env: sf: add missing spi_flash_freePatrick Delaunay
Free the SPI resources by calling spi_flash_free() in each env sf function to avoid issue for other SPI users. Signed-off-by: Patrick Delaunay <[email protected]>
2021-04-16env: sf: add support of command env erasePatrick Delaunay
Add support of opts erase for env in SPI flash; this opts is used by command 'env erase'. This command only fills the env offset by 0x0 (bit flip to 0) and the saved environment becomes invalid (with bad CRC). It doesn't erase the sector here to avoid issue when the sector is larger than the env (i.e. embedded when CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE). The needed sector erase will be managed in the next "env save" command, using the opt ".save", before to update the environment in SPI flash. Signed-off-by: Patrick Delaunay <[email protected]>
2021-04-16env: sf: update the use of macro ENV_SAVE_PTRPatrick Delaunay
Remove CONFIG_IS_ENABLED(SAVEENV) as it is already tested in the ENV_SAVE_PTR macro. Signed-off-by: Patrick Delaunay <[email protected]>
2021-04-16env: add ENV_ERASE_PTR macroPatrick Delaunay
Add ENV_ERASE_PTR macro to handle erase opts and remove the associated ifdef. This patch is a extension of previous commit 82b2f4135719 ("env_internal.h: add alternative ENV_SAVE_PTR macro"). Signed-off-by: Patrick Delaunay <[email protected]>
2021-04-16env: Fix invalid env handling in env_init()Marek Vasut
This fixes the case where there are multiple environment drivers, one of them is the default environment one, and it is followed by an environment driver which does not implement .init() callback. The default environment driver sets gd->env_valid to ENV_INVALID and returns 0 from its .init() callback implementation, which is valid behavior for default environment. Since the subsequent environment driver does not implement .init(), it also does not modify the $ret variable in the loop. Therefore, the loop is exited with gd->env_valid=ENV_INVALID and ret=0, which means that the code further down in env_init() will not reset the environment to the default one, which is incorrect. This patch sets the $ret variable back to -ENOENT in case the env_valid is set to ENV_INVALID by an environment driver, so that the environment would be correctly reset back to default one, unless a subsequent driver loads a valid environment. Signed-off-by: Marek Vasut <[email protected]> Tested-By: Tim Harvey <[email protected]>
2021-04-16env/fat.c: support redund environmentBrandon Maier
Signed-off-by: Brandon Maier <[email protected]> CC: Joe Hershberger <[email protected]> CC: Wolfgang Denk <[email protected]>
2021-04-16env: Fix warning when forcing environment without ENV_ACCESS_IGNORE_FORCEMartin Fuzzey
Since commit 0f036bf4b87e ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set") a warning message is displayed when setenv -f is used WITHOUT CONFIG_ENV_ACCESS_IGNORE_FORCE, but the variable is set anyway, resulting in lots of log pollution. env_flags_validate() returns 0 if the access is accepted, or non zero if it is refused. So the original code #ifndef CONFIG_ENV_ACCESS_IGNORE_FORCE if (flag & H_FORCE) return 0; #endif was correct, it returns 0 (accepts the modification) if forced UNLESS IGNORE_FORCE is set (in which case access checks in the following code are applied). The broken patch just added a printf to the force accepted case. To obtain the intent of the patch we need this: if (flag & H_FORCE) { #ifdef CONFIG_ENV_ACCESS_IGNORE_FORCE printf("## Error: Can't force access to \"%s\"\n", name); #else return 0; #endif } Fixes: 0f036bf4b87e ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set") Signed-off-by: Martin Fuzzey <[email protected]>
2021-04-16env: increment redund flag on read failBrandon Maier
If one of the reads fails when importing redundant environments (a single read failure), the env_flags wouldn't get initialized in env_import_redund(). If a user then calls saveenv, the new environment will have the wrong flags value. So on the next load the new environment will be ignored. While debugging this, I also noticed that env/sf.c was not correctly handling a single read failure, as it would not check the crc before assigning it to gd->env_addr. Having a special error path for when there is a single read failure seems unnecessary and may lead to future bugs. Instead collapse the 'single read failure' error to be the same as a 'single crc failure'. That way env_check_redund() either passes or fails, and if it passes we are guaranteed to have checked the CRC. Signed-off-by: Brandon Maier <[email protected]> CC: Joe Hershberger <[email protected]> CC: Wolfgang Denk <[email protected]> CC: Heiko Schocher <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2021-04-16env: add CONFIG_ENV_SECT_SIZE_AUTORasmus Villemoes
This is roughly the U-Boot side equivalent to commit e282c422e0 (tools: fw_env: use erasesize from MEMGETINFO ioctl). The motivation is the case where one has a board with several revisions, where the SPI flashes have different erase sizes. In our case, we have an 8K environment, and the flashes have erase sizes of 4K (newer boards) and 64K (older boards). Currently, we must set CONFIG_ENV_SECT_SIZE to 64K to make the code work on the older boards, but for the newer ones, that ends up wasting quite a bit of time reading/erasing/restoring the last 56K. At first, I wanted to allow setting CONFIG_ENV_SECT_SIZE to 0 to mean "use the erase size the chip reports", but that config option is used in a number of preprocessor conditionals, and shared between ENV_IS_IN_FLASH and ENV_IS_IN_SPI_FLASH. So instead, introduce a new boolean config option, which for now can only be used with ENV_IS_IN_SPI_FLASH. If left off, there's no change in behaviour. The only slightly annoying detail is that, when selected, the compiler is apparently not smart enough to see that the the saved_size and saved_offset variables are only used under the same "if (sect_size > CONFIG_ENV_SIZE)" condition as where they are computed, so we need to initialize them to 0 to avoid "may be used uninitialized" warnings. On our newer boards with the 4K erase size, saving the environment now takes 0.080 seconds instead of 0.53 seconds, which directly translates to that much faster boot time since our logic always causes the environment to be written during boot. Signed-off-by: Rasmus Villemoes <[email protected]>
2021-04-16env/sf.c: use a variable to hold the sector sizeRasmus Villemoes
As preparation for the next patch, use a local variable to represent the sector size. No functional change. Signed-off-by: Rasmus Villemoes <[email protected]>
2021-04-16arm: dts: k3-j721e-main: Update the speed modes supported and their itap ↵Aswath Govindraju
delay values for MMCSD subsystems According to latest errata of J721e [1], HS400 mode is not supported in MMCSD0 subsystem (i2024) and SDR104 mode is not supported in MMCSD1/2 subsystems (i2090). Therefore, replace mmc-hs400-1_8v with mmc-hs200-1_8v in MMCSD0 subsystem and add a sdhci mask to disable SDR104 speed mode. Also, update the itap delay values for all the MMCSD subsystems according the latest J721e data sheet[2] [1] - https://www.ti.com/lit/er/sprz455/sprz455.pdf [2] - https://www.ti.com/lit/ds/symlink/tda4vm.pdf Fixes: 70e167495ab2 ("arm: dts: k3-j721e: Sync Linux v5.11-rc6 dts into U-Boot") Signed-off-by: Aswath Govindraju <[email protected]>
2021-04-16Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxiTom Rini
This adds support for devices with R40 dual rank DRAM, and asymmetric A64 DRAM devices like the Pinephone/3GB. Also we enable automatic gzipped kernel support, and allow scripted DT overlay support. The rest of the patches are cleanups, but also some sunxi-specific preparatory patches for USB3.0 and improved HDMI support. The bulk of those changes will go through other trees, though. Build-tested for all 156 sunxi boards, and boot tested on a A64, A20, R40, H5, H6 and H616 board. USB, SD card, eMMC, HDMI and Ethernet all work there (where applicable), with the exception of Ethernet on the H5. Since this is already broken in v2021.04, I will send a separate fix.
2021-04-16sunxi: video: select dw-hdmi in Kconfig, not MakefileJernej Skrabec
Currently sunxi Makefile manually specifies full path to dw-hdmi common code. However, that is not needed because it can be selected in Kconfig instead. Select proper symbol in Kconfig and drop path from Makefile. Signed-off-by: Jernej Skrabec <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16sunxi: arm64: Add addresses for compressed kernel loadArnaud Ferraris
The "booti" command to load arm64 Linux kernels supports automatic decompression of zipped kernel images, but relies on some environment variables to point to usable buffer RAM. Add those variables and let them point to some default values, that should cover most use-cases. Signed-off-by: Andre Przywara <[email protected]>
2021-04-16sunxi: binman: Do not hardcode U-Boot load addressSamuel Holland
The FIT description has access to the configuration variables. Use the appropriate variable instead of hardcoding the address. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16sunxi: binman: Respect the default FIT configurationSamuel Holland
binman can fill in the default FIT configuration index as selected by the "default-dt" argument, which is set to CONFIG_DEFAULT_DEVICE_TREE. Let's respect the user's configuration by taking advantage of this feature, instead of always defaulting to the first device tree in CONFIG_OF_LIST. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16clk: sunxi: h6: Add XHCI clocksSamuel Holland
The XHCI controller has its own clock and reset. Add them. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16clk: sunxi: Add a dummy clock driver for the RTCSamuel Holland
The 32kHz clock ("LOSC") on sunxi SoCs is provided by the RTC. It is used, among other things, by the XHCI controller in the H6. To be able to call clk_get_bulk() on the XHCI controller, some device needs to provide all referenced clocks. Since LOSC is a fixed-rate always-on clock, implementation is trivial. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16sunxi: enable dual rank memory on R40Icenowy Zheng
Previously we do not have proper dual rank memory detection on R40 (because we omitted PIR_QSGATE, which does not work on R40 with our configuration), and dual rank memory is just simply disabled as early R40 boards available (Banana Pi M2 Ultra and Berry) have single rank memory. As a board with dual rank memory (Forlinx OKA40i-C) is now known to us, we need to have a way to do memory rank detection to support that board. Add some routine to detect memory rank by trying to access the memory in rank 1 and check for error status of the memory controller, and then enable dual rank memory on R40. Similar routine can be used to detect half DQ width (which is also detected by PIR_QSGATE on other SoCs), but it's left unimplemented because there's no known R40 board with half DQ width now. Signed-off-by: Icenowy Zheng <[email protected]> Reviewed-by: Andre Przywara <[email protected]> [Andre: Move R40 detect code call into sunxi_dram_init()] Signed-off-by: Andre Przywara <[email protected]>
2021-04-16sunxi: support asymmetric dual rank DRAM on A64/R40Icenowy Zheng
Previously we have known that R40 has a configuration register for its rank 1, which allows different configuration than rank 0. Reverse engineering of newest libdram of A64 from Allwinner shows that A64 has this register too. It's bit 0 (which enables dual rank in rank 0 configuration register) means a dedicated rank size setup is used for rank 1. Now, Pine64 scheduled to use a 3GiB LPDDR3 DRAM chip (which has 2GiB rank 0 and 1GiB rank 1) on PinePhone, that makes asymmetric dual rank DRAM support necessary. Add this support. The code could support both A64 and R40, but because dual rank detection is broken on R40 now, we cannot really use it on R40 currently. Signed-off-by: Icenowy Zheng <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Tested-by: Peter Robinson <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-16sunxi: add fdtoverlay_addr_r environment variableJernej Skrabec
Commit 69076dff2284 ("cmd: pxe: add support for FDT overlays") added support for loading DT overlay files to PXE boot. However, it needs additional environment variable which points to memory location which can be used to temporary store overlay data. Add it and in the process unify alignment using spaces and fix comment. Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2021-04-15Merge branch '2021-04-14-assorted-vboot-improvements'Tom Rini
- Add ECDSA support to FIT images - Improve FIT image loadables (incl fpga) support - Further FIT improvements with SPL
2021-04-15Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
update ls1028aqds networking protocol, config in ls1021atwr, env in ls1012a Add seli3 board support, booke watchdog, update eTSEC support in ppc-qemu Add DM_SERIAL and lpuart in sl28, add DM_ETH support for some of powerpc platforms Signed-off-by: Priyanka Jain <[email protected]>
2021-04-15Merge https://source.denx.de/u-boot/custodians/u-boot-x86Tom Rini
- Minor fix to Apollo Lake devicetree bindings for FSP - Refactor Designware PCIe drivers to core and SoC parts - Add Amlogic Meson Designware PCIe controller driver
2021-04-15configs: T1042D4RDB: enable DM_ETHCamelia Groza
Enable DM_ETH and DM_MDIO for the T1042D4RDB. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: t1042d4rdb: add FMan v3 nodesCamelia Groza
Add the FMan v3 nodes for the T1042D4RDB. The nodes are copied over with little modification from the Linux kernel source code. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: t1042: add QorIQ DPAA 1 FMan v3 nodesCamelia Groza
Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T1042 SoC. The device tree nodes are copied over with little modification from the Linux kernel source code. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15configs: T4240RDB: enable DM_ETHCamelia Groza
Enable DM_ETH and DM_MDIO for the T4240RDB. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: qoriq: update the mdio offsets under the second FMan v3Camelia Groza
When two FMan's are present on a board, the MDIO nodes are found at the same offsets inside each FMan. This causes "non unique device name" errors when registering the MDIO nodes under the second FMan. Fix this by updating the offsets of the MDIO nodes to include the parent FMan's offset. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: t4240rdb: add FMan v3 nodesCamelia Groza
Add the FMan v3 nodes for the T4240RDB. The nodes are copied over with little modification from the Linux kernel source code. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: t4240: add QorIQ DPAA 1 FMan v3 nodesCamelia Groza
Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T4240 SoC. The device tree nodes are copied over with little modification from the Linux kernel source code. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15configs: T2080RDB: enable DM_ETHCamelia Groza
Enable DM_ETH and DM_MDIO for the T2080RDB. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15board: freescale: t208xrdb: fdt fixups under DM_ETHCamelia Groza
Disable the FMan mEMAC 5 and 6 nodes from the fdt since they are not available under the supported RCW. Also disable the associated "fsl,dpa-ethernet" nodes that reference them. This is a simplified version of the fdt_fixup_fman_ethernet call for use under DM_ETH. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: t2080rdb: add FMan v3 nodesCamelia Groza
Add the FMan v3 nodes for the T2080RDB. The nodes are copied over with little modification from the Linux kernel source code. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15powerpc: dts: t2080: add QorIQ DPAA 1 FMan v3 nodesCamelia Groza
Add the QorIQ DPAA 1 FMan v3 device tree nodes for the T2080 SoC. The device tree nodes are copied over with little modification from the Linux kernel source code. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15ls1012a: use default scan_dev_for_bootMian Yousaf Kaukab
scan_dev_for_efi is supposed to be called from scan_dev_for_boot. However, this call is missing for ls1012a boards. As a result EFI boot doesn’t work. Fix this issue by removing custom definition of scan_dev_for_boot and use the default definition instead. Signed-off-by: Mian Yousaf Kaukab <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15board: sl28: add config to enable console output on SER0Michael Walle
Sometimes it is desireable to have the console output on the first serial line. Introduce a configuration option for it (in the board scope). Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15board: sl28: enable DM_SERIALMichael Walle
With all preparations in place, switch over to DM_SERIAL. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15board: sl28: move DM_* configs to KconfigMichael Walle
Move the CONFIG_DM_* from the defconfig to the TARGET_SL28 config. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15armv8: fsl-layerscape: spl: call spl_early_init()Michael Walle
DM_SERIAL needs both the device tree as well as an early heap. Thus, we have to call spl_early_init() to initialize the memory allocator and the setup the device tree. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15armv8: fsl-layerscape: spl: add debug UART supportMichael Walle
To use the debug UART we have to call debug_uart_init() in the SPL. Do so as soon as possible. As an example, here is how you can use it on a LS1028A SoC: CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_BASE=0x21c0500 CONFIG_DEBUG_UART_CLOCK=200000000 Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2021-04-15freescale: ls1021atwr: Drop use of CONFIG_RESETSimon Glass
It is not recommended to use CONFIG_xxx defines for things which are not Kconfig options. Rename this. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>