All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] armv8/ls1043a: Add the OCRAM initialization
@ 2016-10-12 12:15 Pratiyush Srivastava
  2016-10-12 16:37 ` york sun
  2016-10-17  3:35 ` Prabhakar Kushwaha
  0 siblings, 2 replies; 12+ messages in thread
From: Pratiyush Srivastava @ 2016-10-12 12:15 UTC (permalink / raw)
  To: u-boot

Clear the content to zero and the ECC error bit of OCRAM1/2.

The OCRAM must be initialized to ZERO by the unit of 8-Byte before
accessing it, or else it will generate ECC error. And the IBR has
accessed the OCRAM before this initialization, so the ECC error
status bit should to be cleared.

Signed-off-by: Pratiyush Srivastava <pratiyush.srivastava@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
---
 arch/arm/cpu/armv8/start.S | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index 19c771d..24fed46 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -11,6 +11,9 @@
 #include <asm/macro.h>
 #include <asm/armv8/mmu.h>
 
+#define DCSR_SYS_DCFG_SBEESR2	0x20140534
+#define DCSR_SYS_DCFG_MBEESR2	0x20140544
+
 /*************************************************************************
  *
  * Startup Code (reset vector)
@@ -259,10 +262,46 @@ WEAK(lowlevel_init)
 #endif /* CONFIG_ARMV8_MULTIENTRY */
 
 2:
+#if defined(CONFIG_FSL_LSCH2) && !defined(CONFIG_SPL_BUILD)
+	bl	fsl_ocram_init
+#endif
 	mov	lr, x29			/* Restore LR */
 	ret
 ENDPROC(lowlevel_init)
 
+#if defined(CONFIG_FSL_LSCH2) && !defined(CONFIG_SPL_BUILD)
+ENTRY(fsl_ocram_init)
+	mov	x28, lr			/* Save LR */
+	bl	fsl_clear_ocram
+	bl	fsl_ocram_clear_ecc_err
+	mov	lr, x28			/* Restore LR */
+	ret
+ENDPROC(fsl_ocram_init)
+
+ENTRY(fsl_clear_ocram)
+/* Clear OCRAM */
+	ldr	x0, =CONFIG_SYS_FSL_OCRAM_BASE
+	ldr	x1, =(CONFIG_SYS_FSL_OCRAM_BASE + CONFIG_SYS_FSL_OCRAM_SIZE)
+	mov	x2, #0
+clear_loop:
+	str	x2, [x0]
+	add	x0, x0, #8
+	cmp	x0, x1
+	b.lo	clear_loop
+	ret
+ENDPROC(fsl_clear_ocram)
+
+ENTRY(fsl_ocram_clear_ecc_err)
+	/* OCRAM1/2 ECC status bit */
+	mov	w1, #0x60
+	ldr	x0, =DCSR_SYS_DCFG_SBEESR2
+	str	w1, [x0]
+	ldr	x0, =DCSR_SYS_DCFG_MBEESR2
+	str	w1, [x0]
+	ret
+ENDPROC(fsl_ocram_init)
+#endif
+
 WEAK(smp_kick_all_cpus)
 	/* Kick secondary cpus up by SGI 0 interrupt */
 #if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
-- 
2.7.4

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

end of thread, other threads:[~2016-11-14 17:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-12 12:15 [U-Boot] [PATCH] armv8/ls1043a: Add the OCRAM initialization Pratiyush Srivastava
2016-10-12 16:37 ` york sun
2016-10-17  3:35 ` Prabhakar Kushwaha
2016-10-21 20:08   ` york sun
2016-10-23 13:59     ` Prabhakar Kushwaha
2016-10-24 16:15       ` york sun
2016-10-25  1:43         ` Mingkai Hu
2016-10-25  4:30         ` Calvin Johnson
2016-10-26 16:39           ` york sun
2016-10-27  9:47             ` Calvin Johnson
2016-11-07 18:36               ` york sun
     [not found]               ` <1ff50edd-3948-c861-6ac9-9a0618ea3584@nxp.com>
2016-11-14 17:32                 ` york sun

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.