dnsmasq: full: disable ipset support by default
[openwrt/staging/mkresin.git] / target / linux / ipq40xx / patches-4.14 / 082-ARM-dts-ipq4019-Add-TZ-and-SMEM-reserved-regions.patch
1 From fc566294610fa49e9d8c31c4ecc9c82f49b11f59 Mon Sep 17 00:00:00 2001
2 From: Sven Eckelmann <sven.eckelmann@openmesh.com>
3 Date: Wed, 18 Apr 2018 09:10:44 +0200
4 Subject: [PATCH] ARM: dts: ipq4019: Add TZ and SMEM reserved regions
5
6 The QSEE (trustzone) is started on IPQ4019 before Linux is started.
7 According to QCA, it is placed in in the the memory region
8 0x87e80000-0x88000000 and must not be accessed directly. There is an
9 additional memory region 0x87e00000-0x87E80000 smem which which can be used
10 for communication with the TZ. The driver for the latter is not yet ready
11 but it is still not allowed to use this memory region like any other
12 memory region.
13
14 Not reserving this memory region either leads to kernel crashes, kernel
15 hangs (often during the boot) or bus errors for userspace programs. The
16 latter happens when a program is using a memory region which is mapped to
17 these physical memory regions.
18
19 [ 571.758058] Unhandled fault: imprecise external abort (0xc06) at 0x01715ff8
20 [ 571.758099] pgd = cebec000
21 [ 571.763826] [01715ff8] *pgd=8e7fa835, *pte=87e7f75f, *ppte=87e7fc7f
22 Bus error
23
24 Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
25
26 Forwarded: https://patchwork.kernel.org/patch/10347459/
27 ---
28 Cc: Sricharan Ramabadhran <srichara@qti.qualcomm.com>
29 Cc: Senthilkumar N L <snlakshm@qti.qualcomm.com>
30
31 There are additional memory regions which have to be initialized first by
32 Linux. So they are currently not used. We were told by QCA that the
33 features QSDK uses them for are:
34
35 * crash dump feature
36 - a couple of regions used when 'qca,scm_restart_reason' dt node has the
37 value 'dload_status' not set to 1
38 + apps_bl <0x87000000 0x400000>
39 + sbl <0x87400000 0x100000>
40 + cnss_debug <0x87400000 0x100000>
41 + cpu_context_dump <0x87b00000 0x080000>
42 - required driver not available in Linux
43 - safe to remove
44 * QSEE app execution
45 - region tz_apps <0x87b80000 0x280000>
46 - required driver not available in Linux
47 - safe to remove
48 * communication with TZ/QSEE
49 - region smem <0x87b80000 0x280000>
50 - driver changes not yet upstreamed
51 - must not be removed because any access can crash kernel/program
52 * trustzone (QSEE) private memory
53 - region tz <0x87e80000 0x180000>
54 - must not be removed because any access can crash kernel/program
55
56 The problem with the missing regions was reported in 2016 [1]. So maybe
57 this change qualifies for a stable@vger.kernel.org submission.
58
59 [1] https://www.spinics.net/lists/linux-arm-msm/msg21536.html
60 ---
61 arch/arm/boot/dts/qcom-ipq4019.dtsi | 16 ++++++++++++++++
62 1 file changed, 16 insertions(+)
63
64 --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
65 +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
66 @@ -23,6 +23,22 @@
67 compatible = "qcom,ipq4019";
68 interrupt-parent = <&intc>;
69
70 + reserved-memory {
71 + #address-cells = <0x1>;
72 + #size-cells = <0x1>;
73 + ranges;
74 +
75 + smem_region: smem@87e00000 {
76 + reg = <0x87e00000 0x080000>;
77 + no-map;
78 + };
79 +
80 + tz@87e80000 {
81 + reg = <0x87e80000 0x180000>;
82 + no-map;
83 + };
84 + };
85 +
86 aliases {
87 spi0 = &blsp1_spi1;
88 spi1 = &blsp1_spi2;