diff options
author | Tom Rini <trini@konsulko.com> | 2017-05-22 14:14:44 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-05-22 14:14:44 -0400 |
commit | c2774e6149a6bedb0941deefec84665119e685a4 (patch) | |
tree | 664984e321d29aed8afd0ab0818c81f6a0737c08 /arch/nds32/cpu/n1213/start.S | |
parent | e34b913a942d9c3977985999853e5e224fd5597d (diff) | |
parent | b841b6e94662b3b21a56d6ecaab64dcdfb0d311c (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-nds32
Diffstat (limited to 'arch/nds32/cpu/n1213/start.S')
-rw-r--r-- | arch/nds32/cpu/n1213/start.S | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/arch/nds32/cpu/n1213/start.S b/arch/nds32/cpu/n1213/start.S index 99971fdbdb..f9f999902c 100644 --- a/arch/nds32/cpu/n1213/start.S +++ b/arch/nds32/cpu/n1213/start.S @@ -114,11 +114,39 @@ reset_gp: set_ivb: li $r0, 0x0 - /* turn on BTB */ mtsr $r0, $misc_ctl /* set IVIC, vector size: 4 bytes, base: 0x0 */ mtsr $r0, $ivb +/* + * MMU_CTL NTC0 Cacheable/Write-Back + */ + li $r0, ~0x3 + mfsr $r1, $mr8 + and $r1, $r1, $r0 + mtsr $r1, $mr8 +#if (!defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF)) + li $r0, 0x4 + mfsr $r1, $mr0 + or $r1, $r1, $r0 + mtsr $r1, $mr0 +#endif + +#if !defined(CONFIG_SYS_ICACHE_OFF) + li $r0, 0x1 + mfsr $r1, $mr8 + or $r1, $r1, $r0 + mtsr $r1, $mr8 +#endif + +#if !defined(CONFIG_SYS_DCACHE_OFF) + li $r0, 0x2 + mfsr $r1, $mr8 + or $r1, $r1, $r0 + mtsr $r1, $mr8 +#endif + + jal mem_init #ifndef CONFIG_SKIP_LOWLEVEL_INIT jal lowlevel_init @@ -133,7 +161,6 @@ update_gp: ori $gp, $gp, lo12(_GLOBAL_OFFSET_TABLE_-4) add5.pc $gp #endif - /* * do critical initializations first (shall be in short time) * do self_relocation ASAP. @@ -161,11 +188,14 @@ update_gp: */ call_board_init_f: li $sp, CONFIG_SYS_INIT_SP_ADDR - li $r10, GD_SIZE /* get GD size */ - sub $sp, $sp, $r10 /* GD start addr */ - move $r10, $sp + move $r0, $sp + bal board_init_f_alloc_reserve + move $sp, $r0 + bal board_init_f_init_reserve +#ifdef CONFIG_DEBUG_UART + bal debug_uart_init +#endif li $r0, 0x00000000 - #ifdef __PIC__ #ifdef __NDS32_N1213_43U1H__ /* __NDS32_N1213_43U1H__ implies NDS32 V0 ISA */ @@ -201,12 +231,10 @@ stack_setup: la $r1, _end@GOTOFF move $r2, $r6 /* r2 <- scratch for copy_loop */ - copy_loop: - lwi.p $r7, [$r0], #4 - swi.p $r7, [$r2], #4 + lmw.bim $r11, [$r0], $r18 + smw.bim $r11, [$r2], $r18 blt $r0, $r1, copy_loop - /* * fix relocations related issues */ @@ -246,6 +274,8 @@ clbss_l: * initialization, now running from RAM. */ call_board_init_r: + bal invalidate_icache_all + bal flush_dcache_all la $r0, board_init_r@GOTOFF move $lp, $r0 /* offset of board_init_r() */ add $lp, $lp, $r9 /* real address of board_init_r() */ |