root / hw / ppc.h @ 78ced65e
History | View | Annotate | Download (2 kB)
1 | 87ecb68b | pbrook | /* PowerPC hardware exceptions management helpers */
|
---|---|---|---|
2 | 87ecb68b | pbrook | typedef void (*clk_setup_cb)(void *opaque, uint32_t freq); |
3 | c227f099 | Anthony Liguori | typedef struct clk_setup_t clk_setup_t; |
4 | c227f099 | Anthony Liguori | struct clk_setup_t {
|
5 | 87ecb68b | pbrook | clk_setup_cb cb; |
6 | 87ecb68b | pbrook | void *opaque;
|
7 | 87ecb68b | pbrook | }; |
8 | c227f099 | Anthony Liguori | static inline void clk_setup (clk_setup_t *clk, uint32_t freq) |
9 | 87ecb68b | pbrook | { |
10 | 87ecb68b | pbrook | if (clk->cb != NULL) |
11 | 87ecb68b | pbrook | (*clk->cb)(clk->opaque, freq); |
12 | 87ecb68b | pbrook | } |
13 | 87ecb68b | pbrook | |
14 | 87ecb68b | pbrook | clk_setup_cb cpu_ppc_tb_init (CPUState *env, uint32_t freq); |
15 | 87ecb68b | pbrook | /* Embedded PowerPC DCR management */
|
16 | 73b01960 | Alexander Graf | typedef uint32_t (*dcr_read_cb)(void *opaque, int dcrn); |
17 | 73b01960 | Alexander Graf | typedef void (*dcr_write_cb)(void *opaque, int dcrn, uint32_t val); |
18 | 87ecb68b | pbrook | int ppc_dcr_init (CPUState *env, int (*dcr_read_error)(int dcrn), |
19 | 87ecb68b | pbrook | int (*dcr_write_error)(int dcrn)); |
20 | 87ecb68b | pbrook | int ppc_dcr_register (CPUState *env, int dcrn, void *opaque, |
21 | 87ecb68b | pbrook | dcr_read_cb drc_read, dcr_write_cb dcr_write); |
22 | d63cb48d | Edgar E. Iglesias | clk_setup_cb ppc_emb_timers_init (CPUState *env, uint32_t freq, |
23 | d63cb48d | Edgar E. Iglesias | unsigned int decr_excp); |
24 | d63cb48d | Edgar E. Iglesias | |
25 | 87ecb68b | pbrook | /* Embedded PowerPC reset */
|
26 | 87ecb68b | pbrook | void ppc40x_core_reset (CPUState *env);
|
27 | 87ecb68b | pbrook | void ppc40x_chip_reset (CPUState *env);
|
28 | 87ecb68b | pbrook | void ppc40x_system_reset (CPUState *env);
|
29 | 87ecb68b | pbrook | void PREP_debug_write (void *opaque, uint32_t addr, uint32_t val); |
30 | 87ecb68b | pbrook | |
31 | d60efc6b | Blue Swirl | extern CPUWriteMemoryFunc * const PPC_io_write[]; |
32 | d60efc6b | Blue Swirl | extern CPUReadMemoryFunc * const PPC_io_read[]; |
33 | 87ecb68b | pbrook | void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val); |
34 | b1d8e52e | blueswir1 | |
35 | b1d8e52e | blueswir1 | void ppc40x_irq_init (CPUState *env);
|
36 | 9fdc60bf | aurel32 | void ppce500_irq_init (CPUState *env);
|
37 | b1d8e52e | blueswir1 | void ppc6xx_irq_init (CPUState *env);
|
38 | b1d8e52e | blueswir1 | void ppc970_irq_init (CPUState *env);
|
39 | 5ce4aafd | aurel32 | |
40 | 5ce4aafd | aurel32 | /* PPC machines for OpenBIOS */
|
41 | 5ce4aafd | aurel32 | enum {
|
42 | 5ce4aafd | aurel32 | ARCH_PREP = 0,
|
43 | 5ce4aafd | aurel32 | ARCH_MAC99, |
44 | 5ce4aafd | aurel32 | ARCH_HEATHROW, |
45 | 0f921197 | Alexander Graf | ARCH_MAC99_U3, |
46 | 5ce4aafd | aurel32 | }; |
47 | 5ce4aafd | aurel32 | |
48 | 7f1aec5f | Laurent Vivier | #define FW_CFG_PPC_WIDTH (FW_CFG_ARCH_LOCAL + 0x00) |
49 | 7f1aec5f | Laurent Vivier | #define FW_CFG_PPC_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01) |
50 | 7f1aec5f | Laurent Vivier | #define FW_CFG_PPC_DEPTH (FW_CFG_ARCH_LOCAL + 0x02) |
51 | dc333cd6 | Alexander Graf | #define FW_CFG_PPC_TBFREQ (FW_CFG_ARCH_LOCAL + 0x03) |
52 | 45024f09 | Alexander Graf | #define FW_CFG_PPC_IS_KVM (FW_CFG_ARCH_LOCAL + 0x05) |
53 | 45024f09 | Alexander Graf | #define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) |
54 | 45024f09 | Alexander Graf | #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) |
55 | 802670e6 | Blue Swirl | |
56 | 802670e6 | Blue Swirl | #define PPC_SERIAL_MM_BAUDBASE 399193 |