public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nios2: consolidate reset initialization
@ 2010-04-20  3:01 Thomas Chou
  2010-04-23  2:01 ` Scott McNutt
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Chou @ 2010-04-20  3:01 UTC (permalink / raw)
  To: u-boot

Global interrupt should be disabled from the beginning.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 arch/nios2/cpu/start.S |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index 31cd5b0..d1016ea 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -34,6 +34,7 @@
 	.global _start
 
 _start:
+	wrctl	status, r0		/* Disable interrupts */
 	/* ICACHE INIT -- only the icache line at the reset address
 	 * is invalidated at reset. So the init must stay within
 	 * the cache line size (8 words). If GERMS is used, we'll
@@ -43,10 +44,9 @@ _start:
 	ori	r4, r0, %lo(CONFIG_SYS_ICACHELINE_SIZE)
 	movhi	r5, %hi(CONFIG_SYS_ICACHE_SIZE)
 	ori	r5, r5, %lo(CONFIG_SYS_ICACHE_SIZE)
-	mov	r6, r0
-0:	initi	r6
-	add	r6, r6, r4
-	bltu	r6, r5, 0b
+0:	initi	r5
+	sub	r5, r5, r4
+	bgt	r5, r0, 0b
 	br	_except_end	/* Skip the tramp */
 
 	/* EXCEPTION TRAMPOLINE -- the following gets copied
@@ -62,7 +62,6 @@ _except_end:
 	/* INTERRUPTS -- for now, all interrupts masked and globally
 	 * disabled.
 	 */
-	wrctl	status, r0		/* Disable interrupts */
 	wrctl	ienable, r0		/* All disabled	*/
 
 	/* DCACHE INIT -- if dcache not implemented, initd behaves as
-- 
1.6.6.1

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

* [U-Boot] [PATCH] nios2: consolidate reset initialization
  2010-04-20  3:01 [U-Boot] [PATCH] nios2: consolidate reset initialization Thomas Chou
@ 2010-04-23  2:01 ` Scott McNutt
  0 siblings, 0 replies; 2+ messages in thread
From: Scott McNutt @ 2010-04-23  2:01 UTC (permalink / raw)
  To: u-boot

Applied. Thanks.
--Scott

Thomas Chou wrote:
> Global interrupt should be disabled from the beginning.
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>  arch/nios2/cpu/start.S |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
> index 31cd5b0..d1016ea 100644
> --- a/arch/nios2/cpu/start.S
> +++ b/arch/nios2/cpu/start.S
> @@ -34,6 +34,7 @@
>  	.global _start
>  
>  _start:
> +	wrctl	status, r0		/* Disable interrupts */
>  	/* ICACHE INIT -- only the icache line at the reset address
>  	 * is invalidated at reset. So the init must stay within
>  	 * the cache line size (8 words). If GERMS is used, we'll
> @@ -43,10 +44,9 @@ _start:
>  	ori	r4, r0, %lo(CONFIG_SYS_ICACHELINE_SIZE)
>  	movhi	r5, %hi(CONFIG_SYS_ICACHE_SIZE)
>  	ori	r5, r5, %lo(CONFIG_SYS_ICACHE_SIZE)
> -	mov	r6, r0
> -0:	initi	r6
> -	add	r6, r6, r4
> -	bltu	r6, r5, 0b
> +0:	initi	r5
> +	sub	r5, r5, r4
> +	bgt	r5, r0, 0b
>  	br	_except_end	/* Skip the tramp */
>  
>  	/* EXCEPTION TRAMPOLINE -- the following gets copied
> @@ -62,7 +62,6 @@ _except_end:
>  	/* INTERRUPTS -- for now, all interrupts masked and globally
>  	 * disabled.
>  	 */
> -	wrctl	status, r0		/* Disable interrupts */
>  	wrctl	ienable, r0		/* All disabled	*/
>  
>  	/* DCACHE INIT -- if dcache not implemented, initd behaves as

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

end of thread, other threads:[~2010-04-23  2:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20  3:01 [U-Boot] [PATCH] nios2: consolidate reset initialization Thomas Chou
2010-04-23  2:01 ` Scott McNutt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox