3 * Josef Baumgartner <josef.baumgartner@telex.de>
7 * BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de>
9 * Arcturus Networks Inc. <www.arcturusnetworks.com>
11 * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
12 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
13 * Hayden Fraser (Hayden.Fraser@freescale.com)
16 * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
18 * See file CREDITS for list of people who contributed to this
21 * This program is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU General Public License as
23 * published by the Free Software Foundation; either version 2 of
24 * the License, or (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
39 #include <asm/immap.h>
41 #if defined(CONFIG_CMD_NET)
48 /* Only 5272 Flexbus chipselect is different from the rest */
51 volatile fbcs_t *fbcs = (fbcs_t *) (MMAP_FBCS);
53 #if (defined(CONFIG_SYS_CS0_BASE) && defined(CONFIG_SYS_CS0_MASK) \
54 && defined(CONFIG_SYS_CS0_CTRL))
55 fbcs->csar0 = CONFIG_SYS_CS0_BASE;
56 fbcs->cscr0 = CONFIG_SYS_CS0_CTRL;
57 fbcs->csmr0 = CONFIG_SYS_CS0_MASK;
59 #warning "Chip Select 0 are not initialized/used"
61 #if (defined(CONFIG_SYS_CS1_BASE) && defined(CONFIG_SYS_CS1_MASK) \
62 && defined(CONFIG_SYS_CS1_CTRL))
63 fbcs->csar1 = CONFIG_SYS_CS1_BASE;
64 fbcs->cscr1 = CONFIG_SYS_CS1_CTRL;
65 fbcs->csmr1 = CONFIG_SYS_CS1_MASK;
67 #if (defined(CONFIG_SYS_CS2_BASE) && defined(CONFIG_SYS_CS2_MASK) \
68 && defined(CONFIG_SYS_CS2_CTRL))
69 fbcs->csar2 = CONFIG_SYS_CS2_BASE;
70 fbcs->cscr2 = CONFIG_SYS_CS2_CTRL;
71 fbcs->csmr2 = CONFIG_SYS_CS2_MASK;
73 #if (defined(CONFIG_SYS_CS3_BASE) && defined(CONFIG_SYS_CS3_MASK) \
74 && defined(CONFIG_SYS_CS3_CTRL))
75 fbcs->csar3 = CONFIG_SYS_CS3_BASE;
76 fbcs->cscr3 = CONFIG_SYS_CS3_CTRL;
77 fbcs->csmr3 = CONFIG_SYS_CS3_MASK;
79 #if (defined(CONFIG_SYS_CS4_BASE) && defined(CONFIG_SYS_CS4_MASK) \
80 && defined(CONFIG_SYS_CS4_CTRL))
81 fbcs->csar4 = CONFIG_SYS_CS4_BASE;
82 fbcs->cscr4 = CONFIG_SYS_CS4_CTRL;
83 fbcs->csmr4 = CONFIG_SYS_CS4_MASK;
85 #if (defined(CONFIG_SYS_CS5_BASE) && defined(CONFIG_SYS_CS5_MASK) \
86 && defined(CONFIG_SYS_CS5_CTRL))
87 fbcs->csar5 = CONFIG_SYS_CS5_BASE;
88 fbcs->cscr5 = CONFIG_SYS_CS5_CTRL;
89 fbcs->csmr5 = CONFIG_SYS_CS5_MASK;
91 #if (defined(CONFIG_SYS_CS6_BASE) && defined(CONFIG_SYS_CS6_MASK) \
92 && defined(CONFIG_SYS_CS6_CTRL))
93 fbcs->csar6 = CONFIG_SYS_CS6_BASE;
94 fbcs->cscr6 = CONFIG_SYS_CS6_CTRL;
95 fbcs->csmr6 = CONFIG_SYS_CS6_MASK;
97 #if (defined(CONFIG_SYS_CS7_BASE) && defined(CONFIG_SYS_CS7_MASK) \
98 && defined(CONFIG_SYS_CS7_CTRL))
99 fbcs->csar7 = CONFIG_SYS_CS7_BASE;
100 fbcs->cscr7 = CONFIG_SYS_CS7_CTRL;
101 fbcs->csmr7 = CONFIG_SYS_CS7_MASK;
106 #if defined(CONFIG_M5208)
107 void cpu_init_f(void)
109 volatile scm1_t *scm1 = (scm1_t *) MMAP_SCM1;
111 #ifndef CONFIG_WATCHDOG
112 volatile wdog_t *wdg = (wdog_t *) MMAP_WDOG;
114 /* Disable the watchdog if we aren't using it */
118 scm1->mpr = 0x77777777;
126 /* FlexBus Chipselect */
132 /* initialize higher level parts of CPU like timers */
138 void uart_port_conf(int port)
140 volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
145 gpio->par_uart &= GPIO_PAR_UART0_UNMASK;
146 gpio->par_uart |= (GPIO_PAR_UART_U0TXD | GPIO_PAR_UART_U0RXD);
149 gpio->par_uart &= GPIO_PAR_UART0_UNMASK;
150 gpio->par_uart |= (GPIO_PAR_UART_U1TXD | GPIO_PAR_UART_U1RXD);
153 #ifdef CONFIG_SYS_UART2_PRI_GPIO
155 (GPIO_PAR_TMR_TIN0_UNMASK | GPIO_PAR_TMR_TIN1_UNMASK);
157 (GPIO_PAR_TMR_TIN0_U2TXD | GPIO_PAR_TMR_TIN1_U2RXD);
159 #ifdef CONFIG_SYS_UART2_ALT1_GPIO
161 (GPIO_PAR_FECI2C_MDC_UNMASK | GPIO_PAR_FECI2C_MDIO_UNMASK);
163 (GPIO_PAR_FECI2C_MDC_U2TXD | GPIO_PAR_FECI2C_MDIO_U2RXD);
165 #ifdef CONFIG_SYS_UART2_ALT1_GPIO
167 (GPIO_PAR_FECI2C_SDA_UNMASK | GPIO_PAR_FECI2C_SCL_UNMASK);
169 (GPIO_PAR_FECI2C_SDA_U2TXD | GPIO_PAR_FECI2C_SCL_U2RXD);
175 #if defined(CONFIG_CMD_NET)
176 int fecpin_setclear(struct eth_device *dev, int setclear)
178 volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
182 GPIO_PAR_FEC_7W_FEC | GPIO_PAR_FEC_MII_FEC;
184 GPIO_PAR_FECI2C_MDC_MDC | GPIO_PAR_FECI2C_MDIO_MDIO;
187 (GPIO_PAR_FEC_7W_UNMASK & GPIO_PAR_FEC_MII_UNMASK);
188 gpio->par_feci2c &= GPIO_PAR_FECI2C_RMII_UNMASK;
192 #endif /* CONFIG_CMD_NET */
193 #endif /* CONFIG_M5208 */
195 #if defined(CONFIG_M5253)
197 * Breath some life into the CPU...
199 * Set up the memory map,
200 * initialize a bunch of registers,
201 * initialize the UPM's
203 void cpu_init_f(void)
205 mbar_writeByte(MCFSIM_MPARK, 0x40); /* 5249 Internal Core takes priority over DMA */
206 mbar_writeByte(MCFSIM_SYPCR, 0x00);
207 mbar_writeByte(MCFSIM_SWIVR, 0x0f);
208 mbar_writeByte(MCFSIM_SWSR, 0x00);
209 mbar_writeByte(MCFSIM_SWDICR, 0x00);
210 mbar_writeByte(MCFSIM_TIMER1ICR, 0x00);
211 mbar_writeByte(MCFSIM_TIMER2ICR, 0x88);
212 mbar_writeByte(MCFSIM_I2CICR, 0x00);
213 mbar_writeByte(MCFSIM_UART1ICR, 0x00);
214 mbar_writeByte(MCFSIM_UART2ICR, 0x00);
215 mbar_writeByte(MCFSIM_ICR6, 0x00);
216 mbar_writeByte(MCFSIM_ICR7, 0x00);
217 mbar_writeByte(MCFSIM_ICR8, 0x00);
218 mbar_writeByte(MCFSIM_ICR9, 0x00);
219 mbar_writeByte(MCFSIM_QSPIICR, 0x00);
221 mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080);
222 mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */
223 mbar2_writeByte(MCFSIM_SPURVEC, 0x00);
225 /*mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); */ /* Enable a 1 cycle pre-drive cycle on CS1 */
227 /* FlexBus Chipselect */
230 #ifdef CONFIG_FSL_I2C
231 CONFIG_SYS_I2C_PINMUX_REG =
232 CONFIG_SYS_I2C_PINMUX_REG & CONFIG_SYS_I2C_PINMUX_CLR;
233 CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
234 #ifdef CONFIG_SYS_I2C2_OFFSET
235 CONFIG_SYS_I2C2_PINMUX_REG &= CONFIG_SYS_I2C2_PINMUX_CLR;
236 CONFIG_SYS_I2C2_PINMUX_REG |= CONFIG_SYS_I2C2_PINMUX_SET;
240 /* enable instruction cache now */
244 /*initialize higher level parts of CPU like timers */
250 void uart_port_conf(int port)
252 volatile u32 *par = (u32 *) MMAP_PAR;
266 #endif /* #if defined(CONFIG_M5253) */
268 #if defined(CONFIG_M5271)
269 void cpu_init_f(void)
271 #ifndef CONFIG_WATCHDOG
272 /* Disable the watchdog if we aren't using it */
273 mbar_writeShort(MCF_WTM_WCR, 0);
276 /* FlexBus Chipselect */
279 #ifdef CONFIG_SYS_MCF_SYNCR
280 /* Set clockspeed according to board header file */
281 mbar_writeLong(MCF_FMPLL_SYNCR, CONFIG_SYS_MCF_SYNCR);
283 /* Set clockspeed to 100MHz */
284 mbar_writeLong(MCF_FMPLL_SYNCR,
285 MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0));
287 while (!mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK) ;
291 * initialize higher level parts of CPU like timers
298 void uart_port_conf(int port)
305 temp = mbar_readShort(MCF_GPIO_PAR_UART) & 0xFFF3;
306 temp |= (MCF_GPIO_PAR_UART_U0TXD | MCF_GPIO_PAR_UART_U0RXD);
307 mbar_writeShort(MCF_GPIO_PAR_UART, temp);
310 temp = mbar_readShort(MCF_GPIO_PAR_UART) & 0xF0FF;
311 temp |= (MCF_GPIO_PAR_UART_U1RXD_UART1 | MCF_GPIO_PAR_UART_U1TXD_UART1);
312 mbar_writeShort(MCF_GPIO_PAR_UART, temp);
315 temp = mbar_readShort(MCF_GPIO_PAR_UART) & 0xCFFF;
317 mbar_writeShort(MCF_GPIO_PAR_UART, temp);
322 #if defined(CONFIG_CMD_NET)
323 int fecpin_setclear(struct eth_device *dev, int setclear)
326 /* Enable Ethernet pins */
327 mbar_writeByte(MCF_GPIO_PAR_FECI2C,
328 (mbar_readByte(MCF_GPIO_PAR_FECI2C) | 0xF0));
334 #endif /* CONFIG_CMD_NET */
337 #if defined(CONFIG_M5272)
339 * Breath some life into the CPU...
341 * Set up the memory map,
342 * initialize a bunch of registers,
343 * initialize the UPM's
345 void cpu_init_f(void)
347 /* if we come from RAM we assume the CPU is
348 * already initialized.
350 #ifndef CONFIG_MONITOR_IS_IN_RAM
351 volatile sysctrl_t *sysctrl = (sysctrl_t *) (CONFIG_SYS_MBAR);
352 volatile gpio_t *gpio = (gpio_t *) (MMAP_GPIO);
353 volatile csctrl_t *csctrl = (csctrl_t *) (MMAP_FBCS);
355 sysctrl->sc_scr = CONFIG_SYS_SCR;
356 sysctrl->sc_spr = CONFIG_SYS_SPR;
359 gpio->gpio_pacnt = CONFIG_SYS_PACNT;
360 gpio->gpio_paddr = CONFIG_SYS_PADDR;
361 gpio->gpio_padat = CONFIG_SYS_PADAT;
362 gpio->gpio_pbcnt = CONFIG_SYS_PBCNT;
363 gpio->gpio_pbddr = CONFIG_SYS_PBDDR;
364 gpio->gpio_pbdat = CONFIG_SYS_PBDAT;
365 gpio->gpio_pdcnt = CONFIG_SYS_PDCNT;
367 /* Memory Controller: */
368 csctrl->cs_br0 = CONFIG_SYS_BR0_PRELIM;
369 csctrl->cs_or0 = CONFIG_SYS_OR0_PRELIM;
371 #if (defined(CONFIG_SYS_OR1_PRELIM) && defined(CONFIG_SYS_BR1_PRELIM))
372 csctrl->cs_br1 = CONFIG_SYS_BR1_PRELIM;
373 csctrl->cs_or1 = CONFIG_SYS_OR1_PRELIM;
376 #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM)
377 csctrl->cs_br2 = CONFIG_SYS_BR2_PRELIM;
378 csctrl->cs_or2 = CONFIG_SYS_OR2_PRELIM;
381 #if defined(CONFIG_SYS_OR3_PRELIM) && defined(CONFIG_SYS_BR3_PRELIM)
382 csctrl->cs_br3 = CONFIG_SYS_BR3_PRELIM;
383 csctrl->cs_or3 = CONFIG_SYS_OR3_PRELIM;
386 #if defined(CONFIG_SYS_OR4_PRELIM) && defined(CONFIG_SYS_BR4_PRELIM)
387 csctrl->cs_br4 = CONFIG_SYS_BR4_PRELIM;
388 csctrl->cs_or4 = CONFIG_SYS_OR4_PRELIM;
391 #if defined(CONFIG_SYS_OR5_PRELIM) && defined(CONFIG_SYS_BR5_PRELIM)
392 csctrl->cs_br5 = CONFIG_SYS_BR5_PRELIM;
393 csctrl->cs_or5 = CONFIG_SYS_OR5_PRELIM;
396 #if defined(CONFIG_SYS_OR6_PRELIM) && defined(CONFIG_SYS_BR6_PRELIM)
397 csctrl->cs_br6 = CONFIG_SYS_BR6_PRELIM;
398 csctrl->cs_or6 = CONFIG_SYS_OR6_PRELIM;
401 #if defined(CONFIG_SYS_OR7_PRELIM) && defined(CONFIG_SYS_BR7_PRELIM)
402 csctrl->cs_br7 = CONFIG_SYS_BR7_PRELIM;
403 csctrl->cs_or7 = CONFIG_SYS_OR7_PRELIM;
406 #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
408 /* enable instruction cache now */
414 * initialize higher level parts of CPU like timers
421 void uart_port_conf(int port)
423 volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
428 gpio->gpio_pbcnt &= ~(GPIO_PBCNT_PB0MSK | GPIO_PBCNT_PB1MSK);
429 gpio->gpio_pbcnt |= (GPIO_PBCNT_URT0_TXD | GPIO_PBCNT_URT0_RXD);
432 gpio->gpio_pdcnt &= ~(GPIO_PDCNT_PD1MSK | GPIO_PDCNT_PD4MSK);
433 gpio->gpio_pdcnt |= (GPIO_PDCNT_URT1_RXD | GPIO_PDCNT_URT1_TXD);
438 #if defined(CONFIG_CMD_NET)
439 int fecpin_setclear(struct eth_device *dev, int setclear)
441 volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
444 gpio->gpio_pbcnt |= GPIO_PBCNT_E_MDC | GPIO_PBCNT_E_RXER |
445 GPIO_PBCNT_E_RXD1 | GPIO_PBCNT_E_RXD2 |
446 GPIO_PBCNT_E_RXD3 | GPIO_PBCNT_E_TXD1 |
447 GPIO_PBCNT_E_TXD2 | GPIO_PBCNT_E_TXD3;
452 #endif /* CONFIG_CMD_NET */
453 #endif /* #if defined(CONFIG_M5272) */
455 #if defined(CONFIG_M5275)
458 * Breathe some life into the CPU...
460 * Set up the memory map,
461 * initialize a bunch of registers,
462 * initialize the UPM's
464 void cpu_init_f(void)
467 * if we come from RAM we assume the CPU is
468 * already initialized.
471 #ifndef CONFIG_MONITOR_IS_IN_RAM
472 volatile wdog_t *wdog_reg = (wdog_t *) (MMAP_WDOG);
473 volatile gpio_t *gpio_reg = (gpio_t *) (MMAP_GPIO);
475 /* Kill watchdog so we can initialize the PLL */
478 /* FlexBus Chipselect */
480 #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
482 #ifdef CONFIG_FSL_I2C
483 CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR;
484 CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET;
487 /* enable instruction cache now */
492 * initialize higher level parts of CPU like timers
499 void uart_port_conf(int port)
501 volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
506 gpio->par_uart &= ~UART0_ENABLE_MASK;
507 gpio->par_uart |= UART0_ENABLE_MASK;
510 gpio->par_uart &= ~UART1_ENABLE_MASK;
511 gpio->par_uart |= UART1_ENABLE_MASK;
514 gpio->par_uart &= ~UART2_ENABLE_MASK;
515 gpio->par_uart |= UART2_ENABLE_MASK;
520 #if defined(CONFIG_CMD_NET)
521 int fecpin_setclear(struct eth_device *dev, int setclear)
523 struct fec_info_s *info = (struct fec_info_s *) dev->priv;
524 volatile gpio_t *gpio = (gpio_t *)MMAP_GPIO;
527 /* Enable Ethernet pins */
528 if (info->iobase == CONFIG_SYS_FEC0_IOBASE) {
529 gpio->par_feci2c |= 0x0F00;
530 gpio->par_fec0hl |= 0xC0;
532 gpio->par_feci2c |= 0x00A0;
533 gpio->par_fec1hl |= 0xC0;
536 if (info->iobase == CONFIG_SYS_FEC0_IOBASE) {
537 gpio->par_feci2c &= ~0x0F00;
538 gpio->par_fec0hl &= ~0xC0;
540 gpio->par_feci2c &= ~0x00A0;
541 gpio->par_fec1hl &= ~0xC0;
547 #endif /* CONFIG_CMD_NET */
548 #endif /* #if defined(CONFIG_M5275) */
550 #if defined(CONFIG_M5282)
552 * Breath some life into the CPU...
554 * Set up the memory map,
555 * initialize a bunch of registers,
556 * initialize the UPM's
558 void cpu_init_f(void)
560 #ifndef CONFIG_WATCHDOG
561 /* disable watchdog if we aren't using it */
565 #ifndef CONFIG_MONITOR_IS_IN_RAM
568 MCFCLOCK_SYNCR_MFD(CONFIG_SYS_MFD) |
569 MCFCLOCK_SYNCR_RFD(CONFIG_SYS_RFD);
570 while (!(MCFCLOCK_SYNSR & MCFCLOCK_SYNSR_LOCK)) ;
572 MCFGPIO_PBCDPAR = 0xc0;
574 /* Set up the GPIO ports */
575 #ifdef CONFIG_SYS_PEPAR
576 MCFGPIO_PEPAR = CONFIG_SYS_PEPAR;
578 #ifdef CONFIG_SYS_PFPAR
579 MCFGPIO_PFPAR = CONFIG_SYS_PFPAR;
581 #ifdef CONFIG_SYS_PJPAR
582 MCFGPIO_PJPAR = CONFIG_SYS_PJPAR;
584 #ifdef CONFIG_SYS_PSDPAR
585 MCFGPIO_PSDPAR = CONFIG_SYS_PSDPAR;
587 #ifdef CONFIG_SYS_PASPAR
588 MCFGPIO_PASPAR = CONFIG_SYS_PASPAR;
590 #ifdef CONFIG_SYS_PEHLPAR
591 MCFGPIO_PEHLPAR = CONFIG_SYS_PEHLPAR;
593 #ifdef CONFIG_SYS_PQSPAR
594 MCFGPIO_PQSPAR = CONFIG_SYS_PQSPAR;
596 #ifdef CONFIG_SYS_PTCPAR
597 MCFGPIO_PTCPAR = CONFIG_SYS_PTCPAR;
599 #if defined(CONFIG_SYS_PORTTC)
600 MCFGPIO_PORTTC = CONFIG_SYS_PORTTC;
602 #if defined(CONFIG_SYS_DDRTC)
603 MCFGPIO_DDRTC = CONFIG_SYS_DDRTC;
605 #ifdef CONFIG_SYS_PTDPAR
606 MCFGPIO_PTDPAR = CONFIG_SYS_PTDPAR;
608 #ifdef CONFIG_SYS_PUAPAR
609 MCFGPIO_PUAPAR = CONFIG_SYS_PUAPAR;
612 #if defined(CONFIG_SYS_DDRD)
613 MCFGPIO_DDRD = CONFIG_SYS_DDRD;
615 #ifdef CONFIG_SYS_DDRUA
616 MCFGPIO_DDRUA = CONFIG_SYS_DDRUA;
619 /* FlexBus Chipselect */
622 #endif /* CONFIG_MONITOR_IS_IN_RAM */
624 /* defer enabling cache until boot (see do_go) */
625 /* icache_enable(); */
629 * initialize higher level parts of CPU like timers
636 void uart_port_conf(int port)
641 MCFGPIO_PUAPAR &= 0xFc;
642 MCFGPIO_PUAPAR |= 0x03;
645 MCFGPIO_PUAPAR &= 0xF3;
646 MCFGPIO_PUAPAR |= 0x0C;
649 MCFGPIO_PASPAR &= 0xFF0F;
650 MCFGPIO_PASPAR |= 0x00A0;
655 #if defined(CONFIG_CMD_NET)
656 int fecpin_setclear(struct eth_device *dev, int setclear)
659 MCFGPIO_PASPAR |= 0x0F00;
660 MCFGPIO_PEHLPAR = CONFIG_SYS_PEHLPAR;
662 MCFGPIO_PASPAR &= 0xF0FF;
663 MCFGPIO_PEHLPAR &= ~CONFIG_SYS_PEHLPAR;
667 #endif /* CONFIG_CMD_NET */
670 #if defined(CONFIG_M5249)
672 * Breath some life into the CPU...
674 * Set up the memory map,
675 * initialize a bunch of registers,
676 * initialize the UPM's
678 void cpu_init_f(void)
681 * NOTE: by setting the GPIO_FUNCTION registers, we ensure that the UART pins
682 * (UART0: gpio 30,27, UART1: gpio 31, 28) will be used as UART pins
683 * which is their primary function.
686 mbar2_writeLong(MCFSIM_GPIO_FUNC, CONFIG_SYS_GPIO_FUNC);
687 mbar2_writeLong(MCFSIM_GPIO1_FUNC, CONFIG_SYS_GPIO1_FUNC);
688 mbar2_writeLong(MCFSIM_GPIO_EN, CONFIG_SYS_GPIO_EN);
689 mbar2_writeLong(MCFSIM_GPIO1_EN, CONFIG_SYS_GPIO1_EN);
690 mbar2_writeLong(MCFSIM_GPIO_OUT, CONFIG_SYS_GPIO_OUT);
691 mbar2_writeLong(MCFSIM_GPIO1_OUT, CONFIG_SYS_GPIO1_OUT);
695 * You can verify these values by using dBug's 'ird'
696 * (Internal Register Display) command
700 mbar_writeByte(MCFSIM_MPARK, 0x30); /* 5249 Internal Core takes priority over DMA */
701 mbar_writeByte(MCFSIM_SYPCR, 0x00);
702 mbar_writeByte(MCFSIM_SWIVR, 0x0f);
703 mbar_writeByte(MCFSIM_SWSR, 0x00);
704 mbar_writeLong(MCFSIM_IMR, 0xfffffbff);
705 mbar_writeByte(MCFSIM_SWDICR, 0x00);
706 mbar_writeByte(MCFSIM_TIMER1ICR, 0x00);
707 mbar_writeByte(MCFSIM_TIMER2ICR, 0x88);
708 mbar_writeByte(MCFSIM_I2CICR, 0x00);
709 mbar_writeByte(MCFSIM_UART1ICR, 0x00);
710 mbar_writeByte(MCFSIM_UART2ICR, 0x00);
711 mbar_writeByte(MCFSIM_ICR6, 0x00);
712 mbar_writeByte(MCFSIM_ICR7, 0x00);
713 mbar_writeByte(MCFSIM_ICR8, 0x00);
714 mbar_writeByte(MCFSIM_ICR9, 0x00);
715 mbar_writeByte(MCFSIM_QSPIICR, 0x00);
717 mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080);
718 mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */
719 mbar2_writeByte(MCFSIM_SPURVEC, 0x00);
720 mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); /* Enable a 1 cycle pre-drive cycle on CS1 */
722 /* Setup interrupt priorities for gpio7 */
723 /* mbar2_writeLong(MCFSIM_INTLEV5, 0x70000000); */
725 /* IDE Config registers */
726 mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020);
727 mbar2_writeLong(MCFSIM_IDECONFIG2, 0x00000000);
729 /* FlexBus Chipselect */
732 /* enable instruction cache now */
737 * initialize higher level parts of CPU like timers
744 void uart_port_conf(int port)
747 #endif /* #if defined(CONFIG_M5249) */