summaryrefslogtreecommitdiff
path: root/arch/arm/lib
AgeCommit message (Collapse)Author
2018-09-26MLK-19726-2 arm: Don't remove all devices when power domain driver is enabledYe Li
Because we power off all devices in board_quiesce_devices which is prior then executing dm_remove_devices_flags. So any access to HW in dm_remove_devices_flags will cause problem. However, some drivers like ethernet which implements the pre_remove callback is always called without any flags check, and this finally accesses FEC controller. Since we don't need to remove all devices in u-boot before starting kernel, disable this feature when power domain is enabled. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27MLK-10647 armv7: Fix Dcache disable issue on i.MX7Ye.Li
The issue on the i.MX7D is that, there is one cache-able memory access between the L1 and L2 cache flush by calling the flush_dache_all-> v7_maint_dcache_all() [Flush L1 and L2 cache) which written in the C code. L1-cache-flush -> This will flush L1 cache to L2 cache in the end. Cache-able memory access -> This will have the chance cause the L1 line-fill with dirty data from L2 cache(L1 cache-line dirty, L2 clean) L2-cache-flush -> This will only flush L2 cache to L3, but still some dirty data on the L1 cacheline. After C & M bit clean, -> The dirty data on the L1 cache line lost, which will cause memory coherent issue if that dirty cache line has some useful data This patch should works fine on the i.MX6 and i.MX7. The second cache flush have zero impact on the i.MX6, but this is really need for the i.MX7D platform due to the L1 line-fill during the first dcache_flush. And the second flush will not bring in the L1 dirty cache line due to the C bit is clear now, which means the dcache is disabled. Acked-by: Jason Liu<r64343@freescale.com> Reviewed-by: Jason Liu<r64343@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com> (cherry picked from commit f5d5f07fba936c4bb05c887de9d72fb75b3dc0f2) (cherry picked from commit 86c784cf4c4b633d37a76de7d47155c08f75dc82) (cherry picked from commit d85cd484e6825631aa1ab572e5e0539f2191d795) (cherry picked from commit 2b29c1873c2293abe1c4b361392521223b9c9ecf) (cherry picked from commit 3eaf56494f3000f841531e8c219cf3dd9ca024f7)
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-23arm64: show_regs: Dump the LRs HW valuesKarl Beldan
These were dropped in [1], after relocation, for their values offset by reloc_off. Unconditionally show the HW values and add a '(reloc)' hint for the offset values showed after relocation. Also, the LRs' dumps are now formatted the same way the other regs' are. [1] Commit 082693f4 ("arm64 :show_regs: show the address before relocation") Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com>
2018-02-14arm/PSCI: support PSCI versions greater than 1.0Andre Heider
ATF recently began announcing PSCI v1.1. Since that version is unknown to u-boot, the PSCI device nodes were not updated. Switch from the case statement to a greater/less-than comparison so that v1.1, as well as future versions, get at least the compatible nodes of known versions. PSCI v1.1 doesn't seem to have introduced a new corresponding compatible. Signed-off-by: Andre Heider <a.heider@gmail.com>
2018-02-13ARM: image: indent with tab instead of 4 spacesMasahiro Yamada
Commit 6808ef9ac2a6 ("move booti_setup to arch/arm/lig/image.c") not only moved the code, but also replaced a tab with 4 spaces to break the Linux coding style. Restore tab indentation. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Chen <bin.chen@linaro.org>
2018-02-10efi_loader: fix building crt0 on armHeinrich Schuchardt
Before the patch an undefined constant EFI_SUBSYSTEM was used in the crt0 code. The current version of binutils does not swallow the error. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888403 The necessary constant IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in pe.h. So let's factor out asm-generic/pe.h for the image subsystem constants and use it in our assembler code. IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER does not exist in the specification let's use IMAGE_SUBSYSTEM_EFI_ROM instead. The include pe.h is only used in code maintained by Alex so let him be the maintainer here too. Reported-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Vagrant Cascadian <vagrant@debian.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-02-07move booti_setup to arch/arm/lig/image.cBin Chen
Follow bootz's pattern by moving the booti_setup to arch/arm/lib. This allows to use booti_setup in other paths, e.g booting an Android image containing Image format. Note that kernel relocation is move out of booti_setup and it is the caller's responsibility to do it and allows them do it differently. say, cmd/booti.c just do a manually, while in the bootm path, we can use bootm_load_os(with some changes). Signed-off-by: Bin Chen <bin.chen@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-01-28arm: bootm-fdt.c: fix compiler warningHeiko Schocher
compiling U-Boot with bosch_mpcxxxxd_sd_defconfig drops warning: arch/arm/lib/bootm-fdt.c: In function ‘arch_fixup_fdt’: arch/arm/lib/bootm-fdt.c:37:6: warning: unused variable ‘ret’ [-Wunused-variable] int ret = 0; ^~~ Fix it. Signed-off-by: Heiko Schocher <hs@denx.de>
2018-01-22efi_selftest: test start imageHeinrich Schuchardt
This pair of tests checks the StartImage boot service. Each test loads an EFI application into memory and starts it. One returns by calling the Exit boot service. The other returns directly. The tests are not built on x86_64 because the relocation code for the efi binary cannot be created. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-12ARM: bootm: don't assume sp is in DRAM bank 0Stephen Warren
arch_lmb_reserve() currently assumes that the stack pointer is within DRAM bank 0. This is not necessarily true. Enhance the code to search through DRAM banks until the bank that does contain SP is found, and then reserve the tail of that bank. Fixes: 2d1916e48bd8 ("ARM: add flat device tree support") Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
2018-01-12ARMv8: Allow dynamic early stack pointerStephen Warren
U-Boot typically uses a hard-coded value for the stack pointer before relocation. Implement option SYS_INIT_SP_BSS_OFFSET to instead calculate the initial SP at run-time. This is useful to avoid hard-coding addresses into U-Boot, so that can be loaded and executed at arbitrary addresses and thus avoid using arbitrary addresses at runtime. This option's value is the offset added to &_bss_start in order to calculate the stack pointer. This offset should be large enough so that the early malloc region, global data (gd), and early stack usage do not overlap any appended DTB. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2017-12-24arm: Add support of updating dts before fix-upPrabhakar Kushwaha
"ethernet" node fix-up for device tree happens before Linux boot. There can be requirement of updating "ethernet" node even before fix-up. So, add support of updating "ethernet" node. Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2017-12-16efi_loader: helloworld.c: Reduce file sizeAlexander Graf
The efi linker script includes sections needed for the dynamic linker. However, in our EFI application environment we don't have a dynamic linker. So let's remove them. That way we save on 4k padding and reduce the file size of the hello world efi binary from ~4k to ~1k. Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-07armv8: fix gd after relocationYork Sun
Commit 21f4486faa5d ("armv8: update gd after relocate") sets x18 without checking the return value of spl_relocate_stack_gd(). Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: York Sun <york.sun@nxp.com> CC: Kever Yang <kever.yang@rock-chips.com> CC: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-12-04arm64 :show_regs: show the address before relocationPeng Fan
After relocation, when error happends, it is hard to track ELR and LR with asm file objdumped from elf file. So subtract the gd->reloc_off the reflect the compliation address. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-21arm: provide a PCS-compliant setjmp implementationPhilipp Tomsich
The previous setjmp-implementation (as a static inline function that contained an 'asm volatile' sequence) was extremely fragile: (some versions of) GCC optimised the set of registers. One critical example was the removal of 'r9' from the clobber list, if -ffixed-reg9 was supplied. To increase robustness and ensure PCS-compliant behaviour, the setjmp and longjmp implementation are now in assembly and closely match what one would expect to find in a libc implementation. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Andy Yan <andy.yan@rock-chips.com>
2017-11-21arm: boot0 hook: move boot0 hook before '_start'Philipp Tomsich
The boot0 hook on ARM does not insert its payload before the vector table. This is both a mismatch with thec comment above it and contradict usage of the boot0 hook on ARM64. To fix this (and unify the semantics for ARM and ARM64), we change the boot0-hook semantics on ARM to match those on ARM64: (1) if a boot0-hook is present it is inserted at the start of the image (2) if a boot0-hook is present, emitting the ARM vector table (and the _start) symbol are suppressed in vectors.S and the boot0-hook has full control over where and when it wants to emit these Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-11-17armv8: update gd after relocateKever Yang
We need to update gd in assamble code after relocate, this is a fix to: adc421e arm: move gd handling outside of C code Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-11-17arm64: support running at addr other than linked toStephen Warren
This is required in the case where U-Boot is typically loaded and run at a particular address, but for some reason the RAM at that location is not available, e.g. due to memory fragmentation loading other boot binaries or firmware, splitting an SMP complex between various different OSs without using e.g. the EL2 second-stage page tables to hide the memory asignments, or due to known ECC failures. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2017-10-12Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini
2017-10-09armv8: layerscape: Enable falcon bootYork Sun
Add jump_to_image_linux() for arm64. Add "noreturn" flag to armv8_switch_to_el2(). Add hooks to fsl-layerscape to enable falcon boot. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Łukasz Majewski <lukma@denx.de> Tested-by: Łukasz Majewski <lukma@denx.de>
2017-10-08ARMv8: fix error in freeing stack framezijun_hu
relocate_code() allocates 32 bytes stack frame but only 16 bytes are freed before return. it will cause errors to possible previous frames and doesn't make relocate_code() look like a function. fix by freeing 32 bytes stack space Signed-off-by: zijun_hu <zijun_hu@htc.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-08ARMv8: get new GD address from gd->new_gd directlyzijun_hu
the new GD address is calculated via board data BD currently it require the new GD area locates below BD tightly, so a strict constraint is imposed on memory layout which maybe make special platform unpleasant. fix it by getting new GD address from gd->new_gd directly. Signed-off-by: zijun_hu <zijun_hu@htc.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-13armv8: TPL_STACK will always be defined, so test CONFIG_TPL_NEEDS_SEPARATE_STACKPhilipp Tomsich
Now that TPL_STACK has been moved off the whitelist (ok, I'm lying: the 'moving off the whitelist' part comes in once moveconfig runs... which will be a few commits down the line) and added to Kconfig, we need to test CONFIG_TPL_NEEDS_SEPARATE_STACK to see whether the value from TPL_STACK should be used or whether we try to inherit whatever SPL uses. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13armv8: spl: Support separate stack for TPLPhilipp Tomsich
To allow a TPL and SPL to run from different addresses/memories, we need to split setup of the TPL and SPL stacks. To do so, we introduce CONFIG_TPL_STACK (not listed in Kconfig) which can be used to override the initial stack pointer for TPL. To provide backward compatibility for existing boards, this is added as an optional configuration item and the normal search order (i.e. SPL_STACK, then SYS_STACK) apply if not defined. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-06-29Revert "armv7m: Disable D-cache when booting nommu(ARMv7M) Linux kernel"Tom Rini
The author of the commit discovered later on that this was already being done in cleanup_before_linux() on arch/arm/cpu/armv7m/cpu.c. This reverts commit 8f079cccb369995e46a2ab530d5d60b88c1e70bb. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-06-12ARM: provide a valid exception stack address for startup codeLothar Waßmann
Create exception stack in IRAM if available to facilitate debugging of pre-relocation code by catching exceptions rather than stopping dead. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
2017-06-12arm: adjust PC displayed in exception handlers to point to the failing ↵Lothar Waßmann
instruction Adjust the program counter register to point to the failing instruction depending on the exeption type. This makes it easier to localize the offending instruction leading to a fatal exception. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
2017-06-12ARM: remove bogus cp_delay() functionLothar Waßmann
The cp_delay() function was introduced because of a missing 'volatile' attribute to the 'asm' statement in get_cr() which led to the 'mrc' instruction in get_cr() being optimised out eventually. This has been fixed in commit 53fd4b8c22bb ("arm: mmu: Add missing volatile for reading SCTLR register") but the bogus cp_delay() function which was introduced as a workaround for the malfunctioning get_cr() was never removed. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
2017-06-10Merge git://git.denx.de/u-boot-dmTom Rini
2017-06-09armv7m: Disable D-cache when booting nommu(ARMv7M) Linux kerneltnishinaga.dev@gmail.com
Disable D-Cache is required when booting nommu Linux kernel. (please see Linux kernel source "arch/arm/kernel/head-nommu.S") U-Boot is enabled D-cache and I-Cache at startup. However, it does not disable D-Cache before booting nommu Linux kernel. Therefore, I call dcache_disable() when the CPU is ARMv7M to fix this problem. Signed-off-by: Toshifumi NISHINAGA <tnishinaga.dev@gmail.com>
2017-06-09arm: Disable LPAE if not enabledSimon Glass
If CONFIG_ARMV7_LPAE is not defined we should make sure that the feature is disabled. This can happen if U-Boot is chain-loaded from another boot loader which does enable LPAE. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-09arm: Don't try to support CONFIG_ARMV7_LPAE on ARMv4TSimon Glass
At present if CONFIG_ARMV7_LPAE is defined then mmu_setup() will use instructions which are invalid on ARMv4T. This happens on Tegra since it has an ARMv4T boot CPU. Add a check for the architecture version to allow the code to be built. It will not actually be executed by the boot CPU, but needs to compile. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-09arm: Rename HCTR to HTCRSimon Glass
This appears to be a typo. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05arm: Add Kconfig symbols used for Linux asm compatibilityPhil Edworthy
Rather than change asm files that come from Linux, add the symbols to Kconfig. Since one of the symbols is for thumb2 builds, make CPU_V7M always select them. Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
2017-06-05arm: Add declarations to avoid needing to include headersSimon Glass
At present common.h includes various ARM-specific headers. In preparation for dropping this, add a few explicit declarations. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05arm: Add explicit include of <asm/mach-types.h>Simon Glass
Rather than relying on common.h to provide this include, which is going away at some point, include it explicitly in each file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-06-01dm: Use dm.h header when driver mode is usedSimon Glass
This header includes things that are needed to make driver build. Adjust existing users to include that always, even if other dm/ includes are present Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-17armv8: fsl: move ccn504 code into FSL MakefileAndre Przywara
The generic ARMv8 assembly code contains routines for setting up a CCN interconnect, though the Freescale SoCs are the only user. Link this code only for Freescale targets, this saves some precious bytes in the chronically tight SPL. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2017-05-17armv8: SPL: only compile GIC code if neededAndre Przywara
Not every SoC needs to set up the GIC interrupt controller, so link think code only when the respective config option is set. This shaves off some bytes from the SPL code size. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-05-11spl: fdt: support for fdt fixup for falcon bootB, Ravi
Adding support for fdt fixup to update the memory node in device tree for falcon boot. This is needed for single stage or falcon bootmode, to pass memory configuration to kernel through DT memory node. Signed-off-by: Ravi Babu <ravibabu@ti.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2017-05-08spl: make image arg or fdt blob address reconfigurableVikas Manocha
At present fdt blob or argument address being passed to kernel is fixed at compile time using macro CONFIG_SYS_SPL_ARGS_ADDR. FDT blob from different media like nand, nor flash are copied to the address pointed by the macro. The problem is, it makes args/fdt blob compulsory to copy which is not required in cases like for NOR Flash. This patch removes this limitation. Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
2017-04-27arm/lib/bootm.c: keep ARM v7M in thumb mode during boot_jump_linux()Patrice Chotard
On ARM v7M, the processor will return to ARM mode when executing a blx instruction with bit 0 of the address == 0. Always set it to 1 to stay in thumb mode. Tested on STM32f746-disco board Similar commit: f99993c10882f7dc8ec35993d5febe59aac01e6a Author: Matt Porter <mporter@konsulko.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-04-18ARM: adjust arm-smccc code for use in U-BootMasahiro Yamada
Adjust ARM SMC Calling Convention code for U-Boot: - Replace the license block with SPDX - Change path to asm-offsets.h - Define UNWIND() as no-op - Add Kconfig entry - Add asm-offsets Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-04-08armv7m: add instruction & data cache supportVikas Manocha
This patch adds armv7m instruction & data cache support. Signed-off-by: Vikas Manocha <vikas.manocha@st.com> cc: Christophe KERELLO <christophe.kerello@st.com>
2017-04-06Remove various unused interrupt related codeTom Rini
With d53ecad92f06 some unused interrupt related code was removed. However all of these options are currently unused. Rather than migrate some of these options to Kconfig we just remove the code in question. The only related code changes here are that in some cases we use CONFIG_STACKSIZE in non-IRQ related context. In these cases we rename and move the value local to the code in question. Fixes: d53ecad92f06 ("Merge branch 'master' of git://git.denx.de/u-boot-sunxi") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-04-04arm: bootm: Add dm_remove_devices_flags() call to announce_and_cleanup()Stefan Roese
This patch adds a call to dm_remove_devices_flags() to announce_and_cleanup() so that drivers that have one of the removal flags set (e.g. DM_FLAG_ACTIVE_DMA_REMOVE) in their driver struct, may do some last-stage cleanup before the OS is started. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>