]> rtime.felk.cvut.cz Git - sysless.git/blob - arch/h8300/generic/libs/gdbstub/h8s-2633-rmap.h
It is possible to compile gdb-stub under omk now.
[sysless.git] / arch / h8300 / generic / libs / gdbstub / h8s-2633-rmap.h
1 #ifndef H8S_2633_RMAP_H
2 #define H8S_2633_RMAP_H
3
4 #ifndef IN_ASM 
5
6 #define R_UCHAR(a)  (*(volatile unsigned char *)(a))
7 #define R_USHORT(a) (*(volatile unsigned short *)(a))
8 #define R_ULONG(a)  (*(volatile unsigned long *)(a))
9 /* IIC_SCRX&=~SCRX_IICEm */
10 #define SCI_REGENABLE_SCRX asm("bclr    #4, @0xFFFDB4:16")
11  
12 #else /* for use in asm file */
13
14 #define R_UCHAR(a)  (a)
15 #define R_USHORT(a) (a)
16 #define R_ULONG(a)  (a)
17 /* IIC_SCRX&=~SCRX_IICEm */
18 #define SCI_REGENABLE_SCRX      bclr    #4, @0xFFFDB4:16
19
20 #endif
21
22 /* Module stop controll */
23 #define MSTPCRA         R_UCHAR(0xfffffde8)   /* module stop control C */
24 #define MSTPCRB         R_UCHAR(0xfffffde9)   /* module stop control C */
25 #define MSTPCRC         R_UCHAR(0xfffffdea)   /* module stop control C */
26
27 /* sci */
28
29 /* Use only definition for selected channel */
30 #if     GDB_SCI_PORT==0
31 # define SCI_REGENABLE SCI_REGENABLE_SCRX
32 # define SCI_BASE 0xffffff78
33 # define SCI_MSTR MSTPCRB
34 # define SCI_MSTPCR_BIT BIT(7)
35 #elif GDB_SCI_PORT==1
36 # define SCI_REGENABLE SCI_REGENABLE_SCRX
37 # define SCI_BASE 0xffffff80
38 # define SCI_MSTR MSTPCRB
39 # define SCI_MSTPCR_BIT BIT(6)
40 #elif GDB_SCI_PORT==2
41 # define SCI_REGENABLE 
42 # define SCI_BASE 0xffffff88
43 # define SCI_MSTR MSTPCRB
44 # define SCI_MSTPCR_BIT BIT(5)
45 #elif GDB_SCI_PORT==3
46 # define SCI_REGENABLE 
47 # define SCI_BASE 0xfffffdd0
48 # define SCI_MSTR MSTPCRC
49 # define SCI_MSTPCR_BIT BIT(7)
50 #elif GDB_SCI_PORT==4
51 # define SCI_REGENABLE 
52 # define SCI_BASE 0xfffffdd8
53 # define SCI_MSTR MSTPCRC
54 # define SCI_MSTPCR_BIT BIT(6)
55 #else
56 # error "You must define SCI port to uuse (GDB_SCI_PORT)"
57 #endif
58
59 #define SCI_SMR         R_UCHAR(SCI_BASE+0)   /* Serial mode            */
60 #define SCI_BRR         R_UCHAR(SCI_BASE+1)   /* Bit rate               */
61 #define SCI_SCR         R_UCHAR(SCI_BASE+2)   /* Serial control       */
62 #define SCI_TDR         R_UCHAR(SCI_BASE+3)   /* Transmit data        */
63 #define SCI_SSR         R_UCHAR(SCI_BASE+4)   /* Serial status        */
64 #define SCI_RDR         R_UCHAR(SCI_BASE+5)   /* Receive data         */
65 #define SCI_SCMR        R_UCHAR(SCI_BASE+6)   /* Smart card mode      */
66
67 #define SCI_PER  BIT(3)
68 #define SCI_FER  BIT(4) 
69 #define SCI_ORER BIT(5)
70
71 #define SCI_RDRF BIT(6)
72 #define SCI_TDRE BIT(7)
73
74 /* PC Break Controller */
75
76 #define PBC_BARA        R_ULONG(0xfffffe00)   /* Break Address A      */
77 #define PBC_BARB        R_ULONG(0xfffffe04)   /* Break Address B      */
78 #define PBC_BCRA        R_UCHAR(0xfffffe08)   /* Break Control A      */
79 #define PBC_BCRB        R_UCHAR(0xfffffe09)   /* Break Control B      */
80
81 #define PBC_BARX(idx)   (((volatile unsigned long *)0xfffffe00)[idx])
82 #define PBC_BCRX(idx)   (((volatile unsigned char *)0xfffffe08)[idx])
83
84 /* io ports */
85 #define P1DDR           R_UCHAR(0xfffffe30)   /* Port 1 Data Direction Register */
86 #define P1DR            R_UCHAR(0xffffff00)   /* Port 1 Data Register           */
87 #define PADDR           R_UCHAR(0xfffffe39)   /* Port A Data Direction Register */
88 #define PBDDR           R_UCHAR(0xfffffe3a)   /* Port B Data Direction Register */
89 #define PCDDR           R_UCHAR(0xfffffe3b)   /* Port C Data Direction Register */
90
91 #define PGDDR           R_UCHAR(0xfffffe3f)   /* Port G Data Direction Register */
92 /* memory controll registers */
93 #define ABWCR           R_UCHAR(0xfffffed0)   /* Bus width control       */
94 #define ASTCR           R_UCHAR(0xfffffed1)   /* Access state control    */
95 #define WCRH            R_UCHAR(0xfffffed2)   /* Wait control H          */
96 #define WCRL            R_UCHAR(0xfffffed3)   /* Wait control L          */
97 #define BCRH            R_UCHAR(0xfffffed4)   /* Bus control  H          */
98 #define BCRL            R_UCHAR(0xfffffed5)   /* Bus control  L          */
99 #define MCR             R_UCHAR(0xfffffed6)   /* Memory control reg      */
100 #define DRAMCR          R_UCHAR(0xfffffed7)   /* DRAM control register   */
101 #define RTCNT           R_UCHAR(0xfffffed8)   /* Refresh timer counter   */
102 #define RTCOR           R_UCHAR(0xfffffed9)   /* Refresh timer const     */
103 #define PFCR            R_UCHAR(0xfffffdeb)   /* Pin Function control    */
104
105 /* Exception vectors */
106 #define EXCPTVEC_ERI0   80      /* SCI 0 */
107 #define EXCPTVEC_ERI1   84      /* SCI 1 */
108 #define EXCPTVEC_ERI2   88      /* SCI 2 */
109 #define EXCPTVEC_NMI    7
110 #define EXCPTVEC_TRAP2  10
111 #define EXCPTVEC_TRAP3  11
112 #define EXCPTVEC_PBC    27
113
114
115 #endif