blob: 6488db25c4b77b16208b77c69e83def8253da48a [file] [log] [blame]
pbrook87ecb682007-11-17 17:14:51 +00001#ifndef QEMU_SH_H
2#define QEMU_SH_H
3/* Definitions for SH board emulation. */
4
balrog703243a2007-12-12 01:11:42 +00005#include "sh_intc.h"
6
balrog5c167362008-12-07 19:39:58 +00007#define A7ADDR(x) ((x) & 0x1fffffff)
8#define P4ADDR(x) ((x) | 0xe0000000)
9
pbrook87ecb682007-11-17 17:14:51 +000010/* sh7750.c */
11struct SH7750State;
Benoît Canet382863e2011-11-17 14:22:58 +010012struct MemoryRegion;
pbrook87ecb682007-11-17 17:14:51 +000013
Benoît Canet382863e2011-11-17 14:22:58 +010014struct SH7750State *sh7750_init(CPUState * cpu, struct MemoryRegion *sysmem);
pbrook87ecb682007-11-17 17:14:51 +000015
16typedef struct {
17 /* The callback will be triggered if any of the designated lines change */
18 uint16_t portamask_trigger;
19 uint16_t portbmask_trigger;
20 /* Return 0 if no action was taken */
21 int (*port_change_cb) (uint16_t porta, uint16_t portb,
22 uint16_t * periph_pdtra,
23 uint16_t * periph_portdira,
24 uint16_t * periph_pdtrb,
25 uint16_t * periph_portdirb);
26} sh7750_io_device;
27
28int sh7750_register_io_device(struct SH7750State *s,
29 sh7750_io_device * device);
30/* sh_timer.c */
31#define TMU012_FEAT_TOCR (1 << 0)
32#define TMU012_FEAT_3CHAN (1 << 1)
33#define TMU012_FEAT_EXTCLK (1 << 2)
Benoît Canet89e29452011-11-17 14:23:00 +010034void tmu012_init(struct MemoryRegion *sysmem, target_phys_addr_t base,
35 int feat, uint32_t freq,
aurel3296e2fc42008-11-21 21:06:42 +000036 qemu_irq ch0_irq, qemu_irq ch1_irq,
37 qemu_irq ch2_irq0, qemu_irq ch2_irq1);
balrog703243a2007-12-12 01:11:42 +000038
pbrook87ecb682007-11-17 17:14:51 +000039
40/* sh_serial.c */
41#define SH_SERIAL_FEAT_SCIF (1 << 0)
Benoît Canet9a9d0b82011-11-17 14:23:02 +010042void sh_serial_init(MemoryRegion *sysmem,
43 target_phys_addr_t base, int feat,
aurel32bf5b7422008-05-09 18:46:04 +000044 uint32_t freq, CharDriverState *chr,
aurel324e7ed2d2008-11-21 21:06:51 +000045 qemu_irq eri_source,
46 qemu_irq rxi_source,
47 qemu_irq txi_source,
48 qemu_irq tei_source,
49 qemu_irq bri_source);
pbrook87ecb682007-11-17 17:14:51 +000050
balrogc6d86a32008-12-07 18:49:57 +000051/* sh7750.c */
52qemu_irq sh7750_irl(struct SH7750State *s);
53
pbrook87ecb682007-11-17 17:14:51 +000054/* tc58128.c */
blueswir17ccfb2e2008-09-14 06:45:34 +000055int tc58128_init(struct SH7750State *s, const char *zone1, const char *zone2);
pbrook87ecb682007-11-17 17:14:51 +000056
pbrook87ecb682007-11-17 17:14:51 +000057#endif