2021-01-12 14:28:32

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH v3 0/5] Expose RPi4's bootloader configuration

Soon to be released versions of RPi4's firmware will take of care
passing their bootloader's configuration[1] to the OS by copying it into
memory and creating a reserved memory node in the board's DT. By
modeling this reserved memory node as an nvmem device using
'nvmem-rmem', which this series introduces, user-space applications will
be able to query this information through nvmem's sysfs interface.

An alternative approach, less nice IMO, would be to create a
platform-specific 'soc' driver.

Regards,
Nicolas

[1] https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md

---

Changes since v2:
- Fix DT bingins

Changes since v1:
- Avoid the reserved-memory indirection by integrating the nvmem driver
into the reserved memory node.

Nicolas Saenz Julienne (5):
dt-bindings: nvmem: Add bindings for rmem driver
nvmem: Add driver to expose reserved memory as nvmem
ARM: dts: bcm2711: Add reserved memory template to hold firmware
configuration
arm64: defconfig: Enable nvmem's rmem driver
ARM: multi_v7_defconfig: Enable nvmem's rmem driver

.../devicetree/bindings/nvmem/rmem.yaml | 49 ++++++++++
arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 17 ++++
arch/arm/configs/multi_v7_defconfig | 1 +
arch/arm64/configs/defconfig | 1 +
drivers/nvmem/Kconfig | 8 ++
drivers/nvmem/Makefile | 2 +
drivers/nvmem/rmem.c | 97 +++++++++++++++++++
drivers/of/platform.c | 1 +
8 files changed, 176 insertions(+)
create mode 100644 Documentation/devicetree/bindings/nvmem/rmem.yaml
create mode 100644 drivers/nvmem/rmem.c

--
2.29.2


2021-01-12 14:28:55

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH v3 4/5] arm64: defconfig: Enable nvmem's rmem driver

It'll be used by the RPi4 family of boards to access its bootloader
configuration.

Signed-off-by: Nicolas Saenz Julienne <[email protected]>
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 9957b6669eb1..81b2418f7f72 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -1077,6 +1077,7 @@ CONFIG_ROCKCHIP_EFUSE=y
CONFIG_NVMEM_SUNXI_SID=y
CONFIG_UNIPHIER_EFUSE=y
CONFIG_MESON_EFUSE=m
+CONFIG_NVMEM_RMEM=m
CONFIG_FPGA=y
CONFIG_FPGA_MGR_STRATIX10_SOC=m
CONFIG_FPGA_BRIDGE=m
--
2.29.2

2021-01-12 14:29:04

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: [PATCH v3 5/5] ARM: multi_v7_defconfig: Enable nvmem's rmem driver

It'll be used by the RPi4 family of boards to access its bootloader
configuration.

Signed-off-by: Nicolas Saenz Julienne <[email protected]>
---
arch/arm/configs/multi_v7_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 6492a3601e7c..0914fa09af0c 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -1106,6 +1106,7 @@ CONFIG_ROCKCHIP_EFUSE=m
CONFIG_NVMEM_SUNXI_SID=y
CONFIG_NVMEM_VF610_OCOTP=y
CONFIG_MESON_MX_EFUSE=m
+CONFIG_NVMEM_RMEM=m
CONFIG_FSI=m
CONFIG_FSI_MASTER_GPIO=m
CONFIG_FSI_MASTER_HUB=m
--
2.29.2

2021-01-19 04:47:26

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH v3 0/5] Expose RPi4's bootloader configuration



On 12/01/2021 14:23, Nicolas Saenz Julienne wrote:
> Soon to be released versions of RPi4's firmware will take of care
> passing their bootloader's configuration[1] to the OS by copying it into
> memory and creating a reserved memory node in the board's DT. By
> modeling this reserved memory node as an nvmem device using
> 'nvmem-rmem', which this series introduces, user-space applications will
> be able to query this information through nvmem's sysfs interface.
>
> An alternative approach, less nice IMO, would be to create a
> platform-specific 'soc' driver.
>
> Regards,
> Nicolas
>
> [1] https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
>
> ---
>
> Changes since v2:
> - Fix DT bingins
>
> Changes since v1:
> - Avoid the reserved-memory indirection by integrating the nvmem driver
> into the reserved memory node.
>
> Nicolas Saenz Julienne (5):
> dt-bindings: nvmem: Add bindings for rmem driver
> nvmem: Add driver to expose reserved memory as nvmem
> ARM: dts: bcm2711: Add reserved memory template to hold firmware
> configuration
> arm64: defconfig: Enable nvmem's rmem driver
> ARM: multi_v7_defconfig: Enable nvmem's rmem driver
>


Thanks Applied (1/5) and (2/5), rest of patches should go via arm-soc tree!

--srini

> .../devicetree/bindings/nvmem/rmem.yaml | 49 ++++++++++
> arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 17 ++++
> arch/arm/configs/multi_v7_defconfig | 1 +
> arch/arm64/configs/defconfig | 1 +
> drivers/nvmem/Kconfig | 8 ++
> drivers/nvmem/Makefile | 2 +
> drivers/nvmem/rmem.c | 97 +++++++++++++++++++
> drivers/of/platform.c | 1 +
> 8 files changed, 176 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/nvmem/rmem.yaml
> create mode 100644 drivers/nvmem/rmem.c
>

2021-01-25 21:13:02

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH v3 0/5] Expose RPi4's bootloader configuration

On Tue, 2021-01-12 at 15:23 +0100, Nicolas Saenz Julienne wrote:
> Soon to be released versions of RPi4's firmware will take of care
> passing their bootloader's configuration[1] to the OS by copying it into
> memory and creating a reserved memory node in the board's DT. By
> modeling this reserved memory node as an nvmem device using
> 'nvmem-rmem', which this series introduces, user-space applications will
> be able to query this information through nvmem's sysfs interface.
>
> An alternative approach, less nice IMO, would be to create a
> platform-specific 'soc' driver.
>
> Regards,
> Nicolas
>
> [1] https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
>

Applied patches #3 to #5 for next.

Regards,
Nicolas


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part