ipq806x: fix boot freeze on zImage kernel
[openwrt/svn-archive/archive.git] / target / linux / ipq806x / patches-4.0 / 300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
1 From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
2 From: Mathieu Olivari <mathieu@codeaurora.org>
3 Date: Wed, 29 Apr 2015 15:21:46 -0700
4 Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
5
6 ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
7 on most ARM architectures. This automatically calculate ZRELADDR by
8 masking PHYS_OFFSET with 0xf8000000.
9
10 However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
11 network accelerators, and the bootloader removes this section from the
12 layout passed from the ATAGS (when used).
13
14 For newer bootloader, when DT is used, this is not a problem, we just
15 reserve this memory in the device tree. But if the bootloader doesn't
16 have DT support, then ATAGS have to be used. In this case, the ARM
17 decompressor will position the kernel in this low mem, which will not be
18 in the RAM section mapped by the bootloader, which means the kernel will
19 freeze in the middle of the boot process trying to map the memory.
20
21 As a work around, this patch allows disabling AUTO_ZRELADDR when
22 ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
23 which don't support device-tree, which is the case on certain early
24 IPQ806x based designs.
25
26 Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
27 ---
28 arch/arm/Kconfig | 2 +-
29 arch/arm/Makefile | 2 ++
30 arch/arm/mach-qcom/Makefile.boot | 1 +
31 3 files changed, 4 insertions(+), 1 deletion(-)
32 create mode 100644 arch/arm/mach-qcom/Makefile.boot
33
34 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
35 index 89c4b5c..4583ea5 100644
36 --- a/arch/arm/Kconfig
37 +++ b/arch/arm/Kconfig
38 @@ -311,7 +311,7 @@ config ARCH_MULTIPLATFORM
39 select ARCH_WANT_OPTIONAL_GPIOLIB
40 select ARM_HAS_SG_CHAIN
41 select ARM_PATCH_PHYS_VIRT
42 - select AUTO_ZRELADDR
43 + select AUTO_ZRELADDR if !ARCH_QCOM
44 select CLKSRC_OF
45 select COMMON_CLK
46 select GENERIC_CLOCKEVENTS
47 diff --git a/arch/arm/Makefile b/arch/arm/Makefile
48 index 7453352..5d6f8ac 100644
49 --- a/arch/arm/Makefile
50 +++ b/arch/arm/Makefile
51 @@ -240,9 +240,11 @@ MACHINE := arch/arm/mach-$(word 1,$(machine-y))/
52 else
53 MACHINE :=
54 endif
55 +ifeq ($(CONFIG_ARCH_QCOM),)
56 ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
57 MACHINE :=
58 endif
59 +endif
60
61 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
62 platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
63 diff --git a/arch/arm/mach-qcom/Makefile.boot b/arch/arm/mach-qcom/Makefile.boot
64 new file mode 100644
65 index 0000000..67a6d5a
66 --- /dev/null
67 +++ b/arch/arm/mach-qcom/Makefile.boot
68 @@ -0,0 +1 @@
69 +zreladdr-y+= 0x42208000
70 --
71 1.9.1
72