ipq806x: 6.1: replace ZRELADDR HACK patch with new version
[openwrt/staging/jow.git] / target / linux / ipq806x / patches-6.1 / 0060-ARM-mach-qcom-fix-support-for-ipq806x.patch
1 From 9c896e9fc2ef1209e4a56d8c9fdd183847c2c814 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Tue, 18 Oct 2022 22:02:46 +0200
4 Subject: [PATCH] ARM: mach-qcom: fix support for ipq806x
5
6 Add a specific config flag for Qcom IPQ806x as this SoC can't use
7 AUTO_ZRELADDR and require the PHYS_OFFSET set to 0x42000000.
8
9 This is needed as some legacy board (or some wrongly configured
10 bootloader) pass the wrong memory map and doesn't exclude the first
11 ~20MB of RAM reserved for the hardware network accellerators.
12
13 With this change we can correctly support each board and prevent any
14 kind of misconfiguration done by the OEM.
15
16 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
17 ---
18 arch/arm/Kconfig | 3 ++-
19 arch/arm/mach-qcom/Kconfig | 13 +++++++++++++
20 2 files changed, 15 insertions(+), 1 deletion(-)
21
22 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
23 index 1af63e17b4ad..0818d35973ad 100644
24 --- a/arch/arm/Kconfig
25 +++ b/arch/arm/Kconfig
26 @@ -282,6 +282,7 @@ config PHYS_OFFSET
27 default 0x30000000 if ARCH_S3C24XX
28 default 0xa0000000 if ARCH_IOP32X || ARCH_PXA
29 default 0xc0000000 if ARCH_EP93XX || ARCH_SA1100
30 + default 0x42000000 if ARCH_IPQ806X
31 default 0
32 help
33 Please provide the physical address corresponding to the
34 @@ -1701,7 +1702,7 @@ config CRASH_DUMP
35
36 config AUTO_ZRELADDR
37 bool "Auto calculation of the decompressed kernel image address" if !ARCH_MULTIPLATFORM
38 - default !(ARCH_FOOTBRIDGE || ARCH_RPC || ARCH_SA1100)
39 + default !(ARCH_FOOTBRIDGE || ARCH_RPC || ARCH_SA1100 || ARCH_IPQ806X)
40 help
41 ZRELADDR is the physical address where the decompressed kernel
42 image will be placed. If AUTO_ZRELADDR is selected, the address
43 diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig
44 index 12a812e61c16..b11b6e391ff0 100644
45 --- a/arch/arm/mach-qcom/Kconfig
46 +++ b/arch/arm/mach-qcom/Kconfig
47 @@ -46,4 +46,17 @@ config ARCH_MDM9615
48 bool "Enable support for MDM9615"
49 select CLKSRC_QCOM
50
51 +config ARCH_IPQ806X
52 + bool "Enable support for IPQ806x"
53 + help
54 + Enable support for the Qualcomm IPQ806x.
55 +
56 + IPQ806x require special PHYS_OFFSET and can't use AUTO_ZRELADDR.
57 + The first ~20MB of RAM is reserved for the hardware network accelerators,
58 + and the bootloader removes this section from the layout passed from the
59 + ATAGS (when used by some bootloader doesn't even do that).
60 +
61 + To support every system and handle legacy systems, hardcode PHYS_OFFSET and
62 + disable AUTO_ZRELADDR.
63 +
64 endif
65 --
66 2.37.2
67