All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/4] beaglev: enable opensbi generic platform
@ 2021-06-15  0:17 Drew Fustini
  2021-06-15  0:17 ` [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Drew Fustini @ 2021-06-15  0:17 UTC (permalink / raw)
  To: buildroot

Introduce BR2_TARGET_UBOOT_FORMAT_DTB to copy u-boot.dtb [1] to
BINARIES_DIR. This file can be used for FW_FDT_PATH [2] in OpenSBI build
when BR2_TARGET_OPENSBI_FW_FDT_PATH is enabled.
  
Update u-boot in beaglev_defconfig to new commit in starfive-tech repo
which enables CONFIG_OF_SEPARATE to build u-boot.dtb [3]. Finally switch
to upstream OpenSBI repo and use generic platform now that it supports
the console UART [4] on the BeagleV Starlight JH7100 board.
 
[1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
[2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
[3] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
[4] https://github.com/riscv/opensbi/commit/e822b7504df0583a6a227d51cb7da8ea9fc79c0a

Drew Fustini (4):
  boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB
  boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH
  configs/beaglev: update u-boot to enable OF_SEPARATE
  configs/beaglev: switch to upstream opensbi generic platform

 boot/opensbi/Config.in    | 10 ++++++++++
 boot/opensbi/opensbi.mk   |  3 +++
 boot/uboot/Config.in      |  3 +++
 boot/uboot/uboot.mk       |  4 ++++
 configs/beaglev_defconfig | 10 ++++++----
 5 files changed, 26 insertions(+), 4 deletions(-)

-- 
2.27.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB
  2021-06-15  0:17 [Buildroot] [PATCH 0/4] beaglev: enable opensbi generic platform Drew Fustini
@ 2021-06-15  0:17 ` Drew Fustini
  2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:51   ` Alistair Francis
  2021-06-15  0:17 ` [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH Drew Fustini
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Drew Fustini @ 2021-06-15  0:17 UTC (permalink / raw)
  To: buildroot

If u-boot CONFIG_OF_SEPARATE is defined [1], then the device tree will
be built and placed in a u-boot.dtb file alongside u-boot.bin.

When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
u-boot.dtb to $(BINARIES_DIR).

This is useful for RISC-V platforms that want to build OpenSBI with an
external DTB by using FW_FDT_PATH [2].

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
[2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md

Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 boot/uboot/Config.in | 3 +++
 boot/uboot/uboot.mk  | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 00c667412006..44a16d892a60 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -252,6 +252,9 @@ config BR2_TARGET_UBOOT_FORMAT_BIN
 	bool "u-boot.bin"
 	default y
 
+config BR2_TARGET_UBOOT_FORMAT_DTB
+	bool "u-boot.dtb"
+
 config BR2_TARGET_UBOOT_FORMAT_DTB_BIN
 	bool "u-boot-dtb.bin"
 
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index dbe82e65b17e..923fd0c1d46c 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -48,6 +48,10 @@ ifeq ($(BR2_TARGET_UBOOT_FORMAT_BIN),y)
 UBOOT_BINS += u-boot.bin
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_DTB),y)
+UBOOT_BINS += u-boot.dtb
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
 UBOOT_BINS += u-boot
 # To make elf usable for debuging on ARC use special target
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH
  2021-06-15  0:17 [Buildroot] [PATCH 0/4] beaglev: enable opensbi generic platform Drew Fustini
  2021-06-15  0:17 ` [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
@ 2021-06-15  0:17 ` Drew Fustini
  2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:56   ` Alistair Francis
  2021-06-15  0:17 ` [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE Drew Fustini
  2021-06-15  0:17 ` [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform Drew Fustini
  3 siblings, 2 replies; 13+ messages in thread
From: Drew Fustini @ 2021-06-15  0:17 UTC (permalink / raw)
  To: buildroot

If u-boot CONFIG_OF_SEPARATE is defined [1], then the device tree will
be built and placed in a u-boot.dtb file alongside u-boot.bin.

When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
u-boot.dtb to $(BINARIES_DIR).

This is useful for RISC-V platforms that want to build OpenSBI with an
external DTB by using FW_FDT_PATH [2].

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
[2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md

Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 boot/opensbi/Config.in  | 10 ++++++++++
 boot/opensbi/opensbi.mk |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
index 632eeec88d77..bd4bd5ee6175 100644
--- a/boot/opensbi/Config.in
+++ b/boot/opensbi/Config.in
@@ -109,4 +109,14 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
 	help
 	  Build OpenSBI with the U-Boot as a Payload.
 
+config BR2_TARGET_OPENSBI_FW_FDT_PATH
+	bool "Include U-Boot DTB in OpenSBI Payload"
+	depends on BR2_TARGET_OPENSBI_PLAT != ""
+	depends on BR2_TARGET_UBOOT
+	depends on BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
+	select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
+	help
+	  Build OpenSBI with FW_FDT_PATH set to $(BINARIES_DIR)/u-boot.dtb
+	  Note that CONFIG_OF_SEPARATE must be set in the u-boot kconfig.
+
 endif
diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
index a525b8aea348..8e055633a82d 100644
--- a/boot/opensbi/opensbi.mk
+++ b/boot/opensbi/opensbi.mk
@@ -46,6 +46,9 @@ endif
 ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
 OPENSBI_DEPENDENCIES += uboot
 OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
+ifeq ($(BR2_TARGET_OPENSBI_FW_FDT_PATH),y)
+OPENSBI_MAKE_ENV += FW_FDT_PATH="$(BINARIES_DIR)/u-boot.dtb"
+endif
 endif
 
 define OPENSBI_BUILD_CMDS
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE
  2021-06-15  0:17 [Buildroot] [PATCH 0/4] beaglev: enable opensbi generic platform Drew Fustini
  2021-06-15  0:17 ` [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
  2021-06-15  0:17 ` [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH Drew Fustini
@ 2021-06-15  0:17 ` Drew Fustini
  2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:56   ` Alistair Francis
  2021-06-15  0:17 ` [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform Drew Fustini
  3 siblings, 2 replies; 13+ messages in thread
From: Drew Fustini @ 2021-06-15  0:17 UTC (permalink / raw)
  To: buildroot

Update commit ID of u-boot to latest commit in starfive-tech repo [1]
which enables OF_SEPARATE [2].

[1] https://github.com/starfive-tech/u-boot/tree/Fedora_VIC_7100_2021.04
[2] https://github.com/starfive-tech/u-boot/commit/64ead5b83959da8eb87b6963843addf5942e6ed4

Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 configs/beaglev_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
index 895902a11a7c..fcbea2cdec86 100644
--- a/configs/beaglev_defconfig
+++ b/configs/beaglev_defconfig
@@ -33,7 +33,7 @@ BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
 # HEAD of the starfive-tech:Fedora_VIC_7100_2021.04 branch
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,494e5ef7b8071d0b2fba50616d97771e44cbcb7c)/uboot-494e5ef7b8071d0b2fba50616d97771e44cbcb7c.tar.gz"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,64ead5b83959da8eb87b6963843addf5942e6ed4)/uboot-64ead5b83959da8eb87b6963843addf5942e6ed4.tar.gz"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_JH71XX_TOOLS=y
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform
  2021-06-15  0:17 [Buildroot] [PATCH 0/4] beaglev: enable opensbi generic platform Drew Fustini
                   ` (2 preceding siblings ...)
  2021-06-15  0:17 ` [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE Drew Fustini
@ 2021-06-15  0:17 ` Drew Fustini
  2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:57   ` Alistair Francis
  3 siblings, 2 replies; 13+ messages in thread
From: Drew Fustini @ 2021-06-15  0:17 UTC (permalink / raw)
  To: buildroot

Switch from the starfive-tech opensbi to upstream repo and use generic
platform now that it supports the console uart [1]. This landed after
the 0.9 release [2], so the current head of master branch is used [3].

FW_FDT_PATH is set to u-boot.dtb so that the device tree from u-boot
will be included in the OpenSBI build [4]. Note that u-boot must have
CONFIG_OF_SEPARATE enabled for u-boot to build u-boot.dtb [5].

[1] https://github.com/riscv/opensbi/commit/e822b7504df0583a6a227d51cb7da8ea9fc79c0a
[2] https://github.com/riscv/opensbi/commit/234ed8e427f4d92903123199f6590d144e0d9351
[3] https://github.com/riscv/opensbi/commit/79f9b4220ffa7f74356054be25d450d7958bf16c
[4] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
[5] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control

Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 configs/beaglev_defconfig | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
index fcbea2cdec86..29e3a52be36c 100644
--- a/configs/beaglev_defconfig
+++ b/configs/beaglev_defconfig
@@ -23,17 +23,19 @@ BR2_TARGET_BEAGLEV_DDRINIT=y
 BR2_TARGET_BEAGLEV_SECONDBOOT=y
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
-# HEAD of the Fedora branch
-BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,opensbi,2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5)/opensbi-2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5.tar.gz"
-BR2_TARGET_OPENSBI_PLAT="starfive/vic7100"
+# upstream opensbi master branch
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,riscv,opensbi,79f9b4220ffa7f74356054be25d450d7958bf16c)/opensbi-79f9b4220ffa7f74356054be25d450d7958bf16c.tar.gz"
+BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG is not set
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_OPENSBI_UBOOT_PAYLOAD=y
+BR2_TARGET_OPENSBI_FW_FDT_PATH=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
 # HEAD of the starfive-tech:Fedora_VIC_7100_2021.04 branch
 BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,64ead5b83959da8eb87b6963843addf5942e6ed4)/uboot-64ead5b83959da8eb87b6963843addf5942e6ed4.tar.gz"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
+BR2_TARGET_UBOOT_FORMAT_DTB=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_JH71XX_TOOLS=y
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB
  2021-06-15  0:17 ` [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
@ 2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:51   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Bin Meng @ 2021-06-15  7:47 UTC (permalink / raw)
  To: buildroot

Hi Drew,

On Tue, Jun 15, 2021 at 8:18 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> If u-boot CONFIG_OF_SEPARATE is defined [1], then the device tree will

nits: U-Boot

> be built and placed in a u-boot.dtb file alongside u-boot.bin.
>
> When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
> u-boot.dtb to $(BINARIES_DIR).
>
> This is useful for RISC-V platforms that want to build OpenSBI with an
> external DTB by using FW_FDT_PATH [2].
>
> [1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control

Please use the official U-Boot github URL, instead of a fork.

https://github.com/u-boot/u-boot

> [2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>
> ---
>  boot/uboot/Config.in | 3 +++
>  boot/uboot/uboot.mk  | 4 ++++
>  2 files changed, 7 insertions(+)
>

Otherwise,
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Regards,
Bin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH
  2021-06-15  0:17 ` [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH Drew Fustini
@ 2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:56   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Bin Meng @ 2021-06-15  7:47 UTC (permalink / raw)
  To: buildroot

Hi Drew,

On Tue, Jun 15, 2021 at 8:18 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> If u-boot CONFIG_OF_SEPARATE is defined [1], then the device tree will

nits: U-Boot

> be built and placed in a u-boot.dtb file alongside u-boot.bin.
>
> When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
> u-boot.dtb to $(BINARIES_DIR).
>
> This is useful for RISC-V platforms that want to build OpenSBI with an
> external DTB by using FW_FDT_PATH [2].
>
> [1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control

Please use the official U-Boot github URL: https://github.com/u-boot/u-boot

> [2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>
> ---
>  boot/opensbi/Config.in  | 10 ++++++++++
>  boot/opensbi/opensbi.mk |  3 +++
>  2 files changed, 13 insertions(+)
>

Otherwise,
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Regards,
Bin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE
  2021-06-15  0:17 ` [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE Drew Fustini
@ 2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:56   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Bin Meng @ 2021-06-15  7:47 UTC (permalink / raw)
  To: buildroot

On Tue, Jun 15, 2021 at 8:18 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> Update commit ID of u-boot to latest commit in starfive-tech repo [1]

nits: U-Boot (and in the commit title)

> which enables OF_SEPARATE [2].
>
> [1] https://github.com/starfive-tech/u-boot/tree/Fedora_VIC_7100_2021.04
> [2] https://github.com/starfive-tech/u-boot/commit/64ead5b83959da8eb87b6963843addf5942e6ed4
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>
> ---
>  configs/beaglev_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Otherwise,
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform
  2021-06-15  0:17 ` [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform Drew Fustini
@ 2021-06-15  7:47   ` Bin Meng
  2021-06-15  7:57   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Bin Meng @ 2021-06-15  7:47 UTC (permalink / raw)
  To: buildroot

On Tue, Jun 15, 2021 at 8:18 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> Switch from the starfive-tech opensbi to upstream repo and use generic
> platform now that it supports the console uart [1]. This landed after
> the 0.9 release [2], so the current head of master branch is used [3].
>
> FW_FDT_PATH is set to u-boot.dtb so that the device tree from u-boot

nits: from U-Boot

> will be included in the OpenSBI build [4]. Note that u-boot must have

nits: U-Boot

> CONFIG_OF_SEPARATE enabled for u-boot to build u-boot.dtb [5].

nits: for U-Boot

>
> [1] https://github.com/riscv/opensbi/commit/e822b7504df0583a6a227d51cb7da8ea9fc79c0a
> [2] https://github.com/riscv/opensbi/commit/234ed8e427f4d92903123199f6590d144e0d9351
> [3] https://github.com/riscv/opensbi/commit/79f9b4220ffa7f74356054be25d450d7958bf16c
> [4] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
> [5] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control

nits: use the official U-Boot github repo

>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>
> ---
>  configs/beaglev_defconfig | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>

Otherwise,
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB
  2021-06-15  0:17 ` [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
  2021-06-15  7:47   ` Bin Meng
@ 2021-06-15  7:51   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Alistair Francis @ 2021-06-15  7:51 UTC (permalink / raw)
  To: buildroot

On Tue, Jun 15, 2021 at 10:18 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> If u-boot CONFIG_OF_SEPARATE is defined [1], then the device tree will
> be built and placed in a u-boot.dtb file alongside u-boot.bin.
>
> When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
> u-boot.dtb to $(BINARIES_DIR).
>
> This is useful for RISC-V platforms that want to build OpenSBI with an
> external DTB by using FW_FDT_PATH [2].
>
> [1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
> [2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>

After Bin's comments are addresses:

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  boot/uboot/Config.in | 3 +++
>  boot/uboot/uboot.mk  | 4 ++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 00c667412006..44a16d892a60 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -252,6 +252,9 @@ config BR2_TARGET_UBOOT_FORMAT_BIN
>         bool "u-boot.bin"
>         default y
>
> +config BR2_TARGET_UBOOT_FORMAT_DTB
> +       bool "u-boot.dtb"
> +
>  config BR2_TARGET_UBOOT_FORMAT_DTB_BIN
>         bool "u-boot-dtb.bin"
>
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index dbe82e65b17e..923fd0c1d46c 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -48,6 +48,10 @@ ifeq ($(BR2_TARGET_UBOOT_FORMAT_BIN),y)
>  UBOOT_BINS += u-boot.bin
>  endif
>
> +ifeq ($(BR2_TARGET_UBOOT_FORMAT_DTB),y)
> +UBOOT_BINS += u-boot.dtb
> +endif
> +
>  ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
>  UBOOT_BINS += u-boot
>  # To make elf usable for debuging on ARC use special target
> --
> 2.27.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH
  2021-06-15  0:17 ` [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH Drew Fustini
  2021-06-15  7:47   ` Bin Meng
@ 2021-06-15  7:56   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Alistair Francis @ 2021-06-15  7:56 UTC (permalink / raw)
  To: buildroot

On Tue, Jun 15, 2021 at 10:18 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> If u-boot CONFIG_OF_SEPARATE is defined [1], then the device tree will
> be built and placed in a u-boot.dtb file alongside u-boot.bin.
>
> When BR2_TARGET_UBOOT_FORMAT_DTB is enabled, buildroot will copy
> u-boot.dtb to $(BINARIES_DIR).
>
> This is useful for RISC-V platforms that want to build OpenSBI with an
> external DTB by using FW_FDT_PATH [2].
>
> [1] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
> [2] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  boot/opensbi/Config.in  | 10 ++++++++++
>  boot/opensbi/opensbi.mk |  3 +++
>  2 files changed, 13 insertions(+)
>
> diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
> index 632eeec88d77..bd4bd5ee6175 100644
> --- a/boot/opensbi/Config.in
> +++ b/boot/opensbi/Config.in
> @@ -109,4 +109,14 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
>         help
>           Build OpenSBI with the U-Boot as a Payload.
>
> +config BR2_TARGET_OPENSBI_FW_FDT_PATH
> +       bool "Include U-Boot DTB in OpenSBI Payload"
> +       depends on BR2_TARGET_OPENSBI_PLAT != ""
> +       depends on BR2_TARGET_UBOOT
> +       depends on BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
> +       select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
> +       help
> +         Build OpenSBI with FW_FDT_PATH set to $(BINARIES_DIR)/u-boot.dtb
> +         Note that CONFIG_OF_SEPARATE must be set in the u-boot kconfig.
> +
>  endif
> diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
> index a525b8aea348..8e055633a82d 100644
> --- a/boot/opensbi/opensbi.mk
> +++ b/boot/opensbi/opensbi.mk
> @@ -46,6 +46,9 @@ endif
>  ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
>  OPENSBI_DEPENDENCIES += uboot
>  OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
> +ifeq ($(BR2_TARGET_OPENSBI_FW_FDT_PATH),y)
> +OPENSBI_MAKE_ENV += FW_FDT_PATH="$(BINARIES_DIR)/u-boot.dtb"
> +endif
>  endif
>
>  define OPENSBI_BUILD_CMDS
> --
> 2.27.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE
  2021-06-15  0:17 ` [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE Drew Fustini
  2021-06-15  7:47   ` Bin Meng
@ 2021-06-15  7:56   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Alistair Francis @ 2021-06-15  7:56 UTC (permalink / raw)
  To: buildroot

On Tue, Jun 15, 2021 at 10:19 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> Update commit ID of u-boot to latest commit in starfive-tech repo [1]
> which enables OF_SEPARATE [2].
>
> [1] https://github.com/starfive-tech/u-boot/tree/Fedora_VIC_7100_2021.04
> [2] https://github.com/starfive-tech/u-boot/commit/64ead5b83959da8eb87b6963843addf5942e6ed4
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  configs/beaglev_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
> index 895902a11a7c..fcbea2cdec86 100644
> --- a/configs/beaglev_defconfig
> +++ b/configs/beaglev_defconfig
> @@ -33,7 +33,7 @@ BR2_TARGET_UBOOT=y
>  BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
>  BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
>  # HEAD of the starfive-tech:Fedora_VIC_7100_2021.04 branch
> -BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,494e5ef7b8071d0b2fba50616d97771e44cbcb7c)/uboot-494e5ef7b8071d0b2fba50616d97771e44cbcb7c.tar.gz"
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,64ead5b83959da8eb87b6963843addf5942e6ed4)/uboot-64ead5b83959da8eb87b6963843addf5942e6ed4.tar.gz"
>  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_JH71XX_TOOLS=y
> --
> 2.27.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform
  2021-06-15  0:17 ` [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform Drew Fustini
  2021-06-15  7:47   ` Bin Meng
@ 2021-06-15  7:57   ` Alistair Francis
  1 sibling, 0 replies; 13+ messages in thread
From: Alistair Francis @ 2021-06-15  7:57 UTC (permalink / raw)
  To: buildroot

On Tue, Jun 15, 2021 at 10:19 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> Switch from the starfive-tech opensbi to upstream repo and use generic
> platform now that it supports the console uart [1]. This landed after
> the 0.9 release [2], so the current head of master branch is used [3].
>
> FW_FDT_PATH is set to u-boot.dtb so that the device tree from u-boot
> will be included in the OpenSBI build [4]. Note that u-boot must have
> CONFIG_OF_SEPARATE enabled for u-boot to build u-boot.dtb [5].
>
> [1] https://github.com/riscv/opensbi/commit/e822b7504df0583a6a227d51cb7da8ea9fc79c0a
> [2] https://github.com/riscv/opensbi/commit/234ed8e427f4d92903123199f6590d144e0d9351
> [3] https://github.com/riscv/opensbi/commit/79f9b4220ffa7f74356054be25d450d7958bf16c
> [4] https://github.com/riscv/opensbi/blob/master/docs/firmware/fw.md
> [5] https://github.com/lentinj/u-boot/blob/master/doc/README.fdt-control
>
> Signed-off-by: Drew Fustini <drew@beagleboard.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  configs/beaglev_defconfig | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
> index fcbea2cdec86..29e3a52be36c 100644
> --- a/configs/beaglev_defconfig
> +++ b/configs/beaglev_defconfig
> @@ -23,17 +23,19 @@ BR2_TARGET_BEAGLEV_DDRINIT=y
>  BR2_TARGET_BEAGLEV_SECONDBOOT=y
>  BR2_TARGET_OPENSBI=y
>  BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
> -# HEAD of the Fedora branch
> -BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,opensbi,2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5)/opensbi-2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5.tar.gz"
> -BR2_TARGET_OPENSBI_PLAT="starfive/vic7100"
> +# upstream opensbi master branch
> +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,riscv,opensbi,79f9b4220ffa7f74356054be25d450d7958bf16c)/opensbi-79f9b4220ffa7f74356054be25d450d7958bf16c.tar.gz"
> +BR2_TARGET_OPENSBI_PLAT="generic"
>  # BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG is not set
>  # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
>  BR2_TARGET_OPENSBI_UBOOT_PAYLOAD=y
> +BR2_TARGET_OPENSBI_FW_FDT_PATH=y
>  BR2_TARGET_UBOOT=y
>  BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
>  BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
>  # HEAD of the starfive-tech:Fedora_VIC_7100_2021.04 branch
>  BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,64ead5b83959da8eb87b6963843addf5942e6ed4)/uboot-64ead5b83959da8eb87b6963843addf5942e6ed4.tar.gz"
>  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
> +BR2_TARGET_UBOOT_FORMAT_DTB=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_JH71XX_TOOLS=y
> --
> 2.27.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-06-15  7:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15  0:17 [Buildroot] [PATCH 0/4] beaglev: enable opensbi generic platform Drew Fustini
2021-06-15  0:17 ` [Buildroot] [PATCH 1/4] boot/uboot: introduce BR2_TARGET_UBOOT_FORMAT_DTB Drew Fustini
2021-06-15  7:47   ` Bin Meng
2021-06-15  7:51   ` Alistair Francis
2021-06-15  0:17 ` [Buildroot] [PATCH 2/4] boot/opensbi: introduce BR2_TARGET_OPENSBI_FW_FDT_PATH Drew Fustini
2021-06-15  7:47   ` Bin Meng
2021-06-15  7:56   ` Alistair Francis
2021-06-15  0:17 ` [Buildroot] [PATCH 3/4] configs/beaglev: update u-boot to enable OF_SEPARATE Drew Fustini
2021-06-15  7:47   ` Bin Meng
2021-06-15  7:56   ` Alistair Francis
2021-06-15  0:17 ` [Buildroot] [PATCH 4/4] configs/beaglev: switch to upstream opensbi generic platform Drew Fustini
2021-06-15  7:47   ` Bin Meng
2021-06-15  7:57   ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.