e671d4584a5a9a71c13165ea738b0192b71e936e
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0447-ARM-dts-bcm2711-Add-reserved-memory-template-to-hold.patch
1 From b3a070cf6fe04129d2c174e45c14b98a759e0402 Mon Sep 17 00:00:00 2001
2 From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
3 Date: Fri, 11 Dec 2020 12:22:01 +0100
4 Subject: [PATCH] ARM: dts: bcm2711: Add reserved memory template to
5 hold firmware configuration
6
7 RPi4's co-processor will copy the board's bootloader[1] configuration
8 into memory for the OS to consume. Specifically, for the bootloader
9 configuration and upgrade user-space routines to query it through
10 nvmem's sysfs interface.
11
12 Introduce a reserved-memory area template for the co-processor to edit
13 before booting the system so as for Linux not to overwrite that memory
14 and to expose it as an nvmem device.
15
16 Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
17
18 [1] https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
19 ---
20
21 Changes since v1:
22 - Introduce compatible string
23 - Change alias name to something more explicit
24 ---
25 arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 17 +++++++++++++++++
26 1 file changed, 17 insertions(+)
27
28 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
29 +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
30 @@ -24,6 +24,7 @@
31 emmc2bus = &emmc2bus;
32 ethernet0 = &genet;
33 pcie0 = &pcie0;
34 + blconfig = &blconfig;
35 };
36
37 leds {
38 @@ -215,6 +216,22 @@
39 status = "okay";
40 };
41
42 +&rmem {
43 + /*
44 + * RPi4's co-processor will copy the board's bootloader configuration
45 + * into memory for the OS to consume. It'll also update this node with
46 + * its placement information.
47 + */
48 + blconfig: nvram@0 {
49 + compatible = "raspberrypi,bootloader-config", "nvmem-rmem";
50 + #address-cells = <1>;
51 + #size-cells = <1>;
52 + reg = <0x0 0x0 0x0>;
53 + no-map;
54 + status = "disabled";
55 + };
56 +};
57 +
58 /* SDHCI is used to control the SDIO for wireless */
59 &sdhci {
60 #address-cells = <1>;