All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5] arm: socfpga: fix U-Boot running from fpga OnChip RAM
@ 2018-08-16  7:38 Simon Goldschmidt
  2018-08-16 11:17 ` Marek Vasut
  0 siblings, 1 reply; 20+ messages in thread
From: Simon Goldschmidt @ 2018-08-16  7:38 UTC (permalink / raw)
  To: u-boot

gd->env_addr points to pre-relocation address even after
relocation. This leads to an abort in env_callback_init
when loading the environment.

Fix this by enabling CONFIG_SYS_EXTRA_ENV_RELOC.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
---

Changes in v5:
Improve comments

Changes in v4:
enable this fix for all socfpga, not for gen5 only

Changes in v3:
this patch is new in v3

Changes in v2:
None

 include/configs/socfpga_common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 8ebf6b85fe..8b9f0427c0 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -284,6 +284,18 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPL_STACK		CONFIG_SYS_SPL_MALLOC_START
 #endif
 
+/*
+ * When U-Boot is started from FPGA, prevent gd->env_addr to point into
+ * FPGA OnChip RAM after relocation
+ */
+#define CONFIG_SYS_EXTRA_ENV_RELOC
+/*
+ * CONFIG_SYS_EXTRA_ENV_RELOC code needs this to calculate the relocation
+ * offset for gd->env_addr. Since this is based on gd->relocaddr, we need
+ * to use CONFIG_SYS_TEXT_BASE here.
+ */
+#define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_TEXT_BASE
+
 /* Extra Environment */
 #ifndef CONFIG_SPL_BUILD
 
-- 
2.17.1

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

end of thread, other threads:[~2018-09-19  8:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16  7:38 [U-Boot] [PATCH v5] arm: socfpga: fix U-Boot running from fpga OnChip RAM Simon Goldschmidt
2018-08-16 11:17 ` Marek Vasut
2018-08-16 13:00   ` Simon Goldschmidt
2018-08-16 13:06     ` Marek Vasut
2018-08-16 13:12       ` Simon Goldschmidt
2018-08-16 13:15         ` Marek Vasut
2018-08-16 13:50           ` Simon Goldschmidt
2018-08-16 14:04             ` Marek Vasut
2018-08-16 19:44               ` Simon Goldschmidt
2018-08-16 23:57                 ` Marek Vasut
2018-08-17  6:56                   ` Simon Goldschmidt
2018-08-17 10:01                     ` Marek Vasut
2018-08-18  8:55                       ` Simon Goldschmidt
2018-08-18 12:25                         ` Marek Vasut
2018-09-17 20:44                           ` Simon Goldschmidt
2018-09-18  9:20                             ` Marek Vasut
2018-09-18 10:29                               ` Simon Goldschmidt
2018-09-18 10:37                                 ` Marek Vasut
2018-09-18 19:55                                   ` Simon Goldschmidt
2018-09-19  8:54                                     ` Marek Vasut

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.