2007-11-17 20:14:51 +03:00
|
|
|
/* PowerPC hardware exceptions management helpers */
|
|
|
|
typedef void (*clk_setup_cb)(void *opaque, uint32_t freq);
|
2009-10-02 01:12:16 +04:00
|
|
|
typedef struct clk_setup_t clk_setup_t;
|
|
|
|
struct clk_setup_t {
|
2007-11-17 20:14:51 +03:00
|
|
|
clk_setup_cb cb;
|
|
|
|
void *opaque;
|
|
|
|
};
|
2009-10-02 01:12:16 +04:00
|
|
|
static inline void clk_setup (clk_setup_t *clk, uint32_t freq)
|
2007-11-17 20:14:51 +03:00
|
|
|
{
|
|
|
|
if (clk->cb != NULL)
|
|
|
|
(*clk->cb)(clk->opaque, freq);
|
|
|
|
}
|
|
|
|
|
|
|
|
clk_setup_cb cpu_ppc_tb_init (CPUState *env, uint32_t freq);
|
|
|
|
/* Embedded PowerPC DCR management */
|
2009-12-21 16:02:39 +03:00
|
|
|
typedef uint32_t (*dcr_read_cb)(void *opaque, int dcrn);
|
|
|
|
typedef void (*dcr_write_cb)(void *opaque, int dcrn, uint32_t val);
|
2007-11-17 20:14:51 +03:00
|
|
|
int ppc_dcr_init (CPUState *env, int (*dcr_read_error)(int dcrn),
|
|
|
|
int (*dcr_write_error)(int dcrn));
|
|
|
|
int ppc_dcr_register (CPUState *env, int dcrn, void *opaque,
|
|
|
|
dcr_read_cb drc_read, dcr_write_cb dcr_write);
|
|
|
|
clk_setup_cb ppc_emb_timers_init (CPUState *env, uint32_t freq);
|
|
|
|
/* Embedded PowerPC reset */
|
|
|
|
void ppc40x_core_reset (CPUState *env);
|
|
|
|
void ppc40x_chip_reset (CPUState *env);
|
|
|
|
void ppc40x_system_reset (CPUState *env);
|
|
|
|
void PREP_debug_write (void *opaque, uint32_t addr, uint32_t val);
|
|
|
|
|
2009-08-25 22:29:31 +04:00
|
|
|
extern CPUWriteMemoryFunc * const PPC_io_write[];
|
|
|
|
extern CPUReadMemoryFunc * const PPC_io_read[];
|
2007-11-17 20:14:51 +03:00
|
|
|
void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val);
|
2008-10-26 16:43:07 +03:00
|
|
|
|
|
|
|
void ppc40x_irq_init (CPUState *env);
|
2009-03-02 19:42:32 +03:00
|
|
|
void ppce500_irq_init (CPUState *env);
|
2008-10-26 16:43:07 +03:00
|
|
|
void ppc6xx_irq_init (CPUState *env);
|
|
|
|
void ppc970_irq_init (CPUState *env);
|
2009-01-08 19:01:23 +03:00
|
|
|
|
|
|
|
/* PPC machines for OpenBIOS */
|
|
|
|
enum {
|
|
|
|
ARCH_PREP = 0,
|
|
|
|
ARCH_MAC99,
|
|
|
|
ARCH_HEATHROW,
|
|
|
|
};
|
|
|
|
|
2009-08-08 14:19:24 +04:00
|
|
|
#define FW_CFG_PPC_WIDTH (FW_CFG_ARCH_LOCAL + 0x00)
|
|
|
|
#define FW_CFG_PPC_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01)
|
|
|
|
#define FW_CFG_PPC_DEPTH (FW_CFG_ARCH_LOCAL + 0x02)
|
2009-08-15 18:27:05 +04:00
|
|
|
|
|
|
|
#define PPC_SERIAL_MM_BAUDBASE 399193
|