]> git.ipfire.org Git - thirdparty/u-boot.git/blame - arch/arm/cpu/arm920t/cpu.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[thirdparty/u-boot.git] / arch / arm / cpu / arm920t / cpu.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
3d818266
WD
2/*
3 * (C) Copyright 2002
4 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
5 * Marius Groeger <mgroeger@sysgo.de>
6 *
7 * (C) Copyright 2002
792a09eb 8 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
3d818266
WD
9 */
10
11/*
12 * CPU specific code
13 */
14
d678a59d 15#include <common.h>
3d818266 16#include <command.h>
9edefc27 17#include <cpu_func.h>
36bf446b 18#include <irq_func.h>
677e62f4 19#include <asm/system.h>
3d818266 20
b3acb6cd 21static void cache_flush(void);
3d818266 22
3d818266
WD
23int cleanup_before_linux (void)
24{
25 /*
26 * this function is called just before we call linux
27 * it prepares the processor for linux
28 *
29 * we turn off caches etc ...
30 */
31
9d3915b2 32 disable_interrupts();
3d818266
WD
33
34 /* turn off I/D-cache */
b3acb6cd
JCPV
35 icache_disable();
36 dcache_disable();
3d818266 37 /* flush I/D-cache */
b3acb6cd 38 cache_flush();
74f4304e 39
b3acb6cd 40 return 0;
3d818266
WD
41}
42
b3acb6cd
JCPV
43/* flush I/D-cache */
44static void cache_flush (void)
3d818266 45{
b3acb6cd 46 unsigned long i = 0;
3d818266 47
b3acb6cd 48 asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
3d818266 49}