diff mbox series

[v3,2/2] spl: fdt: Record load/entry fit-images entries in 64bit format

Message ID 96f941c67199250db9dc07bf78212f9e834b0237.1602489072.git.michal.simek@xilinx.com
State Superseded
Delegated to: Tom Rini
Headers show
Series Add support for loading images above 4GB | expand

Commit Message

Michal Simek Oct. 12, 2020, 7:51 a.m. UTC
The commit 9f45aeb93727 ("spl: fit: implement fdt_record_loadable") which
introduced fdt_record_loadable() state there spl_fit.c is not 64bit safe.
Based on my tests on Xilinx ZynqMP zcu102 platform there shouldn't be a
problem to record these addresses in 64bit format.
The patch adds support for systems which need to load images above 4GB.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

(no changes since v1)

 common/fdt_support.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Simon Glass Oct. 15, 2020, 3:05 p.m. UTC | #1
On Mon, 12 Oct 2020 at 01:51, Michal Simek <michal.simek@xilinx.com> wrote:
>
> The commit 9f45aeb93727 ("spl: fit: implement fdt_record_loadable") which
> introduced fdt_record_loadable() state there spl_fit.c is not 64bit safe.
> Based on my tests on Xilinx ZynqMP zcu102 platform there shouldn't be a
> problem to record these addresses in 64bit format.
> The patch adds support for systems which need to load images above 4GB.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> (no changes since v1)
>
>  common/fdt_support.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)

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

I am wondering whether we should use #size-cells etc. to select this?
Michal Simek Oct. 15, 2020, 4:18 p.m. UTC | #2
On 15. 10. 20 17:05, Simon Glass wrote:
> On Mon, 12 Oct 2020 at 01:51, Michal Simek <michal.simek@xilinx.com> wrote:
>>
>> The commit 9f45aeb93727 ("spl: fit: implement fdt_record_loadable") which
>> introduced fdt_record_loadable() state there spl_fit.c is not 64bit safe.
>> Based on my tests on Xilinx ZynqMP zcu102 platform there shouldn't be a
>> problem to record these addresses in 64bit format.
>> The patch adds support for systems which need to load images above 4GB.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> (no changes since v1)
>>
>>  common/fdt_support.c | 9 ++-------
>>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> I am wondering whether we should use #size-cells etc. to select this?
> 

size-cells/address-cells are used for reg property. We are not using it
and it is really just property with two cells which are pointing to
address. That's why I don't think we need this property there.

Thanks,
Michal
diff mbox series

Patch

diff --git a/common/fdt_support.c b/common/fdt_support.c
index b8a8768a2147..5ae75df3c658 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -611,14 +611,9 @@  int fdt_record_loadable(void *blob, u32 index, const char *name,
 	if (node < 0)
 		return node;
 
-	/*
-	 * We record these as 32bit entities, possibly truncating addresses.
-	 * However, spl_fit.c is not 64bit safe either: i.e. we should not
-	 * have an issue here.
-	 */
-	fdt_setprop_u32(blob, node, "load", load_addr);
+	fdt_setprop_u64(blob, node, "load", load_addr);
 	if (entry_point != -1)
-		fdt_setprop_u32(blob, node, "entry", entry_point);
+		fdt_setprop_u64(blob, node, "entry", entry_point);
 	fdt_setprop_u32(blob, node, "size", size);
 	if (type)
 		fdt_setprop_string(blob, node, "type", type);