6 #define __BV32(num) ((0x80000000 >> (num)))
7 #define __BV16(num) ((0x8000 >> (num)))
8 #define __BV08(num) ((0x80 >> (num)))
22 typedef struct fpuregs
{
27 typedef struct context
{
32 /* Machine State Register */
33 #define MSR_POW 0x00040000
34 #define MSR_TGPR 0x00020000
35 #define MSR_ILE 0x00010000
36 #define MSR_EE 0x00008000
37 #define MSR_PR 0x00004000
38 #define MSR_FP 0x00002000
39 #define MSR_ME 0x00001000
40 #define MSR_FE0 0x00000800
41 #define MSR_SE 0x00000400
42 #define MSR_BE 0x00000200
43 #define MSR_FE1 0x00000100
44 #define MSR_IP 0x00000040
45 #define MSR_IS 0x00000020
46 #define MSR_DS 0x00000010
47 #define MSR_RI 0x00000002
48 #define MSR_LE 0x00000001
51 #define XER 0x001 /* Integer Exception Register */
52 #define LR 0x008 /* Link Register */
53 #define CTR 0x009 /* Count Register */
54 #define DEC 0x016 /* Decrementer */
55 #define SDR1 0x019 /* MMU base address */
56 #define SRR0 0x01A /* Save/Restore Register 0 */
57 #define SRR1 0x01B /* Save/Restore Register 1 */
58 #define TBLU 0x10C /* Time Base Lower */
59 #define TBUU 0x10D /* Time Base Upper */
60 #define SPRG0 0x110 /* Special Purpose Register General 0 */
61 #define SPRG1 0x111 /* Special Purpose Register General 1 */
62 #define SPRG2 0x112 /* Special Purpose Register General 2 */
63 #define SPRG3 0x113 /* Special Purpose Register General 3 */
64 #define SPRG4 0x114 /* Special Purpose Register General 4 */
65 #define SPRG5 0x115 /* Special Purpose Register General 5 */
66 #define SPRG6 0x116 /* Special Purpose Register General 6 */
67 #define SPRG7 0x117 /* Special Purpose Register General 7 */
77 static inline struct KernelBase
*getKernelBase()
79 return (struct KernelBase
*)rdspr(SPRG4
);
82 static inline struct ExecBase
*getSysBase()
84 return (struct ExecBase
*)rdspr(SPRG5
);
87 /* Interrupt controller */
90 uint32_t ictl_pim
; /* Peripheral interrupt mask register */
91 uint32_t ictl_ppri
[3]; /* Peripheral priority and HI/LO select register */
92 uint32_t ictl_ee
; /* External enable and external types register */
93 uint32_t ictl_cpmim
; /* Critical Priority and Main Interrupt Mask Register */
94 uint32_t ictl_mip
[2]; /* Main Interrupt Priority and INT/SMI Select Register */
96 uint32_t ictl_pmce
; /* PerStat, MainStat, CritStat Encoded Register */
97 uint32_t ictl_cis
; /* Critical Interrupt Status All Register */
98 uint32_t ictl_mis
; /* Main Interrupt Status All Register */
99 uint32_t ictl_pis
; /* Peripheral Interrupt Status All Register */
101 uint32_t ictl_bes
; /* Bus Error Status Register */
103 uint32_t ictl_mie
; /* Main Interrupt Emulation All Register */
104 uint32_t ictl_pie
; /* Peripheral Interrupt Emulation All Register */
105 uint32_t ictl_iie
; /* IRQ Interrupt Emulation All Register */
108 #define MPC5200B_IRQ0 0 /* IRQ 0 */
109 #define MPC5200B_ST0 1 /* Slice Timer 0 */
110 #define MPC5200B_HI_INT 2 /* HI_int */
111 #define MPC5200B_WAKEUP 3 /* WakeUp from deep-sleep */
113 #define MPC5200B_ST1 4 /* Slice Timer 1 */
114 #define MPC5200B_IRQ1 5 /* IRQ 1 */
115 #define MPC5200B_IRQ2 6 /* IRQ 2 */
116 #define MPC5200B_IRQ3 7 /* IRQ 3 */
117 #define MPC5200B_LO_INT 8 /* LO_int */
118 #define MPC5200B_RTC_PINT 9 /* RTC Periodic Int */
119 #define MPC5200B_RTC_SINT 10 /* RTC Stopwatch and Alarm Int */
120 #define MPC5200B_GPIO_STD 11 /* GPIO interrupts */
121 #define MPC5200B_GPIO_WKUP 12 /* GPIO wakeup */
122 #define MPC5200B_TMR0 13 /* Timer 0 */
123 #define MPC5200B_TMR1 14 /* Timer 1 */
124 #define MPC5200B_TMR2 15 /* Timer 2 */
125 #define MPC5200B_TMR3 16 /* Timer 3 */
126 #define MPC5200B_TMR4 17 /* Timer 4 */
127 #define MPC5200B_TMR5 18 /* Timer 5 */
128 #define MPC5200B_TMR6 19 /* Timer 6 */
129 #define MPC5200B_TMR7 20 /* Timer 7 */
131 #define MPC5200B_BESTCOMM 21
132 #define MPC5200B_PSC1 22
133 #define MPC5200B_PSC2 23
134 #define MPC5200B_PSC3 24
135 #define MPC5200B_PSC6 25
136 #define MPC5200B_ETHER 26
137 #define MPC5200B_USB 27
138 #define MPC5200B_ATA 28
139 #define MPC5200B_PCICM 29
140 #define MPC5200B_PCISC_RX 30
141 #define MPC5200B_PCISC_TX 31
142 #define MPC5200B_PSC4 32
143 #define MPC5200B_PSC5 33
144 #define MPC5200B_SPI_MODF 34
145 #define MPC5200B_SPI_SPIF 35
146 #define MPC5200B_I2C1 36
147 #define MPC5200B_I2C2 37
148 #define MPC5200B_CAN1 38
149 #define MPC5200B_CAN2 39
150 #define MPC5200B_XLB 42
151 #define MPC5200B_BDLC 43
152 #define MPC5200B_BESTCOMMLP 44
154 #define PER_BESTCOMM 0
163 #define PER_PCISC_RX 9
164 #define PER_PCISC_TX 10
167 #define PER_SPI_MODF 13
168 #define PER_SPI_SPIF 14
175 #define PER_BESTCOMMLP 23
177 #define ICTL_PIM_BESTCOMM __BV32(PER_BESTCOMM)
178 #define ICTL_PIM_PSC1 __BV32(PER_PSC1)
179 #define ICTL_PIM_PSC2 __BV32(PER_PSC2)
180 #define ICTL_PIM_PSC3 __BV32(PER_PSC3)
181 #define ICTL_PIM_PSC6 __BV32(PER_PSC6)
182 #define ICTL_PIM_ETHER __BV32(PER_ETHER)
183 #define ICTL_PIM_USB __BV32(PER_USB)
184 #define ICTL_PIM_ATA __BV32(PER_ATA)
185 #define ICTL_PIM_PCICM __BV32(PER_PCICM)
186 #define ICTL_PIM_PCISC_RX __BV32(PER_PCISC_RX)
187 #define ICTL_PIM_PCISC_TX __BV32(PER_PCISC_TX)
188 #define ICTL_PIM_PSC4 __BV32(PER_PSC4)
189 #define ICTL_PIM_PSC5 __BV32(PER_PSC5)
190 #define ICTL_PIM_SPI_MODF __BV32(PER_SPI_MODF)
191 #define ICTL_PIM_SPI_SPIF __BV32(PER_SPI_SPIF)
192 #define ICTL_PIM_I2C1 __BV32(PER_I2C1)
193 #define ICTL_PIM_I2C2 __BV32(PER_I2C2)
194 #define ICTL_PIM_CAN1 __BV32(PER_CAN1)
195 #define ICTL_PIM_CAN2 __BV32(PER_CAN2)
196 #define ICTL_PIM_XLB __BV32(PER_XLB)
197 #define ICTL_PIM_BDLC __BV32(PER_BDLC)
198 #define ICTL_PIM_BESTCOMMLP __BV32(PER_BESTCOMMLP)
200 #define ICTL_EE_MEE __BV32(19)
201 #define ICTL_EE_CEB __BV32(31)
205 volatile uint32_t slt_tc
; /* Terminal count register */
206 volatile uint32_t slt_cf
; /* Control field register */
207 volatile uint32_t slt_cv
; /* Count value register. Read only! */
208 volatile uint32_t slt_ts
; /* Timer Status register */
211 #define SLT_CF_RUNWAIT 0x04000000 /* Run/Wait */
212 #define SLT_CF_INTRENA 0x02000000 /* Interrupt enable */
213 #define SLT_CF_ENABLE 0x01000000 /* Enable/Disable timer */
215 #define SLT_TS_ST 0x01000000 /* Terminal count reached. Write 1 to clear */
220 volatile uint32_t ata_config
;
221 volatile uint32_t ata_status
;
223 volatile uint32_t ata_pio1
;
224 volatile uint32_t ata_pio2
;
225 volatile uint32_t ata_dma1
;
226 volatile uint32_t ata_dma2
;
227 volatile uint32_t ata_udma1
;
228 volatile uint32_t ata_udma2
;
229 volatile uint32_t ata_udma3
;
230 volatile uint32_t ata_udma4
;
231 volatile uint32_t ata_udma5
;
232 volatile uint32_t ata_invalid
;
240 uint32_t bc_currentPointer
;
241 uint32_t bc_endPointer
;
242 uint32_t bc_variablePointer
;
243 uint32_t bc_interruptVector
;
244 uint32_t bc_interruptPending
;
245 uint32_t bc_interruptMask
;
248 uint32_t bc_requestMuxControl
;
249 uint32_t bc_taskSize
[2];
252 /* Bestcomm's task description table */
258 uint32_t exec_status
;
264 #endif /* ASM_MPC5200B_H */