Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************/ |
| 2 | |
| 3 | /* |
| 4 | * m528xsim.h -- ColdFire 5280/5282 System Integration Module support. |
| 5 | * |
| 6 | * (C) Copyright 2003, Greg Ungerer (gerg@snapgear.com) |
| 7 | */ |
| 8 | |
| 9 | /****************************************************************************/ |
| 10 | #ifndef m528xsim_h |
| 11 | #define m528xsim_h |
| 12 | /****************************************************************************/ |
| 13 | |
Greg Ungerer | 733f31b | 2010-11-02 17:40:37 +1000 | [diff] [blame] | 14 | #define CPU_NAME "COLDFIRE(m528x)" |
| 15 | #define CPU_INSTR_PER_JIFFY 3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Greg Ungerer | a12cf0a | 2010-11-09 10:12:29 +1000 | [diff] [blame] | 17 | #include <asm/m52xxacr.h> |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | /* |
| 20 | * Define the 5280/5282 SIM register set addresses. |
| 21 | */ |
Greg Ungerer | 254eef7 | 2011-03-05 22:17:17 +1000 | [diff] [blame] | 22 | #define MCFICM_INTC0 (MCF_IPSBAR + 0x0c00) /* Base for Interrupt Ctrl 0 */ |
| 23 | #define MCFICM_INTC1 (MCF_IPSBAR + 0x0d00) /* Base for Interrupt Ctrl 0 */ |
| 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 */ |
Steven King | 91d6041 | 2010-01-22 12:43:03 -0800 | [diff] [blame] | 37 | #define MCFINT_QSPI 18 /* Interrupt number for QSPI */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #define MCFINT_PIT1 55 /* Interrupt number for PIT1 */ |
| 39 | |
| 40 | /* |
| 41 | * SDRAM configuration registers. |
| 42 | */ |
Greg Ungerer | 6a92e19 | 2011-03-06 23:01:46 +1000 | [diff] [blame^] | 43 | #define MCFSIM_DCR (MCF_IPSBAR + 0x00000044) /* Control */ |
| 44 | #define MCFSIM_DACR0 (MCF_IPSBAR + 0x00000048) /* Base address 0 */ |
| 45 | #define MCFSIM_DMR0 (MCF_IPSBAR + 0x0000004c) /* Address mask 0 */ |
| 46 | #define MCFSIM_DACR1 (MCF_IPSBAR + 0x00000050) /* Base address 1 */ |
| 47 | #define MCFSIM_DMR1 (MCF_IPSBAR + 0x00000054) /* Address mask 1 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
Greg Ungerer | 7ce4d42 | 2005-09-12 11:18:10 +1000 | [diff] [blame] | 49 | /* |
Greg Ungerer | babc08b | 2011-03-06 00:54:36 +1000 | [diff] [blame] | 50 | * DMA unit base addresses. |
| 51 | */ |
| 52 | #define MCFDMA_BASE0 (MCF_IPSBAR + 0x00000100) |
| 53 | #define MCFDMA_BASE1 (MCF_IPSBAR + 0x00000140) |
| 54 | #define MCFDMA_BASE2 (MCF_IPSBAR + 0x00000180) |
| 55 | #define MCFDMA_BASE3 (MCF_IPSBAR + 0x000001C0) |
| 56 | |
| 57 | /* |
Greg Ungerer | 5701542 | 2010-11-03 12:50:30 +1000 | [diff] [blame] | 58 | * UART module. |
| 59 | */ |
Greg Ungerer | a0ba433 | 2011-03-06 00:20:01 +1000 | [diff] [blame] | 60 | #define MCFUART_BASE1 (MCF_IPSBAR + 0x00000200) |
| 61 | #define MCFUART_BASE2 (MCF_IPSBAR + 0x00000240) |
| 62 | #define MCFUART_BASE3 (MCF_IPSBAR + 0x00000280) |
| 63 | |
| 64 | /* |
| 65 | * FEC ethernet module. |
| 66 | */ |
| 67 | #define MCFFEC_BASE (MCF_IPSBAR + 0x00001000) |
| 68 | #define MCFFEC_SIZE 0x800 |
Greg Ungerer | 5701542 | 2010-11-03 12:50:30 +1000 | [diff] [blame] | 69 | |
| 70 | /* |
sfking@fdwdc.com | 6da6e63 | 2009-06-19 18:11:08 -0700 | [diff] [blame] | 71 | * GPIO registers |
| 72 | */ |
| 73 | #define MCFGPIO_PORTA (MCF_IPSBAR + 0x00100000) |
| 74 | #define MCFGPIO_PORTB (MCF_IPSBAR + 0x00100001) |
| 75 | #define MCFGPIO_PORTC (MCF_IPSBAR + 0x00100002) |
| 76 | #define MCFGPIO_PORTD (MCF_IPSBAR + 0x00100003) |
| 77 | #define MCFGPIO_PORTE (MCF_IPSBAR + 0x00100004) |
| 78 | #define MCFGPIO_PORTF (MCF_IPSBAR + 0x00100005) |
| 79 | #define MCFGPIO_PORTG (MCF_IPSBAR + 0x00100006) |
| 80 | #define MCFGPIO_PORTH (MCF_IPSBAR + 0x00100007) |
| 81 | #define MCFGPIO_PORTJ (MCF_IPSBAR + 0x00100008) |
| 82 | #define MCFGPIO_PORTDD (MCF_IPSBAR + 0x00100009) |
| 83 | #define MCFGPIO_PORTEH (MCF_IPSBAR + 0x0010000A) |
| 84 | #define MCFGPIO_PORTEL (MCF_IPSBAR + 0x0010000B) |
| 85 | #define MCFGPIO_PORTAS (MCF_IPSBAR + 0x0010000C) |
| 86 | #define MCFGPIO_PORTQS (MCF_IPSBAR + 0x0010000D) |
| 87 | #define MCFGPIO_PORTSD (MCF_IPSBAR + 0x0010000E) |
| 88 | #define MCFGPIO_PORTTC (MCF_IPSBAR + 0x0010000F) |
| 89 | #define MCFGPIO_PORTTD (MCF_IPSBAR + 0x00100010) |
| 90 | #define MCFGPIO_PORTUA (MCF_IPSBAR + 0x00100011) |
| 91 | |
| 92 | #define MCFGPIO_DDRA (MCF_IPSBAR + 0x00100014) |
| 93 | #define MCFGPIO_DDRB (MCF_IPSBAR + 0x00100015) |
| 94 | #define MCFGPIO_DDRC (MCF_IPSBAR + 0x00100016) |
| 95 | #define MCFGPIO_DDRD (MCF_IPSBAR + 0x00100017) |
| 96 | #define MCFGPIO_DDRE (MCF_IPSBAR + 0x00100018) |
| 97 | #define MCFGPIO_DDRF (MCF_IPSBAR + 0x00100019) |
| 98 | #define MCFGPIO_DDRG (MCF_IPSBAR + 0x0010001A) |
| 99 | #define MCFGPIO_DDRH (MCF_IPSBAR + 0x0010001B) |
| 100 | #define MCFGPIO_DDRJ (MCF_IPSBAR + 0x0010001C) |
| 101 | #define MCFGPIO_DDRDD (MCF_IPSBAR + 0x0010001D) |
| 102 | #define MCFGPIO_DDREH (MCF_IPSBAR + 0x0010001E) |
| 103 | #define MCFGPIO_DDREL (MCF_IPSBAR + 0x0010001F) |
| 104 | #define MCFGPIO_DDRAS (MCF_IPSBAR + 0x00100020) |
| 105 | #define MCFGPIO_DDRQS (MCF_IPSBAR + 0x00100021) |
| 106 | #define MCFGPIO_DDRSD (MCF_IPSBAR + 0x00100022) |
| 107 | #define MCFGPIO_DDRTC (MCF_IPSBAR + 0x00100023) |
| 108 | #define MCFGPIO_DDRTD (MCF_IPSBAR + 0x00100024) |
| 109 | #define MCFGPIO_DDRUA (MCF_IPSBAR + 0x00100025) |
| 110 | |
| 111 | #define MCFGPIO_PORTAP (MCF_IPSBAR + 0x00100028) |
| 112 | #define MCFGPIO_PORTBP (MCF_IPSBAR + 0x00100029) |
| 113 | #define MCFGPIO_PORTCP (MCF_IPSBAR + 0x0010002A) |
| 114 | #define MCFGPIO_PORTDP (MCF_IPSBAR + 0x0010002B) |
| 115 | #define MCFGPIO_PORTEP (MCF_IPSBAR + 0x0010002C) |
| 116 | #define MCFGPIO_PORTFP (MCF_IPSBAR + 0x0010002D) |
| 117 | #define MCFGPIO_PORTGP (MCF_IPSBAR + 0x0010002E) |
| 118 | #define MCFGPIO_PORTHP (MCF_IPSBAR + 0x0010002F) |
| 119 | #define MCFGPIO_PORTJP (MCF_IPSBAR + 0x00100030) |
| 120 | #define MCFGPIO_PORTDDP (MCF_IPSBAR + 0x00100031) |
| 121 | #define MCFGPIO_PORTEHP (MCF_IPSBAR + 0x00100032) |
| 122 | #define MCFGPIO_PORTELP (MCF_IPSBAR + 0x00100033) |
| 123 | #define MCFGPIO_PORTASP (MCF_IPSBAR + 0x00100034) |
| 124 | #define MCFGPIO_PORTQSP (MCF_IPSBAR + 0x00100035) |
| 125 | #define MCFGPIO_PORTSDP (MCF_IPSBAR + 0x00100036) |
| 126 | #define MCFGPIO_PORTTCP (MCF_IPSBAR + 0x00100037) |
| 127 | #define MCFGPIO_PORTTDP (MCF_IPSBAR + 0x00100038) |
| 128 | #define MCFGPIO_PORTUAP (MCF_IPSBAR + 0x00100039) |
| 129 | |
| 130 | #define MCFGPIO_SETA (MCF_IPSBAR + 0x00100028) |
| 131 | #define MCFGPIO_SETB (MCF_IPSBAR + 0x00100029) |
| 132 | #define MCFGPIO_SETC (MCF_IPSBAR + 0x0010002A) |
| 133 | #define MCFGPIO_SETD (MCF_IPSBAR + 0x0010002B) |
| 134 | #define MCFGPIO_SETE (MCF_IPSBAR + 0x0010002C) |
| 135 | #define MCFGPIO_SETF (MCF_IPSBAR + 0x0010002D) |
| 136 | #define MCFGPIO_SETG (MCF_IPSBAR + 0x0010002E) |
| 137 | #define MCFGPIO_SETH (MCF_IPSBAR + 0x0010002F) |
| 138 | #define MCFGPIO_SETJ (MCF_IPSBAR + 0x00100030) |
| 139 | #define MCFGPIO_SETDD (MCF_IPSBAR + 0x00100031) |
| 140 | #define MCFGPIO_SETEH (MCF_IPSBAR + 0x00100032) |
| 141 | #define MCFGPIO_SETEL (MCF_IPSBAR + 0x00100033) |
| 142 | #define MCFGPIO_SETAS (MCF_IPSBAR + 0x00100034) |
| 143 | #define MCFGPIO_SETQS (MCF_IPSBAR + 0x00100035) |
| 144 | #define MCFGPIO_SETSD (MCF_IPSBAR + 0x00100036) |
| 145 | #define MCFGPIO_SETTC (MCF_IPSBAR + 0x00100037) |
| 146 | #define MCFGPIO_SETTD (MCF_IPSBAR + 0x00100038) |
| 147 | #define MCFGPIO_SETUA (MCF_IPSBAR + 0x00100039) |
| 148 | |
| 149 | #define MCFGPIO_CLRA (MCF_IPSBAR + 0x0010003C) |
| 150 | #define MCFGPIO_CLRB (MCF_IPSBAR + 0x0010003D) |
| 151 | #define MCFGPIO_CLRC (MCF_IPSBAR + 0x0010003E) |
| 152 | #define MCFGPIO_CLRD (MCF_IPSBAR + 0x0010003F) |
| 153 | #define MCFGPIO_CLRE (MCF_IPSBAR + 0x00100040) |
| 154 | #define MCFGPIO_CLRF (MCF_IPSBAR + 0x00100041) |
| 155 | #define MCFGPIO_CLRG (MCF_IPSBAR + 0x00100042) |
| 156 | #define MCFGPIO_CLRH (MCF_IPSBAR + 0x00100043) |
| 157 | #define MCFGPIO_CLRJ (MCF_IPSBAR + 0x00100044) |
| 158 | #define MCFGPIO_CLRDD (MCF_IPSBAR + 0x00100045) |
| 159 | #define MCFGPIO_CLREH (MCF_IPSBAR + 0x00100046) |
| 160 | #define MCFGPIO_CLREL (MCF_IPSBAR + 0x00100047) |
| 161 | #define MCFGPIO_CLRAS (MCF_IPSBAR + 0x00100048) |
| 162 | #define MCFGPIO_CLRQS (MCF_IPSBAR + 0x00100049) |
| 163 | #define MCFGPIO_CLRSD (MCF_IPSBAR + 0x0010004A) |
| 164 | #define MCFGPIO_CLRTC (MCF_IPSBAR + 0x0010004B) |
| 165 | #define MCFGPIO_CLRTD (MCF_IPSBAR + 0x0010004C) |
| 166 | #define MCFGPIO_CLRUA (MCF_IPSBAR + 0x0010004D) |
| 167 | |
| 168 | #define MCFGPIO_PBCDPAR (MCF_IPSBAR + 0x00100050) |
| 169 | #define MCFGPIO_PFPAR (MCF_IPSBAR + 0x00100051) |
| 170 | #define MCFGPIO_PEPAR (MCF_IPSBAR + 0x00100052) |
| 171 | #define MCFGPIO_PJPAR (MCF_IPSBAR + 0x00100054) |
| 172 | #define MCFGPIO_PSDPAR (MCF_IPSBAR + 0x00100055) |
| 173 | #define MCFGPIO_PASPAR (MCF_IPSBAR + 0x00100056) |
| 174 | #define MCFGPIO_PEHLPAR (MCF_IPSBAR + 0x00100058) |
| 175 | #define MCFGPIO_PQSPAR (MCF_IPSBAR + 0x00100059) |
| 176 | #define MCFGPIO_PTCPAR (MCF_IPSBAR + 0x0010005A) |
| 177 | #define MCFGPIO_PTDPAR (MCF_IPSBAR + 0x0010005B) |
| 178 | #define MCFGPIO_PUAPAR (MCF_IPSBAR + 0x0010005C) |
| 179 | |
| 180 | /* |
Greg Ungerer | f317c71 | 2011-03-05 23:32:35 +1000 | [diff] [blame] | 181 | * PIT timer base addresses. |
| 182 | */ |
| 183 | #define MCFPIT_BASE1 (MCF_IPSBAR + 0x00150000) |
| 184 | #define MCFPIT_BASE2 (MCF_IPSBAR + 0x00160000) |
| 185 | #define MCFPIT_BASE3 (MCF_IPSBAR + 0x00170000) |
| 186 | #define MCFPIT_BASE4 (MCF_IPSBAR + 0x00180000) |
| 187 | |
| 188 | /* |
sfking@fdwdc.com | 6da6e63 | 2009-06-19 18:11:08 -0700 | [diff] [blame] | 189 | * Edge Port registers |
| 190 | */ |
| 191 | #define MCFEPORT_EPPAR (MCF_IPSBAR + 0x00130000) |
| 192 | #define MCFEPORT_EPDDR (MCF_IPSBAR + 0x00130002) |
| 193 | #define MCFEPORT_EPIER (MCF_IPSBAR + 0x00130003) |
| 194 | #define MCFEPORT_EPDR (MCF_IPSBAR + 0x00130004) |
| 195 | #define MCFEPORT_EPPDR (MCF_IPSBAR + 0x00130005) |
| 196 | #define MCFEPORT_EPFR (MCF_IPSBAR + 0x00130006) |
| 197 | |
| 198 | /* |
| 199 | * Queued ADC registers |
| 200 | */ |
| 201 | #define MCFQADC_PORTQA (MCF_IPSBAR + 0x00190006) |
| 202 | #define MCFQADC_PORTQB (MCF_IPSBAR + 0x00190007) |
| 203 | #define MCFQADC_DDRQA (MCF_IPSBAR + 0x00190008) |
| 204 | #define MCFQADC_DDRQB (MCF_IPSBAR + 0x00190009) |
| 205 | |
| 206 | /* |
| 207 | * General Purpose Timers registers |
| 208 | */ |
| 209 | #define MCFGPTA_GPTPORT (MCF_IPSBAR + 0x001A001D) |
| 210 | #define MCFGPTA_GPTDDR (MCF_IPSBAR + 0x001A001E) |
| 211 | #define MCFGPTB_GPTPORT (MCF_IPSBAR + 0x001B001D) |
| 212 | #define MCFGPTB_GPTDDR (MCF_IPSBAR + 0x001B001E) |
| 213 | /* |
| 214 | * |
| 215 | * definitions for generic gpio support |
| 216 | * |
| 217 | */ |
| 218 | #define MCFGPIO_PODR MCFGPIO_PORTA /* port output data */ |
| 219 | #define MCFGPIO_PDDR MCFGPIO_DDRA /* port data direction */ |
| 220 | #define MCFGPIO_PPDR MCFGPIO_PORTAP /* port pin data */ |
| 221 | #define MCFGPIO_SETR MCFGPIO_SETA /* set output */ |
| 222 | #define MCFGPIO_CLRR MCFGPIO_CLRA /* clr output */ |
| 223 | |
| 224 | #define MCFGPIO_IRQ_MAX 8 |
| 225 | #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE |
| 226 | #define MCFGPIO_PIN_MAX 180 |
| 227 | |
| 228 | |
| 229 | /* |
Greg Ungerer | 7ce4d42 | 2005-09-12 11:18:10 +1000 | [diff] [blame] | 230 | * Derek Cheung - 6 Feb 2005 |
| 231 | * add I2C and QSPI register definition using Freescale's MCF5282 |
| 232 | */ |
| 233 | /* set Port AS pin for I2C or UART */ |
| 234 | #define MCF5282_GPIO_PASPAR (volatile u16 *) (MCF_IPSBAR + 0x00100056) |
| 235 | |
Greg Ungerer | 8bb2518 | 2007-03-07 11:28:13 +1000 | [diff] [blame] | 236 | /* Port UA Pin Assignment Register (8 Bit) */ |
| 237 | #define MCF5282_GPIO_PUAPAR 0x10005C |
| 238 | |
Greg Ungerer | 7ce4d42 | 2005-09-12 11:18:10 +1000 | [diff] [blame] | 239 | /* Interrupt Mask Register Register Low */ |
| 240 | #define MCF5282_INTC0_IMRL (volatile u32 *) (MCF_IPSBAR + 0x0C0C) |
| 241 | /* Interrupt Control Register 7 */ |
| 242 | #define MCF5282_INTC0_ICR17 (volatile u8 *) (MCF_IPSBAR + 0x0C51) |
| 243 | |
| 244 | |
Greg Ungerer | dd65b1d | 2009-04-30 23:15:56 +1000 | [diff] [blame] | 245 | /* |
| 246 | * Reset Control Unit (relative to IPSBAR). |
| 247 | */ |
| 248 | #define MCF_RCR 0x110000 |
| 249 | #define MCF_RSR 0x110001 |
| 250 | |
| 251 | #define MCF_RCR_SWRESET 0x80 /* Software reset bit */ |
| 252 | #define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ |
Greg Ungerer | 7ce4d42 | 2005-09-12 11:18:10 +1000 | [diff] [blame] | 253 | |
| 254 | /********************************************************************* |
| 255 | * |
| 256 | * Inter-IC (I2C) Module |
| 257 | * |
| 258 | *********************************************************************/ |
| 259 | /* Read/Write access macros for general use */ |
| 260 | #define MCF5282_I2C_I2ADR (volatile u8 *) (MCF_IPSBAR + 0x0300) // Address |
| 261 | #define MCF5282_I2C_I2FDR (volatile u8 *) (MCF_IPSBAR + 0x0304) // Freq Divider |
| 262 | #define MCF5282_I2C_I2CR (volatile u8 *) (MCF_IPSBAR + 0x0308) // Control |
| 263 | #define MCF5282_I2C_I2SR (volatile u8 *) (MCF_IPSBAR + 0x030C) // Status |
| 264 | #define MCF5282_I2C_I2DR (volatile u8 *) (MCF_IPSBAR + 0x0310) // Data I/O |
| 265 | |
| 266 | /* Bit level definitions and macros */ |
| 267 | #define MCF5282_I2C_I2ADR_ADDR(x) (((x)&0x7F)<<0x01) |
| 268 | |
| 269 | #define MCF5282_I2C_I2FDR_IC(x) (((x)&0x3F)) |
| 270 | |
| 271 | #define MCF5282_I2C_I2CR_IEN (0x80) // I2C enable |
| 272 | #define MCF5282_I2C_I2CR_IIEN (0x40) // interrupt enable |
| 273 | #define MCF5282_I2C_I2CR_MSTA (0x20) // master/slave mode |
| 274 | #define MCF5282_I2C_I2CR_MTX (0x10) // transmit/receive mode |
| 275 | #define MCF5282_I2C_I2CR_TXAK (0x08) // transmit acknowledge enable |
| 276 | #define MCF5282_I2C_I2CR_RSTA (0x04) // repeat start |
| 277 | |
| 278 | #define MCF5282_I2C_I2SR_ICF (0x80) // data transfer bit |
| 279 | #define MCF5282_I2C_I2SR_IAAS (0x40) // I2C addressed as a slave |
| 280 | #define MCF5282_I2C_I2SR_IBB (0x20) // I2C bus busy |
| 281 | #define MCF5282_I2C_I2SR_IAL (0x10) // aribitration lost |
| 282 | #define MCF5282_I2C_I2SR_SRW (0x04) // slave read/write |
| 283 | #define MCF5282_I2C_I2SR_IIF (0x02) // I2C interrupt |
| 284 | #define MCF5282_I2C_I2SR_RXAK (0x01) // received acknowledge |
| 285 | |
| 286 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | #endif /* m528xsim_h */ |