Statistics
| Branch: | Revision:

root / hw / sh.h @ 1f51470d

History | View | Annotate | Download (1.6 kB)

1 87ecb68b pbrook
#ifndef QEMU_SH_H
2 87ecb68b pbrook
#define QEMU_SH_H
3 87ecb68b pbrook
/* Definitions for SH board emulation.  */
4 87ecb68b pbrook
5 703243a0 balrog
#include "sh_intc.h"
6 703243a0 balrog
7 5c16736a balrog
#define A7ADDR(x) ((x) & 0x1fffffff)
8 5c16736a balrog
#define P4ADDR(x) ((x) | 0xe0000000)
9 5c16736a balrog
10 87ecb68b pbrook
/* sh7750.c */
11 87ecb68b pbrook
struct SH7750State;
12 382863e2 Benoît Canet
struct MemoryRegion;
13 87ecb68b pbrook
14 382863e2 Benoît Canet
struct SH7750State *sh7750_init(CPUState * cpu, struct MemoryRegion *sysmem);
15 87ecb68b pbrook
16 87ecb68b pbrook
typedef struct {
17 87ecb68b pbrook
    /* The callback will be triggered if any of the designated lines change */
18 87ecb68b pbrook
    uint16_t portamask_trigger;
19 87ecb68b pbrook
    uint16_t portbmask_trigger;
20 87ecb68b pbrook
    /* Return 0 if no action was taken */
21 87ecb68b pbrook
    int (*port_change_cb) (uint16_t porta, uint16_t portb,
22 87ecb68b pbrook
                           uint16_t * periph_pdtra,
23 87ecb68b pbrook
                           uint16_t * periph_portdira,
24 87ecb68b pbrook
                           uint16_t * periph_pdtrb,
25 87ecb68b pbrook
                           uint16_t * periph_portdirb);
26 87ecb68b pbrook
} sh7750_io_device;
27 87ecb68b pbrook
28 87ecb68b pbrook
int sh7750_register_io_device(struct SH7750State *s,
29 87ecb68b pbrook
                              sh7750_io_device * device);
30 87ecb68b pbrook
/* sh_timer.c */
31 87ecb68b pbrook
#define TMU012_FEAT_TOCR   (1 << 0)
32 87ecb68b pbrook
#define TMU012_FEAT_3CHAN  (1 << 1)
33 87ecb68b pbrook
#define TMU012_FEAT_EXTCLK (1 << 2)
34 89e29451 Benoît Canet
void tmu012_init(struct MemoryRegion *sysmem, target_phys_addr_t base,
35 89e29451 Benoît Canet
                 int feat, uint32_t freq,
36 96e2fc41 aurel32
                 qemu_irq ch0_irq, qemu_irq ch1_irq,
37 96e2fc41 aurel32
                 qemu_irq ch2_irq0, qemu_irq ch2_irq1);
38 703243a0 balrog
39 87ecb68b pbrook
40 87ecb68b pbrook
/* sh_serial.c */
41 87ecb68b pbrook
#define SH_SERIAL_FEAT_SCIF (1 << 0)
42 9a9d0b81 Benoît Canet
void sh_serial_init(MemoryRegion *sysmem,
43 9a9d0b81 Benoît Canet
                    target_phys_addr_t base, int feat,
44 bf5b7423 aurel32
                     uint32_t freq, CharDriverState *chr,
45 4e7ed2d1 aurel32
                     qemu_irq eri_source,
46 4e7ed2d1 aurel32
                     qemu_irq rxi_source,
47 4e7ed2d1 aurel32
                     qemu_irq txi_source,
48 4e7ed2d1 aurel32
                     qemu_irq tei_source,
49 4e7ed2d1 aurel32
                     qemu_irq bri_source);
50 87ecb68b pbrook
51 c6d86a33 balrog
/* sh7750.c */
52 c6d86a33 balrog
qemu_irq sh7750_irl(struct SH7750State *s);
53 c6d86a33 balrog
54 87ecb68b pbrook
/* tc58128.c */
55 7ccfb2eb blueswir1
int tc58128_init(struct SH7750State *s, const char *zone1, const char *zone2);
56 87ecb68b pbrook
57 87ecb68b pbrook
#endif