aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-04power: Refactor Makefile rulesSimon Glass
Move the power/ rules into drivers/power to avoid clutter in the Makefile and drivers/Makefile files. We must select SPL_POWER if SPL_POWER_DOMAIN is used, since the two are currently independent and boards do not necessarily enable SPL_POWER. Add a TPL_POWER as well, as that is used by one board. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-09-04power: Add a POWER configSimon Glass
At present we have SPL_POWER but not piain POWER. This works because there is a special build rule in Makefile that always includes the drivers/power directory. It is better to have all driver directories included by drivers/Makefile and there is already a rule in there for this purpose. It just needs a Kconfig for U-Boot proper, so add one. Update the pmic.h header file so that it defines the old pmic struct always, when driver model is not in use. That will avoid build errors for boards which enable POWER but not DM_PMIC. Enable this option always. That seems strange at first sight, but it actually but mimics the current Makefile behaviour. Once we can drop the old PMICs it should be easy enough to rename DM_PMIC to POWWER, or something similar. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04i2c: Convert CONFIG_POWER_I2C et al to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_POWER_I2C CONFIG_POWER_LEGACY They are handled at the same time due to a dependency between them. Update the Makefile rule to use legacy power only in U-Boot proper. Unfortunately a separate rule is needed in SPL to be able to build legacy power. Add SPL related symbols for both, to allow for SPL-only usage. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> [trini: More SPL related cleanups, reword commit message] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-04power: Rename CONFIG_POWER to CONFIG_POWER_LEGACYSimon Glass
This option is used in pre-driver model code and much of it has never been converted to driver model. We want to add a new option to enable power support, so we can use a simple rule in the Makefile. Rename this one, which is really about a particular implementation of power. Also update the pmic.h header file so it either includes the legacy API or the driver model one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-09-04power: Tidy up #undef of CONFIG_DM_PMICSimon Glass
Add a proper Kconfig option for SPL so we can remove the hack in some of the board config files. This involves adding CONFIG_SPL_DM_PMIC to some of the configs as well as updateing the Makefile rule for PMIC_RK8XX to exclude SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> [trini: Add SPL_PMIC_RK8XX, enable when needed, handle undef of CONFIG_DM_PMIC_PFUZE100 as well] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-04gpio: Add a GPIO configSimon Glass
At present we have SPL_GPIO and TPL_GPIO but not piain GPIO. This works because there is a special build rule in Makefile that always includes the drivers/gpio directory. It is better to have all driver directories included by drivers/Makefile and there is already a rule in there for this purpose. It just needs a Kconfig for U-Boot proper, so add one. Enable the option always for now, since this mimics current behaviour. This can be updated once DM_GPIO is used everywhere. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04tegra: gpio: Drop use of CONFIG_xxx variablesSimon Glass
It is not a good idea to use things called CONFIG_xxx in the source code since this prefix is reserved for use by Kconfig. Rename these variables. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04Makefile: Move drivers/dma/ into drivers/MakefileSimon Glass
This rule should not be in the top-level Makefile. Move it, making use of the new LEGACY_DMA Kconfig. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04Convert CONFIG_DMA_LPC32XX to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_DMA_LPC32XX Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04ti: Convert CONFIG_TI_EDMA3 to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_TI_EDMA3 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-09-04dma: Add a Kconfig for legacy DMASimon Glass
We cannot use the existing DMA config for the MCD driver because it is not migrated to driver model. In order to move it to drivers/Makefile we need some sort of option for it. Add a new DMA_LEGACY option, which also acts as a signal that it should be migrated. Enable this for devkit3250 which uses CONFIG_DMA_LPC32XX which is not converted to Kconfig. For now this is not used in the Makefile. That update happens in a following patch. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04Makefile: Unify the rules for BOOTCOUNT_LIMITSimon Glass
Use a single rule that works for all phases. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04sata: Rename SATA_SUPPORT to SATASimon Glass
Rename this options so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04ppc: Rename MPC8XXX_INIT_DDR_SUPPORT to MPC8XXX_INIT_DDRSimon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04Rename CACHE_SUPPORT to CACHESimon Glass
Rename this option so that CONFIG_IS_ENABLED can be used with it. Oddly there is already an SPL_CACHE option. Drop it in favour of this one. Drop the special SPL Makefile rule which is now superfluous. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04spi: Rename SPI_SUPPORT to SPISimon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04serial: Add a SERIAL configSimon Glass
At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This works because there is a special build rule in Makefile that always includes the drivers/serial directory. It is better to have all driver directories included by drivers/Makefile and there is already a rule in there for this purpose. It just needs a Kconfig for U-Boot proper, so add one. It is always enabled, for now, since that mimics the current behaviour. It should be possible to drop the strange 'SERIAL_PRESENT' option at some point and use SERIAL instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04serial: Rename SERIAL_SUPPORT to SERIALSimon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04rtc: Rename RTC_SUPPORT to RTCSimon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04pch: Rename PCH_SUPPORT to PCHSimon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04mmc: Rename MMC_SUPPORT to MMCSimon Glass
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> [trini: Fixup some incorrect renames] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-03Merge branch '2021-09-03-xyz-modem-fixes' into nextTom Rini
- Assorted x/y/z modem fixes from Pali
2021-09-03xyz-modem: Allow to cancel transfer also by CTRL+CPali Rohár
Currently it is possible to cancel loadx and loady commands by pressing CTRL+X (CAN character) at least 3 times quickly. All other U-Boot commands, including loadb and loads can be cancelled by CTRL+C. So allow it also in xyz-modem code used by loadx and loady commands. Implement it by handling CTRL+C (ETX character) in the same way as CTRL+X (CAN character). Due to how x/y-modem protocol works, it is required to press CTRL+C or CTRL+X at least 3 times quickly. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-09-03xyz-modem: Show information about finished transferPali Rohár
Show "## Start Addr" or "## Binary (...) download aborted" information like in Kermit "loadb" command. Signed-off-by: Pali Rohár <pali@kernel.org>
2021-09-03xyz-modem: Properly abort/terminate transfer on errorPali Rohár
Transfer termination tries to instruct sender that transfer was terminated. Print error message and indicates aborted transfer in return value. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-09-03xyz-modem: Close stream after processing/sending terminate sequencePali Rohár
Obviously it is not possible to send terminate sequence over stream after closing stream. Signed-off-by: Pali Rohár <pali@kernel.org>
2021-09-03xyz-modem: Put xyzModem_stream_close debug diagnostic message into ZM_DEBUG()Pali Rohár
This is how all other debug / diagnostic messages are handled. Signed-off-by: Pali Rohár <pali@kernel.org>
2021-09-03xyz-modem: Fix x-modem "xyzModem_eof error" at the end of filePali Rohár
In x-modem protocol EOF is not an error state at the end of file. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-09-03xyz-modem: Fix crash after cancelling transferPali Rohár
Variable xyz.len is set to -1 on error. At the end xyzModem_stream_read() function calls memcpy() with length from variable xyz.len. If this variable is set to -1 then value passed to memcpy is casted to unsigned value, which means to copy whole address space. Which then cause U-Boot crash. E.g. on arm64 it cause CPU crash: "Synchronous Abort" handler, esr 0x96000006 Fix this issue by checking that value stored in xyz.len is valid prior trying to use it. Signed-off-by: Pali Rohár <pali@kernel.org> Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-09-03Revert most of the series for adding vexpress_aemv8r supportTom Rini
Per a request from Andre Przywara and agreed with by Peter Hoyes, the vexpress aemv8r support wasn't quite ready to be merged, but the discussion had moved off list. We should keep the first patch in the series for now, but revert the rest. This reverts the following commits: e0bd6f31ce41 doc: Add documentation for the Arm vexpress board configs 30e5a449e8c7 arm: Use armv8_switch_to_el1 env to switch to EL1 b53bbca63bf4 vexpress64: Add BASER_FVP vexpress board variant 2f5b7b74903f armv8: Add ARMv8 MPU configuration logic 37a757e227cc armv8: Ensure EL1&0 VMSA is enabled Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-02Merge branch '2021-09-02-assorted-platform-and-bugfixes' into nextTom Rini
- Add position independent execution support for ARMv7 - Snapdragon, synquacer, vexpress64 fixes / improvements - Prevent NEON register use on ARMv8 - Other assorted fixes
2021-09-02tools: env: Handle shorter read callsThibault Ferrante
On some cases, the actual number of bytes read can be shorter than what was requested. This can be handled gracefully by taking this difference into account instead of exiting. Signed-off-by: Thibault Ferrante <thibault.ferrante@gmail.com>
2021-09-02psci: fix double declarationOleksandr Suvorov
The prototype of psci_features() duplicated. Remove extra declaration. Fixed: e21e3ffdd1 ("psci: Fix warnings when compiling with W=1") Reported-by: Michael Scott <mike@foundries.io> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2021-09-02pci: iproc: fix compilation errors and warningsBharat Gooty
Signed-off-by: Bharat Gooty <bharat.gooty@broadcom.com>
2021-09-02mailmap: Update e-mail for Jernej SkrabecJernej Skrabec
Old address doesn't exist anymore. Map it to new one. Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Andre Przywara <andre.przywara@arm.com>
2021-09-02ARM: Prevent the compiler from using NEON registersSamuel Holland
For ARMv8-A, NEON is standard, so the compiler can use it even when no special target flags are provided. For example, it can use stores from NEON registers to zero-initialize large structures. GCC 11 decides to do this inside the DRAM init code for the Allwinner H6. However, GCC 11 has a bug where it generates misaligned NEON register stores even with -mstrict-align. Since the MMU is not enabled this early in SPL, the misaligned store causes an exception and breaks booting. Work around this issue by restricting the compiler to using GPRs only, not vector registers. This prevents any future surprises relating to NEON use as well. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Andre Przywara <andre.przywara@arm.com>
2021-09-02doc: Add documentation for the Arm vexpress board configsPeter Hoyes
Create a new documentation section for Arm Ltd boards with a sub-page for the vexpress board (FVP-A, FVP-R and Juno). Document how the armv8_switch_to_el1 environment variable can be used to switch between booting from S-EL2/S-EL1 at runtime on the BASER_FVP. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2021-09-02arm: Use armv8_switch_to_el1 env to switch to EL1Peter Hoyes
Use the environment variable armv8_switch_to_el1 to determine whether to switch to EL1 at runtime. This is an alternative to the CONFIG_ARMV8_SWITCH_TO_EL1 compile-time option. The environment variable will be ineffective if the ARMV8_MULTIENTRY config is used. This is required by the Armv8r64 architecture, which must be able to boot at S-EL1 for Linux but may need to boot at other ELs for other systems. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2021-09-02vexpress64: Add BASER_FVP vexpress board variantPeter Hoyes
The BASER_FVP board variant is implemented on top of the BASE_FVP board config (which, in turn, is based on the Juno Versatile Express board config). They all share a similar memory map - for BASER_FVP the map is inverted from the BASE_FVP (https://developer.arm.com/documentation/100964/1114/Base-Platform/Base---memory/BaseR-Platform-memory-map) * Create new TARGET_VEXPRESS64_BASER_FVP target, which uses the same board config as BASE_FVP and JUNO * Adapt vexpress_aemv8a.h header file to support BASER_FVP (and rename to vexpress_aemv8.h) * Enable config to switch to EL1 for the BASER_FVP * Create vexpress_aemv8r defconfig * Provide an MPU memory map for the BASER_FVP For now, only single core boot is supported. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> [trini: Add MAINTAINERS, move BOOTCOMMAND to defconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-02armv8: Add ARMv8 MPU configuration logicPeter Hoyes
Armv8r64 is the first Armv8 platform that only has a PMSA at the current exception level. The architecture supplement for Armv8r64 describes new fields in ID_AA64MMFR0_EL1 which can be used to detect whether a VMSA or PMSA is present. These fields are RES0 on Armv8a. Add logic to read these fields and, for the protection of the memory used by U-Boot, initialize the MPU instead of the MMU during init, then clear the MPU regions before transition to the next stage. Provide a default (blank) MPU memory map, which can be overridden by board configurations. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2021-09-02armv8: Ensure EL1&0 VMSA is enabledPeter Hoyes
On Armv8-R, the EL1&0 memory system architecture is configurable as a VMSA or PMSA, and resets to an "architecturally unknown" value. Add code to armv8_switch_to_el1_m which detects whether the MSA at EL1&0 is configurable using the id_aa64mmfr0_el1 register MSA fields. If it is we must ensure the VMSA is enabled so that a rich OS can boot. The MSA and MSA_FRAC fields are described in the Armv8-R architecture profile supplement (section G1.3.7): https://developer.arm.com/documentation/ddi0600/latest/ Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2021-09-02armv8: Disable pointer authentication traps for EL1Peter Hoyes
The use of ARMv8.3 pointer authentication (PAuth) is governed by fields in HCR_EL2, which trigger a 'trap to EL2' if not enabled. The reset value of these fields is 'architecturally unknown' so we must ensure that the fields are enabled (to disable the traps) if we are entering the kernel at EL1. The APK field disables PAuth instruction traps and the API field disables PAuth register traps Add code to disable the traps in armv8_switch_to_el1_m. Prior to doing so, it checks fields in the ID_AA64ISAR1_EL1 register to ensure pointer authentication is supported by the hardware. The runtime checks require a second temporary register, so add this to the EL1 transition macro signature and update 2 call sites. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
2021-09-02Revert "configs: synquacer: Make U-Boot binary position independent"Masami Hiramatsu
This reverts commit f7e16bb0c5362c9b01d7e6e96bf6c77fd6b3d89e, since the U-Boot doesn't boot if it is booted directly from SPI-NOR with CONFIG_POSITION_INDEPENDENT=y. Unless fixing this issue, it is better to revert this change. Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2021-09-02lib: add crc16.o if CONFIG_MMC_SPI_CRC_ON for SPL buildAndreas Schwab
CONFIG_MMC_SPI_CRC_ON needs the crc16 functions, but it was not included in an SPL build. For non-SPL builds, crc16.o is already added unconditionally. This also removes CONFIG_SPL_YMODEM_SUPPORT from the sifive board configs, which is only relevant for some ARM boards and was only set for its side effect of adding crc16.o.
2021-09-02cmd/part: correct alignment of partition listHeinrich Schuchardt
When running 'part list' for an ISO partition the numbers are not under the labels. Correct the alignment of the ISO partition list. With the patch the output looks like: Part Start Sect x Size Type 1 3720 5024 512 U-Boot Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-09-02arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr()Stephan Gerhold
The logic in msm_generate_mac_addr() was originally taken from the LK bootloader where the serial number is a string and must be parsed first. However, in U-Boot msm_board_serial() returns an u32 and msm_generate_mac_addr() has quite complicated code that will first print it as a hex string and then immediately parse it again. What this function actually does at the end is to put the serial number encoded as big endian (the order used for the hex string) into the u8 *mac. Use put_unaligned_be32() to do that with bit shifts instead of going through the string format. This should be slightly more efficient and cleaner but does not result in any functional difference. Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-09-02arm: mach-snapdragon: misc: Initialize eMMC if necessaryStephan Gerhold
At the moment U-Boot produces an empty MAC address (02:00:00:00:00:00) if the eMMC is not used by anything in U-Boot (e.g. with CONFIG_ENV_IS_NOWHERE=y instead of having the environment on eMMC). This happens because then there is nothing that actually initializes the eMMC and reads the "cid" that is later accessed. To fix this, call mmc_init() to ensure the eMMC is initialized. There is no functional difference if the eMMC is already initialized since then mmc_init() will just return without doing anything. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2021-09-02armv7: Add Position Independent Execution supportChia-Wei Wang
A U-Boot image could be loaded and executed at a different location than it was linked at. For example, Aspeed takes a stable release version of U-Boot image as the golden one for recovery purposes. When the primary storage such as flash is corrupted, the golden image would be loaded to any SRAM/DRAM address on demands through ethernet/UART/etc and run for rescue. To deal with this condition, the PIE is needed as there is only one signed, golden image, which could be however executed at different places. This patch adds the PIE support for ARMv7 platform. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-09-02arm: Fix option dependency with Kconfig languageChia-Wei Wang
Use Kconfig 'depends on' instead of #if macro to express the option depdencies. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2021-09-02Merge branch '2021-09-02-assorted-fixes' into nextTom Rini
- Drop old OpenSSL support - Add DM_HASH support, use it. - Assorted "stemmy" platform updates - Various bugfixes