paul@0 | 1 | /* |
paul@0 | 2 | * Entry point of the firmware. |
paul@16 | 3 | * The firmware code is executed in the ICache. |
paul@0 | 4 | * |
paul@59 | 5 | * Copyright 2009 (C) Qi Hardware Inc. |
paul@59 | 6 | * Author: Wolfgang Spraul <wolfgang@sharism.cc> |
paul@0 | 7 | * |
paul@16 | 8 | * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk> |
paul@16 | 9 | * |
paul@0 | 10 | * This program is free software; you can redistribute it and/or |
paul@0 | 11 | * modify it under the terms of the GNU General Public License |
paul@61 | 12 | * as published by the Free Software Foundation; either version |
paul@61 | 13 | * 3 of the License, or (at your option) any later version. |
paul@0 | 14 | * |
paul@0 | 15 | * This program is distributed in the hope that it will be useful, |
paul@0 | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@0 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@0 | 18 | * GNU General Public License for more details. |
paul@0 | 19 | * |
paul@0 | 20 | * You should have received a copy of the GNU General Public License |
paul@0 | 21 | * along with this program; if not, write to the Free Software |
paul@0 | 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@0 | 23 | * Boston, MA 02110-1301, USA |
paul@0 | 24 | */ |
paul@0 | 25 | |
paul@0 | 26 | .text |
paul@0 | 27 | .extern c_main |
paul@0 | 28 | .globl _start |
paul@0 | 29 | .set noreorder |
paul@0 | 30 | _start: |
paul@0 | 31 | b real_start |
paul@0 | 32 | nop |
paul@59 | 33 | // 8 words for firmware parameters (0x80002008), struct fw_args |
paul@0 | 34 | .word 0x0 |
paul@0 | 35 | .word 0x0 |
paul@0 | 36 | .word 0x0 |
paul@0 | 37 | .word 0x0 |
paul@0 | 38 | .word 0x0 |
paul@0 | 39 | .word 0x0 |
paul@0 | 40 | .word 0x0 |
paul@59 | 41 | .word 0x0 |
paul@59 | 42 | real_start: |
paul@0 | 43 | /* |
paul@0 | 44 | * setup stack, jump to C code |
paul@0 | 45 | */ |
paul@0 | 46 | la $29, 0x80004000 /* sp */ |
paul@0 | 47 | j c_main |
paul@0 | 48 | nop |
paul@0 | 49 | |
paul@0 | 50 | .set reorder |