1 /****************************************************************************/ 2 3 /* 4 * m527xsim.h -- ColdFire 5270/5271 System Integration Module support. 5 * 6 * (C) Copyright 2004, Greg Ungerer (gerg@snapgear.com) 7 */ 8 9 /****************************************************************************/ 10 #ifndef m527xsim_h 11 #define m527xsim_h 12 /****************************************************************************/ 13 14 #define CPU_NAME "COLDFIRE(m527x)" 15 #define CPU_INSTR_PER_JIFFY 3 16 17 #include <asm/m52xxacr.h> 18 19 /* 20 * Define the 5270/5271 SIM register set addresses. 21 */ 22 #define MCFICM_INTC0 (MCF_IPSBAR + 0x0c00) /* Base for Interrupt Ctrl 0 */ 23 #define MCFICM_INTC1 (MCF_IPSBAR + 0x0d00) /* Base for Interrupt Ctrl 1 */ 24 25 #define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */ 26 #define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */ 27 #define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */ 28 #define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */ 29 #define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */ 30 #define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */ 31 #define MCFINTC_IRLR 0x18 /* */ 32 #define MCFINTC_IACKL 0x19 /* */ 33 #define MCFINTC_ICR0 0x40 /* Base ICR register */ 34 35 #define MCFINT_VECBASE 64 /* Vector base number */ 36 #define MCFINT_UART0 13 /* Interrupt number for UART0 */ 37 #define MCFINT_UART1 14 /* Interrupt number for UART1 */ 38 #define MCFINT_UART2 15 /* Interrupt number for UART2 */ 39 #define MCFINT_QSPI 18 /* Interrupt number for QSPI */ 40 #define MCFINT_PIT1 36 /* Interrupt number for PIT1 */ 41 42 /* 43 * SDRAM configuration registers. 44 */ 45 #ifdef CONFIG_M5271 46 #define MCFSIM_DCR 0x40 /* SDRAM control */ 47 #define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */ 48 #define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */ 49 #define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */ 50 #define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */ 51 #endif 52 #ifdef CONFIG_M5275 53 #define MCFSIM_DMR 0x40 /* SDRAM mode */ 54 #define MCFSIM_DCR 0x44 /* SDRAM control */ 55 #define MCFSIM_DCFG1 0x48 /* SDRAM configuration 1 */ 56 #define MCFSIM_DCFG2 0x4c /* SDRAM configuration 2 */ 57 #define MCFSIM_DBAR0 0x50 /* SDRAM base address 0 */ 58 #define MCFSIM_DMR0 0x54 /* SDRAM address mask 0 */ 59 #define MCFSIM_DBAR1 0x58 /* SDRAM base address 1 */ 60 #define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */ 61 #endif 62 63 /* 64 * DMA unit base addresses. 65 */ 66 #define MCFDMA_BASE0 (MCF_IPSBAR + 0x100) 67 #define MCFDMA_BASE1 (MCF_IPSBAR + 0x140) 68 #define MCFDMA_BASE2 (MCF_IPSBAR + 0x180) 69 #define MCFDMA_BASE3 (MCF_IPSBAR + 0x1C0) 70 71 /* 72 * UART module. 73 */ 74 #define MCFUART_BASE1 (MCF_IPSBAR + 0x200) 75 #define MCFUART_BASE2 (MCF_IPSBAR + 0x240) 76 #define MCFUART_BASE3 (MCF_IPSBAR + 0x280) 77 78 /* 79 * FEC ethernet module. 80 */ 81 #define MCFFEC_BASE0 (MCF_IPSBAR + 0x1000) 82 #define MCFFEC_SIZE0 0x800 83 #define MCFFEC_BASE1 (MCF_IPSBAR + 0x1800) 84 #define MCFFEC_SIZE1 0x800 85 86 #ifdef CONFIG_M5271 87 #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000) 88 #define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001) 89 #define MCFGPIO_PODR_DATAL (MCF_IPSBAR + 0x100002) 90 #define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100003) 91 #define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100004) 92 #define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100005) 93 #define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x100006) 94 #define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x100007) 95 #define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100008) 96 #define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100009) 97 #define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000A) 98 #define MCFGPIO_PODR_TIMER (MCF_IPSBAR + 0x10000B) 99 100 #define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100010) 101 #define MCFGPIO_PDDR_DATAH (MCF_IPSBAR + 0x100011) 102 #define MCFGPIO_PDDR_DATAL (MCF_IPSBAR + 0x100012) 103 #define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100013) 104 #define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100014) 105 #define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100015) 106 #define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x100016) 107 #define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100017) 108 #define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100018) 109 #define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x100019) 110 #define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x10001A) 111 #define MCFGPIO_PDDR_TIMER (MCF_IPSBAR + 0x10001B) 112 113 #define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x100020) 114 #define MCFGPIO_PPDSDR_DATAH (MCF_IPSBAR + 0x100021) 115 #define MCFGPIO_PPDSDR_DATAL (MCF_IPSBAR + 0x100022) 116 #define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x100023) 117 #define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x100024) 118 #define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100025) 119 #define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100026) 120 #define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100027) 121 #define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100028) 122 #define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100029) 123 #define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x10002A) 124 #define MCFGPIO_PPDSDR_TIMER (MCF_IPSBAR + 0x10002B) 125 126 #define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100030) 127 #define MCFGPIO_PCLRR_DATAH (MCF_IPSBAR + 0x100031) 128 #define MCFGPIO_PCLRR_DATAL (MCF_IPSBAR + 0x100032) 129 #define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100033) 130 #define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100034) 131 #define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x100035) 132 #define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100036) 133 #define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100037) 134 #define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x100038) 135 #define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100039) 136 #define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x10003A) 137 #define MCFGPIO_PCLRR_TIMER (MCF_IPSBAR + 0x10003B) 138 139 /* 140 * Generic GPIO support 141 */ 142 #define MCFGPIO_PODR MCFGPIO_PODR_ADDR 143 #define MCFGPIO_PDDR MCFGPIO_PDDR_ADDR 144 #define MCFGPIO_PPDR MCFGPIO_PPDSDR_ADDR 145 #define MCFGPIO_SETR MCFGPIO_PPDSDR_ADDR 146 #define MCFGPIO_CLRR MCFGPIO_PCLRR_ADDR 147 148 #define MCFGPIO_PIN_MAX 100 149 #define MCFGPIO_IRQ_MAX 8 150 #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE 151 152 #define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10004A) 153 #define MCFGPIO_PAR_TIMER (MCF_IPSBAR + 0x10004C) 154 #endif 155 156 #ifdef CONFIG_M5275 157 #define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004) 158 #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100005) 159 #define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100008) 160 #define MCFGPIO_PODR_FEC0H (MCF_IPSBAR + 0x10000A) 161 #define MCFGPIO_PODR_FEC0L (MCF_IPSBAR + 0x10000B) 162 #define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x10000C) 163 #define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000D) 164 #define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x10000E) 165 #define MCFGPIO_PODR_TIMERH (MCF_IPSBAR + 0x10000F) 166 #define MCFGPIO_PODR_TIMERL (MCF_IPSBAR + 0x100010) 167 #define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100011) 168 #define MCFGPIO_PODR_FEC1H (MCF_IPSBAR + 0x100012) 169 #define MCFGPIO_PODR_FEC1L (MCF_IPSBAR + 0x100013) 170 #define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100014) 171 #define MCFGPIO_PODR_IRQ (MCF_IPSBAR + 0x100015) 172 #define MCFGPIO_PODR_USBH (MCF_IPSBAR + 0x100016) 173 #define MCFGPIO_PODR_USBL (MCF_IPSBAR + 0x100017) 174 #define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100018) 175 176 #define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100020) 177 #define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100021) 178 #define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100024) 179 #define MCFGPIO_PDDR_FEC0H (MCF_IPSBAR + 0x100026) 180 #define MCFGPIO_PDDR_FEC0L (MCF_IPSBAR + 0x100027) 181 #define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100028) 182 #define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x100029) 183 #define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x10002A) 184 #define MCFGPIO_PDDR_TIMERH (MCF_IPSBAR + 0x10002B) 185 #define MCFGPIO_PDDR_TIMERL (MCF_IPSBAR + 0x10002C) 186 #define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x10002D) 187 #define MCFGPIO_PDDR_FEC1H (MCF_IPSBAR + 0x10002E) 188 #define MCFGPIO_PDDR_FEC1L (MCF_IPSBAR + 0x10002F) 189 #define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100030) 190 #define MCFGPIO_PDDR_IRQ (MCF_IPSBAR + 0x100031) 191 #define MCFGPIO_PDDR_USBH (MCF_IPSBAR + 0x100032) 192 #define MCFGPIO_PDDR_USBL (MCF_IPSBAR + 0x100033) 193 #define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100034) 194 195 #define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x10003C) 196 #define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x10003D) 197 #define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100040) 198 #define MCFGPIO_PPDSDR_FEC0H (MCF_IPSBAR + 0x100042) 199 #define MCFGPIO_PPDSDR_FEC0L (MCF_IPSBAR + 0x100043) 200 #define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100044) 201 #define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x100045) 202 #define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100046) 203 #define MCFGPIO_PPDSDR_TIMERH (MCF_IPSBAR + 0x100047) 204 #define MCFGPIO_PPDSDR_TIMERL (MCF_IPSBAR + 0x100048) 205 #define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100049) 206 #define MCFGPIO_PPDSDR_FEC1H (MCF_IPSBAR + 0x10004A) 207 #define MCFGPIO_PPDSDR_FEC1L (MCF_IPSBAR + 0x10004B) 208 #define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x10004C) 209 #define MCFGPIO_PPDSDR_IRQ (MCF_IPSBAR + 0x10004D) 210 #define MCFGPIO_PPDSDR_USBH (MCF_IPSBAR + 0x10004E) 211 #define MCFGPIO_PPDSDR_USBL (MCF_IPSBAR + 0x10004F) 212 #define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100050) 213 214 #define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100058) 215 #define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100059) 216 #define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x10005C) 217 #define MCFGPIO_PCLRR_FEC0H (MCF_IPSBAR + 0x10005E) 218 #define MCFGPIO_PCLRR_FEC0L (MCF_IPSBAR + 0x10005F) 219 #define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100060) 220 #define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x100061) 221 #define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100062) 222 #define MCFGPIO_PCLRR_TIMERH (MCF_IPSBAR + 0x100063) 223 #define MCFGPIO_PCLRR_TIMERL (MCF_IPSBAR + 0x100064) 224 #define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100065) 225 #define MCFGPIO_PCLRR_FEC1H (MCF_IPSBAR + 0x100066) 226 #define MCFGPIO_PCLRR_FEC1L (MCF_IPSBAR + 0x100067) 227 #define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100068) 228 #define MCFGPIO_PCLRR_IRQ (MCF_IPSBAR + 0x100069) 229 #define MCFGPIO_PCLRR_USBH (MCF_IPSBAR + 0x10006A) 230 #define MCFGPIO_PCLRR_USBL (MCF_IPSBAR + 0x10006B) 231 #define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x10006C) 232 233 234 /* 235 * Generic GPIO support 236 */ 237 #define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL 238 #define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL 239 #define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL 240 #define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL 241 #define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL 242 243 #define MCFGPIO_PIN_MAX 148 244 #define MCFGPIO_IRQ_MAX 8 245 #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE 246 247 #define MCFGPIO_PAR_QSPI (MCF_IPSBAR + 0x10007E) 248 #endif 249 250 /* 251 * PIT timer base addresses. 252 */ 253 #define MCFPIT_BASE1 (MCF_IPSBAR + 0x150000) 254 #define MCFPIT_BASE2 (MCF_IPSBAR + 0x160000) 255 #define MCFPIT_BASE3 (MCF_IPSBAR + 0x170000) 256 #define MCFPIT_BASE4 (MCF_IPSBAR + 0x180000) 257 258 /* 259 * EPort 260 */ 261 #define MCFEPORT_EPDDR (MCF_IPSBAR + 0x130002) 262 #define MCFEPORT_EPDR (MCF_IPSBAR + 0x130004) 263 #define MCFEPORT_EPPDR (MCF_IPSBAR + 0x130005) 264 265 /* 266 * GPIO pins setups to enable the UARTs. 267 */ 268 #ifdef CONFIG_M5271 269 #define MCF_GPIO_PAR_UART 0x100048 /* PAR UART address */ 270 #define UART0_ENABLE_MASK 0x000f 271 #define UART1_ENABLE_MASK 0x0ff0 272 #define UART2_ENABLE_MASK 0x3000 273 #endif 274 #ifdef CONFIG_M5275 275 #define MCF_GPIO_PAR_UART 0x10007c /* PAR UART address */ 276 #define UART0_ENABLE_MASK 0x000f 277 #define UART1_ENABLE_MASK 0x00f0 278 #define UART2_ENABLE_MASK 0x3f00 279 #endif 280 281 /* 282 * Reset Controll Unit (relative to IPSBAR). 283 */ 284 #define MCF_RCR 0x110000 285 #define MCF_RSR 0x110001 286 287 #define MCF_RCR_SWRESET 0x80 /* Software reset bit */ 288 #define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ 289 290 /****************************************************************************/ 291 #endif /* m527xsim_h */ 292