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#ifndef __MPC74XX_H__
31#define __MPC74XX_H__
32
33
34
35
36#define EXC_OFF_SYS_RESET 0x0100
37#define _START_OFFSET EXC_OFF_SYS_RESET
38
39
40
41
42#define l2cr 1017
43
44#define L2CR_L2E 0x80000000
45#define L2CR_L2PE 0x40000000
46#define L2CR_L2SIZ_2M 0x00000000
47#define L2CR_L2SIZ_1M 0x30000000
48#define L2CR_L2SIZ_HM 0x20000000
49#define L2CR_L2SIZ_QM 0x10000000
50#define L2CR_L2CLK_1 0x02000000
51#define L2CR_L2CLK_1_5 0x04000000
52#define L2CR_L2CLK_2 0x08000000
53#define L2CR_L2CLK_2_5 0x0a000000
54#define L2CR_L2CLK_3 0x0c000000
55#define L2CR_L2CLK_3_5 0x06000000
56#define L2CR_L2CLK_4 0x0e000000
57#define L2CR_L2RAM_BURST 0x01000000
58#define L2CR_DO 0x00400000
59#define L2CR_L2I 0x00200000
60#define L2CR_L2CTL 0x00100000
61#define L2CR_L2WT 0x00080000
62#define L2CR_TS 0x00040000
63#define L2CR_TS_OFF -L2CR_TS
64#define L2CR_L2OH_5 0x00000000
65#define L2CR_L2OH_1 0x00010000
66#define L2CR_L2OH_INV 0x00020000
67#define L2CR_L2IP 0x00000001
68
69#ifndef __ASSEMBLY__
70
71typedef enum __cpu_t {
72 CPU_740, CPU_750,
73 CPU_740P, CPU_750P,
74 CPU_745, CPU_755,
75 CPU_750CX, CPU_750FX, CPU_750GX,
76 CPU_7400,
77 CPU_7410,
78 CPU_7447A, CPU_7448,
79 CPU_7450, CPU_7455, CPU_7457,
80 CPU_UNKNOWN} cpu_t;
81
82extern cpu_t get_cpu_type(void);
83
84#define l1icache_enable icache_enable
85
86void l2cache_enable(void);
87void l1dcache_enable(void);
88
89static __inline__ unsigned long get_msr (void)
90{
91 unsigned long msr;
92 asm volatile("mfmsr %0" : "=r" (msr) :);
93 return msr;
94}
95
96static __inline__ void set_msr (unsigned long msr)
97{
98 asm volatile("mtmsr %0" : : "r" (msr));
99}
100
101static __inline__ unsigned long get_hid0 (void)
102{
103 unsigned long hid0;
104 asm volatile("mfspr %0, 1008" : "=r" (hid0) :);
105 return hid0;
106}
107
108static __inline__ unsigned long get_hid1 (void)
109{
110 unsigned long hid1;
111 asm volatile("mfspr %0, 1009" : "=r" (hid1) :);
112 return hid1;
113}
114
115static __inline__ void set_hid0 (unsigned long hid0)
116{
117 asm volatile("mtspr 1008, %0" : : "r" (hid0));
118}
119
120static __inline__ void set_hid1 (unsigned long hid1)
121{
122 asm volatile("mtspr 1009, %0" : : "r" (hid1));
123}
124
125#endif
126#endif
127