ipq806x: 6.1: refresh kernel patches
[openwrt/staging/ldir.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 --- a/arch/arm/Kconfig
23 +++ b/arch/arm/Kconfig
24 @@ -283,6 +283,7 @@ config PHYS_OFFSET
25 default 0x30000000 if ARCH_S3C24XX
26 default 0xa0000000 if ARCH_IOP32X || ARCH_PXA
27 default 0xc0000000 if ARCH_EP93XX || ARCH_SA1100
28 + default 0x42000000 if ARCH_IPQ806X
29 default 0
30 help
31 Please provide the physical address corresponding to the
32 @@ -1702,7 +1703,7 @@ config CRASH_DUMP
33
34 config AUTO_ZRELADDR
35 bool "Auto calculation of the decompressed kernel image address" if !ARCH_MULTIPLATFORM
36 - default !(ARCH_FOOTBRIDGE || ARCH_RPC || ARCH_SA1100)
37 + default !(ARCH_FOOTBRIDGE || ARCH_RPC || ARCH_SA1100 || ARCH_IPQ806X)
38 help
39 ZRELADDR is the physical address where the decompressed kernel
40 image will be placed. If AUTO_ZRELADDR is selected, the address
41 --- a/arch/arm/mach-qcom/Kconfig
42 +++ b/arch/arm/mach-qcom/Kconfig
43 @@ -46,4 +46,17 @@ config ARCH_MDM9615
44 bool "Enable support for MDM9615"
45 select CLKSRC_QCOM
46
47 +config ARCH_IPQ806X
48 + bool "Enable support for IPQ806x"
49 + help
50 + Enable support for the Qualcomm IPQ806x.
51 +
52 + IPQ806x require special PHYS_OFFSET and can't use AUTO_ZRELADDR.
53 + The first ~20MB of RAM is reserved for the hardware network accelerators,
54 + and the bootloader removes this section from the layout passed from the
55 + ATAGS (when used by some bootloader doesn't even do that).
56 +
57 + To support every system and handle legacy systems, hardcode PHYS_OFFSET and
58 + disable AUTO_ZRELADDR.
59 +
60 endif