All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4] common: board: Dont relocate FDT incase of CONFIG_OF_EMBED
@ 2015-12-03 14:46 Michal Simek
  2015-12-06 22:07 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2015-12-03 14:46 UTC (permalink / raw)
  To: u-boot

From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>

Don't relocate fdt in case of CONFIG_OF EMBED as the fdt is
already embedded with u-boot image.
Update fdt_blob after relocation as the fdt will be copied
during u-boot relocation.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com> (QEMU x86)
Tested-by: Thomas Chou <thomas@wytron.com.tw> (Nios2)
Acked-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v4:
- board: Update fdt_blob after relocation. Updating it before
  relocation may cause issue with some devices if they try to use
  it before it actually relocated

Changes in v3:
- Remove maybe unused and move ifdefs to functions directly - reported
  by Simon

Changes in v2:
- Fix commit message reported by Alexey

 common/board_f.c | 4 ++++
 common/board_r.c | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/common/board_f.c b/common/board_f.c
index b035c90ff3b7..668a0478a45b 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -510,6 +510,7 @@ static int reserve_global_data(void)
 
 static int reserve_fdt(void)
 {
+#ifndef CONFIG_OF_EMBED
 	/*
 	 * If the device tree is sitting immediately above our image then we
 	 * must relocate it. If it is embedded in the data section, then it
@@ -523,6 +524,7 @@ static int reserve_fdt(void)
 		debug("Reserving %lu Bytes for FDT at: %08lx\n",
 		      gd->fdt_size, gd->start_addr_sp);
 	}
+#endif
 
 	return 0;
 }
@@ -660,12 +662,14 @@ static int setup_dram_config(void)
 
 static int reloc_fdt(void)
 {
+#ifndef CONFIG_OF_EMBED
 	if (gd->flags & GD_FLG_SKIP_RELOC)
 		return 0;
 	if (gd->new_fdt) {
 		memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size);
 		gd->fdt_blob = gd->new_fdt;
 	}
+#endif
 
 	return 0;
 }
diff --git a/common/board_r.c b/common/board_r.c
index f7118e8fc486..8b6576c233f2 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -165,6 +165,14 @@ static int initr_reloc_global_data(void)
 	 */
 	gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
 #endif
+#ifdef CONFIG_OF_EMBED
+	/*
+	* The fdt_blob needs to be moved to new relocation address
+	* incase of FDT blob is embedded with in image
+	*/
+	gd->fdt_blob += gd->reloc_off;
+#endif
+
 	return 0;
 }
 
-- 
1.9.1

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

* [U-Boot] [U-Boot, v4] common: board: Dont relocate FDT incase of CONFIG_OF_EMBED
  2015-12-03 14:46 [U-Boot] [PATCH v4] common: board: Dont relocate FDT incase of CONFIG_OF_EMBED Michal Simek
@ 2015-12-06 22:07 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2015-12-06 22:07 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 03, 2015 at 03:46:03PM +0100, Michal Simek wrote:

> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> 
> Don't relocate fdt in case of CONFIG_OF EMBED as the fdt is
> already embedded with u-boot image.
> Update fdt_blob after relocation as the fdt will be copied
> during u-boot relocation.
> 
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com> (QEMU x86)
> Tested-by: Thomas Chou <thomas@wytron.com.tw> (Nios2)
> Acked-by: Thomas Chou <thomas@wytron.com.tw>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151206/c7345d4a/attachment.sig>

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

end of thread, other threads:[~2015-12-06 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 14:46 [U-Boot] [PATCH v4] common: board: Dont relocate FDT incase of CONFIG_OF_EMBED Michal Simek
2015-12-06 22:07 ` [U-Boot] [U-Boot, " Tom Rini

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.