Skip to content
Snippets Groups Projects
Commit fd2712d0 authored by Thomas Chou's avatar Thomas Chou Committed by Scott McNutt
Browse files

nios2: consolidate reset initialization


Global interrupt should be disabled from the beginning.

Signed-off-by: default avatarThomas Chou <thomas@wytron.com.tw>
Signed-off-by: default avatarScott McNutt <smcnutt@psyent.com>
parent 99485296
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
.global _start .global _start
_start: _start:
wrctl status, r0 /* Disable interrupts */
/* ICACHE INIT -- only the icache line at the reset address /* ICACHE INIT -- only the icache line at the reset address
* is invalidated at reset. So the init must stay within * is invalidated at reset. So the init must stay within
* the cache line size (8 words). If GERMS is used, we'll * the cache line size (8 words). If GERMS is used, we'll
...@@ -43,10 +44,9 @@ _start: ...@@ -43,10 +44,9 @@ _start:
ori r4, r0, %lo(CONFIG_SYS_ICACHELINE_SIZE) ori r4, r0, %lo(CONFIG_SYS_ICACHELINE_SIZE)
movhi r5, %hi(CONFIG_SYS_ICACHE_SIZE) movhi r5, %hi(CONFIG_SYS_ICACHE_SIZE)
ori r5, r5, %lo(CONFIG_SYS_ICACHE_SIZE) ori r5, r5, %lo(CONFIG_SYS_ICACHE_SIZE)
mov r6, r0 0: initi r5
0: initi r6 sub r5, r5, r4
add r6, r6, r4 bgt r5, r0, 0b
bltu r6, r5, 0b
br _except_end /* Skip the tramp */ br _except_end /* Skip the tramp */
/* EXCEPTION TRAMPOLINE -- the following gets copied /* EXCEPTION TRAMPOLINE -- the following gets copied
...@@ -62,7 +62,6 @@ _except_end: ...@@ -62,7 +62,6 @@ _except_end:
/* INTERRUPTS -- for now, all interrupts masked and globally /* INTERRUPTS -- for now, all interrupts masked and globally
* disabled. * disabled.
*/ */
wrctl status, r0 /* Disable interrupts */
wrctl ienable, r0 /* All disabled */ wrctl ienable, r0 /* All disabled */
/* DCACHE INIT -- if dcache not implemented, initd behaves as /* DCACHE INIT -- if dcache not implemented, initd behaves as
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment