1.1 --- a/stage1/head1.S Sun Jan 17 18:48:13 2016 +0100
1.2 +++ b/stage1/head1.S Sun Jan 17 18:49:42 2016 +0100
1.3 @@ -4,7 +4,7 @@
1.4 * Copyright (C) 2009 Qi Hardware Inc.
1.5 * Author: Wolfgang Spraul <wolfgang@sharism.cc>
1.6 *
1.7 - * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software: you can redistribute it and/or modify
1.11 * it under the terms of the GNU General Public License as published by
1.12 @@ -25,10 +25,15 @@
1.13 .globl _start
1.14 .set noreorder
1.15
1.16 +#define CP0_STATUS $12
1.17 +#define CP0_CAUSE $13
1.18 +
1.19 _start:
1.20 b real_start
1.21 nop
1.22 - // 8 words for firmware parameters (0x80002008), struct fw_args
1.23 +
1.24 + /* 8 words for firmware parameters (0x80002008), struct fw_args */
1.25 +
1.26 .word 0x0
1.27 .word 0x0
1.28 .word 0x0
1.29 @@ -37,7 +42,19 @@
1.30 .word 0x0
1.31 .word 0x0
1.32 .word 0x0
1.33 +
1.34 real_start:
1.35 + /*
1.36 + Reset various registers. Otherwise, interrupts do not apparently get
1.37 + re-enabled properly later when requested.
1.38 + */
1.39 +
1.40 + li $t0, 0x0040fc04 /* BEV=1, interrupts enabled, ERL=1 */
1.41 + mtc0 $t0, CP0_STATUS
1.42 +
1.43 + li $t0, 0x00800000 /* IV=1 */
1.44 + mtc0 $t0, CP0_CAUSE
1.45 +
1.46 /* Setup stack, jump to C code. */
1.47
1.48 la $sp, 0x80004000