]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/ColdFire_MCF52259_CodeWarrior/Freescale_Headers/MCF52259_SCM.h
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
[freertos] / FreeRTOS / Demo / ColdFire_MCF52259_CodeWarrior / Freescale_Headers / MCF52259_SCM.h
1 /* Coldfire C Header File\r
2  * Copyright Freescale Semiconductor Inc\r
3  * All rights reserved.\r
4  *\r
5  * 2008/04/17 Revision: 0.2\r
6  *\r
7  * (c) Copyright UNIS, spol. s r.o. 1997-2008\r
8  * UNIS, spol. s r.o.\r
9  * Jundrovska 33\r
10  * 624 00 Brno\r
11  * Czech Republic\r
12  * http      : www.processorexpert.com\r
13  * mail      : info@processorexpert.com\r
14  */\r
15 \r
16 #ifndef __MCF52259_SCM_H__\r
17 #define __MCF52259_SCM_H__\r
18 \r
19 \r
20 /*********************************************************************\r
21 *\r
22 * System Control Module (SCM)\r
23 *\r
24 *********************************************************************/\r
25 \r
26 /* Register read/write macros */\r
27 #define MCF_SCM_RAMBAR                       (*(vuint32*)(&__IPSBAR[0x8]))\r
28 #define MCF_SCM_PPMRH                        (*(vuint32*)(&__IPSBAR[0xC]))\r
29 #define MCF_SCM_CRSR                         (*(vuint8 *)(&__IPSBAR[0x10]))\r
30 #define MCF_SCM_CWCR                         (*(vuint8 *)(&__IPSBAR[0x11]))\r
31 #define MCF_SCM_CWSR                         (*(vuint8 *)(&__IPSBAR[0x13]))\r
32 #define MCF_SCM_DMAREQC                      (*(vuint32*)(&__IPSBAR[0x14]))\r
33 #define MCF_SCM_PPMRL                        (*(vuint32*)(&__IPSBAR[0x18]))\r
34 #define MCF_SCM_MPARK                        (*(vuint32*)(&__IPSBAR[0x1C]))\r
35 #define MCF_SCM_MPR                          (*(vuint8 *)(&__IPSBAR[0x20]))\r
36 #define MCF_SCM_PPMRS                        (*(vuint8 *)(&__IPSBAR[0x21]))\r
37 #define MCF_SCM_PPMRC                        (*(vuint8 *)(&__IPSBAR[0x22]))\r
38 #define MCF_SCM_IPSBMT                       (*(vuint8 *)(&__IPSBAR[0x23]))\r
39 #define MCF_SCM_PACR0                        (*(vuint8 *)(&__IPSBAR[0x24]))\r
40 #define MCF_SCM_PACR1                        (*(vuint8 *)(&__IPSBAR[0x25]))\r
41 #define MCF_SCM_PACR2                        (*(vuint8 *)(&__IPSBAR[0x26]))\r
42 #define MCF_SCM_PACR3                        (*(vuint8 *)(&__IPSBAR[0x27]))\r
43 #define MCF_SCM_PACR4                        (*(vuint8 *)(&__IPSBAR[0x28]))\r
44 #define MCF_SCM_PACR5                        (*(vuint8 *)(&__IPSBAR[0x29]))\r
45 #define MCF_SCM_PACR6                        (*(vuint8 *)(&__IPSBAR[0x2A]))\r
46 #define MCF_SCM_PACR7                        (*(vuint8 *)(&__IPSBAR[0x2B]))\r
47 #define MCF_SCM_PACR8                        (*(vuint8 *)(&__IPSBAR[0x2C]))\r
48 #define MCF_SCM_PACR10                       (*(vuint8 *)(&__IPSBAR[0x2E]))\r
49 #define MCF_SCM_GPACR0                       (*(vuint8 *)(&__IPSBAR[0x30]))\r
50 #define MCF_SCM_GPACR1                       (*(vuint8 *)(&__IPSBAR[0x31]))\r
51 #define MCF_SCM_PACR(x)                      (*(vuint8 *)(&__IPSBAR[0x24 + ((x)*0x1)]))\r
52 #define MCF_SCM_GPACR(x)                     (*(vuint8 *)(&__IPSBAR[0x30 + ((x)*0x1)]))\r
53 \r
54 /* Other macros */\r
55 #define MCF_SCM_IPSBAR                       (*(vuint32*)(&__IPSBAR[0x0]))\r
56 #define MCF_SCM_IPSBAR_V                     (0x1)\r
57 #define MCF_SCM_IPSBAR_BA(x)                 ((x)&0xC0000000)\r
58 \r
59 \r
60 /* Bit definitions and macros for MCF_SCM_RAMBAR */\r
61 #define MCF_SCM_RAMBAR_BDE                   (0x200)\r
62 #define MCF_SCM_RAMBAR_BA(x)                 ((x)&0xFFFF0000)\r
63 \r
64 /* Bit definitions and macros for MCF_SCM_PPMRH */\r
65 #define MCF_SCM_PPMRH_CDGPIO                 (0x1)\r
66 #define MCF_SCM_PPMRH_CDEPORT                (0x2)\r
67 #define MCF_SCM_PPMRH_CDPIT0                 (0x8)\r
68 #define MCF_SCM_PPMRH_CDPIT1                 (0x10)\r
69 #define MCF_SCM_PPMRH_CDADC                  (0x80)\r
70 #define MCF_SCM_PPMRH_CDGPT                  (0x100)\r
71 #define MCF_SCM_PPMRH_CDPWM                  (0x200)\r
72 #define MCF_SCM_PPMRH_CDCFM                  (0x800)\r
73 #define MCF_SCM_PPMRH_CDUSB                  (0x1000)\r
74 \r
75 /* Bit definitions and macros for MCF_SCM_CRSR */\r
76 #define MCF_SCM_CRSR_EXT                     (0x80)\r
77 \r
78 /* Bit definitions and macros for MCF_SCM_CWCR */\r
79 #define MCF_SCM_CWCR_CWTIF                   (0x1)\r
80 #define MCF_SCM_CWCR_CWTAVAL                 (0x2)\r
81 #define MCF_SCM_CWCR_CWTA                    (0x4)\r
82 #define MCF_SCM_CWCR_CWT(x)                  (((x)&0x7)<<0x3)\r
83 #define MCF_SCM_CWCR_CWT_2_9                 (0)\r
84 #define MCF_SCM_CWCR_CWT_2_11                (0x8)\r
85 #define MCF_SCM_CWCR_CWT_2_13                (0x10)\r
86 #define MCF_SCM_CWCR_CWT_2_15                (0x18)\r
87 #define MCF_SCM_CWCR_CWT_2_19                (0x20)\r
88 #define MCF_SCM_CWCR_CWT_2_23                (0x28)\r
89 #define MCF_SCM_CWCR_CWT_2_27                (0x30)\r
90 #define MCF_SCM_CWCR_CWT_2_31                (0x38)\r
91 #define MCF_SCM_CWCR_CWRI                    (0x40)\r
92 #define MCF_SCM_CWCR_CWE                     (0x80)\r
93 \r
94 /* Bit definitions and macros for MCF_SCM_CWSR */\r
95 #define MCF_SCM_CWSR_CWSR(x)                 (((x)&0xFF)<<0)\r
96 \r
97 /* Bit definitions and macros for MCF_SCM_DMAREQC */\r
98 #define MCF_SCM_DMAREQC_DMAC0(x)             (((x)&0xF)<<0)\r
99 #define MCF_SCM_DMAREQC_DMAC1(x)             (((x)&0xF)<<0x4)\r
100 #define MCF_SCM_DMAREQC_DMAC2(x)             (((x)&0xF)<<0x8)\r
101 #define MCF_SCM_DMAREQC_DMAC3(x)             (((x)&0xF)<<0xC)\r
102 \r
103 /* Bit definitions and macros for MCF_SCM_PPMRL */\r
104 #define MCF_SCM_PPMRL_CDG                    (0x2)\r
105 #define MCF_SCM_PPMRL_CDMINIBUS              (0x8)\r
106 #define MCF_SCM_PPMRL_CDDMA                  (0x10)\r
107 #define MCF_SCM_PPMRL_CDUART0                (0x20)\r
108 #define MCF_SCM_PPMRL_CDUART1                (0x40)\r
109 #define MCF_SCM_PPMRL_CDUART2                (0x80)\r
110 #define MCF_SCM_PPMRL_CDI2C0                 (0x200)\r
111 #define MCF_SCM_PPMRL_CDQSPI                 (0x400)\r
112 #define MCF_SCM_PPMRL_CDI2C1                 (0x800)\r
113 #define MCF_SCM_PPMRL_CDDTIM0                (0x2000)\r
114 #define MCF_SCM_PPMRL_CDDTIM1                (0x4000)\r
115 #define MCF_SCM_PPMRL_CDDTIM2                (0x8000)\r
116 #define MCF_SCM_PPMRL_CDDTIM3                (0x10000)\r
117 #define MCF_SCM_PPMRL_CDINTC0                (0x20000)\r
118 #define MCF_SCM_PPMRL_CDINTC1                (0x40000)\r
119 #define MCF_SCM_PPMRL_CDFEC                  (0x200000)\r
120 \r
121 /* Bit definitions and macros for MCF_SCM_MPARK */\r
122 #define MCF_SCM_MPARK_LCKOUT_TIME(x)         (((x)&0xF)<<0x8)\r
123 #define MCF_SCM_MPARK_PRKLAST                (0x1000)\r
124 #define MCF_SCM_MPARK_TIMEOUT                (0x2000)\r
125 #define MCF_SCM_MPARK_FIXED                  (0x4000)\r
126 #define MCF_SCM_MPARK_M1_PRTY(x)             (((x)&0x3)<<0x10)\r
127 #define MCF_SCM_MPARK_M0_PRTY(x)             (((x)&0x3)<<0x12)\r
128 #define MCF_SCM_MPARK_M2_PRTY(x)             (((x)&0x3)<<0x14)\r
129 #define MCF_SCM_MPARK_M3_PRTY(x)             (((x)&0x3)<<0x16)\r
130 #define MCF_SCM_MPARK_BCR24BIT               (0x1000000)\r
131 #define MCF_SCM_MPARK_M2_P_EN                (0x2000000)\r
132 \r
133 /* Bit definitions and macros for MCF_SCM_MPR */\r
134 #define MCF_SCM_MPR_MPR(x)                   (((x)&0xF)<<0)\r
135 \r
136 /* Bit definitions and macros for MCF_SCM_PPMRS */\r
137 #define MCF_SCM_PPMRS_PPMRS(x)               (((x)&0x7F)<<0)\r
138 #define MCF_SCM_PPMRS_DISABLE_ALL            (0x40)\r
139 #define MCF_SCM_PPMRS_DISABLE_CFM            (0x2B)\r
140 #define MCF_SCM_PPMRS_DISABLE_CAN            (0x2A)\r
141 #define MCF_SCM_PPMRS_DISABLE_PWM            (0x29)\r
142 #define MCF_SCM_PPMRS_DISABLE_GPT            (0x28)\r
143 #define MCF_SCM_PPMRS_DISABLE_ADC            (0x27)\r
144 #define MCF_SCM_PPMRS_DISABLE_PIT1           (0x24)\r
145 #define MCF_SCM_PPMRS_DISABLE_PIT0           (0x23)\r
146 #define MCF_SCM_PPMRS_DISABLE_EPORT          (0x21)\r
147 #define MCF_SCM_PPMRS_DISABLE_PORTS          (0x20)\r
148 #define MCF_SCM_PPMRS_DISABLE_INTC           (0x11)\r
149 #define MCF_SCM_PPMRS_DISABLE_DTIM3          (0x10)\r
150 #define MCF_SCM_PPMRS_DISABLE_DTIM2          (0xF)\r
151 #define MCF_SCM_PPMRS_DISABLE_DTIM1          (0xE)\r
152 #define MCF_SCM_PPMRS_DISABLE_DTIM0          (0xD)\r
153 #define MCF_SCM_PPMRS_DISABLE_QSPI           (0xA)\r
154 #define MCF_SCM_PPMRS_DISABLE_I2C            (0x9)\r
155 #define MCF_SCM_PPMRS_DISABLE_UART2          (0x7)\r
156 #define MCF_SCM_PPMRS_DISABLE_UART1          (0x6)\r
157 #define MCF_SCM_PPMRS_DISABLE_UART0          (0x5)\r
158 #define MCF_SCM_PPMRS_DISABLE_DMA            (0x4)\r
159 #define MCF_SCM_PPMRS_SET_CDG                (0x1)\r
160 \r
161 /* Bit definitions and macros for MCF_SCM_PPMRC */\r
162 #define MCF_SCM_PPMRC_PPMRC(x)               (((x)&0x7F)<<0)\r
163 #define MCF_SCM_PPMRC_ENABLE_ALL             (0x40)\r
164 #define MCF_SCM_PPMRC_ENABLE_CFM             (0x2B)\r
165 #define MCF_SCM_PPMRC_ENABLE_CAN             (0x2A)\r
166 #define MCF_SCM_PPMRC_ENABLE_PWM             (0x29)\r
167 #define MCF_SCM_PPMRC_ENABLE_GPT             (0x28)\r
168 #define MCF_SCM_PPMRC_ENABLE_ADC             (0x27)\r
169 #define MCF_SCM_PPMRC_ENABLE_PIT1            (0x24)\r
170 #define MCF_SCM_PPMRC_ENABLE_PIT0            (0x23)\r
171 #define MCF_SCM_PPMRC_ENABLE_EPORT           (0x21)\r
172 #define MCF_SCM_PPMRC_ENABLE_PORTS           (0x20)\r
173 #define MCF_SCM_PPMRC_ENABLE_INTC            (0x11)\r
174 #define MCF_SCM_PPMRC_ENABLE_DTIM3           (0x10)\r
175 #define MCF_SCM_PPMRC_ENABLE_DTIM2           (0xF)\r
176 #define MCF_SCM_PPMRC_ENABLE_DTIM1           (0xE)\r
177 #define MCF_SCM_PPMRC_ENABLE_DTIM0           (0xD)\r
178 #define MCF_SCM_PPMRC_ENABLE_QSPI            (0xA)\r
179 #define MCF_SCM_PPMRC_ENABLE_I2C             (0x9)\r
180 #define MCF_SCM_PPMRC_ENABLE_UART2           (0x7)\r
181 #define MCF_SCM_PPMRC_ENABLE_UART1           (0x6)\r
182 #define MCF_SCM_PPMRC_ENABLE_UART0           (0x5)\r
183 #define MCF_SCM_PPMRC_ENABLE_DMA             (0x4)\r
184 #define MCF_SCM_PPMRC_CLEAR_CDG              (0x1)\r
185 \r
186 /* Bit definitions and macros for MCF_SCM_IPSBMT */\r
187 #define MCF_SCM_IPSBMT_BMT(x)                (((x)&0x7)<<0)\r
188 #define MCF_SCM_IPSBMT_BMT_CYCLES_1024       (0)\r
189 #define MCF_SCM_IPSBMT_BMT_CYCLES_512        (0x1)\r
190 #define MCF_SCM_IPSBMT_BMT_CYCLES_256        (0x2)\r
191 #define MCF_SCM_IPSBMT_BMT_CYCLES_128        (0x3)\r
192 #define MCF_SCM_IPSBMT_BMT_CYCLES_64         (0x4)\r
193 #define MCF_SCM_IPSBMT_BMT_CYCLES_32         (0x5)\r
194 #define MCF_SCM_IPSBMT_BMT_CYCLES_16         (0x6)\r
195 #define MCF_SCM_IPSBMT_BMT_CYCLES_8          (0x7)\r
196 #define MCF_SCM_IPSBMT_BME                   (0x8)\r
197 \r
198 /* Bit definitions and macros for MCF_SCM_PACR */\r
199 #define MCF_SCM_PACR_ACCESS_CTRL0(x)         (((x)&0x7)<<0)\r
200 #define MCF_SCM_PACR_LOCK0                   (0x8)\r
201 #define MCF_SCM_PACR_ACCESS_CTRL1(x)         (((x)&0x7)<<0x4)\r
202 #define MCF_SCM_PACR_LOCK1                   (0x80)\r
203 \r
204 /* Bit definitions and macros for MCF_SCM_PACR10 */\r
205 #define MCF_SCM_PACR10_ACCESS_CTRL0(x)       (((x)&0x7)<<0)\r
206 #define MCF_SCM_PACR10_LOCK0                 (0x8)\r
207 #define MCF_SCM_PACR10_ACCESS_CTRL1(x)       (((x)&0x7)<<0x4)\r
208 #define MCF_SCM_PACR10_LOCK1                 (0x80)\r
209 \r
210 /* Bit definitions and macros for MCF_SCM_GPACR */\r
211 #define MCF_SCM_GPACR_ACCESS_CTRL(x)         (((x)&0xF)<<0)\r
212 #define MCF_SCM_GPACR_LOCK                   (0x80)\r
213 \r
214 \r
215 #endif /* __MCF52259_SCM_H__ */\r