Skip to contentSkip to conversation

riscv: binman: fix the load field format

PATCH Superseded Randolph 2 participants 4 messages Nov 9, 2023 – Nov 15, 2023 RISC-V

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Randolph

author
#0 lore raw

PATCH 1/1 riscv: binman: fix the load field format

The #address-cells is now equal to 2. The format of the load field for the Linux kernel doesn't match.

---
 arch/riscv/dts/binman.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/dts/binman.dtsi +2 -1
index 6b4eb8dc7b..5117d7c8c9 100644
@@ -50,7 +50,8 @@
 					os = "Linux";
 					arch = "riscv";
 					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
+					load = <U64_TO_U32_H(CONFIG_TEXT_BASE)
+						U64_TO_U32_L(CONFIG_TEXT_BASE)>;
 
 					linux_blob: blob-ext {
 						filename = "Image";
Signature · 1 line
2.34.1
#1 lore raw

Hi Randolph,

Quoted 14 lines · On Wed, Nov 8, 2023, 20:15 Randolph <[email protected]> wrote:

The #address-cells is now equal to 2. The format of the load field for the Linux kernel doesn't match.

---
 arch/riscv/dts/binman.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/dts/binman.dtsi +0 -0
index 6b4eb8dc7b..5117d7c8c9 100644

arch/riscv/dts/binman.dtsi line 54

Quoted 6 lines
arch/riscv/dts/binman.dtsi +2 -1
@@ -50,7 +50,8 @@
                                        os = "Linux";
                                        arch = "riscv";
                                        compression = "none";
-                                       load = <CONFIG_TEXT_BASE>;
+                                       load = <U64_TO_U32_H(CONFIG_TEXT_BASE)
+                                               U64_TO_U32_L(CONFIG_TEXT_BASE)>;

Does this work?

load = /bits 64/ <CONFIG_TEXT_BASE>

Quoted 6 lines
arch/riscv/dts/binman.dtsi +0 -1
                                        linux_blob: blob-ext {
                                                filename = "Image";
--

2.34.1

Regards,
Simon

#2 lore raw

Hi Simon,
Thanks a lot.

Quoted 12 lines · Simon Glass

Hi Randolph,

Quoted 9 lines · On Wed, Nov 8, 2023, 20:15 Randolph <[email protected]> wrote:

The #address-cells is now equal to 2. The format of the load field for the Linux kernel doesn't match.

---
 arch/riscv/dts/binman.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 12 lines

arch/riscv/dts/binman.dtsi line 54

Quoted 11 lines
arch/riscv/dts/binman.dtsi +2 -1
index 6b4eb8dc7b..5117d7c8c9 100644
@@ -50,7 +50,8 @@
                                        os = "Linux";
                                        arch = "riscv";
                                        compression = "none";
-                                       load = <CONFIG_TEXT_BASE>;
+                                       load = <U64_TO_U32_H(CONFIG_TEXT_BASE)
+                                               U64_TO_U32_L(CONFIG_TEXT_BASE)>;

I just see the #address-cells changed from 1 to 2 in commit id: 5a348ccf0257. In my last commit for binman.dtsi (commit id: d311df8b3169), it is based on the value of #address-cells being 1. That's the reason for my patch submission.

Quoted 4 lines

Does this work?

load = /bits 64/ <CONFIG_TEXT_BASE>

Yes, it works. We use this way for the DDR memory start address above 4G platform. We find the example for 64bit address in the document tools/binman/binman.rst and use it.
What is the method that we should continue to use in the binman.dtsi?
1. #address-cells = 2
2. append /bits/64

Quoted 9 lines
Quoted 6 lines
arch/riscv/dts/binman.dtsi +0 -1
                                        linux_blob: blob-ext {
                                                filename = "Image";
--

2.34.1

Regards,
Simon

#3 lore raw

Hi Randolph,

Quoted 33 lines · Randolph Lin

Hi Simon,
Thanks a lot.

Quoted 12 lines · Simon Glass

Hi Randolph,

Quoted 9 lines · On Wed, Nov 8, 2023, 20:15 Randolph <[email protected]> wrote:

The #address-cells is now equal to 2. The format of the load field for the Linux kernel doesn't match.

---
 arch/riscv/dts/binman.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 12 lines

arch/riscv/dts/binman.dtsi line 54

Quoted 11 lines
arch/riscv/dts/binman.dtsi +2 -1
index 6b4eb8dc7b..5117d7c8c9 100644
@@ -50,7 +50,8 @@
                                        os = "Linux";
                                        arch = "riscv";
                                        compression = "none";
-                                       load = <CONFIG_TEXT_BASE>;
+                                       load = <U64_TO_U32_H(CONFIG_TEXT_BASE)
+                                               U64_TO_U32_L(CONFIG_TEXT_BASE)>;

I just see the #address-cells changed from 1 to 2 in commit id: 5a348ccf0257. In my last commit for binman.dtsi (commit id: d311df8b3169), it is based on the value of #address-cells being 1. That's the reason for my patch submission.

Quoted 2 lines

Does this work?

Quoted 8 lines
Quoted 2 lines

load = /bits 64/ <CONFIG_TEXT_BASE>

Yes, it works. We use this way for the DDR memory start address above 4G platform. We find the example for 64bit address in the document tools/binman/binman.rst and use it.
What is the method that we should continue to use in the binman.dtsi?
1. #address-cells = 2
2. append /bits/64

I believe these go together. Using (1) means you have a 2-cell value, which is 64 bits since each cell is 32-bits.

Or perhaps I misunderstand what you are asking?

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
arch/riscv/dts/binman.dtsi +0 -1
                                        linux_blob: blob-ext {
                                                filename = "Image";
--

2.34.1

Regards,
Simon