Re: [RFC 6/8] m68k: m5441x: set rambar to end of SRAM physical addr space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

Le 08/07/2015 15:53, Greg Ungerer a écrit :
Hi Yannick,

On 08/07/15 19:51, Yannick GICQUEL wrote:
Even if SRAM is not used, this is required to avoid inconsistency at runtime.
Otherwise, an assertion failed in ld.so during init process execution:

Inconsistency detected by ld.so: rtld.c: 1290: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!

Can you explain further?
Is this really the underlying problem?
Surely the presence of the SRAM block mapped in shouldn't
have any impact on running applications.

I think this is due to SRAM backdoor default activation on m5441x.

cf. reference manual (p.190):
(...)By default, the RAMBAR is invalid, but the backdoor is enabled. In this state, any core accesses to the SRAM are routed through the backdoor(...)

Also, i think this backdoor must be disabled. In section 4.3.1.2.3, its explained the "the address mode for normal accesses is determined by the MMUBAR, RAMBARs, and ACRs in the priority order listed(...)", before handling these accesses as virtual addresses.

Thus, when the backdoor is enable, the virtual address translation is not performed for the SRAM 64Kb range.


I just realized that i didn't simply try disabling the backdoor by setting RAMBAR to 0. I have just done this test and this seems sufficient to fix the assertion failed at ld.so
execution.

Where does CONFIG_SRAM_BASE come from?
I didn't see in this series anywhere.
Old "artifact" from initial FSL BSP ; agreed : it should not be delivered as is. Also, may be this code could be moved outside head.S and put in a m5441 related file... it need a try before patch update.

Regards
Greg



Signed-off-by: Yannick GICQUEL <yannick.gicquel@xxxxxxxxx>
---
  arch/m68k/coldfire/head.S | 9 +++++++++
  1 file changed, 9 insertions(+)

diff --git a/arch/m68k/coldfire/head.S b/arch/m68k/coldfire/head.S
index fa31be2..bf39885 100644
--- a/arch/m68k/coldfire/head.S
+++ b/arch/m68k/coldfire/head.S
@@ -151,6 +151,15 @@ _start0:

  _start:
      nop                    /* filler */
+#if defined(CONFIG_M5441x)
+#if defined(CONFIG_SRAM_BASE)
+    movel    #(CONFIG_SRAM_BASE+0x221), %d0
+#else
+    movel    #(0x8ff00000+0x221), %d0
+#endif
+    movec    %d0, %rambar1
+#endif
+
      movew    #0x2700, %sr            /* no interrupts */
      movel    #CACHE_INIT,%d0            /* disable cache */
      movec    %d0,%CACR



--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux