]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/arm-tegra-restore-dt-abi-on-tegra124-chromebooks.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / queue-4.19 / arm-tegra-restore-dt-abi-on-tegra124-chromebooks.patch
1 From 284329b9394625fa618451d90fe37a359a090325 Mon Sep 17 00:00:00 2001
2 From: Thierry Reding <treding@nvidia.com>
3 Date: Mon, 11 Feb 2019 12:09:19 +0100
4 Subject: ARM: tegra: Restore DT ABI on Tegra124 Chromebooks
5
6 [ Upstream commit 94d9b9337d09bdd27735005b3251d97ab29f7273 ]
7
8 Commit 482997699ef0 ("ARM: tegra: Fix unit_address_vs_reg DTC warnings
9 for /memory") inadventently broke device tree ABI by adding a unit-
10 address to the "/memory" node because the device tree compiler flagged
11 the missing unit-address as a warning.
12
13 Tegra124 Chromebooks (a.k.a. Nyan) use a bootloader that relies on the
14 full name of the memory node in device tree being exactly "/memory". It
15 can be argued whether this was a good decision or not, and some other
16 bootloaders (such as U-Boot) do accept a unit-address in the name of the
17 node, but the device tree is an ABI and we can't break existing setups
18 just because the device tree compiler considers it bad practice to omit
19 the unit-address nowadays.
20
21 This partially reverts the offending commit and restores device tree ABI
22 compatibility.
23
24 Fixes: 482997699ef0 ("ARM: tegra: Fix unit_address_vs_reg DTC warnings for /memory")
25 Reported-by: Tristan Bastian <tristan-c.bastian@gmx.de>
26 Signed-off-by: Thierry Reding <treding@nvidia.com>
27 Tested-by: Tristan Bastian <tristan-c.bastian@gmx.de>
28 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
29 Signed-off-by: Sasha Levin <sashal@kernel.org>
30 ---
31 arch/arm/boot/dts/tegra124-nyan.dtsi | 17 ++++++++++++++++-
32 1 file changed, 16 insertions(+), 1 deletion(-)
33
34 diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi b/arch/arm/boot/dts/tegra124-nyan.dtsi
35 index d5f11d6d987e..bc85b6a166c7 100644
36 --- a/arch/arm/boot/dts/tegra124-nyan.dtsi
37 +++ b/arch/arm/boot/dts/tegra124-nyan.dtsi
38 @@ -13,10 +13,25 @@
39 stdout-path = "serial0:115200n8";
40 };
41
42 - memory@80000000 {
43 + /*
44 + * Note that recent version of the device tree compiler (starting with
45 + * version 1.4.2) warn about this node containing a reg property, but
46 + * missing a unit-address. However, the bootloader on these Chromebook
47 + * devices relies on the full name of this node to be exactly /memory.
48 + * Adding the unit-address causes the bootloader to create a /memory
49 + * node and write the memory bank configuration to that node, which in
50 + * turn leads the kernel to believe that the device has 2 GiB of
51 + * memory instead of the amount detected by the bootloader.
52 + *
53 + * The name of this node is effectively ABI and must not be changed.
54 + */
55 + memory {
56 + device_type = "memory";
57 reg = <0x0 0x80000000 0x0 0x80000000>;
58 };
59
60 + /delete-node/ memory@80000000;
61 +
62 host1x@50000000 {
63 hdmi@54280000 {
64 status = "okay";
65 --
66 2.19.1
67