Skip to contentSkip to conversation

cmd: fdt: Fix fdt address information after the movement

PATCH New Marek Vasut 2 participants 5 messages Oct 18, 2018 – Nov 22, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: fdt: Fix fdt address information after the movement

From: Hiroyuki Yokoyama <[email protected]>

This patch fixes the address information of fdt.

wrong case:
=> fdt addr 0x48000000
=> fdt move 0x48000000 0x41000000 0xa000
=> fdt addr
The address of the fdt is 48000000

Active address in this case is 0x41000000.

Cc Hiroyuki Yokoyama <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Pantelis Antoniou <[email protected]>
---
 cmd/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/fdt.c +1 -1
index 8a19a3fdbf..84be26f4f1 100644
@@ -202,7 +202,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 				fdt_strerror(err));
 			return 1;
 		}
-		working_fdt = newaddr;
+		set_working_fdt_addr((ulong)newaddr);
 #ifdef CONFIG_OF_SYSTEM_SETUP
 	/* Call the board-specific fixup routine */
 	} else if (strncmp(argv[1], "sys", 3) == 0) {
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 cmd: fdt: Fix fdt address information after the movement

Quoted 13 lines · Marek Vasut

From: Hiroyuki Yokoyama <[email protected]>

This patch fixes the address information of fdt.

wrong case:
=> fdt addr 0x48000000
=> fdt move 0x48000000 0x41000000 0xa000
=> fdt addr
The address of the fdt is 48000000

Active address in this case is 0x41000000.

Quoted 9 lines
Cc Hiroyuki Yokoyama <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Pantelis Antoniou <[email protected]>
---
 cmd/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Also, the cast to struct fdt_header * in the code above looks wrong. I think it should have a map_sysmem() in there.

#2 lore raw

PATCH 1/1 cmd: fdt: Fix fdt address information after the movement

Quoted 24 lines · Simon Glass
Quoted 13 lines · Marek Vasut

From: Hiroyuki Yokoyama <[email protected]>

This patch fixes the address information of fdt.

wrong case:
=> fdt addr 0x48000000
=> fdt move 0x48000000 0x41000000 0xa000
=> fdt addr
The address of the fdt is 48000000

Active address in this case is 0x41000000.

Quoted 9 lines
Cc Hiroyuki Yokoyama <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Pantelis Antoniou <[email protected]>
---
 cmd/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines

Also, the cast to struct fdt_header * in the code above looks wrong. I think it should have a map_sysmem() in there.

Rather than that, I wonder, what would happen if we put FDT above 32bit address space and used the 'fdt' command ? Would that work or not ? I suspect the later ...

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

PATCH 1/1 cmd: fdt: Fix fdt address information after the movement

Hi Marek,

Quoted 26 lines · Marek Vasut
Quoted 24 lines · Simon Glass
Quoted 22 lines · Marek Vasut

From: Hiroyuki Yokoyama <[email protected]>

This patch fixes the address information of fdt.

wrong case:
=> fdt addr 0x48000000
=> fdt move 0x48000000 0x41000000 0xa000
=> fdt addr
The address of the fdt is 48000000

Active address in this case is 0x41000000.

Cc Hiroyuki Yokoyama <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Pantelis Antoniou <[email protected]>
---
 cmd/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 4 lines

Also, the cast to struct fdt_header * in the code above looks wrong. I think it should have a map_sysmem() in there.

Rather than that, I wonder, what would happen if we put FDT above 32bit address space and used the 'fdt' command ? Would that work or not ? I suspect the later ...

I don't know. I'm looking forward to having tests for all these cases one day.

Regards,
Simon

#4 lore raw

PATCH 1/1 cmd: fdt: Fix fdt address information after the movement

Quoted 32 lines · Simon Glass

Hi Marek,

Quoted 28 lines · Marek Vasut
Quoted 26 lines · Simon Glass
Quoted 13 lines · Marek Vasut

From: Hiroyuki Yokoyama <[email protected]>

This patch fixes the address information of fdt.

wrong case:
=> fdt addr 0x48000000
=> fdt move 0x48000000 0x41000000 0xa000
=> fdt addr
The address of the fdt is 48000000

Active address in this case is 0x41000000.

Quoted 9 lines
Cc Hiroyuki Yokoyama <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
Cc Pantelis Antoniou <[email protected]>
---
 cmd/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Also, the cast to struct fdt_header * in the code above looks wrong. I think it should have a map_sysmem() in there.

Rather than that, I wonder, what would happen if we put FDT above 32bit address space and used the 'fdt' command ? Would that work or not ? I suspect the later ...

I don't know. I'm looking forward to having tests for all these cases one day.

Applied to u-boot-dm, thanks!