2 * Memory Setup stuff - taken from blob memsetup.S
4 * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and
5 * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
6 * 2003-2004 (c) MontaVista Software, Inc.
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 /* The ADS GC+ for Linux Boot Rom Ver. 1.73 does memory init for us.
35 * However the darn thing leaves the MMU enabled before handing control
36 * over to us. So we need to disable the MMU and we use lowlevel_init
40 @ The following code segment was borrowed with gratitude from:
41 @ linux-2.4.19-rmk7/arch/arm/boot/compressed/head-sa1100.S
43 @ Data cache might be active.
44 @ Be sure to flush kernel binary out of the cache,
45 @ whatever state it is, before it is turned off.
46 @ This is done by fetching through currently executed
47 @ memory to be sure we hit the same cache.
49 add r3, r2, #0x4000 @ 16 kb is quite enough...
53 mcr p15, 0, r0, c7, c10, 4 @ drain WB
54 mcr p15, 0, r0, c7, c7, 0 @ flush I & D caches
56 @ disabling MMU and caches
57 mrc p15, 0, r0, c1, c0, 0 @ read control reg
58 bic r0, r0, #0x0d @ clear WB, DC, MMU
59 bic r0, r0, #0x1000 @ clear Icache
60 mcr p15, 0, r0, c1, c0, 0