aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-4.9/222-arm_zimage_none.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-01-27 14:32:10 +0100
committerFelix Fietkau <nbd@nbd.name>2017-02-04 20:28:14 +0100
commitf791fb4af45032a653ba7c850f4564923871cb16 (patch)
treec1fc4e564c8e27faad582e5b55a9ce91816a241c /target/linux/generic/patches-4.9/222-arm_zimage_none.patch
parent7d00cfe9bb693e376ac9d035e13f8ce8a5ff572c (diff)
downloadupstream-f791fb4af45032a653ba7c850f4564923871cb16.tar.gz
upstream-f791fb4af45032a653ba7c850f4564923871cb16.tar.bz2
upstream-f791fb4af45032a653ba7c850f4564923871cb16.zip
kernel: add linux 4.9 support
Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Tim Harvey <tharvey@gateworks.com> [fixes]
Diffstat (limited to 'target/linux/generic/patches-4.9/222-arm_zimage_none.patch')
-rw-r--r--target/linux/generic/patches-4.9/222-arm_zimage_none.patch124
1 files changed, 124 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.9/222-arm_zimage_none.patch b/target/linux/generic/patches-4.9/222-arm_zimage_none.patch
new file mode 100644
index 0000000000..8de9851e09
--- /dev/null
+++ b/target/linux/generic/patches-4.9/222-arm_zimage_none.patch
@@ -0,0 +1,124 @@
+ARM: implement "uncompressed zImage"
+
+Based on RFC patch by Uwe Kleine-König
+http://www.spinics.net/lists/arm-kernel/msg230153.html
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+--- a/arch/arm/boot/compressed/Makefile
++++ b/arch/arm/boot/compressed/Makefile
+@@ -71,6 +71,7 @@ compress-$(CONFIG_KERNEL_LZO) = lzo
+ compress-$(CONFIG_KERNEL_LZMA) = lzma
+ compress-$(CONFIG_KERNEL_XZ) = xzkern
+ compress-$(CONFIG_KERNEL_LZ4) = lz4
++compress-$(CONFIG_KERNEL_CAT) = cat
+
+ # Borrowed libfdt files for the ATAG compatibility mode
+
+--- a/arch/arm/boot/compressed/decompress.c
++++ b/arch/arm/boot/compressed/decompress.c
+@@ -55,6 +55,10 @@ extern char * strstr(const char * s1, co
+ #include "../../../../lib/decompress_unlz4.c"
+ #endif
+
++#ifdef CONFIG_KERNEL_CAT
++#include "../../../../lib/decompress_uncat.c"
++#endif
++
+ int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
+ {
+ return __decompress(input, len, NULL, NULL, output, 0, NULL, error);
+--- /dev/null
++++ b/arch/arm/boot/compressed/piggy.cat.S
+@@ -0,0 +1,6 @@
++ .section .piggydata,#alloc
++ .globl input_data
++input_data:
++ .incbin "arch/arm/boot/compressed/piggy.cat"
++ .globl input_data_end
++input_data_end:
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -127,6 +127,9 @@ config HAVE_KERNEL_LZO
+ config HAVE_KERNEL_LZ4
+ bool
+
++config HAVE_KERNEL_CAT
++ bool
++
+ choice
+ prompt "Kernel compression mode"
+ default KERNEL_GZIP
+@@ -193,9 +196,10 @@ config KERNEL_LZO
+ bool "LZO"
+ depends on HAVE_KERNEL_LZO
+ help
+- Its compression ratio is the poorest among the choices. The kernel
+- size is about 10% bigger than gzip; however its speed
+- (both compression and decompression) is the fastest.
++ Its compression ratio is the poorest among the choices (apart from
++ uncompressed below). The kernel size is about 10% bigger than gzip;
++ however its speed (both compression and decompression) is the
++ fastest.
+
+ config KERNEL_LZ4
+ bool "LZ4"
+@@ -209,6 +213,12 @@ config KERNEL_LZ4
+ is about 8% bigger than LZO. But the decompression speed is
+ faster than LZO.
+
++config KERNEL_CAT
++ bool "uncompressed"
++ depends on HAVE_KERNEL_CAT
++ help
++ Don't use compression at all.
++
+ endchoice
+
+ config DEFAULT_HOSTNAME
+--- /dev/null
++++ b/lib/decompress_uncat.c
+@@ -0,0 +1,17 @@
++#include <linux/types.h>
++#include <linux/compiler.h>
++
++#ifdef STATIC
++
++STATIC int __decompress(unsigned char *buf, long in_len,
++ long (*fill)(void*, unsigned long),
++ long (*flush)(void*, unsigned long),
++ unsigned char *output, long out_len,
++ long *posp,
++ void (*error)(char *x))
++{
++ memmove(output, buf, in_len);
++ return 0;
++}
++
++#endif
+--- a/scripts/Makefile.lib
++++ b/scripts/Makefile.lib
+@@ -357,6 +357,13 @@ cmd_lz4 = (cat $(filter-out FORCE,$^) |
+ lz4c -l -c1 stdin stdout && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
+ (rm -f $@ ; false)
+
++# uncompressed
++# ---------------------------------------------------------------------------
++quiet_cmd_cat = CAT $@
++cmd_cat = (cat $(filter-out FORCE,$^) \
++ && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
++ (rm -f $@ ; false)
++
+ # U-Boot mkimage
+ # ---------------------------------------------------------------------------
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -65,6 +65,7 @@ config ARM
+ select HAVE_KERNEL_LZMA
+ select HAVE_KERNEL_LZO
+ select HAVE_KERNEL_XZ
++ select HAVE_KERNEL_CAT
+ select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M
+ select HAVE_KRETPROBES if (HAVE_KPROBES)
+ select HAVE_MEMBLOCK