aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/boot/compressed (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-04-02MIPS: Reduce kernel image size for !CONFIG_DEBUG_ZBOOTWu Zhangjin2-1/+7
!CONFIG_DEBUG_ZBOOT doesn't need puts() and puthex(), remove them and the corrospindig strings for !CONFIG_DEBUG_ZBOOT, as a result, it saves about 1280 bytes. [ralf@linux-mips.org: Resolved reject.] Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Cc: Wu Zhangjin <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/1898/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2015-03-31MIPS: Allow platforms to specify the decompressor load addressAndrew Bresticker1-2/+4
Platforms which use raw zboot images may need to link the image at a fixed address if there is no other way to communicate the load address to the bootloader. Allow the per-platform Kbuild files to specify an optional zboot image load address (zload-y) and fall back to calc_vmlinuz_load_addr if unset. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: Andrew Bresticker <abrestic@chromium.org> Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com> Cc: James Hartley <james.hartley@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Patchwork: https://patchwork.linux-mips.org/patch/9566/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-08-26MIPS: ZBOOT: add missing <linux/string.h> includeAurelien Jarno1-0/+1
Commit dc4d7b37 (MIPS: ZBOOT: gather string functions into string.c) moved the string related functions into a separate file, which might cause the following build error, depending on the configuration: | CC arch/mips/boot/compressed/decompress.o | In file included from linux/arch/mips/boot/compressed/../../../../lib/decompress_unxz.c:234:0, | from linux/arch/mips/boot/compressed/decompress.c:67: | linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'fill_temp': | linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:162:2: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration] | cc1: some warnings being treated as errors | linux/scripts/Makefile.build:308: recipe for target 'arch/mips/boot/compressed/decompress.o' failed | make[6]: *** [arch/mips/boot/compressed/decompress.o] Error 1 | linux/arch/mips/Makefile:308: recipe for target 'vmlinuz' failed It does not fail with the standard configuration, as when CONFIG_DYNAMIC_DEBUG is not enabled <linux/string.h> gets included in include/linux/dynamic_debug.h. There might be other ways for it to get indirectly included. We can't add the include directly in xz_dec_stream.c as some architectures might want to use a different version for the boot/ directory (see for example arch/x86/boot/string.h). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Cc: stable@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7420/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-08-02MIPS: ZBOOT: implement stack protector in compressed boot phaseBen Chan1-0/+14
This patch implements the stack protector code in MIPS compressed boot phase based on the same code added to arm in commit 8779657d29c0ebcc0c94ede4df2f497baf1b563f "stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG" by Kees Cook <keescook@chromium.org> Signed-off-by: Ben Chan <benchan@chromium.org> Cc: Kees Cook <keescook@chromium.org> Cc: Olof Johansson <olofj@chromium.org> Reviewed-by: Kees Cook <keescook@chromium.org> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7175/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-01-24mips: delete non-required instances of include <linux/init.h>Paul Gortmaker2-2/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6320/
2014-01-24MIPS: ZBOOT: gather string functions into string.cAntony Pavlov3-24/+30
In the worst case this adds less then 128 bytes of code but on the other hand this makes code organization more clear. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-mips@linux-mips.org Cc: Ralf Baechle <ralf@linux-mips.org> Cc: John Crispin <blogic@openwrt.org> Cc: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6344/
2014-01-23MIPS: JZ4740: reuse UART0 address macro for vmlinuz debug portAntony Pavlov1-2/+2
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/5927/
2013-10-29MIPS: ZBOOT: Support LZ4 compression schemeFlorian Fainelli2-1/+7
Add support for the LZ4 compression scheme in the ZBOOT decompression stub, in order to support it we need to: - select the "lz4" compression tool to compress the vmlinux.bin payload - memcpy() is also required for decompress_unlz4.c so we share the implementation between GZIP, XZ and now LZ4 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-mips@linux-mips.org Cc: blogic@openwrt.org Cc: james.hogan@imgtec.com Patchwork: https://patchwork.linux-mips.org/patch/5829/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-10-29MIPS: ZBOOT: Define program header for text loadable segmentFlorian Fainelli1-1/+4
There is currently no corresponding ELF program header for the "text" loadable segment which is confusing for some bootloader out there such as CFE because it expects to find a program header matching the segment it is trying to load. The Linux kernel ELF binary "vmlinux" has a similar program header for the text segment so we just mimic this here too. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-mips@linux-mips.org Cc: blogic@openwrt.org Cc: james.hogan@imgtec.com Patchwork: https://patchwork.linux-mips.org/patch/5827/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-10-29MIPS: ZBOOT: Support XZ compression schemeFlorian Fainelli2-1/+12
Add support for the XZ compression scheme in the ZBOOT decompression stub, in order to support it we need to: - select the "xzkern" compression tool to compress the vmlinux.bin payload - link with ashldi3.o for xz_dec_run() to work - memcpy() is also required for decompress_unxz.c so we share the implementation between GZIP and XZ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-mips@linux-mips.org Cc: blogic@openwrt.org Cc: james.hogan@imgtec.com Patchwork: https://patchwork.linux-mips.org/patch/5818/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-09-03MIPS: Refactor load/entry address calculationsJames Hogan1-1/+1
The vmlinux load address and entry address is calculated in multiple places: - arch/mips/Makefile defines load-y from CONFIG_PHYSICAL_START (or defined by the platform) and passes it to arch/mips/boot/compressed/Makefile. - arch/mips/boot/compressed/Makefile calculates kernel entry using nm. - arch/mips/lasat/image/Makefile calculates both load and entry address using nm. Lets combine these in the main Makefile and then pass them as Make parameters to each of the three boot image Makefiles (in boot/, boot/compressed, lasat/image/). The boot/ Makefile doesn't currently use them, but will soon need to for U-Boot image targets. The existing load-y definition is used in preference to calculating the load address using nm. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5794/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-07-01MIPS: Boot: Compressed: Remove -fstack-protector from CFLAGSMarkos Chandras1-0/+2
When building with -fstack-protector, gcc emits the __stack_chk_guard and __stack_chk_fail symbols to check for stack stability. These symbols are defined in vmlinux but the generated vmlinux.bin that is used to create the compressed vmlinuz image has no symbol table so the linker can't find these symbols during the final linking phase. As a result of which, we need either to redefine these symbols just for the compressed image or drop the -fstack-protector option when building the compressed image. This patch implements the latter of two options. Fixes the following linking problem: dbg.c:(.text+0x7c): undefined reference to `__stack_chk_guard' dbg.c:(.text+0x80): undefined reference to `__stack_chk_guard' dbg.c:(.text+0xd4): undefined reference to `__stack_chk_guard' dbg.c:(.text+0xec): undefined reference to `__stack_chk_fail' [ralf@linux-mips.org: I'm applying this before the patch that actually adds stack protector support for MIPS. This means, it will not be possible to trigger above error message with any commit from the tree but rather they are what one would hit without this commit.] Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Markos Chandras <markos.chandras@imgtec.com> Patchwork: https://patchwork.linux-mips.org/patch/5575/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-13MIPS: Netlogic: Support compressed kernelJayachandran C1-0/+12
Add SYS_SUPPORTS_ZBOOT and SYS_SUPPORTS_ZBOOT_UART16550 config options for XLR and XLP. Update boot/compressed/uart-16550.c to add UART port for XLR and XLP. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5417/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-13MIPS: boot: Fixes for compressed/uart-16550.cJayachandran C1-3/+7
Fix uart-16550.c for adding XLR/XLP support, changes are: * Make register read/write use volatile pointers * Support 32 bit IO read/write * Increase timeout in waiting for UART LSR Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5416/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-02-01MIPS: Whitespace cleanup.Ralf Baechle4-10/+10
Having received another series of whitespace patches I decided to do this once and for all rather than dealing with this kind of patches trickling in forever. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2012-10-11MIPS: Alchemy: Single kernel for DB1200/1300/1550Manuel Lauss1-4/+0
Combine support for the DB1200/PB1200, DB1300 and DB1550 boards into a single kernel image. defconfig-generated image verified on DB1200, DB1300 and DB1550. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/4335/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2012-07-23MIPS: Enable vmlinuz for JZ4740LluĂ­s Batlle i Rossell2-0/+9
This patch adds support for building a compressed kernel for the JZ4740 architecture. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Maarten ter Huurne <maarten@treewalker.org> Cc: Sergei Shtylyov <sshtylyov@mvista.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3563/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-12-07MIPS: Alchemy: Basic support for the DB1300 board.Manuel Lauss1-1/+4
Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> To: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/2867/ Patchwork: https://patchwork.linux-mips.org/patch/2919/ Patchwork: https://patchwork.linux-mips.org/patch/2928/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-05-19MIPS: Alchemy: Rewrite UART setup and constants.Manuel Lauss1-1/+1
Detect CPU type at runtime and setup uarts accordingly; also clean up the uart base address mess in the process as far as possible. Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> To: Linux-MIPS <linux-mips@linux-mips.org> Cc: Florian Fainelli <florian@openwrt.org> Cc: Wolfgang Grandegger <wg@grandegger.com> Patchwork: https://patchwork.linux-mips.org/patch/2352/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org
2011-05-10MIPS: Fix calc_vmlinuz_load_addr build warnings.Ralf Baechle1-1/+1
HOSTCC arch/mips/boot/compressed/calc_vmlinuz_load_addr arch/mips/boot/compressed/calc_vmlinuz_load_addr.c: In function 'main': arch/mips/boot/compressed/calc_vmlinuz_load_addr.c:35:2: warning: format '%llx' expects type 'long long unsigned int *', but argument 3 has type 'uint64_t *' arch/mips/boot/compressed/calc_vmlinuz_load_addr.c:54:2: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'uint64_t' Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-10-18Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linusLinus Torvalds1-1/+1
* 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus: MIPS: Enable ISA_DMA_API config to fix build failure MIPS: 32-bit: Fix build failure in asm/fcntl.h MIPS: Remove all generated vmlinuz* files on "make clean" MIPS: do_sigaltstack() expects userland pointers MIPS: Fix error values in case of bad_stack MIPS: Sanitize restart logics MIPS: secure_computing, syscall audit: syscall number should in r2, not r0. MIPS: Don't block signals if we'd failed to setup a sigframe
2010-10-18MIPS: Remove all generated vmlinuz* files on "make clean"Wu Zhangjin1-1/+1
[Ralf: I changed the patch to explicitly list all files to be deleted out of paranoia.] Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Patchwork: http://patchwork.linux-mips.org/patch/1590/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-10-04MIPS: Calculate VMLINUZ_LOAD_ADDRESS based on the length of vmlinux.binShmulik Ladkani1-1/+1
Fix VMLINUZ_LOAD_ADDRESS calculation to be based on the length of vmlinux.bin, the actual uncompressed kernel binary. Previously it was based on the length of KBUILD_IMAGE (the unstripped ELF vmlinux), which is bigger than vmlinux.bin. As a result, vmlinuz was loaded into a memory address higher then actually needed - a problem for small memory platforms. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> To: linux-mips@linux-mips.org Cc: alex@digriz.org.uk Cc: manuel.lauss@googlemail.com Cc: sam@ravnborg.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/1564/ Acked-by: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05MIPS: strip the un-needed sections of vmlinuzWu Zhangjin1-0/+3
This patch use "strip -s" to strip the .symtab and .strtab sections of vmlinuz. Note: This patch is based on http://patchwork.linux-mips.org/patch/1324/ Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1383/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05MIPS: Clean up the calculation of VMLINUZ_LOAD_ADDRESSWu Zhangjin1-13/+13
We have calculated VMLINUZ_LOAD_ADDRESS in shell, which is indecipherable. This patch rewrites it in C. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> To: linux-mips <linux-mips@linux-mips.org> Cc: Alexander Clouter <alex@digriz.org.uk> Cc: Manuel Lauss <manuel.lauss@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Alexander Clouter <alex@digriz.org.uk> Patchwork: https://patchwork.linux-mips.org/patch/1324/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05MIPS: Clean up arch/mips/boot/compressed/decompress.cWu Zhangjin1-24/+14
- Remove several outdated comments - Clearify the definition of zimage_start and zimage_size and the their usage Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1382/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05MIPS: Clean up arch/mips/boot/compressed/ld.scriptWu Zhangjin1-34/+17
- Remove unused symbols: _fdata, _text; only _edata and _end are needed by head.S - Remove unused sections: .sbss, .stab, .gptab.sdata, .gptab.sbss - Change the alignment to 16 bytes to ensure it is greater than any fundamental type of a MIPS compiler. - Clean up comments Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1381/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05MIPS: Unify the suffix of compressed vmlinux.binWu Zhangjin2-8/+61
The compressed vmlinux.bin is only a temp file so it's ok to use the same suffix .z for them (.gz,.lzo,.lzma...) to remove several lines and simpify the maintenance (no need to add the "suffix_$(xxx) := suffix" line). Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> To: linux-mips <linux-mips@linux-mips.org> Cc: Alexander Clouter <alex@digriz.org.uk> Cc: Manuel Lauss <manuel.lauss@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Patchwork: https://patchwork.linux-mips.org/patch/1323/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> ---
2010-08-05MIPS: Alchemy: remove SOC_AU1X00 in favor of MIPS_ALCHEMYManuel Lauss1-1/+1
Remove the CONFIG_SOC_AU1X00 Kconfig symbol since its job can also be done by MACH_ALCHEMY, now renamed to MIPS_ALCHEMY. Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> To: Linux-MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/1461/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-08-05MIPS: Refactor arch/mips/boot/compressed/MakefileSam Ravnborg1-25/+29
- use hostprogs-y for the elf2ecoff - list all *.o file in targets - renamed obj-y to vmlinuzobjs-y (it was confusing to re-use a kbuild variable) - fix all uses of if_changed/cmd - use kbuild rules to beautify output - update clean-file to clean vmlinuz.* in top-level directory - simplied logic in arch/mips/Makefile for compressed targets The net result is a more kbuild conformant Makefile but readability did not increase. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> To: linux-mips <linux-mips@linux-mips.org> To: Wu Zhangjin <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/1304/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27MIPS: Make the debugging of compressed kernel configurableWu Zhangjin1-0/+2
This patch adds a new DEBUG_ZBOOT option to allow the users to enable it to debug the compressed kernel support for a new board and this optoin should be disabled to reduce the kernel image size and speed up the kernel booting procedure when the compressed kernel support is stable. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> To: Ralf Baechle <ralf@linux-mips.org> Cc: Manuel Lauss <manuel.lauss@googlemail.com> Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/918/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27MIPS: Simplify the weak annotation with __weakWu Zhangjin1-2/+2
Found by $ find arch/mips/ -name "*.c" | xargs -i grep -H weak {} | grep -v __weak [Ralf: Made this bulletproof by including <linux/compiler.h>] Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/874/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27MIPS: Alchemy: debug output for compressed kernelsManuel Lauss2-0/+8
Hook up the compressed debug output for all Alchemy systems supported by current kernel codebase. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> To: Linux-MIPS <linux-mips@linux-mips.org> Cc: Wu Zhangjin <wuzhangjin@gmail.com> Patchwork: http://patchwork.linux-mips.org/patch/879/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27MIPS: Cleanup the Makefile of compressed kernel supportWu Zhangjin1-3/+3
This patch removes a useless "\" (line break) and tunes the format of a long line. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/869/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27MIPS: Loongson: Change the Email address of Wu ZhangjinWu Zhangjin2-3/+3
Currently wuzj@lemote.com is not usable; change it to wuzhangjin@gmail.com. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Cc: yanh@lemote.com Cc: huhb@lemote.com Cc: zhangfx@lemote.com Patchwork: http://patchwork.linux-mips.org/patch/829/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-01-28MIPS: Fix vmlinuz build for 32bit-only math shellsAlexander Clouter1-2/+5
POSIX requires $((<expression>)) arithmetic in sh only to have long arithmetic so on 32-bit sh binaries might do only 32-bit arithmetic but the arithmetic done in arch/mips/boot/compressed/Makefile needs 64-bit. I play with the AR7 platform, so VMLINUX_LOAD_ADDRESS is 0xffffffff94100000, and for an example 4MiB kernel VMLINUZ_LOAD_ADDRESS is made out to be: ---- alex@berk:~$ bash -c 'printf "%x\n" $((0xffffffff94100000 + 0x400000))' ffffffff94500000 alex@berk:~$ dash -c 'printf "%x\n" $((0xffffffff94100000 + 0x400000))' 80000000003fffff ---- The former is obviously correct whilst the later breaks things royally. Fortunately working with only the lower 32bit's works for both bash and dash: ---- $ bash -c 'printf "%x\n" $((0x94100000 + 0x400000))' 94500000 $ dash -c 'printf "%x\n" $((0x94100000 + 0x400000))' 94500000 ---- So, we can split the original 64bit string to two parts, and only calculate the low 32bit part, which is big enough (1GiB kernel sizes anyone?) for a normal Linux kernel image file, now, we calculate the VMLINUZ_LOAD_ADDRESS like this: 1. if present, append top 32bit of VMLINUX_LOAD_ADDRESS" as a prefix 2. get the sum of the low 32bit of VMLINUX_LOAD_ADDRESS + VMLINUX_SIZE This patch fixes vmlinuz kernel builds on systems where only a 32bit-only math shell is available. Patch Changelog: Version 2 - simplified method by using 'expr' for 'substr' and making it work with dash once again Version 1 - Revert the removals of '-n "$(VMLINUX_SIZE)"' to avoid the error of "make clean" - Consider more cases of the VMLINUX_LOAD_ADDRESS Version 0 - initial release Signed-off-by: Alexander Clouter <alex@digriz.org.uk> Acked-by: Wu Zhangjin <wuzhangjin@gmail.com> Patchwork: http://patchwork.linux-mips.org/patch/861/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-01-28MIPS: Add support of LZO-compressed kernelsWu Zhangjin2-0/+6
The necessary changes to the x86 Kconfig and boot/compressed to allow the use of this new compression method. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Patchwork: http://patchwork.linux-mips.org/patch/857/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-01-12MIPS: Cleanup and Fixup of compressed kernel supportWu Zhangjin3-155/+59
o Remove the .initrd section. The initrd section was already handled when vmlinux was linked. o Discard .MIPS.options, .options, .pdr, .reginfo, .comment and .note sections. If .MIPS.options is not removed, kernels compiled with gcc 3.4.6 will not boot. o Clean up the file format. o Remove several other unneeded sections. Tested with GCC 3.4.6 and 4.4.1 with and without initrd. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/785/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-12-17MIPS: Add support for GZIP / BZIP2 / LZMA compressed kernel imagesWu Zhangjin7-0/+516
This patch helps to generate smaller kernel images for linux-MIPS, Here is the effect when using lzma: $ ls -sh vmlinux 7.1M vmlinux $ ls -sh vmlinuz 1.5M vmlinuz Have tested the 32bit kernel on Qemu/Malta and 64bit kernel on FuLoong Mini PC. both of them work well. and also, tested by Alexander Clouter on an AR7 based Linksys WAG54Gv2, and by Manuel Lauss on an Alchemy board. This -v2 version incorporate the feedback from Ralf, and add the following changes: 1. add .ecoff, .bin, .erec format support 2. only enable it and the debug source code for the machines we tested 3. a dozen of fixups and cleanups and if you want to enable it for your board, please try to select SYS_SUPPORTS_ZBOOT for it, and if the board have an 16550 compatible uart, you can select SYS_SUPPORTS_ZBOOT_UART16550 directly. and then sending the relative patches to Ralf. Tested-by: Manuel Lauss <manuel.lauss@googlemail.com> Tested-by: Alexander Clouter <alex@digriz.org.uk> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>