aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/boot
AgeCommit message (Collapse)Author
2011-05-02ARM: zImage: direct comparison with pc is not allowed in Thumb2 modeNicolas Pitre
... and recent binutils actually enforces it. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-29ARM: zImage: make sure no GOTOFF relocs are used with .bss symbolsNicolas Pitre
To be able to relocate the .bss section at run time independently from the rest of the code, we must make sure that no GOTOFF relocations are used with .bss symbols. This usually means that no global variables can be marked static unless they're also const. To enforce this, suffice to fail the build whenever a private symbol is allocated to .bss and list those symbols for convenience. The user_stack and user_stack_end labels in head.S were converted into non exported symbols to remove false positives. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-29ARM: zImage: make sure not to relocate on top of the relocation codeNicolas Pitre
If the zImage load address is slightly below the relocation address, there is a risk for the copied data to overwrite the copy loop or cache flush code that the relocation process requires. Always bump the relocation address by the size of that code to avoid this issue. Noticed by Tony Lindgren <tony@atomide.com>. While at it, let's start the copy from the restart symbol which makes the above code size computation possible by the assembler directly, given that we don't need to preserve the code before that point anyway. And therefore we don't need to carry the _start pointer in r5 anymore. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-29ARM: zImage: Fix bad SP address after relocating kernelTony Lindgren
Otherwise cache_clean_flush can overwrite some of the relocated area depending on where the kernel image gets loaded. This fixes booting on n900 after commit 6d7d0ae51574943bf571d269da3243257a2d15db (ARM: 6750/1: improvements to compressed/head.S). Thanks to Aaro Koskinen <aaro.koskinen@nokia.com> for debugging the address of the relocated area that gets corrupted, and to Nicolas Pitre <nicolas.pitre@linaro.org> for the other uncompress related fixes. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-29Revert "ARM: zImage: avoid using the stack in cache_clean_flush"Nicolas Pitre
This reverts commit b4459ba5170430c1370e98c7e0c470a77d7daf83. Some reports indicate this prevents successful boot. Let's use a simpler alternative as proposed for mainline.
2011-04-27ARM: zImage: avoid using the stack in cache_clean_flushNicolas Pitre
With commit 6d7d0ae5 "improvements to compressed/head.S" the code relocates itself, calls cache_clean_flush, and restart from the beginning in order to determine the new stack location amongst other things. But cache_clean_flush in the ARMv7 case was stashing the content of some registers to the old stack location, possibly corrupting the newly relocated code. Let's rework register assignment in cache_clean_flush to avoid stack usage entirely. Thanks to Aaro Koskinen <aaro.koskinen@nokia.com> for investigating this problem. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Tested-by: Tony Lindgren <tony@atomide.com>
2011-04-25Revert "ARM: zImage: fix issues with missing GOT entries for some global ↵Nicolas Pitre
variables" This reverts commit 925f6039cebb771e0143c26bd9c63dfd1fa314db. The whole situation is rather messy and a more comprehensive fix will be required. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-25ARM: zImage: the page table memory must be considered before relocationNicolas Pitre
For correctness, the initial page table located right before the decompressed kernel should be considered when determining if relocation is required. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-25ARM: zImage: don't ignore error returned from decompress()Nicolas Pitre
If decompress() returns an error without calling error(), we must not attempt to boot the resulting kernel. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-25ARM: zImage: make sure the stack is 64-bit alignedNicolas Pitre
With ARMv5+ and EABI, the compiler expects a 64-bit aligned stack so instructions like STRD and LDRD can be used. Without this, mysterious boot failures were seen semi randomly with the LZMA decompressor. While at it, let's align .bss as well. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> CC: stable@kernel.org
2011-04-20ARM: zImage: fix issues with missing GOT entries for some global variablesNicolas Pitre
Many architecture specific versions of uncompress.h make use of global variables marked static. In such case the GOT is bypassed and the code in head.S can't relocate them. Instead of removing the static keyword from all those files and hope that it won't come back, let's simply define it out. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-20ARM: compressed/misc.c: simplify decompress_kernel()Nicolas Pitre
The return value for decompress_kernel() is no longer used. Furthermore, this was obtained and stored in a variable called output_ptr which is a complete misnomer for what is actually the size of the decompressed kernel image. Let's get rid of it. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-20ARM: zImage: no need to get the decompressed size from the filesystemNicolas Pitre
In commit d239b1dc093d the hardcoded 4x estimate for the decompressed kernel size was replaced by the exact Image file size and passed to the linker as a symbol value. Turns out that this is unneeded as the size is already included at the end of the compressed piggy data. For those compressed formats that don't include this data, the build system already takes care of appending it using size_append in scripts/Makefile.lib. So let's use that instead. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-14arm/dt: vexpress: Update basic DT to use skeleton.dtsi file.Grant Likely
Converted .dts file to use skeleton.dtsi, and added 'dtbs' target. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-13ARM: vexpress: add basic dts DT sourceLorenzo Pieralisi
This patch provides a simple device tree source for the Versatile Express board. It just defines memory layout and assigns a compatible string to the board. Compiled blob tested on Versatile Express, passed to the kernel through u-boot. 'chosen' node defined within u-boot to avoid cluttering the default dts configuration. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
2011-04-04arm/dt: Add basic devicetree support to IGEPv2 and v3Grant Likely
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-04-04arm/dt: Add a make rule to build dtb for enabled boardsShawn Guo
With 'make ARCH=arm dtb', it builds Device Tree Blobs for those boards enabled by build CONFIG. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-04-01arm/dt: Add basic device tree support for mx51 and mx53 boardsJason Liu
This patch add support for the Genesi Efika MX Smarttop and Smartbook, the Freescale mx51 babbage board, and the Freescale mx53 loco board Signed-off-by: Jason Liu <jason.hui@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-04-01arm/dt: Add basic device tree support for overoAndy Doan
Enable basic device tree support for Gumstix Overo. tested with Overo Tide COM and Tobi expansion board Signed-off-by: Andy Doan <andy.doan@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-04-01arm/dt: Update basic device tree support for smdkv310 boardThomas Abraham
Add documentation, make dt_match table __initdata, and include the skeleton.dtsi file in the device tree. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-28arm/dt: Add basic device tree support for BeagleboadJon Medhurst
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-28dt/arm: Add basic device tree support for smdkv310 boardThomas Abraham
Enable basic device tree support for Exynos4 smdkv310 board. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-28arm/dt: Add Pandaboard devicetree supportGrant Likely
Enable basic device tree support on Pandaboard Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-03-28arm/dt: Basic tegra devicetree supportGrant Likely
This patch adds adds very basic support for booting tegra with a device tree. It simply allows the existing machine_descs to match against the tegra compatible values so that the kernel can boot. Kernel parameters and the initrd pointer is read out of the tree instead of atags. This is not complete device tree support. This change will be reverted when a new machine_desc is added that can populate the device registrations directly from data in the tree instead of using hard coded data. That change will be made in a future patch. v2: Fixed cut-and-paste error in commit text Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-28arm/dt: Basic versatile devicetree supportGrant Likely
This patch adds adds very basic support for booting versatile with a device tree. It simply allows the existing machine_descs to match against the versatile ab & pb compatible values so that the kernel can boot. Kernel parameters and the initrd pointer is read out of the tree instead of atags. This is not complete device tree support. This change will be reverted when a new machine_desc is added that can populate the versatile device registrations directly from data in the tree instead of using hard coded data. That change will be made in a future patch. v5: - Add skeleton device tree for versatile AB and PB. Bare minimum needed for booting. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-28arm/dt: Add dtb make ruleRob Herring
Add a make rule to compile dt blobs for ARM. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Shawn Guo <shawn.guo@freescale.com> Tested-by: Jason Liu <jason.hui@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-03-28ARM: 6826/1: Merge v6 and v7 DEBUG_LL DCC supportStephen Boyd
The inline assembly differences for v6 vs. v7 are purely optimizations. On a v7 processor, an mrc with the pc sets the condition codes to the 28-31 bits of the register being read. It just so happens that the TX/RX full bits the DCC support code is testing for are high enough in the register to be put into the condition codes. On a v6 processor, this "feature" isn't implemented and thus we have to do the usual read, mask, test operations to check for TX/RX full. Thus, we can drop the v7 implementation and just use the v6 implementation for both. Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> (cherry picked from commit dfad549d98b60160547d1b8299051b9456c8da85)
2011-03-16Merge branch 'v6v7' into develRussell King
Conflicts: arch/arm/include/asm/cacheflush.h arch/arm/include/asm/proc-fns.h arch/arm/mm/Kconfig
2011-03-16Merge branch 'misc' into develRussell King
Conflicts: arch/arm/Kconfig
2011-03-16Merge branches 'at91', 'ep93xx', 'errata', 'footbridge', 'fncpy', 'gemini', ↵Russell King
'irqdata', 'pm', 'sh', 'smp', 'spear', 'ux500' and 'via' into devel
2011-03-09ARM: 6778/1: compressed/head.S: make LDFLAGS_vmlinux into a recursively ↵Nicolas Pitre
expanded variable The simply expanded variable may be evaluated before the target file for the stat command is up to date or even exists. Switching to a recursively expanded variable move the execution of the stat command to the location where LDFLAGS_vmlinux is actually used, fixing the dependency issue introduced by patch #6746/1. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-26ARM: 6746/1: remove the 4x expansion presumption while decompressing the kernelNicolas Pitre
We currently presume a 4x expansion to guess the decompressed kernel size in order to determine if the decompressed kernel is in conflict with the location where zImage is loaded. This guess may cause many issues by overestimating the final kernel image size: - This may force a needless relocation if the location of zImage was fine, wasting some precious microseconds of boot time. - The relocation may be located way too far, possibly overwriting the initrd image in RAM. - If the kernel image includes a large already-compressed initramfs image then the problem is even more exacerbated. And if by some strange means the 4x guess is too low then we may overwrite ourselves with the decompressed image. So let's use the exact decompressed kernel image size instead. For that we need to rely on the stat command, but this is hardly a new build dependency as the kernel already depends on many external commands to be built provided by the coreutils package where stat is found. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-23ARM: 6750/1: improvements to compressed/head.SNicolas Pitre
In the case of a conflict between the memory used by the compressed kernel with its decompressor code and the memory used for the decompressed kernel, we currently store the later after the former and relocate it afterwards. This would be more efficient to do this the other way around i.e. relocate the compressed data up front instead, resulting in a smaller copy. That also has the advantage of making the code smaller and more straight forward. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-23ARM: 6663/1: make Thumb2 kernel entry point more similar to the ARM oneNicolas Pitre
Some installers would binary patch the kernel zImage to replace the first few nops with custom instructions. This breaks the Thumb2 kernel as the mode switch is right at the beginning. Let's move it towards the end of the nop sequence instead. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-23ARM: add 'uinstall' target for installing uboot kernelsRussell King
We have 'install' and 'zinstall' for installing Image and zImage kernels, so add 'uinstall' to complete the set. This allows developers to have a ~/bin/installkernel script which (eg) copies the kernel to the tftp server automatically once the kernel has built, resulting in a better workflow. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-19ARM: 6739/1: update .gitignore for boot/compressedNicolas Pitre
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-02-02ARM: v6k: introduce CPU_V6K optionRussell King
Introduce a CPU_V6K configuration option for platforms to select if they have a V6K CPU core. This allows us to identify whether we need to support ARMv6 CPUs without the V6K SMP extensions at build time. Currently CPU_V6K is just an alias for CPU_V6, and all places which reference CPU_V6 are replaced by (CPU_V6 || CPU_V6K). Select CPU_V6K from platforms which are known to be V6K-only. Acked-by: Tony Lindgren <tony@atomide.com> Tested-by: Sourav Poddar <sourav.poddar@ti.com> Tested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-25ARM: 6597/1: Add basic architecture support for VIA/WonderMedia 85xx SoC'sAlexey Charkov
This adds support for the family of Systems-on-Chip produced initially by VIA and now its subsidiary WonderMedia that have recently become widespread in lower-end Chinese ARM-based tablets and netbooks. Support is included for both VT8500 and WM8505, selectable by a configuration switch at kernel build time. Included are basic machine initialization files, register and interrupt definitions, support for the on-chip interrupt controller, high-precision OS timer, GPIO lines, necessary macros for early debug, pulse-width-modulated outputs control, as well as platform device configurations for the specific drivers implemented elsewhere. Signed-off-by: Alexey Charkov <alchark@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-25ARM: 6617/1: mmc, Add zboot from MMC support for SuperH Mobile ARMSimon Horman
This allows a ROM-able zImage to be written to MMC and for SuperH Mobile ARM to boot directly from the MMCIF hardware block. This is achieved by the MaskROM loading the first portion of the image into MERAM and then jumping to it. This portion contains loader code which copies the entire image to SDRAM and jumps to it. From there the zImage boot code proceeds as normal, uncompressing the image into its final location and then jumping to it. Cc: Magnus Damm <magnus.damm@gmail.com> Russell, please consider merging this for 2.6.38. This patch depends on: * "mmc, sh: Move MMCIF_PROGRESS_* into sh_mmcif.h" which will be merged though Paul Mundt's rmobile sh-2.6. The absence of this patch will break the build if the (new) CONFIG_ZBOOT_ROM_MMCIF option is set. There are no subtle side-effects. v2: Addressed comments by Magnus Damm * Fix copyright in vrl4.c * Fix use of #define CONFIG_ZBOOT_ROM_MMCIF in mmcif-sh7372.c * Initialise LED GPIO lines in head-ap4evb.txt instead of mmcif-sh7372.c as this is considered board-specific. v3: Addressed comments made in person by Magnus Damm * Move mmcif_loader to be earlier in the image and reduce the number of blocks of boot program loaded by the MaskRom from 40 to 8 accordingly. * Move LED GPIO initialisation into mmcif_progress_init - This leaves the partner jet script unbloated Other * inline mmcif_update_progress so it is a static inline in a header file v4: * Use htole16() and htole32() in v4rl.c to ensure that the output is little endian v5: Addressed comments by Russell King * Simplify assembly code * Jump to code rather than an address <- bug fix * Use (void __iomem *) as appropriate Roll in mackerel support * This was previously a separate patch, only because of the order in which this code was developed Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-01-05Merge branches 'ftrace', 'gic', 'io', 'kexec', 'mod', 'sa11x0', 'sh' and ↵Russell King
'versatile' into devel
2010-12-05ARM: 6515/1: Add zboot support for SuperH Mobile ARMKuninori Morimoto
When CONFIG_ZBOOT_ROM is selected, the resulting zImage file will be small boot loader and may be burned to rom or flash. This is the non-board-specific framework portion of this patch-set. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms@verge.net.au> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-30ARM: 6503/1: Thumb-2: Restore sensible zImage header layout for ↵Dave Martin
CONFIG_THUMB2_KERNEL The code which makes up the zImage header intends to leave a 32-byte gap followed by a branch to the real entry point, a magic number, and a word containing the absolute entry point address. This gets messed up with with CONFIG_THUMB2_KERNEL, because the size of the initial padding NOPs changes. Instead, the header can be made fully compatible by restoring it to ARM. In the Thumb-2 case, we can replace the initial NOPs with a sequence which switches to Thumb and jumps to the real entry point. As a consequence, the zImage entry point is now always ARM, so no special magic is needed any more for the uImage rules in the Thumb-2 case. Signed-off-by: Dave Martin <dave.martin@linaro.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-30ARM: 6502/1: Thumb-2: Fix CONFIG_THUMB2_KERNEL breakage in compressed/head.SDave Martin
Some instruction operand combinations are used here which are nor permitted in Thumb-2. In particular, most uses of pc as an operand are disallowed in Thumb-2, and deprecated in ARM from ARMv7 onwards. The modified code introduced by this patch should be compatible with all architecture versions >= v3, with or without CONFIG_THUMB2_KERNEL. Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Dave Martin <dave.martin@linaro.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-30ARM: 6499/1: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in ↵Dave Martin
bootp/init.S Directives such as .long and .word do not magically cause the assembler location counter to become aligned in gas. As a result, using these directives in code sections can result in misaligned data words when building a Thumb-2 kernel (CONFIG_THUMB2_KERNEL). This is a Bad Thing, since the ABI permits the compiler to assume that fundamental types of word size or above are word- aligned when accessing them from C. If the data is not really word-aligned, this can cause impaired performance and stray alignment faults in some circumstances. In general, the following rules should be applied when using data word declaration directives inside code sections: * .quad and .double: .align 3 * .long, .word, .single, .float: .align (or .align 2) * .short: No explicit alignment required, since Thumb-2 instructions are always 2 or 4 bytes in size. immediately after an instruction. Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Dave Martin <dave.martin@linaro.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-22ARM: avoid marking decompressor .stack section as having contentsRussell King
The .stack section doesn't contain any contents, and doesn't require initialization either. Rather than marking the output section with 'NOLOAD' but still having it exist in the object files, mark it with %nobits which avoids the assembler marking the section with 'CONTENTS'. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-09-19ARM: Fix build error when using KCONFIG_CONFIGRussell King
Jonathan Cameron reports that when using the environment variable KCONFIG_CONFIG, he encounters this error: make[2]: *** No rule to make target `.config', needed by `arch/arm/boot/compressed/vmlinux.lds' Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-09-09ARM: Partially revert "Auto calculate ZRELADDR and provide option for ↵Russell King
exceptions" Partially revert e69edc7, which introduced automatic zreladdr support. The change in the way the manual definition is defined seems to be error and conflict prone. Go back to the original way we were handling this for the time being, while keeping the automatic zreladdr facility. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-08-10Merge branches 'master' and 'devel' into for-linusRussell King
Conflicts: arch/arm/Kconfig arch/arm/mm/Kconfig
2010-08-10ARM: 6286/1: fix Thumb-2 decompressor broken by "Auto calculate ZRELADDR"Rabin Vincent
"ARM: Auto calculate ZRELADDR and provide option for exceptions" broke the Thumb-2 decompressor because it removed an entry in the LC0 table but didn't adjust the offset the Thumb-2 code uses to load the SP from that table. Fix it, and also change the ARM code to use the separate SP-load since ARM instructions that include the SP in the LDM register list are deprecated. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-08-06Merge branch 'devel' of ↵Russell King
git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel-stable Conflicts: arch/arm/mach-pxa/palmt5.c arch/arm/mach-pxa/palmtreo.c