3bce71d5d75632b6e96bad53922a6af5cf00168d
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / powerpc / platforms / 44x / misc_44x.S
1 /*
2 * This file contains miscellaneous low-level functions for PPC 44x.
3 * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 *
10 */
11
12 #include <asm/reg.h>
13 #include <asm/ppc_asm.h>
14
15 .text
16
17 /*
18 * Do an IO access in AS1
19 */
20 _GLOBAL(as1_readb)
21 mfmsr r7
22 ori r0,r7,MSR_DS
23 sync
24 mtmsr r0
25 sync
26 isync
27 lbz r3,0(r3)
28 sync
29 mtmsr r7
30 sync
31 isync
32 blr
33
34 _GLOBAL(as1_writeb)
35 mfmsr r7
36 ori r0,r7,MSR_DS
37 sync
38 mtmsr r0
39 sync
40 isync
41 stb r3,0(r4)
42 sync
43 mtmsr r7
44 sync
45 isync
46 blr
47
48 /*
49 * void ppc44x_reset_system(char *cmd)
50 *
51 * At present, this routine just applies a system reset.
52 */
53 _GLOBAL(ppc44x_reset_system)
54 mfspr r13,SPRN_DBCR0
55 oris r13,r13,DBCR0_RST_SYSTEM@h
56 mtspr SPRN_DBCR0,r13
57 b . /* Just in case the reset doesn't work */