SPDX: Convert all of our single license tags to Linux Kernel style
[platform/kernel/u-boot.git] / arch / arc / lib / start.S
index b2ba768..3fb0560 100644 (file)
@@ -1,7 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <asm-offsets.h>
@@ -10,22 +9,6 @@
 #include <asm/arcregs.h>
 
 ENTRY(_start)
-       ; Non-masters will be halted immediately, they might be kicked later
-       ; by platform code right before passing control to the Linux kernel
-       ; in bootm.c:boot_jump_linux().
-       lr      r5, [identity]
-       lsr     r5, r5, 8
-       bmsk    r5, r5, 7
-       cmp     r5, 0
-       mov.nz  r0, r5
-       bz      .Lmaster_proceed
-       flag    1
-       nop
-       nop
-       nop
-
-.Lmaster_proceed:
-
        /* Setup interrupt vector base that matches "__text_start" */
        sr      __ivt_start, [ARC_AUX_INTR_VEC_BASE]
 
@@ -40,6 +23,14 @@ ENTRY(_start)
 #endif
        sr      r5, [ARC_AUX_IC_CTRL]
 
+       mov     r5, 1
+       sr      r5, [ARC_AUX_IC_IVIC]
+       ; As per ARC HS databook (see chapter 5.3.3.2)
+       ; it is required to add 3 NOPs after each write to IC_IVIC.
+       nop
+       nop
+       nop
+
 1:
        ; Disable/enable D-cache according to configuration
        lr      r5, [ARC_BCR_DC_BUILD]
@@ -53,6 +44,10 @@ ENTRY(_start)
 #endif
        sr      r5, [ARC_AUX_DC_CTRL]
 
+       mov     r5, 1
+       sr      r5, [ARC_AUX_DC_IVDC]
+
+
 1:
 #ifdef CONFIG_ISA_ARCV2
        ; Disable System-Level Cache (SLC)
@@ -82,7 +77,13 @@ ENTRY(_start)
 
        /* Zero the one and only argument of "board_init_f" */
        mov_s   %r0, 0
-       j       board_init_f
+       bl      board_init_f
+
+       /* We only get here if relocation is disabled by GD_FLG_SKIP_RELOC */
+       /* Make sure we don't lose GD overwritten by zero new GD */
+       mov     %r0, %r25
+       mov     %r1, 0
+       bl      board_init_r
 ENDPROC(_start)
 
 /*