]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/nds32/cpu/n1213/start.S
NDS32: Generic Board Support and Unsupport
[karo-tx-uboot.git] / arch / nds32 / cpu / n1213 / start.S
index 1d1fcf77e471f1ba603ea5e65ccfa806647eab2d..2f0b76c04cf976edd00eafc1d40adbb90c1071ca 100644 (file)
@@ -6,30 +6,13 @@
  *     Copyright (C) 2011      Macpaul Lin <macpaul@andestech.com>
  *                             Greentime Hu <greentime@andestech.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <asm-offsets.h>
 #include <config.h>
 #include <common.h>
 #include <asm/macro.h>
-#include <version.h>
 
 /*
  * Jump vector table for EVIC mode
@@ -68,15 +51,17 @@ _start:     j       reset
        j       tlb_not_present
        j       tlb_misc
        j       tlb_vlpt_miss
-       j       cache_parity_error
+       j       machine_error
        j       debug
        j       general_exception
+       j       syscall
        j       internal_interrupt              ! H0I
        j       internal_interrupt              ! H1I
        j       internal_interrupt              ! H2I
        j       internal_interrupt              ! H3I
        j       internal_interrupt              ! H4I
        j       internal_interrupt              ! H5I
+       j       software_interrupt              ! S0I
 
        .balign 16
 
@@ -168,8 +153,11 @@ turnoff_wtdog:
  * $sp must be 8-byte alignment for ABI compliance.
  */
 call_board_init_f:
-       li      $sp, CONFIG_SYS_INIT_SP_ADDR
-       li      $r0, 0x00000000
+       li              $sp, CONFIG_SYS_INIT_SP_ADDR
+       li              $r10, GD_SIZE   /* get GD size */
+       sub             $sp, $sp, $r10  /* GD start addr */
+       move    $r10, $sp
+       li              $r0, 0x00000000
 
 #ifdef __PIC__
 #ifdef __NDS32_N1213_43U1H__
@@ -238,7 +226,7 @@ fix_got_loop:
 clear_bss:
        la      $r0, __bss_start        /* r0 <- rel __bss_start in FLASH */
        add     $r0, $r0, $r9           /* r0 <- rel __bss_start in FLASH */
-       la      $r1, __bss_end__        /* r1 <- rel __bss_end in RAM */
+       la      $r1, __bss_end          /* r1 <- rel __bss_end in RAM */
        add     $r1, $r1, $r9           /* r0 <- rel __bss_end in RAM */
        li      $r2, 0x00000000         /* clear */
 
@@ -477,7 +465,7 @@ tlb_vlpt_miss:
        bal     do_interruption
 
        .align  5
-cache_parity_error:
+machine_error:
        SAVE_ALL
        move    $r0, $sp                        ! To get the kernel stack
        li      $r1, 5                          ! Determine interruption type
@@ -498,12 +486,26 @@ general_exception:
        bal     do_interruption
 
        .align  5
-internal_interrupt:
+syscall:
        SAVE_ALL
        move    $r0, $sp                        ! To get the kernel stack
        li      $r1, 8                          ! Determine interruption type
        bal     do_interruption
 
+       .align  5
+internal_interrupt:
+       SAVE_ALL
+       move    $r0, $sp                        ! To get the kernel stack
+       li      $r1, 9                          ! Determine interruption type
+       bal     do_interruption
+
+       .align  5
+software_interrupt:
+       SAVE_ALL
+       move    $r0, $sp                        ! To get the kernel stack
+       li      $r1, 10                         ! Determine interruption type
+       bal     do_interruption
+
        .align  5
 
 /*