wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2003 |
| 3 | * Josef Baumgartner <josef.baumgartner@telex.de> |
| 4 | * |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 5 | * MCF5282 additionals |
| 6 | * (C) Copyright 2005 |
| 7 | * BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de> |
| 8 | * |
TsiChungLiew | a1436a8 | 2007-08-16 13:20:50 -0500 | [diff] [blame] | 9 | * Copyright (C) 2004-2007 Freescale Semiconductor, Inc. |
| 10 | * TsiChung Liew (Tsi-Chung.Liew@freescale.com) |
| 11 | * Hayden Fraser (Hayden.Fraser@freescale.com) |
| 12 | * |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 13 | * MCF5275 additions |
| 14 | * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com) |
| 15 | * |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 16 | * See file CREDITS for list of people who contributed to this |
| 17 | * project. |
| 18 | * |
| 19 | * This program is free software; you can redistribute it and/or |
| 20 | * modify it under the terms of the GNU General Public License as |
| 21 | * published by the Free Software Foundation; either version 2 of |
| 22 | * the License, or (at your option) any later version. |
| 23 | * |
| 24 | * This program is distributed in the hope that it will be useful, |
| 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Wolfgang Denk | 977b50f | 2006-05-10 17:43:20 +0200 | [diff] [blame] | 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 27 | * GNU General Public License for more details. |
| 28 | * |
| 29 | * You should have received a copy of the GNU General Public License |
| 30 | * along with this program; if not, write to the Free Software |
| 31 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 32 | * MA 02111-1307 USA |
| 33 | */ |
| 34 | |
| 35 | #include <common.h> |
| 36 | #include <watchdog.h> |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 37 | #include <asm/immap.h> |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 38 | |
TsiChung Liew | f3962d3 | 2008-10-21 13:47:54 +0000 | [diff] [blame] | 39 | #if defined(CONFIG_CMD_NET) |
| 40 | #include <config.h> |
| 41 | #include <net.h> |
| 42 | #include <asm/fec.h> |
| 43 | #endif |
| 44 | |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 45 | #ifndef CONFIG_M5272 |
| 46 | /* Only 5272 Flexbus chipselect is different from the rest */ |
| 47 | void init_fbcs(void) |
| 48 | { |
| 49 | volatile fbcs_t *fbcs = (fbcs_t *) (MMAP_FBCS); |
| 50 | |
| 51 | #if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) \ |
| 52 | && defined(CONFIG_SYS_CS0_CTRL)) |
| 53 | fbcs->csar0 = CONFIG_SYS_CS0_BASE; |
| 54 | fbcs->cscr0 = CONFIG_SYS_CS0_CTRL; |
| 55 | fbcs->csmr0 = CONFIG_SYS_CS0_MASK; |
| 56 | #else |
| 57 | #warning "Chip Select 0 are not initialized/used" |
| 58 | #endif |
| 59 | #if (defined(CONFIG_SYS_CS1_BASE) && defined(CONFIG_SYS_CS1_MASK) \ |
| 60 | && defined(CONFIG_SYS_CS1_CTRL)) |
| 61 | fbcs->csar1 = CONFIG_SYS_CS1_BASE; |
| 62 | fbcs->cscr1 = CONFIG_SYS_CS1_CTRL; |
| 63 | fbcs->csmr1 = CONFIG_SYS_CS1_MASK; |
| 64 | #endif |
| 65 | #if (defined(CONFIG_SYS_CS2_BASE) && defined(CONFIG_SYS_CS2_MASK) \ |
| 66 | && defined(CONFIG_SYS_CS2_CTRL)) |
| 67 | fbcs->csar2 = CONFIG_SYS_CS2_BASE; |
| 68 | fbcs->cscr2 = CONFIG_SYS_CS2_CTRL; |
| 69 | fbcs->csmr2 = CONFIG_SYS_CS2_MASK; |
| 70 | #endif |
| 71 | #if (defined(CONFIG_SYS_CS3_BASE) && defined(CONFIG_SYS_CS3_MASK) \ |
| 72 | && defined(CONFIG_SYS_CS3_CTRL)) |
| 73 | fbcs->csar3 = CONFIG_SYS_CS3_BASE; |
| 74 | fbcs->cscr3 = CONFIG_SYS_CS3_CTRL; |
| 75 | fbcs->csmr3 = CONFIG_SYS_CS3_MASK; |
| 76 | #endif |
| 77 | #if (defined(CONFIG_SYS_CS4_BASE) && defined(CONFIG_SYS_CS4_MASK) \ |
| 78 | && defined(CONFIG_SYS_CS4_CTRL)) |
| 79 | fbcs->csar4 = CONFIG_SYS_CS4_BASE; |
| 80 | fbcs->cscr4 = CONFIG_SYS_CS4_CTRL; |
| 81 | fbcs->csmr4 = CONFIG_SYS_CS4_MASK; |
| 82 | #endif |
| 83 | #if (defined(CONFIG_SYS_CS5_BASE) && defined(CONFIG_SYS_CS5_MASK) \ |
| 84 | && defined(CONFIG_SYS_CS5_CTRL)) |
| 85 | fbcs->csar5 = CONFIG_SYS_CS5_BASE; |
| 86 | fbcs->cscr5 = CONFIG_SYS_CS5_CTRL; |
| 87 | fbcs->csmr5 = CONFIG_SYS_CS5_MASK; |
| 88 | #endif |
| 89 | #if (defined(CONFIG_SYS_CS6_BASE) && defined(CONFIG_SYS_CS6_MASK) \ |
| 90 | && defined(CONFIG_SYS_CS6_CTRL)) |
| 91 | fbcs->csar6 = CONFIG_SYS_CS6_BASE; |
| 92 | fbcs->cscr6 = CONFIG_SYS_CS6_CTRL; |
| 93 | fbcs->csmr6 = CONFIG_SYS_CS6_MASK; |
| 94 | #endif |
| 95 | #if (defined(CONFIG_SYS_CS7_BASE) && defined(CONFIG_SYS_CS7_MASK) \ |
| 96 | && defined(CONFIG_SYS_CS7_CTRL)) |
| 97 | fbcs->csar7 = CONFIG_SYS_CS7_BASE; |
| 98 | fbcs->cscr7 = CONFIG_SYS_CS7_CTRL; |
| 99 | fbcs->csmr7 = CONFIG_SYS_CS7_MASK; |
| 100 | #endif |
| 101 | } |
| 102 | #endif |
| 103 | |
TsiChungLiew | a1436a8 | 2007-08-16 13:20:50 -0500 | [diff] [blame] | 104 | #if defined(CONFIG_M5253) |
| 105 | /* |
| 106 | * Breath some life into the CPU... |
| 107 | * |
| 108 | * Set up the memory map, |
| 109 | * initialize a bunch of registers, |
| 110 | * initialize the UPM's |
| 111 | */ |
| 112 | void cpu_init_f(void) |
| 113 | { |
| 114 | mbar_writeByte(MCFSIM_MPARK, 0x40); /* 5249 Internal Core takes priority over DMA */ |
| 115 | mbar_writeByte(MCFSIM_SYPCR, 0x00); |
| 116 | mbar_writeByte(MCFSIM_SWIVR, 0x0f); |
| 117 | mbar_writeByte(MCFSIM_SWSR, 0x00); |
| 118 | mbar_writeByte(MCFSIM_SWDICR, 0x00); |
| 119 | mbar_writeByte(MCFSIM_TIMER1ICR, 0x00); |
| 120 | mbar_writeByte(MCFSIM_TIMER2ICR, 0x88); |
| 121 | mbar_writeByte(MCFSIM_I2CICR, 0x00); |
| 122 | mbar_writeByte(MCFSIM_UART1ICR, 0x00); |
| 123 | mbar_writeByte(MCFSIM_UART2ICR, 0x00); |
| 124 | mbar_writeByte(MCFSIM_ICR6, 0x00); |
| 125 | mbar_writeByte(MCFSIM_ICR7, 0x00); |
| 126 | mbar_writeByte(MCFSIM_ICR8, 0x00); |
| 127 | mbar_writeByte(MCFSIM_ICR9, 0x00); |
| 128 | mbar_writeByte(MCFSIM_QSPIICR, 0x00); |
| 129 | |
| 130 | mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080); |
| 131 | mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */ |
| 132 | mbar2_writeByte(MCFSIM_SPURVEC, 0x00); |
| 133 | |
Wolfgang Denk | 455ae7e | 2008-12-16 01:02:17 +0100 | [diff] [blame] | 134 | /*mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); */ /* Enable a 1 cycle pre-drive cycle on CS1 */ |
TsiChungLiew | a1436a8 | 2007-08-16 13:20:50 -0500 | [diff] [blame] | 135 | |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 136 | /* FlexBus Chipselect */ |
| 137 | init_fbcs(); |
TsiChungLiew | a1436a8 | 2007-08-16 13:20:50 -0500 | [diff] [blame] | 138 | |
TsiChung Liew | eec567a | 2008-08-19 03:01:19 +0600 | [diff] [blame] | 139 | #ifdef CONFIG_FSL_I2C |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 140 | CONFIG_SYS_I2C_PINMUX_REG = |
| 141 | CONFIG_SYS_I2C_PINMUX_REG & CONFIG_SYS_I2C_PINMUX_CLR; |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 142 | CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET; |
| 143 | #ifdef CONFIG_SYS_I2C2_OFFSET |
| 144 | CONFIG_SYS_I2C2_PINMUX_REG &= CONFIG_SYS_I2C2_PINMUX_CLR; |
| 145 | CONFIG_SYS_I2C2_PINMUX_REG |= CONFIG_SYS_I2C2_PINMUX_SET; |
TsiChung Liew | eec567a | 2008-08-19 03:01:19 +0600 | [diff] [blame] | 146 | #endif |
| 147 | #endif |
| 148 | |
TsiChungLiew | a1436a8 | 2007-08-16 13:20:50 -0500 | [diff] [blame] | 149 | /* enable instruction cache now */ |
| 150 | icache_enable(); |
| 151 | } |
| 152 | |
| 153 | /*initialize higher level parts of CPU like timers */ |
| 154 | int cpu_init_r(void) |
| 155 | { |
| 156 | return (0); |
| 157 | } |
| 158 | |
| 159 | void uart_port_conf(void) |
| 160 | { |
| 161 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 162 | switch (CONFIG_SYS_UART_PORT) { |
TsiChungLiew | a1436a8 | 2007-08-16 13:20:50 -0500 | [diff] [blame] | 163 | case 0: |
| 164 | break; |
| 165 | case 1: |
| 166 | break; |
| 167 | case 2: |
| 168 | break; |
| 169 | } |
| 170 | } |
| 171 | #endif /* #if defined(CONFIG_M5253) */ |
| 172 | |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 173 | #if defined(CONFIG_M5271) |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 174 | void cpu_init_f(void) |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 175 | { |
| 176 | #ifndef CONFIG_WATCHDOG |
| 177 | /* Disable the watchdog if we aren't using it */ |
| 178 | mbar_writeShort(MCF_WTM_WCR, 0); |
| 179 | #endif |
| 180 | |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 181 | /* FlexBus Chipselect */ |
| 182 | init_fbcs(); |
| 183 | |
Richard Retanubun | e0db344 | 2009-01-29 14:36:06 -0500 | [diff] [blame] | 184 | #ifdef CONFIG_SYS_MCF_SYNCR |
| 185 | /* Set clockspeed according to board header file */ |
| 186 | mbar_writeLong(MCF_FMPLL_SYNCR, CONFIG_SYS_MCF_SYNCR); |
| 187 | #else |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 188 | /* Set clockspeed to 100MHz */ |
Richard Retanubun | e0db344 | 2009-01-29 14:36:06 -0500 | [diff] [blame] | 189 | mbar_writeLong(MCF_FMPLL_SYNCR, |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 190 | MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0)); |
Richard Retanubun | e0db344 | 2009-01-29 14:36:06 -0500 | [diff] [blame] | 191 | #endif |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 192 | while (!mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK) ; |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | /* |
| 196 | * initialize higher level parts of CPU like timers |
| 197 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 198 | int cpu_init_r(void) |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 199 | { |
| 200 | return (0); |
| 201 | } |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 202 | |
| 203 | void uart_port_conf(void) |
| 204 | { |
| 205 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 206 | switch (CONFIG_SYS_UART_PORT) { |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 207 | case 0: |
| 208 | mbar_writeShort(MCF_GPIO_PAR_UART, MCF_GPIO_PAR_UART_U0TXD | |
| 209 | MCF_GPIO_PAR_UART_U0RXD); |
| 210 | break; |
| 211 | case 1: |
| 212 | mbar_writeShort(MCF_GPIO_PAR_UART, |
| 213 | MCF_GPIO_PAR_UART_U1RXD_UART1 | |
| 214 | MCF_GPIO_PAR_UART_U1TXD_UART1); |
| 215 | break; |
| 216 | case 2: |
| 217 | mbar_writeShort(MCF_GPIO_PAR_UART, 0x3000); |
| 218 | break; |
| 219 | } |
| 220 | } |
TsiChung Liew | f3962d3 | 2008-10-21 13:47:54 +0000 | [diff] [blame] | 221 | |
| 222 | #if defined(CONFIG_CMD_NET) |
| 223 | int fecpin_setclear(struct eth_device *dev, int setclear) |
| 224 | { |
| 225 | if (setclear) { |
| 226 | /* Enable Ethernet pins */ |
Richard Retanubun | d1ef25d | 2009-01-23 10:47:13 -0500 | [diff] [blame] | 227 | mbar_writeByte(MCF_GPIO_PAR_FECI2C, |
| 228 | (mbar_readByte(MCF_GPIO_PAR_FECI2C) | 0xF0)); |
TsiChung Liew | f3962d3 | 2008-10-21 13:47:54 +0000 | [diff] [blame] | 229 | } else { |
| 230 | } |
| 231 | |
| 232 | return 0; |
| 233 | } |
| 234 | #endif /* CONFIG_CMD_NET */ |
Zachary P. Landau | eacbd31 | 2006-01-26 17:35:56 -0500 | [diff] [blame] | 235 | #endif |
| 236 | |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 237 | #if defined(CONFIG_M5272) |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 238 | /* |
| 239 | * Breath some life into the CPU... |
| 240 | * |
| 241 | * Set up the memory map, |
| 242 | * initialize a bunch of registers, |
| 243 | * initialize the UPM's |
| 244 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 245 | void cpu_init_f(void) |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 246 | { |
| 247 | /* if we come from RAM we assume the CPU is |
| 248 | * already initialized. |
| 249 | */ |
| 250 | #ifndef CONFIG_MONITOR_IS_IN_RAM |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 251 | volatile sysctrl_t *sysctrl = (sysctrl_t *) (CONFIG_SYS_MBAR); |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 252 | volatile gpio_t *gpio = (gpio_t *) (MMAP_GPIO); |
| 253 | volatile csctrl_t *csctrl = (csctrl_t *) (MMAP_FBCS); |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 254 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 255 | sysctrl->sc_scr = CONFIG_SYS_SCR; |
| 256 | sysctrl->sc_spr = CONFIG_SYS_SPR; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 257 | |
Wolfgang Denk | 977b50f | 2006-05-10 17:43:20 +0200 | [diff] [blame] | 258 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 259 | gpio->gpio_pacnt = CONFIG_SYS_PACNT; |
| 260 | gpio->gpio_paddr = CONFIG_SYS_PADDR; |
| 261 | gpio->gpio_padat = CONFIG_SYS_PADAT; |
| 262 | gpio->gpio_pbcnt = CONFIG_SYS_PBCNT; |
| 263 | gpio->gpio_pbddr = CONFIG_SYS_PBDDR; |
| 264 | gpio->gpio_pbdat = CONFIG_SYS_PBDAT; |
| 265 | gpio->gpio_pdcnt = CONFIG_SYS_PDCNT; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 266 | |
| 267 | /* Memory Controller: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 268 | csctrl->cs_br0 = CONFIG_SYS_BR0_PRELIM; |
| 269 | csctrl->cs_or0 = CONFIG_SYS_OR0_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 270 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 271 | #if (defined(CONFIG_SYS_OR1_PRELIM) && defined(CONFIG_SYS_BR1_PRELIM)) |
| 272 | csctrl->cs_br1 = CONFIG_SYS_BR1_PRELIM; |
| 273 | csctrl->cs_or1 = CONFIG_SYS_OR1_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 274 | #endif |
| 275 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 276 | #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM) |
| 277 | csctrl->cs_br2 = CONFIG_SYS_BR2_PRELIM; |
| 278 | csctrl->cs_or2 = CONFIG_SYS_OR2_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 279 | #endif |
| 280 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 281 | #if defined(CONFIG_SYS_OR3_PRELIM) && defined(CONFIG_SYS_BR3_PRELIM) |
| 282 | csctrl->cs_br3 = CONFIG_SYS_BR3_PRELIM; |
| 283 | csctrl->cs_or3 = CONFIG_SYS_OR3_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 284 | #endif |
| 285 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 286 | #if defined(CONFIG_SYS_OR4_PRELIM) && defined(CONFIG_SYS_BR4_PRELIM) |
| 287 | csctrl->cs_br4 = CONFIG_SYS_BR4_PRELIM; |
| 288 | csctrl->cs_or4 = CONFIG_SYS_OR4_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 289 | #endif |
| 290 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 291 | #if defined(CONFIG_SYS_OR5_PRELIM) && defined(CONFIG_SYS_BR5_PRELIM) |
| 292 | csctrl->cs_br5 = CONFIG_SYS_BR5_PRELIM; |
| 293 | csctrl->cs_or5 = CONFIG_SYS_OR5_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 294 | #endif |
| 295 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 296 | #if defined(CONFIG_SYS_OR6_PRELIM) && defined(CONFIG_SYS_BR6_PRELIM) |
| 297 | csctrl->cs_br6 = CONFIG_SYS_BR6_PRELIM; |
| 298 | csctrl->cs_or6 = CONFIG_SYS_OR6_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 299 | #endif |
| 300 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 301 | #if defined(CONFIG_SYS_OR7_PRELIM) && defined(CONFIG_SYS_BR7_PRELIM) |
| 302 | csctrl->cs_br7 = CONFIG_SYS_BR7_PRELIM; |
| 303 | csctrl->cs_or7 = CONFIG_SYS_OR7_PRELIM; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 304 | #endif |
| 305 | |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 306 | #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 307 | |
Wolfgang Denk | 977b50f | 2006-05-10 17:43:20 +0200 | [diff] [blame] | 308 | /* enable instruction cache now */ |
| 309 | icache_enable(); |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 310 | |
| 311 | } |
| 312 | |
| 313 | /* |
| 314 | * initialize higher level parts of CPU like timers |
| 315 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 316 | int cpu_init_r(void) |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 317 | { |
| 318 | return (0); |
| 319 | } |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 320 | |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 321 | void uart_port_conf(void) |
| 322 | { |
| 323 | volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO; |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 324 | |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 325 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 326 | switch (CONFIG_SYS_UART_PORT) { |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 327 | case 0: |
| 328 | gpio->gpio_pbcnt &= ~(GPIO_PBCNT_PB0MSK | GPIO_PBCNT_PB1MSK); |
| 329 | gpio->gpio_pbcnt |= (GPIO_PBCNT_URT0_TXD | GPIO_PBCNT_URT0_RXD); |
| 330 | break; |
| 331 | case 1: |
| 332 | gpio->gpio_pdcnt &= ~(GPIO_PDCNT_PD1MSK | GPIO_PDCNT_PD4MSK); |
| 333 | gpio->gpio_pdcnt |= (GPIO_PDCNT_URT1_RXD | GPIO_PDCNT_URT1_TXD); |
| 334 | break; |
| 335 | } |
| 336 | } |
TsiChung Liew | f3962d3 | 2008-10-21 13:47:54 +0000 | [diff] [blame] | 337 | |
| 338 | #if defined(CONFIG_CMD_NET) |
| 339 | int fecpin_setclear(struct eth_device *dev, int setclear) |
| 340 | { |
| 341 | volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO; |
| 342 | |
| 343 | if (setclear) { |
| 344 | gpio->gpio_pbcnt |= GPIO_PBCNT_E_MDC | GPIO_PBCNT_E_RXER | |
| 345 | GPIO_PBCNT_E_RXD1 | GPIO_PBCNT_E_RXD2 | |
| 346 | GPIO_PBCNT_E_RXD3 | GPIO_PBCNT_E_TXD1 | |
| 347 | GPIO_PBCNT_E_TXD2 | GPIO_PBCNT_E_TXD3; |
| 348 | } else { |
| 349 | } |
| 350 | return 0; |
| 351 | } |
| 352 | #endif /* CONFIG_CMD_NET */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 353 | #endif /* #if defined(CONFIG_M5272) */ |
| 354 | |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 355 | #if defined(CONFIG_M5275) |
| 356 | |
| 357 | /* |
| 358 | * Breathe some life into the CPU... |
| 359 | * |
| 360 | * Set up the memory map, |
| 361 | * initialize a bunch of registers, |
| 362 | * initialize the UPM's |
| 363 | */ |
| 364 | void cpu_init_f(void) |
| 365 | { |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 366 | /* |
| 367 | * if we come from RAM we assume the CPU is |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 368 | * already initialized. |
| 369 | */ |
| 370 | |
| 371 | #ifndef CONFIG_MONITOR_IS_IN_RAM |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 372 | volatile wdog_t *wdog_reg = (wdog_t *) (MMAP_WDOG); |
| 373 | volatile gpio_t *gpio_reg = (gpio_t *) (MMAP_GPIO); |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 374 | |
| 375 | /* Kill watchdog so we can initialize the PLL */ |
| 376 | wdog_reg->wcr = 0; |
| 377 | |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 378 | /* FlexBus Chipselect */ |
| 379 | init_fbcs(); |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 380 | #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */ |
| 381 | |
| 382 | #ifdef CONFIG_FSL_I2C |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 383 | CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR; |
| 384 | CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET; |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 385 | #endif |
| 386 | |
| 387 | /* enable instruction cache now */ |
| 388 | icache_enable(); |
| 389 | } |
| 390 | |
| 391 | /* |
| 392 | * initialize higher level parts of CPU like timers |
| 393 | */ |
| 394 | int cpu_init_r(void) |
| 395 | { |
| 396 | return (0); |
| 397 | } |
| 398 | |
| 399 | void uart_port_conf(void) |
| 400 | { |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 401 | volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO; |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 402 | |
| 403 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 404 | switch (CONFIG_SYS_UART_PORT) { |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 405 | case 0: |
| 406 | gpio->par_uart |= UART0_ENABLE_MASK; |
| 407 | break; |
| 408 | case 1: |
| 409 | gpio->par_uart |= UART1_ENABLE_MASK; |
| 410 | break; |
| 411 | case 2: |
| 412 | gpio->par_uart |= UART2_ENABLE_MASK; |
| 413 | break; |
| 414 | } |
| 415 | } |
TsiChung Liew | f3962d3 | 2008-10-21 13:47:54 +0000 | [diff] [blame] | 416 | |
| 417 | #if defined(CONFIG_CMD_NET) |
| 418 | int fecpin_setclear(struct eth_device *dev, int setclear) |
| 419 | { |
| 420 | struct fec_info_s *info = (struct fec_info_s *) dev->priv; |
| 421 | volatile gpio_t *gpio = (gpio_t *)MMAP_GPIO; |
| 422 | |
| 423 | if (setclear) { |
| 424 | /* Enable Ethernet pins */ |
| 425 | if (info->iobase == CONFIG_SYS_FEC0_IOBASE) { |
| 426 | gpio->par_feci2c |= 0x0F00; |
| 427 | gpio->par_fec0hl |= 0xC0; |
| 428 | } else { |
| 429 | gpio->par_feci2c |= 0x00A0; |
| 430 | gpio->par_fec1hl |= 0xC0; |
| 431 | } |
| 432 | } else { |
| 433 | if (info->iobase == CONFIG_SYS_FEC0_IOBASE) { |
| 434 | gpio->par_feci2c &= ~0x0F00; |
| 435 | gpio->par_fec0hl &= ~0xC0; |
| 436 | } else { |
| 437 | gpio->par_feci2c &= ~0x00A0; |
| 438 | gpio->par_fec1hl &= ~0xC0; |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | return 0; |
| 443 | } |
| 444 | #endif /* CONFIG_CMD_NET */ |
Matthew Fettke | f71d9d9 | 2008-02-04 15:38:20 -0600 | [diff] [blame] | 445 | #endif /* #if defined(CONFIG_M5275) */ |
| 446 | |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 447 | #if defined(CONFIG_M5282) |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 448 | /* |
| 449 | * Breath some life into the CPU... |
| 450 | * |
| 451 | * Set up the memory map, |
| 452 | * initialize a bunch of registers, |
| 453 | * initialize the UPM's |
| 454 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 455 | void cpu_init_f(void) |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 456 | { |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 457 | #ifndef CONFIG_WATCHDOG |
| 458 | /* disable watchdog if we aren't using it */ |
| 459 | MCFWTM_WCR = 0; |
| 460 | #endif |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 461 | |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 462 | #ifndef CONFIG_MONITOR_IS_IN_RAM |
| 463 | /* Set speed /PLL */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 464 | MCFCLOCK_SYNCR = |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 465 | MCFCLOCK_SYNCR_MFD(CONFIG_SYS_MFD) | |
| 466 | MCFCLOCK_SYNCR_RFD(CONFIG_SYS_RFD); |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 467 | while (!(MCFCLOCK_SYNSR & MCFCLOCK_SYNSR_LOCK)) ; |
| 468 | |
| 469 | MCFGPIO_PBCDPAR = 0xc0; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 470 | |
| 471 | /* Set up the GPIO ports */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 472 | #ifdef CONFIG_SYS_PEPAR |
| 473 | MCFGPIO_PEPAR = CONFIG_SYS_PEPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 474 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 475 | #ifdef CONFIG_SYS_PFPAR |
| 476 | MCFGPIO_PFPAR = CONFIG_SYS_PFPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 477 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 478 | #ifdef CONFIG_SYS_PJPAR |
| 479 | MCFGPIO_PJPAR = CONFIG_SYS_PJPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 480 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 481 | #ifdef CONFIG_SYS_PSDPAR |
| 482 | MCFGPIO_PSDPAR = CONFIG_SYS_PSDPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 483 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 484 | #ifdef CONFIG_SYS_PASPAR |
| 485 | MCFGPIO_PASPAR = CONFIG_SYS_PASPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 486 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 487 | #ifdef CONFIG_SYS_PEHLPAR |
| 488 | MCFGPIO_PEHLPAR = CONFIG_SYS_PEHLPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 489 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 490 | #ifdef CONFIG_SYS_PQSPAR |
| 491 | MCFGPIO_PQSPAR = CONFIG_SYS_PQSPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 492 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 493 | #ifdef CONFIG_SYS_PTCPAR |
| 494 | MCFGPIO_PTCPAR = CONFIG_SYS_PTCPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 495 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 496 | #ifdef CONFIG_SYS_PTDPAR |
| 497 | MCFGPIO_PTDPAR = CONFIG_SYS_PTDPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 498 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 499 | #ifdef CONFIG_SYS_PUAPAR |
| 500 | MCFGPIO_PUAPAR = CONFIG_SYS_PUAPAR; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 501 | #endif |
| 502 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 503 | #ifdef CONFIG_SYS_DDRUA |
| 504 | MCFGPIO_DDRUA = CONFIG_SYS_DDRUA; |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 505 | #endif |
| 506 | |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 507 | /* FlexBus Chipselect */ |
| 508 | init_fbcs(); |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 509 | |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 510 | #endif /* CONFIG_MONITOR_IS_IN_RAM */ |
Heiko Schocher | 9acb626 | 2006-04-20 08:42:42 +0200 | [diff] [blame] | 511 | |
| 512 | /* defer enabling cache until boot (see do_go) */ |
| 513 | /* icache_enable(); */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | /* |
| 517 | * initialize higher level parts of CPU like timers |
| 518 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 519 | int cpu_init_r(void) |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 520 | { |
| 521 | return (0); |
| 522 | } |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 523 | |
| 524 | void uart_port_conf(void) |
| 525 | { |
| 526 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 527 | switch (CONFIG_SYS_UART_PORT) { |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 528 | case 0: |
| 529 | MCFGPIO_PUAPAR &= 0xFc; |
| 530 | MCFGPIO_PUAPAR |= 0x03; |
| 531 | break; |
| 532 | case 1: |
| 533 | MCFGPIO_PUAPAR &= 0xF3; |
| 534 | MCFGPIO_PUAPAR |= 0x0C; |
| 535 | break; |
| 536 | case 2: |
| 537 | MCFGPIO_PASPAR &= 0xFF0F; |
| 538 | MCFGPIO_PASPAR |= 0x00A0; |
| 539 | break; |
| 540 | } |
| 541 | } |
TsiChung Liew | f3962d3 | 2008-10-21 13:47:54 +0000 | [diff] [blame] | 542 | |
| 543 | #if defined(CONFIG_CMD_NET) |
| 544 | int fecpin_setclear(struct eth_device *dev, int setclear) |
| 545 | { |
| 546 | if (setclear) { |
| 547 | MCFGPIO_PASPAR |= 0x0F00; |
| 548 | MCFGPIO_PEHLPAR = CONFIG_SYS_PEHLPAR; |
| 549 | } else { |
| 550 | MCFGPIO_PASPAR &= 0xF0FF; |
| 551 | MCFGPIO_PEHLPAR &= ~CONFIG_SYS_PEHLPAR; |
| 552 | } |
| 553 | return 0; |
| 554 | } |
| 555 | #endif /* CONFIG_CMD_NET */ |
wdenk | bf9e3b3 | 2004-02-12 00:47:09 +0000 | [diff] [blame] | 556 | #endif |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 557 | |
| 558 | #if defined(CONFIG_M5249) |
| 559 | /* |
| 560 | * Breath some life into the CPU... |
| 561 | * |
| 562 | * Set up the memory map, |
| 563 | * initialize a bunch of registers, |
| 564 | * initialize the UPM's |
| 565 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 566 | void cpu_init_f(void) |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 567 | { |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 568 | /* |
| 569 | * NOTE: by setting the GPIO_FUNCTION registers, we ensure that the UART pins |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 570 | * (UART0: gpio 30,27, UART1: gpio 31, 28) will be used as UART pins |
| 571 | * which is their primary function. |
| 572 | * ~Jeremy |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 573 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 574 | mbar2_writeLong(MCFSIM_GPIO_FUNC, CONFIG_SYS_GPIO_FUNC); |
| 575 | mbar2_writeLong(MCFSIM_GPIO1_FUNC, CONFIG_SYS_GPIO1_FUNC); |
| 576 | mbar2_writeLong(MCFSIM_GPIO_EN, CONFIG_SYS_GPIO_EN); |
| 577 | mbar2_writeLong(MCFSIM_GPIO1_EN, CONFIG_SYS_GPIO1_EN); |
| 578 | mbar2_writeLong(MCFSIM_GPIO_OUT, CONFIG_SYS_GPIO_OUT); |
| 579 | mbar2_writeLong(MCFSIM_GPIO1_OUT, CONFIG_SYS_GPIO1_OUT); |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 580 | |
| 581 | /* |
| 582 | * dBug Compliance: |
| 583 | * You can verify these values by using dBug's 'ird' |
| 584 | * (Internal Register Display) command |
| 585 | * ~Jeremy |
| 586 | * |
Wolfgang Denk | 977b50f | 2006-05-10 17:43:20 +0200 | [diff] [blame] | 587 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 588 | mbar_writeByte(MCFSIM_MPARK, 0x30); /* 5249 Internal Core takes priority over DMA */ |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 589 | mbar_writeByte(MCFSIM_SYPCR, 0x00); |
| 590 | mbar_writeByte(MCFSIM_SWIVR, 0x0f); |
| 591 | mbar_writeByte(MCFSIM_SWSR, 0x00); |
| 592 | mbar_writeLong(MCFSIM_IMR, 0xfffffbff); |
| 593 | mbar_writeByte(MCFSIM_SWDICR, 0x00); |
| 594 | mbar_writeByte(MCFSIM_TIMER1ICR, 0x00); |
| 595 | mbar_writeByte(MCFSIM_TIMER2ICR, 0x88); |
| 596 | mbar_writeByte(MCFSIM_I2CICR, 0x00); |
| 597 | mbar_writeByte(MCFSIM_UART1ICR, 0x00); |
| 598 | mbar_writeByte(MCFSIM_UART2ICR, 0x00); |
| 599 | mbar_writeByte(MCFSIM_ICR6, 0x00); |
| 600 | mbar_writeByte(MCFSIM_ICR7, 0x00); |
| 601 | mbar_writeByte(MCFSIM_ICR8, 0x00); |
| 602 | mbar_writeByte(MCFSIM_ICR9, 0x00); |
| 603 | mbar_writeByte(MCFSIM_QSPIICR, 0x00); |
| 604 | |
| 605 | mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080); |
Wolfgang Denk | 977b50f | 2006-05-10 17:43:20 +0200 | [diff] [blame] | 606 | mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */ |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 607 | mbar2_writeByte(MCFSIM_SPURVEC, 0x00); |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 608 | mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); /* Enable a 1 cycle pre-drive cycle on CS1 */ |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 609 | |
| 610 | /* Setup interrupt priorities for gpio7 */ |
| 611 | /* mbar2_writeLong(MCFSIM_INTLEV5, 0x70000000); */ |
| 612 | |
| 613 | /* IDE Config registers */ |
| 614 | mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); |
| 615 | mbar2_writeLong(MCFSIM_IDECONFIG2, 0x00000000); |
| 616 | |
TsiChung Liew | 012522f | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 617 | /* FlexBus Chipselect */ |
| 618 | init_fbcs(); |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 619 | |
| 620 | /* enable instruction cache now */ |
| 621 | icache_enable(); |
| 622 | } |
| 623 | |
| 624 | /* |
| 625 | * initialize higher level parts of CPU like timers |
| 626 | */ |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 627 | int cpu_init_r(void) |
stroese | 8c725b9 | 2004-12-16 18:09:49 +0000 | [diff] [blame] | 628 | { |
| 629 | return (0); |
| 630 | } |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 631 | |
| 632 | void uart_port_conf(void) |
| 633 | { |
| 634 | /* Setup Ports: */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 635 | switch (CONFIG_SYS_UART_PORT) { |
TsiChungLiew | 83ec20b | 2007-08-15 19:21:21 -0500 | [diff] [blame] | 636 | case 0: |
| 637 | break; |
| 638 | case 1: |
| 639 | break; |
| 640 | } |
| 641 | } |
| 642 | #endif /* #if defined(CONFIG_M5249) */ |