diff mbox series

[v3,5/9] sunxi: binman: Provide a default BL31 filename

Message ID 20200906032615.40448-6-samuel@sholland.org
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series sunxi: binman fixes and SCP firmware support | expand

Commit Message

Samuel Holland Sept. 6, 2020, 3:26 a.m. UTC
Prior to commit 7f7f8aca8257 ("sunxi: Convert 64-bit boards to use
binman"), if the BL31 environment variable was not defined, the firmware
would be loaded from a file "bl31.bin" in the current directory. Restore
that behavior by providing that as the default filename in case no entry
arg is provided, which will be the case if the environment variable is
unset.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

I tested this and verified it to work. The key code is from
tools/binman/etype/blob_named_by_arg.py:
	super().__init__(...)
	filename, = self.GetEntryArgsOrProps(...)
	if filename:
	    self._filename = filename

If `filename` is the empty string, it evaluates to False, and the filename
set from the DT property in the superclass constructor is not overwritten.

---
 arch/arm/dts/sunxi-u-boot.dtsi | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Glass Sept. 6, 2020, 1:58 p.m. UTC | #1
On Sat, 5 Sep 2020 at 21:26, Samuel Holland <samuel@sholland.org> wrote:
>
> Prior to commit 7f7f8aca8257 ("sunxi: Convert 64-bit boards to use
> binman"), if the BL31 environment variable was not defined, the firmware
> would be loaded from a file "bl31.bin" in the current directory. Restore
> that behavior by providing that as the default filename in case no entry
> arg is provided, which will be the case if the environment variable is
> unset.
>
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
> I tested this and verified it to work. The key code is from
> tools/binman/etype/blob_named_by_arg.py:
>         super().__init__(...)
>         filename, = self.GetEntryArgsOrProps(...)
>         if filename:
>             self._filename = filename
>
> If `filename` is the empty string, it evaluates to False, and the filename
> set from the DT property in the superclass constructor is not overwritten.
>
> ---
>  arch/arm/dts/sunxi-u-boot.dtsi | 1 +
>  1 file changed, 1 insertion(+)
>

This is fine. I thought you wanted it to be a default for the etype as
a whole, which would need a bit of refactoring. But if you are happy
with this, it's good.

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
index 82b97a9503f..6ab0c783ba5 100644
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -52,6 +52,7 @@ 
 #endif
 
 					atf-bl31 {
+						filename = "bl31.bin";
 					};
 				};