Merge branch 'master' of git://www.denx.de/git/u-boot-net
[platform/kernel/u-boot.git] / cpu / mpc5xxx / io.S
1 /*
2  *  Copyright (C) 1998  Dan Malek <dmalek@jlc.net>
3  *  Copyright (C) 1999  Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
4  *  Copyright (C) 2001  Sysgo Real-Time Solutions, GmbH <www.elinos.com>
5  *                      Andreas Heppel <aheppel@sysgo.de>
6  *  Copyright (C) 2003  Wolfgang Denk <wd@denx.de>
7  *
8  * See file CREDITS for list of people who contributed to this
9  * project.
10  *
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.
15  *
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.
20  *
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,
24  * MA 02111-1307 USA
25  */
26
27 #include <config.h>
28 #include <ppc_asm.tmpl>
29
30 /* ------------------------------------------------------------------------------- */
31 /*  Function:     in8 */
32 /*  Description:  Input 8 bits */
33 /* ------------------------------------------------------------------------------- */
34         .globl  in8
35 in8:
36         lbz     r3,0(r3)
37         sync
38         blr
39
40 /* ------------------------------------------------------------------------------- */
41 /*  Function:     in16 */
42 /*  Description:  Input 16 bits */
43 /* ------------------------------------------------------------------------------- */
44         .globl  in16
45 in16:
46         lhz     r3,0(r3)
47         sync
48         blr
49
50 /* ------------------------------------------------------------------------------- */
51 /*  Function:     in16r */
52 /*  Description:  Input 16 bits and byte reverse */
53 /* ------------------------------------------------------------------------------- */
54         .globl  in16r
55 in16r:
56         lhbrx   r3,0,r3
57         sync
58         blr
59
60 /* ------------------------------------------------------------------------------- */
61 /*  Function:     in32 */
62 /*  Description:  Input 32 bits */
63 /* ------------------------------------------------------------------------------- */
64         .globl  in32
65 in32:
66         lwz     3,0(3)
67         sync
68         blr
69
70 /* ------------------------------------------------------------------------------- */
71 /*  Function:     in32r */
72 /*  Description:  Input 32 bits and byte reverse */
73 /* ------------------------------------------------------------------------------- */
74     .globl  in32r
75 in32r:
76         lwbrx   r3,0,r3
77         sync
78         blr
79
80 /* ------------------------------------------------------------------------------- */
81 /*  Function:     out8 */
82 /*  Description:  Output 8 bits */
83 /* ------------------------------------------------------------------------------- */
84         .globl  out8
85 out8:
86         stb     r4,0(r3)
87         sync
88         blr
89
90 /* ------------------------------------------------------------------------------- */
91 /*  Function:     out16 */
92 /*  Description:  Output 16 bits */
93 /* ------------------------------------------------------------------------------- */
94         .globl  out16
95 out16:
96         sth     r4,0(r3)
97         sync
98         blr
99
100 /* ------------------------------------------------------------------------------- */
101 /*  Function:     out16r */
102 /*  Description:  Byte reverse and output 16 bits */
103 /* ------------------------------------------------------------------------------- */
104         .globl  out16r
105 out16r:
106         sthbrx  r4,0,r3
107         sync
108         blr
109
110 /* ------------------------------------------------------------------------------- */
111 /*  Function:     out32 */
112 /*  Description:  Output 32 bits */
113 /* ------------------------------------------------------------------------------- */
114         .globl  out32
115 out32:
116         stw     r4,0(r3)
117         sync
118         blr
119
120 /* ------------------------------------------------------------------------------- */
121 /*  Function:     out32r */
122 /*  Description:  Byte reverse and output 32 bits */
123 /* ------------------------------------------------------------------------------- */
124         .globl  out32r
125 out32r:
126         stwbrx  r4,0,r3
127         sync
128         blr