2022-09-19 02:51:11 -04:00
|
|
|
/*
|
2023-03-08 06:25:07 -05:00
|
|
|
* Copyright (C) 2022, 2023 - Tillitis AB
|
2022-09-19 02:51:11 -04:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
.section ".text.init"
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
li x1, 0
|
|
|
|
li x2, 0
|
|
|
|
li x3, 0
|
|
|
|
li x4, 0
|
|
|
|
li x5, 0
|
|
|
|
li x6, 0
|
|
|
|
li x7, 0
|
|
|
|
li x8, 0
|
|
|
|
li x9, 0
|
|
|
|
li x10,0
|
|
|
|
li x11,0
|
|
|
|
li x12,0
|
|
|
|
li x13,0
|
|
|
|
li x14,0
|
|
|
|
li x15,0
|
|
|
|
li x16,0
|
|
|
|
li x17,0
|
|
|
|
li x18,0
|
|
|
|
li x19,0
|
|
|
|
li x20,0
|
|
|
|
li x21,0
|
|
|
|
li x22,0
|
|
|
|
li x23,0
|
|
|
|
li x24,0
|
|
|
|
li x25,0
|
|
|
|
li x26,0
|
|
|
|
li x27,0
|
|
|
|
li x28,0
|
|
|
|
li x29,0
|
|
|
|
li x30,0
|
|
|
|
li x31,0
|
|
|
|
|
2022-10-21 10:27:23 -04:00
|
|
|
/* Clear all RAM */
|
2022-10-31 10:02:48 -04:00
|
|
|
li a0, 0x40000000 // TK1_RAM_BASE
|
|
|
|
li a1, 0x40020000 // TK1_RAM_BASE + TK1_RAM_SIZE
|
2022-10-21 10:27:23 -04:00
|
|
|
clear:
|
|
|
|
sw zero, 0(a0)
|
|
|
|
addi a0, a0, 4
|
|
|
|
blt a0, a1, clear
|
|
|
|
|
2023-03-02 12:20:28 -05:00
|
|
|
/*
|
|
|
|
* Init stack at top of fw_ram. Leave 16 byte for entering our first function
|
|
|
|
*/
|
2023-03-08 06:25:07 -05:00
|
|
|
li sp, 0xd00007f0 // 2 kiB (TK1_MMIO_FW_RAM_SIZE) minus 16 byte
|
2022-09-19 02:51:11 -04:00
|
|
|
|
|
|
|
call main
|
|
|
|
|
|
|
|
loop:
|
|
|
|
j loop
|