ARM: uniphier: support system reset functionality for PSCI
[platform/kernel/u-boot.git] / examples / api / crt0.S
index 6daf127..5a7049d 100644 (file)
@@ -3,24 +3,7 @@
  *
  * Written by: Rafal Jaworowski <raj@semihalf.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+
  */
 
 #if defined(CONFIG_PPC)
@@ -57,13 +40,38 @@ syscall:
        ldr     ip, =syscall_ptr
        ldr     pc, [ip]
 
+#elif defined(CONFIG_MIPS)
+#include <asm/asm.h>
+       .text
+       .globl __start
+       .ent __start
+__start:
+       PTR_S   $sp, search_hint
+       b       main
+       .end __start
+
+       .globl syscall
+       .ent syscall
+syscall:
+       PTR_S   $ra, return_addr
+       PTR_L   $t9, syscall_ptr
+       jalr    $t9
+       nop
+       PTR_L   $ra, return_addr
+       jr      $ra
+       nop
+       .end syscall
+
+return_addr:
+       .align 8
+       .long 0
 #else
 #error No support for this arch!
 #endif
 
        .globl syscall_ptr
 syscall_ptr:
-       .align  4
+       .align  8
        .long   0
 
        .globl search_hint