summaryrefslogtreecommitdiff
path: root/target/mips/mikrotik-rb4xx/patches/3.14.54/0027-ar71xx-add-zboot-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/mips/mikrotik-rb4xx/patches/3.14.54/0027-ar71xx-add-zboot-support.patch')
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.54/0027-ar71xx-add-zboot-support.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.54/0027-ar71xx-add-zboot-support.patch b/target/mips/mikrotik-rb4xx/patches/3.14.54/0027-ar71xx-add-zboot-support.patch
new file mode 100644
index 000000000..1963931a9
--- /dev/null
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.54/0027-ar71xx-add-zboot-support.patch
@@ -0,0 +1,64 @@
+From 38af1d72bd5c760623996c7a8978e05e007f0e96 Mon Sep 17 00:00:00 2001
+From: Phil Sutter <phil@nwl.cc>
+Date: Mon, 23 Jun 2014 02:51:10 +0200
+Subject: [PATCH] ar71xx: add zboot support
+
+This also contains a workaround for the decompressor overwriting the
+bootloader-passed kernel parameters in memory.
+---
+ arch/mips/Kconfig | 2 ++
+ arch/mips/boot/compressed/Makefile | 6 ++++++
+ arch/mips/boot/compressed/uart-16550.c | 6 ++++++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
+index 95fa1f1..3bb5324 100644
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -106,6 +106,8 @@ config ATH79
+ select SYS_HAS_EARLY_PRINTK
+ select SYS_SUPPORTS_32BIT_KERNEL
+ select SYS_SUPPORTS_BIG_ENDIAN
++ select SYS_SUPPORTS_ZBOOT
++ select SYS_SUPPORTS_ZBOOT_UART16550
+ help
+ Support for the Atheros AR71XX/AR724X/AR913X SoCs.
+
+diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
+index 61af6b6..5a4491d 100644
+--- a/arch/mips/boot/compressed/Makefile
++++ b/arch/mips/boot/compressed/Makefile
+@@ -13,7 +13,13 @@
+ #
+
+ # set the default size of the mallocing area for decompressing
++ifeq ($(CONFIG_ATH79_MACH_RB4XX),y)
++# this needs to be smaller, otherwise the routerboot passed
++# kernel parameters fall into bss area (and are therefore zeroed)
++BOOT_HEAP_SIZE := 0x100000
++else
+ BOOT_HEAP_SIZE := 0x400000
++endif
+
+ # Disable Function Tracer
+ KBUILD_CFLAGS := $(shell echo $(KBUILD_CFLAGS) | sed -e "s/-pg//")
+diff --git a/arch/mips/boot/compressed/uart-16550.c b/arch/mips/boot/compressed/uart-16550.c
+index 237494b..25cb145 100644
+--- a/arch/mips/boot/compressed/uart-16550.c
++++ b/arch/mips/boot/compressed/uart-16550.c
+@@ -12,6 +12,12 @@
+ #define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset))
+ #endif
+
++#ifdef CONFIG_SOC_AR71XX
++#include <ar71xx_regs.h>
++#define PORT(offset) (CKSEG1ADDR(AR71XX_UART_BASE) + (4 * offset))
++#define IOTYPE unsigned int
++#endif
++
+ #ifdef CONFIG_AR7
+ #include <ar7.h>
+ #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
+--
+1.8.5.3
+