cpu_init.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /*
  2. * (C) Copyright 2003
  3. * Josef Baumgartner <josef.baumgartner@telex.de>
  4. *
  5. * MCF5282 additionals
  6. * (C) Copyright 2005
  7. * BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de>
  8. *
  9. * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  10. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  11. * Hayden Fraser (Hayden.Fraser@freescale.com)
  12. *
  13. * MCF5275 additions
  14. * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
  15. *
  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
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  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. #include <common.h>
  35. #include <watchdog.h>
  36. #include <asm/immap.h>
  37. #ifndef CONFIG_M5272
  38. /* Only 5272 Flexbus chipselect is different from the rest */
  39. void init_fbcs(void)
  40. {
  41. volatile fbcs_t *fbcs = (fbcs_t *) (MMAP_FBCS);
  42. #if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) \
  43. && defined(CONFIG_SYS_CS0_CTRL))
  44. fbcs->csar0 = CONFIG_SYS_CS0_BASE;
  45. fbcs->cscr0 = CONFIG_SYS_CS0_CTRL;
  46. fbcs->csmr0 = CONFIG_SYS_CS0_MASK;
  47. #else
  48. #warning "Chip Select 0 are not initialized/used"
  49. #endif
  50. #if (defined(CONFIG_SYS_CS1_BASE) && defined(CONFIG_SYS_CS1_MASK) \
  51. && defined(CONFIG_SYS_CS1_CTRL))
  52. fbcs->csar1 = CONFIG_SYS_CS1_BASE;
  53. fbcs->cscr1 = CONFIG_SYS_CS1_CTRL;
  54. fbcs->csmr1 = CONFIG_SYS_CS1_MASK;
  55. #endif
  56. #if (defined(CONFIG_SYS_CS2_BASE) && defined(CONFIG_SYS_CS2_MASK) \
  57. && defined(CONFIG_SYS_CS2_CTRL))
  58. fbcs->csar2 = CONFIG_SYS_CS2_BASE;
  59. fbcs->cscr2 = CONFIG_SYS_CS2_CTRL;
  60. fbcs->csmr2 = CONFIG_SYS_CS2_MASK;
  61. #endif
  62. #if (defined(CONFIG_SYS_CS3_BASE) && defined(CONFIG_SYS_CS3_MASK) \
  63. && defined(CONFIG_SYS_CS3_CTRL))
  64. fbcs->csar3 = CONFIG_SYS_CS3_BASE;
  65. fbcs->cscr3 = CONFIG_SYS_CS3_CTRL;
  66. fbcs->csmr3 = CONFIG_SYS_CS3_MASK;
  67. #endif
  68. #if (defined(CONFIG_SYS_CS4_BASE) && defined(CONFIG_SYS_CS4_MASK) \
  69. && defined(CONFIG_SYS_CS4_CTRL))
  70. fbcs->csar4 = CONFIG_SYS_CS4_BASE;
  71. fbcs->cscr4 = CONFIG_SYS_CS4_CTRL;
  72. fbcs->csmr4 = CONFIG_SYS_CS4_MASK;
  73. #endif
  74. #if (defined(CONFIG_SYS_CS5_BASE) && defined(CONFIG_SYS_CS5_MASK) \
  75. && defined(CONFIG_SYS_CS5_CTRL))
  76. fbcs->csar5 = CONFIG_SYS_CS5_BASE;
  77. fbcs->cscr5 = CONFIG_SYS_CS5_CTRL;
  78. fbcs->csmr5 = CONFIG_SYS_CS5_MASK;
  79. #endif
  80. #if (defined(CONFIG_SYS_CS6_BASE) && defined(CONFIG_SYS_CS6_MASK) \
  81. && defined(CONFIG_SYS_CS6_CTRL))
  82. fbcs->csar6 = CONFIG_SYS_CS6_BASE;
  83. fbcs->cscr6 = CONFIG_SYS_CS6_CTRL;
  84. fbcs->csmr6 = CONFIG_SYS_CS6_MASK;
  85. #endif
  86. #if (defined(CONFIG_SYS_CS7_BASE) && defined(CONFIG_SYS_CS7_MASK) \
  87. && defined(CONFIG_SYS_CS7_CTRL))
  88. fbcs->csar7 = CONFIG_SYS_CS7_BASE;
  89. fbcs->cscr7 = CONFIG_SYS_CS7_CTRL;
  90. fbcs->csmr7 = CONFIG_SYS_CS7_MASK;
  91. #endif
  92. }
  93. #endif
  94. #if defined(CONFIG_M5253)
  95. /*
  96. * Breath some life into the CPU...
  97. *
  98. * Set up the memory map,
  99. * initialize a bunch of registers,
  100. * initialize the UPM's
  101. */
  102. void cpu_init_f(void)
  103. {
  104. mbar_writeByte(MCFSIM_MPARK, 0x40); /* 5249 Internal Core takes priority over DMA */
  105. mbar_writeByte(MCFSIM_SYPCR, 0x00);
  106. mbar_writeByte(MCFSIM_SWIVR, 0x0f);
  107. mbar_writeByte(MCFSIM_SWSR, 0x00);
  108. mbar_writeByte(MCFSIM_SWDICR, 0x00);
  109. mbar_writeByte(MCFSIM_TIMER1ICR, 0x00);
  110. mbar_writeByte(MCFSIM_TIMER2ICR, 0x88);
  111. mbar_writeByte(MCFSIM_I2CICR, 0x00);
  112. mbar_writeByte(MCFSIM_UART1ICR, 0x00);
  113. mbar_writeByte(MCFSIM_UART2ICR, 0x00);
  114. mbar_writeByte(MCFSIM_ICR6, 0x00);
  115. mbar_writeByte(MCFSIM_ICR7, 0x00);
  116. mbar_writeByte(MCFSIM_ICR8, 0x00);
  117. mbar_writeByte(MCFSIM_ICR9, 0x00);
  118. mbar_writeByte(MCFSIM_QSPIICR, 0x00);
  119. mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080);
  120. mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */
  121. mbar2_writeByte(MCFSIM_SPURVEC, 0x00);
  122. /*mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); *//* Enable a 1 cycle pre-drive cycle on CS1 */
  123. /* FlexBus Chipselect */
  124. init_fbcs();
  125. #ifdef CONFIG_FSL_I2C
  126. CONFIG_SYS_I2C_PINMUX_REG =
  127. CONFIG_SYS_I2C_PINMUX_REG & CONFIG_SYS_I2C_PINMUX_CLR;
  128. CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
  129. #ifdef CONFIG_SYS_I2C2_OFFSET
  130. CONFIG_SYS_I2C2_PINMUX_REG &= CONFIG_SYS_I2C2_PINMUX_CLR;
  131. CONFIG_SYS_I2C2_PINMUX_REG |= CONFIG_SYS_I2C2_PINMUX_SET;
  132. #endif
  133. #endif
  134. /* enable instruction cache now */
  135. icache_enable();
  136. }
  137. /*initialize higher level parts of CPU like timers */
  138. int cpu_init_r(void)
  139. {
  140. return (0);
  141. }
  142. void uart_port_conf(void)
  143. {
  144. /* Setup Ports: */
  145. switch (CONFIG_SYS_UART_PORT) {
  146. case 0:
  147. break;
  148. case 1:
  149. break;
  150. case 2:
  151. break;
  152. }
  153. }
  154. #endif /* #if defined(CONFIG_M5253) */
  155. #if defined(CONFIG_M5271)
  156. void cpu_init_f(void)
  157. {
  158. #ifndef CONFIG_WATCHDOG
  159. /* Disable the watchdog if we aren't using it */
  160. mbar_writeShort(MCF_WTM_WCR, 0);
  161. #endif
  162. /* FlexBus Chipselect */
  163. init_fbcs();
  164. /* Set clockspeed to 100MHz */
  165. mbar_writeShort(MCF_FMPLL_SYNCR,
  166. MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0));
  167. while (!mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK) ;
  168. }
  169. /*
  170. * initialize higher level parts of CPU like timers
  171. */
  172. int cpu_init_r(void)
  173. {
  174. return (0);
  175. }
  176. void uart_port_conf(void)
  177. {
  178. /* Setup Ports: */
  179. switch (CONFIG_SYS_UART_PORT) {
  180. case 0:
  181. mbar_writeShort(MCF_GPIO_PAR_UART, MCF_GPIO_PAR_UART_U0TXD |
  182. MCF_GPIO_PAR_UART_U0RXD);
  183. break;
  184. case 1:
  185. mbar_writeShort(MCF_GPIO_PAR_UART,
  186. MCF_GPIO_PAR_UART_U1RXD_UART1 |
  187. MCF_GPIO_PAR_UART_U1TXD_UART1);
  188. break;
  189. case 2:
  190. mbar_writeShort(MCF_GPIO_PAR_UART, 0x3000);
  191. break;
  192. }
  193. }
  194. #endif
  195. #if defined(CONFIG_M5272)
  196. /*
  197. * Breath some life into the CPU...
  198. *
  199. * Set up the memory map,
  200. * initialize a bunch of registers,
  201. * initialize the UPM's
  202. */
  203. void cpu_init_f(void)
  204. {
  205. /* if we come from RAM we assume the CPU is
  206. * already initialized.
  207. */
  208. #ifndef CONFIG_MONITOR_IS_IN_RAM
  209. volatile sysctrl_t *sysctrl = (sysctrl_t *) (CONFIG_SYS_MBAR);
  210. volatile gpio_t *gpio = (gpio_t *) (MMAP_GPIO);
  211. volatile csctrl_t *csctrl = (csctrl_t *) (MMAP_FBCS);
  212. sysctrl->sc_scr = CONFIG_SYS_SCR;
  213. sysctrl->sc_spr = CONFIG_SYS_SPR;
  214. /* Setup Ports: */
  215. gpio->gpio_pacnt = CONFIG_SYS_PACNT;
  216. gpio->gpio_paddr = CONFIG_SYS_PADDR;
  217. gpio->gpio_padat = CONFIG_SYS_PADAT;
  218. gpio->gpio_pbcnt = CONFIG_SYS_PBCNT;
  219. gpio->gpio_pbddr = CONFIG_SYS_PBDDR;
  220. gpio->gpio_pbdat = CONFIG_SYS_PBDAT;
  221. gpio->gpio_pdcnt = CONFIG_SYS_PDCNT;
  222. /* Memory Controller: */
  223. csctrl->cs_br0 = CONFIG_SYS_BR0_PRELIM;
  224. csctrl->cs_or0 = CONFIG_SYS_OR0_PRELIM;
  225. #if (defined(CONFIG_SYS_OR1_PRELIM) && defined(CONFIG_SYS_BR1_PRELIM))
  226. csctrl->cs_br1 = CONFIG_SYS_BR1_PRELIM;
  227. csctrl->cs_or1 = CONFIG_SYS_OR1_PRELIM;
  228. #endif
  229. #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM)
  230. csctrl->cs_br2 = CONFIG_SYS_BR2_PRELIM;
  231. csctrl->cs_or2 = CONFIG_SYS_OR2_PRELIM;
  232. #endif
  233. #if defined(CONFIG_SYS_OR3_PRELIM) && defined(CONFIG_SYS_BR3_PRELIM)
  234. csctrl->cs_br3 = CONFIG_SYS_BR3_PRELIM;
  235. csctrl->cs_or3 = CONFIG_SYS_OR3_PRELIM;
  236. #endif
  237. #if defined(CONFIG_SYS_OR4_PRELIM) && defined(CONFIG_SYS_BR4_PRELIM)
  238. csctrl->cs_br4 = CONFIG_SYS_BR4_PRELIM;
  239. csctrl->cs_or4 = CONFIG_SYS_OR4_PRELIM;
  240. #endif
  241. #if defined(CONFIG_SYS_OR5_PRELIM) && defined(CONFIG_SYS_BR5_PRELIM)
  242. csctrl->cs_br5 = CONFIG_SYS_BR5_PRELIM;
  243. csctrl->cs_or5 = CONFIG_SYS_OR5_PRELIM;
  244. #endif
  245. #if defined(CONFIG_SYS_OR6_PRELIM) && defined(CONFIG_SYS_BR6_PRELIM)
  246. csctrl->cs_br6 = CONFIG_SYS_BR6_PRELIM;
  247. csctrl->cs_or6 = CONFIG_SYS_OR6_PRELIM;
  248. #endif
  249. #if defined(CONFIG_SYS_OR7_PRELIM) && defined(CONFIG_SYS_BR7_PRELIM)
  250. csctrl->cs_br7 = CONFIG_SYS_BR7_PRELIM;
  251. csctrl->cs_or7 = CONFIG_SYS_OR7_PRELIM;
  252. #endif
  253. #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
  254. /* enable instruction cache now */
  255. icache_enable();
  256. }
  257. /*
  258. * initialize higher level parts of CPU like timers
  259. */
  260. int cpu_init_r(void)
  261. {
  262. return (0);
  263. }
  264. void uart_port_conf(void)
  265. {
  266. volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
  267. /* Setup Ports: */
  268. switch (CONFIG_SYS_UART_PORT) {
  269. case 0:
  270. gpio->gpio_pbcnt &= ~(GPIO_PBCNT_PB0MSK | GPIO_PBCNT_PB1MSK);
  271. gpio->gpio_pbcnt |= (GPIO_PBCNT_URT0_TXD | GPIO_PBCNT_URT0_RXD);
  272. break;
  273. case 1:
  274. gpio->gpio_pdcnt &= ~(GPIO_PDCNT_PD1MSK | GPIO_PDCNT_PD4MSK);
  275. gpio->gpio_pdcnt |= (GPIO_PDCNT_URT1_RXD | GPIO_PDCNT_URT1_TXD);
  276. break;
  277. }
  278. }
  279. #endif /* #if defined(CONFIG_M5272) */
  280. #if defined(CONFIG_M5275)
  281. /*
  282. * Breathe some life into the CPU...
  283. *
  284. * Set up the memory map,
  285. * initialize a bunch of registers,
  286. * initialize the UPM's
  287. */
  288. void cpu_init_f(void)
  289. {
  290. /*
  291. * if we come from RAM we assume the CPU is
  292. * already initialized.
  293. */
  294. #ifndef CONFIG_MONITOR_IS_IN_RAM
  295. volatile wdog_t *wdog_reg = (wdog_t *) (MMAP_WDOG);
  296. volatile gpio_t *gpio_reg = (gpio_t *) (MMAP_GPIO);
  297. /* Kill watchdog so we can initialize the PLL */
  298. wdog_reg->wcr = 0;
  299. /* FlexBus Chipselect */
  300. init_fbcs();
  301. #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
  302. #ifdef CONFIG_FSL_I2C
  303. CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR;
  304. CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
  305. #endif
  306. /* enable instruction cache now */
  307. icache_enable();
  308. }
  309. /*
  310. * initialize higher level parts of CPU like timers
  311. */
  312. int cpu_init_r(void)
  313. {
  314. return (0);
  315. }
  316. void uart_port_conf(void)
  317. {
  318. volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
  319. /* Setup Ports: */
  320. switch (CONFIG_SYS_UART_PORT) {
  321. case 0:
  322. gpio->par_uart |= UART0_ENABLE_MASK;
  323. break;
  324. case 1:
  325. gpio->par_uart |= UART1_ENABLE_MASK;
  326. break;
  327. case 2:
  328. gpio->par_uart |= UART2_ENABLE_MASK;
  329. break;
  330. }
  331. }
  332. #endif /* #if defined(CONFIG_M5275) */
  333. #if defined(CONFIG_M5282)
  334. /*
  335. * Breath some life into the CPU...
  336. *
  337. * Set up the memory map,
  338. * initialize a bunch of registers,
  339. * initialize the UPM's
  340. */
  341. void cpu_init_f(void)
  342. {
  343. #ifndef CONFIG_WATCHDOG
  344. /* disable watchdog if we aren't using it */
  345. MCFWTM_WCR = 0;
  346. #endif
  347. #ifndef CONFIG_MONITOR_IS_IN_RAM
  348. /* Set speed /PLL */
  349. MCFCLOCK_SYNCR =
  350. MCFCLOCK_SYNCR_MFD(CONFIG_SYS_MFD) |
  351. MCFCLOCK_SYNCR_RFD(CONFIG_SYS_RFD);
  352. while (!(MCFCLOCK_SYNSR & MCFCLOCK_SYNSR_LOCK)) ;
  353. MCFGPIO_PBCDPAR = 0xc0;
  354. /* Set up the GPIO ports */
  355. #ifdef CONFIG_SYS_PEPAR
  356. MCFGPIO_PEPAR = CONFIG_SYS_PEPAR;
  357. #endif
  358. #ifdef CONFIG_SYS_PFPAR
  359. MCFGPIO_PFPAR = CONFIG_SYS_PFPAR;
  360. #endif
  361. #ifdef CONFIG_SYS_PJPAR
  362. MCFGPIO_PJPAR = CONFIG_SYS_PJPAR;
  363. #endif
  364. #ifdef CONFIG_SYS_PSDPAR
  365. MCFGPIO_PSDPAR = CONFIG_SYS_PSDPAR;
  366. #endif
  367. #ifdef CONFIG_SYS_PASPAR
  368. MCFGPIO_PASPAR = CONFIG_SYS_PASPAR;
  369. #endif
  370. #ifdef CONFIG_SYS_PEHLPAR
  371. MCFGPIO_PEHLPAR = CONFIG_SYS_PEHLPAR;
  372. #endif
  373. #ifdef CONFIG_SYS_PQSPAR
  374. MCFGPIO_PQSPAR = CONFIG_SYS_PQSPAR;
  375. #endif
  376. #ifdef CONFIG_SYS_PTCPAR
  377. MCFGPIO_PTCPAR = CONFIG_SYS_PTCPAR;
  378. #endif
  379. #ifdef CONFIG_SYS_PTDPAR
  380. MCFGPIO_PTDPAR = CONFIG_SYS_PTDPAR;
  381. #endif
  382. #ifdef CONFIG_SYS_PUAPAR
  383. MCFGPIO_PUAPAR = CONFIG_SYS_PUAPAR;
  384. #endif
  385. #ifdef CONFIG_SYS_DDRUA
  386. MCFGPIO_DDRUA = CONFIG_SYS_DDRUA;
  387. #endif
  388. /* FlexBus Chipselect */
  389. init_fbcs();
  390. #endif /* CONFIG_MONITOR_IS_IN_RAM */
  391. /* defer enabling cache until boot (see do_go) */
  392. /* icache_enable(); */
  393. }
  394. /*
  395. * initialize higher level parts of CPU like timers
  396. */
  397. int cpu_init_r(void)
  398. {
  399. return (0);
  400. }
  401. void uart_port_conf(void)
  402. {
  403. /* Setup Ports: */
  404. switch (CONFIG_SYS_UART_PORT) {
  405. case 0:
  406. MCFGPIO_PUAPAR &= 0xFc;
  407. MCFGPIO_PUAPAR |= 0x03;
  408. break;
  409. case 1:
  410. MCFGPIO_PUAPAR &= 0xF3;
  411. MCFGPIO_PUAPAR |= 0x0C;
  412. break;
  413. case 2:
  414. MCFGPIO_PASPAR &= 0xFF0F;
  415. MCFGPIO_PASPAR |= 0x00A0;
  416. break;
  417. }
  418. }
  419. #endif
  420. #if defined(CONFIG_M5249)
  421. /*
  422. * Breath some life into the CPU...
  423. *
  424. * Set up the memory map,
  425. * initialize a bunch of registers,
  426. * initialize the UPM's
  427. */
  428. void cpu_init_f(void)
  429. {
  430. /*
  431. * NOTE: by setting the GPIO_FUNCTION registers, we ensure that the UART pins
  432. * (UART0: gpio 30,27, UART1: gpio 31, 28) will be used as UART pins
  433. * which is their primary function.
  434. * ~Jeremy
  435. */
  436. mbar2_writeLong(MCFSIM_GPIO_FUNC, CONFIG_SYS_GPIO_FUNC);
  437. mbar2_writeLong(MCFSIM_GPIO1_FUNC, CONFIG_SYS_GPIO1_FUNC);
  438. mbar2_writeLong(MCFSIM_GPIO_EN, CONFIG_SYS_GPIO_EN);
  439. mbar2_writeLong(MCFSIM_GPIO1_EN, CONFIG_SYS_GPIO1_EN);
  440. mbar2_writeLong(MCFSIM_GPIO_OUT, CONFIG_SYS_GPIO_OUT);
  441. mbar2_writeLong(MCFSIM_GPIO1_OUT, CONFIG_SYS_GPIO1_OUT);
  442. /*
  443. * dBug Compliance:
  444. * You can verify these values by using dBug's 'ird'
  445. * (Internal Register Display) command
  446. * ~Jeremy
  447. *
  448. */
  449. mbar_writeByte(MCFSIM_MPARK, 0x30); /* 5249 Internal Core takes priority over DMA */
  450. mbar_writeByte(MCFSIM_SYPCR, 0x00);
  451. mbar_writeByte(MCFSIM_SWIVR, 0x0f);
  452. mbar_writeByte(MCFSIM_SWSR, 0x00);
  453. mbar_writeLong(MCFSIM_IMR, 0xfffffbff);
  454. mbar_writeByte(MCFSIM_SWDICR, 0x00);
  455. mbar_writeByte(MCFSIM_TIMER1ICR, 0x00);
  456. mbar_writeByte(MCFSIM_TIMER2ICR, 0x88);
  457. mbar_writeByte(MCFSIM_I2CICR, 0x00);
  458. mbar_writeByte(MCFSIM_UART1ICR, 0x00);
  459. mbar_writeByte(MCFSIM_UART2ICR, 0x00);
  460. mbar_writeByte(MCFSIM_ICR6, 0x00);
  461. mbar_writeByte(MCFSIM_ICR7, 0x00);
  462. mbar_writeByte(MCFSIM_ICR8, 0x00);
  463. mbar_writeByte(MCFSIM_ICR9, 0x00);
  464. mbar_writeByte(MCFSIM_QSPIICR, 0x00);
  465. mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080);
  466. mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */
  467. mbar2_writeByte(MCFSIM_SPURVEC, 0x00);
  468. mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); /* Enable a 1 cycle pre-drive cycle on CS1 */
  469. /* Setup interrupt priorities for gpio7 */
  470. /* mbar2_writeLong(MCFSIM_INTLEV5, 0x70000000); */
  471. /* IDE Config registers */
  472. mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020);
  473. mbar2_writeLong(MCFSIM_IDECONFIG2, 0x00000000);
  474. /* FlexBus Chipselect */
  475. init_fbcs();
  476. /* enable instruction cache now */
  477. icache_enable();
  478. }
  479. /*
  480. * initialize higher level parts of CPU like timers
  481. */
  482. int cpu_init_r(void)
  483. {
  484. return (0);
  485. }
  486. void uart_port_conf(void)
  487. {
  488. /* Setup Ports: */
  489. switch (CONFIG_SYS_UART_PORT) {
  490. case 0:
  491. break;
  492. case 1:
  493. break;
  494. }
  495. }
  496. #endif /* #if defined(CONFIG_M5249) */