summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-10-31env: Always use char for default_environmentMarek Behún4-8/+8
Sometimes we use uchar and sometimes char for the default environment array. By always using char, we can get rid of some explicit casts. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31board: freescale: various boards: Let env subsystem set gd->env_addrMarek Behún8-29/+0
Various freescale boards set gd->env_addr to default_environment in board_init(), conditional on CONFIG_ENV_IS_NOWHERE, but this is redundant, since it is done by env_init() before board_init() is called. Let the env subsystem handle this. Signed-off-by: Marek Behún <marek.behun@nic.cz> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Cc: Mian Yousaf Kaukab <ykaukab@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31board: synquacer: developerbox: Don't set gd->env_addr to default_environmentMarek Behún1-2/+0
This board sets gd->env_addr to default_environment in board_init(), but the board has environment in SPI flash according to defconfig. Let the env API handle environment automatically. Signed-off-by: Marek Behún <marek.behun@nic.cz> Cc: Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: flash: Cosmetic fixMarek Behún1-1/+1
Change tab to space in env_flash_init(). Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: flash: Let generic env_init() assign default environmentMarek Behún1-3/+0
env_flash_init() (both implementations) assigns default environment if ENV_INVALID, but this is done in the generic env_init() function, which calls this initializer, so drop it from here. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: nowhere: Cosmetic fixMarek Behún1-2/+2
Use spaces instead of tabs in assignments, since there are no lines to align assignment values to. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: nowhere: Let generic env_init() assign default environmentMarek Behún1-1/+0
env_nowhere_init() assigns default environment if ENV_INVALID, but this is done in the generic env_init() function, which calls this initializer, so drop it from here. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: nvram: Cosmetic fix in env_nvram_init()Marek Behún1-2/+2
Use spaces consistently in assignments instead of tabs. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: nvram: Let generic env_init() assign default environmentMarek Behún1-2/+1
env_nvram_init() assigns default environment if ENV_INVALID, but this is done in the generic env_init() function, which calls this initializer, so drop it from here. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: nand: Put ENV_INVALID into gd->env_valid if default environmentMarek Behún1-2/+1
env_nand_init() says the environment is valid even if it is assigning default environment due to not being able to access nand pre-reloaction (determined by macro values). Change this to ENV_INVALID and let the generic env_init() function, which calls this initializer, assign the default environment. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: sf: Put ENV_INVALID into gd->env_valid on CRC failureMarek Behún1-2/+1
env_sf_init_addr() says the environment is valid even if it is assigning default environment due to CRC failure. Change this to ENV_INVALID and let the generic env_init() function, which calls this initializer, assign the default environment. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: sf: Use ENV_VALID enum names instead of literalsMarek Behún1-2/+2
The function env_sf_init_addr() assigns number literals (1) instead of ENV_VALID to gd->env_valid. Fix this. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31env: sf: Cosmetic fix in env_sf_init_addr()Marek Behún1-2/+2
In the if clause we use tabs and in the else clause spaces. Let's use spaces in the if clause too. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31x86: Fix linking u-boot with ld.lldAlistair Delva1-0/+3
When linking the final u-boot binary with LLD, the following link errors are seen: ld.lld: error: can't create dynamic relocation R_386_32 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in arch/x86/cpu/start.o >>> referenced by arch/x86/cpu/start.o:(.text.start+0x32) [...] >>> defined in arch/x86/cpu/start16.o >>> referenced by arch/x86/cpu/start16.o:(.start16+0x1C) According to Nick Desaulniers: "This is a known difference between GNU and LLVM linkers; the GNU linkers permit relocations in readonly segments (making them not read only), LLVM does not (by default)." Since U-Boot apparently seems to use relocations in readonly segments, change the global linker flags to permit them when linking with LLD by specifying '-z notext'. Signed-off-by: Alistair Delva <adelva@google.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31sandbox: Migrate ARCH_MAP_SYSMEM to KconfigTom Rini2-1/+3
Move this from a hard-coded define in config.mk to Kconfig. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31binman: Allow timeout to occur in the image or its sectionSimon Glass1-2/+1
At present testThreadTimeout() assumes that the expected timeout happens first when building the section, but it can just as easily happen at the top-level image. Update the test to cope with both. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2021-10-31image.h: make image_sign_info.fit point to constHannu Lounento2-2/+2
The data blob apparently does not need to be modified through the fit field of the image_sign_info struct so make it point to const to avoid the need to cast away constness in functions that assign a pointer to const data to the field. fit_image_setup_verify already had to cast away constness as it assigned a const void * argument to the field. The cast can now be removed. Signed-off-by: Hannu Lounento <hannu.lounento@vaisala.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31Merge branch '2021-10-31-assorted-platform-updates'Tom Rini99-189/+4434
- Revert GIC LPI changes that need to be reworked. - mvebu SATA booting bugfix - Samsung Galaxy S9/S9+(SM-G96x0), Samsung Galaxy A and Apple M1 platform support.
2021-10-31board: samsung: add support for Galaxy A series of 2017 (a5y17lte)Dzmitry Sankouski13-0/+316
Samsung Galaxy A3, A5, A7 (2017) - middle class Samsung smartphones. U-boot can be used as chain-loaded bootloader to gain control on booting vanilla linux(and possibly others) kernels Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
2021-10-31SoC: exynos: add support for exynos 78x0Dzmitry Sankouski9-0/+889
Samsung Exynos 7880 \ 7870 - SoC for mainstream smartphones and tablets introduced on March 2017. Features: - 8 Cortex A53 cores - ARM Mali-T830 MP3 GPU - LTE Cat. 7 (7880) or 6 (7870) modem Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
2021-10-31pinctrl: exynos: add support for multiple pin banksDzmitry Sankouski1-6/+22
Iterate all pin banks to find a pin Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
2021-10-31serial: samsung: add support for skip debug init in s5pDzmitry Sankouski1-0/+3
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
2021-10-31board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) boardDzmitry Sankouski12-7/+220
Samsung S9 SM-G9600 - Snapdragon SDM845 version of the phone, for China \ Hong Kong markets. Has unlockable bootloader, unlike SM-G960U (American market version), which allows running u-boot as a chain-loaded bootloader. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2021-10-31SoC: qcom: add support for SDM845Dzmitry Sankouski7-0/+312
Hi-end qualcomm chip, introduced in late 2017. Mostly used in flagship phones and tablets of 2018. Features: - arm64 arch - total of 8 Kryo 385 Gold / Silver cores - Hexagon 685 DSP - Adreno 630 GPU Tested only as second-stage bootloader. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Tom Rini <trini@konsulko.com> Cc: Stephan Gerhold <stephan@gerhold.net>
2021-10-31clocks: qcom: add clocks for SDM845 debug uartDzmitry Sankouski3-1/+95
Allows to change clock frequency of debug uart, thus supporting wide range of baudrates. Enable / disable functionality is not implemented yet. In most use cases of SDM845 (i.e. mobile phones and tablets) it's not needed, because qualcomm first stage bootloader leaves it initialized, and on the other hand there's no possibility to replace signed first stage bootloader with u-boot. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2021-10-31pinctrl: qcom: add pinctrl and gpio drivers for SDM845 SoCDzmitry Sankouski5-3/+54
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Stephan Gerhold <stephan@gerhold.net> [trini: Add CONFIG_SDM845 around sdm845_data usage]
2021-10-31spmi: msm: add arbiter version 5 supportDzmitry Sankouski2-50/+105
Currently driver supports only version 1 and 2. Version 5 has slightly different registers structure Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2021-10-31serial: qcom: add support for GENI serial driverDzmitry Sankouski5-0/+639
Generic Interface (GENI) Serial Engine (SE) based uart can be found on newer qualcomm SOCs, starting from SDM845. Tested on Samsung SM-G9600(starqltechn) by chain-loading u-boot with stock bootloader. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2021-10-31doc: board: apple: Add Apple M1 documentationMark Kettenis3-0/+69
Provide preliminary instructions on how to get U-Boot to run on Apple Silicon Macs. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31arm: dts: apple: Add preliminary device treesMark Kettenis8-0/+835
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed. The device trees in this commit are based on the initial Apple M1 device trees from Linux 5.13, nodes for dart, pcie, pinctrl, pmgr, usb based on bindings on track for inclusion in Linux 5.15 and 5.16 and nodes for i2c, mailbox, nvme, pmu, spmi and watchdog that don't have a proposed binding yet. These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31iommu: Add Apple DART driverMark Kettenis4-0/+71
The DART is an IOMMU that is used on Apple's M1 SoC. This driver configures the DART such that it operates in bypass mode which is enough to support DMA for the USB3 ports integrated on the SoC. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31serial: s5p: Add Apple M1 supportMark Kettenis5-24/+130
Apple M1 SoCs include an S5L UART which is a variant of the S5P UART. Add support for this variant and enable it by default on Apple SoCs. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31arm: apple: Add initial support for Apple's M1 SoCMark Kettenis9-0/+283
Add support for Apple's M1 SoC that is used in "Apple Silicon" Macs. This builds a basic U-Boot that can be used as a payload for the m1n1 boot loader being developed by the Asahi Linux project. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Add MAINTAINERS entry]
2021-10-31test: Add tests for IOMMU uclassMark Kettenis10-0/+60
Add a set of tests for the IOMMU uclass. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31iommu: Add IOMMU uclassMark Kettenis9-0/+299
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU. This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-31arm: mvebu: Fix booting from SATAPali Rohár1-2/+2
Use proper SATA macro for boot_device switch in spl_boot_device() function. Signed-off-by: Pali Rohár <pali@kernel.org> Fixes: 2226ca173486 ("arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header")
2021-10-31Revert "arch: arm: use dt and UCLASS_SYSCON to get gic lpi details"Michael Walle5-64/+38
Stop using the device tree as a source for ad-hoc information. This reverts commit 2ae7adc659f7fca9ea65df4318e5bca2b8274310. Signed-off-by: Michael Walle <michael@walle.cc> [trini: Also make board/broadcom/bcmns3/ns3.c fail clearly now] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-10-31Revert "arm64: Layerscape: Survive LPI one-way reset workaround"Tom Rini5-41/+1
Ad-hoc bindings that are not part of the upstream device tree / bindings are not allowed in-tree. Only bindings that are in-progress with upstream and then re-synced once agreed upon are. This reverts commit af288cb291da3abef6be0875527729296f7de7a0. Cc: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Reported-by: Michael Walle <michael@walle.cc> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Marc Zyngier <maz@kernel.org>
2021-10-29Merge https://source.denx.de/u-boot/custodians/u-boot-mmcTom Rini7-6/+89
- Fix mmc_switch timeout - Update mmc hwpartitiion command - Support wait_dat0 for Freescale eSDHC/sdhci drivers
2021-10-29mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCIUsama Arif2-0/+15
There are 4 registers (PERIPHID{0-3}) that contain the ID of MCI. For MMCs' with peripheral id 0x02041180 and 0x03041180, H/W flow control needs to be enabled for multi block writes (MMC CMD 18). Signed-off-by: Usama Arif <usama.arif@arm.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-10-29mmc: Fix mmc_switch excessive timeoutKirill Kapranov1-2/+2
Fix branching to avoid premature falling back on a long timeout instead of continuation of the initialization attempt. Clear of the comment to avoid the ambiguity. Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Ye Li <ye.li@nxp.com> Reviewed-by: Marek Behún <marek.behun@nic.cz> Tested-by: Marek Behún <marek.behun@nic.cz> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-10-29cmd: mmc: check whether card is SD or eMMC before hwpartitionJaehoon Chung1-0/+5
It doesn't need to follow more sequence to do the hwparititioning, because SD doesn't support hwpartitioning feature. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-10-29cmd: mmc: Support mmc hwpartition user enh start -Marek Vasut1-4/+29
Add option to extend the hardware partition to the maximum size by using the '-' dash sign instead of $cnt parameter. This is useful in case we want to switch the entire eMMC user area into pSLC mode, especially in case the device may be populated with different size eMMCs. With this change, we do not have to calculate the number of blocks of the user area manually. To switch the pSLC mode for user area, use e.g. the following. WARNING: This is a one-time irreversible change. => mmc hwpartition user enh 0 - wrrel on complete Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-10-29drivers: mmc: Add wait_dat0 support for sdhci driverStephen Carlson2-0/+22
Adds an implementation of the wait_dat0 MMC operation for the DM SDHCI driver, allowing the driver to continue when the card is ready rather than waiting for the worst case time on each MMC switch operation. Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-10-29drivers: mmc: Add wait_dat0 support for Freescale eSDHC driverStephen Carlson1-0/+16
Adds an implementation of the wait_dat0 MMC operation for the Freescale eSHDC driver, allowing the driver to continue when the card is ready rather than waiting for the worst case time on each MMC switch operation. Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-10-28Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini8-36/+76
- mvebu: Fix usage of BIN header arguments (Pali) - mvebu: turris_omnia: Fix MTD partitions order for Linux (Pali) - mvebu: nandpagesize support for kwbimage v1 (Pali)
2021-10-28arm: mvebu: Fix comments about kwbimage structuresPali Rohár2-2/+2
kwbimage v1 is used on more SoCs. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28arm: mvebu: Update name of kwbimage v1 field at offset 0x2-0x3Pali Rohár2-2/+2
At this offset is stored nand page size. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28tools: kwboot: Patch nandpagesize to zero also for v1 imagePali Rohár1-7/+6
kwbimage v1 has also nandpagesize field. So set it to zero for both image versions when image is not signed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28tools: kwbimage: Add support for NAND_PAGE_SIZE command also for v1 imagesPali Rohár2-1/+4
The NAND_PAGE_SIZE command is already supported by mkimage for v0 images, but not for v1 images. A38x and A39x BootROM supports reading NAND flash page size from v1 image in the same way as Kirkwood BootROM from v0 image. It it documented in A38x and A39x Functional Specification. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>