aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/44x/misc_44x.S
blob: 3bce71d5d75632b6e96bad53922a6af5cf00168d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * This file contains miscellaneous low-level functions for PPC 44x.
 *    Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
 *
 * 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; either version
 * 2 of the License, or (at your option) any later version.
 *
 */

#include <asm/reg.h>
#include <asm/ppc_asm.h>

	.text

/*
 * Do an IO access in AS1
 */
_GLOBAL(as1_readb)
	mfmsr	r7
	ori	r0,r7,MSR_DS
	sync
	mtmsr	r0
	sync
	isync
	lbz	r3,0(r3)
	sync
	mtmsr	r7
	sync
	isync
	blr

_GLOBAL(as1_writeb)
	mfmsr	r7
	ori	r0,r7,MSR_DS
	sync
	mtmsr	r0
	sync
	isync
	stb	r3,0(r4)
	sync
	mtmsr	r7
	sync
	isync
	blr

/*
 * void ppc44x_reset_system(char *cmd)
 *
 * At present, this routine just applies a system reset.
 */
_GLOBAL(ppc44x_reset_system)
	mfspr	r13,SPRN_DBCR0
	oris	r13,r13,DBCR0_RST_SYSTEM@h
	mtspr	SPRN_DBCR0,r13
	b	.			/* Just in case the reset doesn't work */