summaryrefslogtreecommitdiff
path: root/src/arch/ppc/include/ppc.h
blob: d35eb70c54fb883086bcf74dace55c3a1e4ab785 (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
/* Copyright 2000  AG Electronics Ltd. */
/* This code is distributed without warranty under the GPL v2 (see COPYING) */

#ifndef _PPC_H
#define _PPC_H

#define BIG_ENDIAN
#define RODATA __attribute__ ((__section__ (".rodata"))) 

/* stringify is needed for macro expansion */
#define stringify(x) #x

#define mfdcr(reg)	({unsigned int result; \
			__asm__ volatile("mfdcr %0, " stringify(reg) \
				  	 : "=r" (result)); result;})

#define mtdcr(reg, v)	asm volatile("mtdcr " stringify(reg) ",%0" \
			: : "r" (v))

extern unsigned ppc_getmsr(void);
extern unsigned ppc_gethid0(void);
extern unsigned ppc_gethid1(void);
extern unsigned ppc_getpvr(void);
extern void ppc_setmsr(unsigned);
extern void ppc_sethid0(unsigned);
extern void ppc_set1015(unsigned);

extern void ppc_init_float_registers(const double *);

/* Do CPU specific setup, with optional icache */
extern void ppc_setup_cpu(int icache);

extern void ppc_enable_dcache(void);
extern void ppc_disable_dcache(void);
extern void ppc_enable_mmu(void);

/* Describe which sort of ppc CPU I am */
extern void ppc_identify(void);

/* CPU clock speed in ticks per second */
extern unsigned long get_clock_speed();
#endif