Skip to contentSkip to conversation

rpi: Use OF_BOARD rather than OF_EMBED

PATCH In review Peter Robinson 3 participants 3 messages Feb 28, 2023 – Sep 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpi: Use OF_BOARD rather than OF_EMBED

The use of OF_EMBED isn't recommended for standard use and the OF_BOARD is actually a better fit for the Raspberry Pi as the prior firmware provides a DT that can be used by U-Boot and the subsequent OS too, but it still allows the loading of a DT from disk as well if users wish to use the upstream kernel DT.

---
 configs/rpi_0_w_defconfig      | 2 +-
 configs/rpi_2_defconfig        | 2 +-
 configs/rpi_3_32b_defconfig    | 2 +-
 configs/rpi_3_b_plus_defconfig | 2 +-
 configs/rpi_3_defconfig        | 2 +-
 configs/rpi_4_32b_defconfig    | 1 +
 configs/rpi_4_defconfig        | 1 +
 configs/rpi_arm64_defconfig    | 1 +
 configs/rpi_defconfig          | 2 +-
 9 files changed, 9 insertions(+), 6 deletions(-)
configs/rpi_0_w_defconfig +1 -1
index 5249b29d76c..8c217848ca2 100644
@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_2_defconfig +1 -1
index 154284765f4..bfc5679fb7e 100644
@@ -24,7 +24,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_3_32b_defconfig +1 -1
index ef1f25d2ad7..54cdcee980a 100644
@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_3_b_plus_defconfig +1 -1
index 154615d78a1..3008c7a1c18 100644
@@ -22,7 +22,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_3_defconfig +1 -1
index f0cf7f8e236..f7b9108ba00 100644
@@ -22,7 +22,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_4_32b_defconfig +1 -0
index 713b2ee231c..fa20ab767fe 100644
@@ -24,6 +24,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_4_defconfig +1 -0
index 24f70b14fe8..741d4dbbbf4 100644
@@ -24,6 +24,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
configs/rpi_arm64_defconfig +1 -0
index 1d1ff12a58c..5e1195dd786 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_TFTP_TSIZE=y
configs/rpi_defconfig +1 -1
index 28b92b14456..1504093eddf 100644
@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
Signature · 1 line
2.39.2
#1 lore raw
Quoted 7 lines · Peter Robinson

The use of OF_EMBED isn't recommended for standard use and the OF_BOARD is actually a better fit for the Raspberry Pi as the prior firmware provides a DT that can be used by U-Boot and the subsequent OS too, but it still allows the loading of a DT from disk as well if users wish to use the upstream kernel DT.

Quoted 11 lines
---
 configs/rpi_0_w_defconfig      | 2 +-
 configs/rpi_2_defconfig        | 2 +-
 configs/rpi_3_32b_defconfig    | 2 +-
 configs/rpi_3_b_plus_defconfig | 2 +-
 configs/rpi_3_defconfig        | 2 +-
 configs/rpi_4_32b_defconfig    | 1 +
 configs/rpi_4_defconfig        | 1 +
 configs/rpi_arm64_defconfig    | 1 +
 configs/rpi_defconfig          | 2 +-
 9 files changed, 9 insertions(+), 6 deletions(-)

My only concern is from when I did:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
so I think you need to also drop the "imply OF_HAS_PRIOR_STAGE" from the Kconfig files and should probably move to select (do not allow the user to override this, it shall always be OF_EMBED now), or at least imply (sufficiently advanced users may want a different choice and should be able to make it).

Signature · 1 line
Tom
#2 lore raw

Hi,

Quoted 22 lines · Tom Rini
Quoted 7 lines · Peter Robinson

The use of OF_EMBED isn't recommended for standard use and the OF_BOARD is actually a better fit for the Raspberry Pi as the prior firmware provides a DT that can be used by U-Boot and the subsequent OS too, but it still allows the loading of a DT from disk as well if users wish to use the upstream kernel DT.

Quoted 11 lines
---
 configs/rpi_0_w_defconfig      | 2 +-
 configs/rpi_2_defconfig        | 2 +-
 configs/rpi_3_32b_defconfig    | 2 +-
 configs/rpi_3_b_plus_defconfig | 2 +-
 configs/rpi_3_defconfig        | 2 +-
 configs/rpi_4_32b_defconfig    | 1 +
 configs/rpi_4_defconfig        | 1 +
 configs/rpi_arm64_defconfig    | 1 +
 configs/rpi_defconfig          | 2 +-
 9 files changed, 9 insertions(+), 6 deletions(-)
Quoted 7 lines

My only concern is from when I did:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
so I think you need to also drop the "imply OF_HAS_PRIOR_STAGE" from the Kconfig files and should probably move to select (do not allow the user to override this, it shall always be OF_EMBED now), or at least imply (sufficiently advanced users may want a different choice and should be able to make it).

This very old patch seems to have arrived in my queue. I am pleased to see it!

From my understanding the correct thing here is to 'imply OF_HAS_PRIOR_STAGE' in the Kconfig, which is done for some rpi boards but not all. Then the OF_BOARD setting becomes the default.

We should not really 'select OF_HAS_PRIOR_STAGE' since it makes testing with a U-Boot-supplied DT impossible.

Regards,
Simon