Please bear with me - another rename checkin. This qualifies as trivial, no
[coreboot.git] / src / arch / ppc / include / ppc.h
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2000 AG Electronics Ltd.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #ifndef _PPC_H
21 #define _PPC_H
22
23 #define BIG_ENDIAN
24 #define RODATA __attribute__ ((__section__ (".rodata"))) 
25
26 /* stringify is needed for macro expansion */
27 #define stringify(x) #x
28
29 #define mfdcr(reg)      ({unsigned int result; \
30                         __asm__ volatile("mfdcr %0, " stringify(reg) \
31                                          : "=r" (result)); result;})
32
33 #define mtdcr(reg, v)   asm volatile("mtdcr " stringify(reg) ",%0" \
34                         : : "r" (v))
35
36 extern unsigned ppc_getmsr(void);
37 extern unsigned ppc_gethid0(void);
38 extern unsigned ppc_gethid1(void);
39 extern unsigned ppc_getpvr(void);
40 extern void ppc_setmsr(unsigned);
41 extern void ppc_sethid0(unsigned);
42 extern void ppc_set1015(unsigned);
43
44 extern void ppc_init_float_registers(const double *);
45
46 /* Do CPU specific setup, with optional icache */
47 extern void ppc_setup_cpu(int icache);
48
49 extern void ppc_enable_dcache(void);
50 extern void ppc_disable_dcache(void);
51 extern void ppc_enable_mmu(void);
52
53 /* Describe which sort of ppc CPU I am */
54 extern void ppc_identify(void);
55 #endif