Files
system76-coreboot/src/arch/mips/bootblock.S
Vadim Bendebury 11093995e4 mips: disable caches in bootblock startup code
Until proper MIPS cache management is available it is necessary to
disable data and instruction caches, otherwise code placed in memory
stays in data cache and is not available for instruction fetched.

BRANCH=none
BUG=chrome-os-partner:31438,chrome-os-partner:34127
TEST=coreboot loading rombase and rambase now succeeds.

Change-Id: I4147e1325edc0b9bb951cd7ce18d5f104f3eaec0
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Original-Commit-Id: 93d5bfa1d01fbbabbabef33a22287ceeea28b15b
Original-Change-Id: Ib195ed6e5f08ccaa6bbe3325c2199171bfb63b88
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/232191
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9569
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-04-13 17:36:19 +02:00

59 lines
1.5 KiB
ArmAsm

/*
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Imagination Technologies
*
* 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; version 2 of the License.
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
.set noreorder /* Prevent assembler from "optimizing" this code. */
.section ".text._start", "ax", %progbits
.globl _start
_start:
/* Set the stack pointer */
la $sp, _estack
/*
* Initialise the stack to a known value, used later to check for
* overflow.
*/
la $t0, _stack
addi $t1, $sp, -4
li $t2, 0xdeadbeef
1: sw $t2, 0($t0)
bne $t0, $t1, 1b
addi $t0, $t0, 4
/*
* Disable caches for now, proper cache management is coming soon.
* http://crosbug.com/p/34127
*/
mfc0 $t0, $16
li $t1, -8
and $t0, $t0, $t1
ori $t0, $t0, 2
mtc0 $t0, $16
/* Run main */
b main
/*
* Should never return from main. Make sure there is no branch in the
* branch delay slot.
*/
2: nop
b 2b
nop /* Make sure there is no branch after this either. */