1 // SPDX-License-Identifier: GPL-2.0+
4 * Josef Baumgartner <josef.baumgartner@telex.de>
8 * BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de>
10 * Arcturus Networks Inc. <www.arcturusnetworks.com>
12 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
13 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
14 * Hayden Fraser (Hayden.Fraser@freescale.com)
17 * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
24 #include <asm/immap.h>
27 #if defined(CONFIG_CMD_NET)
34 /* Only 5272 Flexbus chipselect is different from the rest */
37 fbcs_t *fbcs = (fbcs_t *) (MMAP_FBCS);
39 #if (defined(CFG_SYS_CS0_BASE) && defined(CFG_SYS_CS0_MASK) \
40 && defined(CFG_SYS_CS0_CTRL))
41 out_be32(&fbcs->csar0, CFG_SYS_CS0_BASE);
42 out_be32(&fbcs->cscr0, CFG_SYS_CS0_CTRL);
43 out_be32(&fbcs->csmr0, CFG_SYS_CS0_MASK);
45 #warning "Chip Select 0 are not initialized/used"
47 #if (defined(CFG_SYS_CS1_BASE) && defined(CFG_SYS_CS1_MASK) \
48 && defined(CFG_SYS_CS1_CTRL))
49 out_be32(&fbcs->csar1, CFG_SYS_CS1_BASE);
50 out_be32(&fbcs->cscr1, CFG_SYS_CS1_CTRL);
51 out_be32(&fbcs->csmr1, CFG_SYS_CS1_MASK);
53 #if (defined(CFG_SYS_CS2_BASE) && defined(CFG_SYS_CS2_MASK) \
54 && defined(CFG_SYS_CS2_CTRL))
55 out_be32(&fbcs->csar2, CFG_SYS_CS2_BASE);
56 out_be32(&fbcs->cscr2, CFG_SYS_CS2_CTRL);
57 out_be32(&fbcs->csmr2, CFG_SYS_CS2_MASK);
59 #if (defined(CFG_SYS_CS3_BASE) && defined(CFG_SYS_CS3_MASK) \
60 && defined(CFG_SYS_CS3_CTRL))
61 out_be32(&fbcs->csar3, CFG_SYS_CS3_BASE);
62 out_be32(&fbcs->cscr3, CFG_SYS_CS3_CTRL);
63 out_be32(&fbcs->csmr3, CFG_SYS_CS3_MASK);
65 #if (defined(CONFIG_SYS_CS4_BASE) && defined(CONFIG_SYS_CS4_MASK) \
66 && defined(CONFIG_SYS_CS4_CTRL))
67 out_be32(&fbcs->csar4, CONFIG_SYS_CS4_BASE);
68 out_be32(&fbcs->cscr4, CONFIG_SYS_CS4_CTRL);
69 out_be32(&fbcs->csmr4, CONFIG_SYS_CS4_MASK);
71 #if (defined(CONFIG_SYS_CS5_BASE) && defined(CONFIG_SYS_CS5_MASK) \
72 && defined(CONFIG_SYS_CS5_CTRL))
73 out_be32(&fbcs->csar5, CONFIG_SYS_CS5_BASE);
74 out_be32(&fbcs->cscr5, CONFIG_SYS_CS5_CTRL);
75 out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK);
77 #if (defined(CONFIG_SYS_CS6_BASE) && defined(CONFIG_SYS_CS6_MASK) \
78 && defined(CONFIG_SYS_CS6_CTRL))
79 out_be32(&fbcs->csar6, CONFIG_SYS_CS6_BASE);
80 out_be32(&fbcs->cscr6, CONFIG_SYS_CS6_CTRL);
81 out_be32(&fbcs->csmr6, CONFIG_SYS_CS6_MASK);
83 #if (defined(CONFIG_SYS_CS7_BASE) && defined(CONFIG_SYS_CS7_MASK) \
84 && defined(CONFIG_SYS_CS7_CTRL))
85 out_be32(&fbcs->csar7, CONFIG_SYS_CS7_BASE);
86 out_be32(&fbcs->cscr7, CONFIG_SYS_CS7_CTRL);
87 out_be32(&fbcs->csmr7, CONFIG_SYS_CS7_MASK);
92 #if defined(CONFIG_M5208)
95 scm1_t *scm1 = (scm1_t *) MMAP_SCM1;
97 #ifndef CONFIG_WATCHDOG
98 wdog_t *wdg = (wdog_t *) MMAP_WDOG;
100 /* Disable the watchdog if we aren't using it */
101 out_be16(&wdg->cr, 0);
104 out_be32(&scm1->mpr, 0x77777777);
105 out_be32(&scm1->pacra, 0);
106 out_be32(&scm1->pacrb, 0);
107 out_be32(&scm1->pacrc, 0);
108 out_be32(&scm1->pacrd, 0);
109 out_be32(&scm1->pacre, 0);
110 out_be32(&scm1->pacrf, 0);
112 /* FlexBus Chipselect */
118 /* initialize higher level parts of CPU like timers */
124 void uart_port_conf(int port)
126 gpio_t *gpio = (gpio_t *) MMAP_GPIO;
131 clrbits_be16(&gpio->par_uart, ~GPIO_PAR_UART0_UNMASK);
132 setbits_be16(&gpio->par_uart, GPIO_PAR_UART_U0TXD | GPIO_PAR_UART_U0RXD);
135 clrbits_be16(&gpio->par_uart, ~GPIO_PAR_UART0_UNMASK);
136 setbits_be16(&gpio->par_uart, GPIO_PAR_UART_U1TXD | GPIO_PAR_UART_U1RXD);
139 #ifdef CONFIG_SYS_UART2_PRI_GPIO
140 clrbits_8(&gpio->par_timer,
141 ~(GPIO_PAR_TMR_TIN0_UNMASK | GPIO_PAR_TMR_TIN1_UNMASK));
142 setbits_8(&gpio->par_timer,
143 GPIO_PAR_TMR_TIN0_U2TXD | GPIO_PAR_TMR_TIN1_U2RXD);
145 #ifdef CONFIG_SYS_UART2_ALT1_GPIO
146 clrbits_8(&gpio->par_feci2c,
147 ~(GPIO_PAR_FECI2C_MDC_UNMASK | GPIO_PAR_FECI2C_MDIO_UNMASK));
148 setbits_8(&gpio->par_feci2c,
149 GPIO_PAR_FECI2C_MDC_U2TXD | GPIO_PAR_FECI2C_MDIO_U2RXD);
151 #ifdef CONFIG_SYS_UART2_ALT1_GPIO
152 clrbits_8(&gpio->par_feci2c,
153 ~(GPIO_PAR_FECI2C_SDA_UNMASK | GPIO_PAR_FECI2C_SCL_UNMASK));
154 setbits_8(&gpio->par_feci2c,
155 GPIO_PAR_FECI2C_SDA_U2TXD | GPIO_PAR_FECI2C_SCL_U2RXD);
161 #if defined(CONFIG_CMD_NET)
162 int fecpin_setclear(fec_info_t *info, int setclear)
164 gpio_t *gpio = (gpio_t *) MMAP_GPIO;
167 setbits_8(&gpio->par_fec,
168 GPIO_PAR_FEC_7W_FEC | GPIO_PAR_FEC_MII_FEC);
169 setbits_8(&gpio->par_feci2c,
170 GPIO_PAR_FECI2C_MDC_MDC | GPIO_PAR_FECI2C_MDIO_MDIO);
172 clrbits_8(&gpio->par_fec,
173 ~(GPIO_PAR_FEC_7W_UNMASK & GPIO_PAR_FEC_MII_UNMASK));
174 clrbits_8(&gpio->par_feci2c, ~GPIO_PAR_FECI2C_RMII_UNMASK);
178 #endif /* CONFIG_CMD_NET */
179 #endif /* CONFIG_M5208 */
181 #if defined(CONFIG_M5253)
183 * Breath some life into the CPU...
185 * Set up the memory map,
186 * initialize a bunch of registers,
187 * initialize the UPM's
189 void cpu_init_f(void)
191 mbar_writeByte(MCFSIM_MPARK, 0x40); /* 5249 Internal Core takes priority over DMA */
192 mbar_writeByte(MCFSIM_SYPCR, 0x00);
193 mbar_writeByte(MCFSIM_SWIVR, 0x0f);
194 mbar_writeByte(MCFSIM_SWSR, 0x00);
195 mbar_writeByte(MCFSIM_SWDICR, 0x00);
196 mbar_writeByte(MCFSIM_TIMER1ICR, 0x00);
197 mbar_writeByte(MCFSIM_TIMER2ICR, 0x88);
198 mbar_writeByte(MCFSIM_I2CICR, 0x00);
199 mbar_writeByte(MCFSIM_UART1ICR, 0x00);
200 mbar_writeByte(MCFSIM_UART2ICR, 0x00);
201 mbar_writeByte(MCFSIM_ICR6, 0x00);
202 mbar_writeByte(MCFSIM_ICR7, 0x00);
203 mbar_writeByte(MCFSIM_ICR8, 0x00);
204 mbar_writeByte(MCFSIM_ICR9, 0x00);
205 mbar_writeByte(MCFSIM_QSPIICR, 0x00);
207 mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080);
208 mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */
209 mbar2_writeByte(MCFSIM_SPURVEC, 0x00);
211 /*mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); */ /* Enable a 1 cycle pre-drive cycle on CS1 */
213 /* FlexBus Chipselect */
216 #ifdef CONFIG_SYS_I2C_FSL
217 CFG_SYS_I2C_PINMUX_REG =
218 CFG_SYS_I2C_PINMUX_REG & CFG_SYS_I2C_PINMUX_CLR;
219 CFG_SYS_I2C_PINMUX_REG |= CFG_SYS_I2C_PINMUX_SET;
220 #ifdef CONFIG_SYS_I2C2_OFFSET
221 CONFIG_SYS_I2C2_PINMUX_REG &= CONFIG_SYS_I2C2_PINMUX_CLR;
222 CONFIG_SYS_I2C2_PINMUX_REG |= CONFIG_SYS_I2C2_PINMUX_SET;
226 /* enable instruction cache now */
230 /*initialize higher level parts of CPU like timers */
236 void uart_port_conf(int port)
238 u32 *par = (u32 *) MMAP_PAR;
243 clrbits_be32(par, 0x00180000);
244 setbits_be32(par, 0x00180000);
247 clrbits_be32(par, 0x00000003);
248 clrbits_be32(par, 0xFFFFFFFC);
252 #endif /* #if defined(CONFIG_M5253) */
254 #if defined(CONFIG_M5271)
255 void cpu_init_f(void)
257 #ifndef CONFIG_WATCHDOG
258 /* Disable the watchdog if we aren't using it */
259 mbar_writeShort(MCF_WTM_WCR, 0);
262 /* FlexBus Chipselect */
265 #ifdef CONFIG_SYS_MCF_SYNCR
266 /* Set clockspeed according to board header file */
267 mbar_writeLong(MCF_FMPLL_SYNCR, CONFIG_SYS_MCF_SYNCR);
269 /* Set clockspeed to 100MHz */
270 mbar_writeLong(MCF_FMPLL_SYNCR,
271 MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0));
273 while (!(mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK)) ;
277 * initialize higher level parts of CPU like timers
284 void uart_port_conf(int port)
291 temp = mbar_readShort(MCF_GPIO_PAR_UART) & 0xFFF3;
292 temp |= (MCF_GPIO_PAR_UART_U0TXD | MCF_GPIO_PAR_UART_U0RXD);
293 mbar_writeShort(MCF_GPIO_PAR_UART, temp);
296 temp = mbar_readShort(MCF_GPIO_PAR_UART) & 0xF0FF;
297 temp |= (MCF_GPIO_PAR_UART_U1RXD_UART1 | MCF_GPIO_PAR_UART_U1TXD_UART1);
298 mbar_writeShort(MCF_GPIO_PAR_UART, temp);
301 temp = mbar_readShort(MCF_GPIO_PAR_UART) & 0xCFFF;
303 mbar_writeShort(MCF_GPIO_PAR_UART, temp);
308 #if defined(CONFIG_CMD_NET)
309 int fecpin_setclear(fec_info_t *info, int setclear)
312 /* Enable Ethernet pins */
313 mbar_writeByte(MCF_GPIO_PAR_FECI2C,
314 (mbar_readByte(MCF_GPIO_PAR_FECI2C) | 0xF0));
320 #endif /* CONFIG_CMD_NET */
322 #endif /* CONFIG_M5271 */
324 #if defined(CONFIG_M5272)
326 * Breath some life into the CPU...
328 * Set up the memory map,
329 * initialize a bunch of registers,
330 * initialize the UPM's
332 void cpu_init_f(void)
334 /* if we come from RAM we assume the CPU is
335 * already initialized.
337 #ifndef CONFIG_MONITOR_IS_IN_RAM
338 sysctrl_t *sysctrl = (sysctrl_t *) (CFG_SYS_MBAR);
339 gpio_t *gpio = (gpio_t *) (MMAP_GPIO);
340 csctrl_t *csctrl = (csctrl_t *) (MMAP_FBCS);
342 out_be16(&sysctrl->sc_scr, CFG_SYS_SCR);
343 out_be16(&sysctrl->sc_spr, CFG_SYS_SPR);
346 out_be32(&gpio->gpio_pacnt, CFG_SYS_PACNT);
347 out_be16(&gpio->gpio_paddr, CFG_SYS_PADDR);
348 out_be16(&gpio->gpio_padat, CFG_SYS_PADAT);
349 out_be32(&gpio->gpio_pbcnt, CFG_SYS_PBCNT);
350 out_be16(&gpio->gpio_pbddr, CFG_SYS_PBDDR);
351 out_be16(&gpio->gpio_pbdat, CFG_SYS_PBDAT);
352 out_be32(&gpio->gpio_pdcnt, CFG_SYS_PDCNT);
354 /* Memory Controller: */
355 out_be32(&csctrl->cs_br0, CONFIG_SYS_BR0_PRELIM);
356 out_be32(&csctrl->cs_or0, CONFIG_SYS_OR0_PRELIM);
358 #if (defined(CONFIG_SYS_OR1_PRELIM) && defined(CONFIG_SYS_BR1_PRELIM))
359 out_be32(&csctrl->cs_br1, CONFIG_SYS_BR1_PRELIM);
360 out_be32(&csctrl->cs_or1, CONFIG_SYS_OR1_PRELIM);
363 #if defined(CONFIG_SYS_OR2_PRELIM) && defined(CONFIG_SYS_BR2_PRELIM)
364 out_be32(&csctrl->cs_br2, CONFIG_SYS_BR2_PRELIM);
365 out_be32(&csctrl->cs_or2, CONFIG_SYS_OR2_PRELIM);
368 #if defined(CONFIG_SYS_OR3_PRELIM) && defined(CONFIG_SYS_BR3_PRELIM)
369 out_be32(&csctrl->cs_br3, CONFIG_SYS_BR3_PRELIM);
370 out_be32(&csctrl->cs_or3, CONFIG_SYS_OR3_PRELIM);
373 #if defined(CONFIG_SYS_OR4_PRELIM) && defined(CONFIG_SYS_BR4_PRELIM)
374 out_be32(&csctrl->cs_br4, CONFIG_SYS_BR4_PRELIM);
375 out_be32(&csctrl->cs_or4, CONFIG_SYS_OR4_PRELIM);
378 #if defined(CONFIG_SYS_OR5_PRELIM) && defined(CONFIG_SYS_BR5_PRELIM)
379 out_be32(&csctrl->cs_br5, CONFIG_SYS_BR5_PRELIM);
380 out_be32(&csctrl->cs_or5, CONFIG_SYS_OR5_PRELIM);
383 #if defined(CONFIG_SYS_OR6_PRELIM) && defined(CONFIG_SYS_BR6_PRELIM)
384 out_be32(&csctrl->cs_br6, CONFIG_SYS_BR6_PRELIM);
385 out_be32(&csctrl->cs_or6, CONFIG_SYS_OR6_PRELIM);
388 #if defined(CONFIG_SYS_OR7_PRELIM) && defined(CONFIG_SYS_BR7_PRELIM)
389 out_be32(&csctrl->cs_br7, CONFIG_SYS_BR7_PRELIM);
390 out_be32(&csctrl->cs_or7, CONFIG_SYS_OR7_PRELIM);
393 #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
395 /* enable instruction cache now */
401 * initialize higher level parts of CPU like timers
408 void uart_port_conf(int port)
410 gpio_t *gpio = (gpio_t *) MMAP_GPIO;
415 clrbits_be32(&gpio->gpio_pbcnt,
416 GPIO_PBCNT_PB0MSK | GPIO_PBCNT_PB1MSK);
417 setbits_be32(&gpio->gpio_pbcnt,
418 GPIO_PBCNT_URT0_TXD | GPIO_PBCNT_URT0_RXD);
421 clrbits_be32(&gpio->gpio_pdcnt,
422 GPIO_PDCNT_PD1MSK | GPIO_PDCNT_PD4MSK);
423 setbits_be32(&gpio->gpio_pdcnt,
424 GPIO_PDCNT_URT1_RXD | GPIO_PDCNT_URT1_TXD);
429 #if defined(CONFIG_CMD_NET)
430 int fecpin_setclear(fec_info_t *info, int setclear)
432 gpio_t *gpio = (gpio_t *) MMAP_GPIO;
435 setbits_be32(&gpio->gpio_pbcnt,
436 GPIO_PBCNT_E_MDC | GPIO_PBCNT_E_RXER |
437 GPIO_PBCNT_E_RXD1 | GPIO_PBCNT_E_RXD2 |
438 GPIO_PBCNT_E_RXD3 | GPIO_PBCNT_E_TXD1 |
439 GPIO_PBCNT_E_TXD2 | GPIO_PBCNT_E_TXD3);
444 #endif /* CONFIG_CMD_NET */
445 #endif /* #if defined(CONFIG_M5272) */
447 #if defined(CONFIG_M5275)
450 * Breathe some life into the CPU...
452 * Set up the memory map,
453 * initialize a bunch of registers,
454 * initialize the UPM's
456 void cpu_init_f(void)
459 * if we come from RAM we assume the CPU is
460 * already initialized.
463 #ifndef CONFIG_MONITOR_IS_IN_RAM
464 wdog_t *wdog_reg = (wdog_t *) (MMAP_WDOG);
465 gpio_t *gpio_reg = (gpio_t *) (MMAP_GPIO);
467 /* Kill watchdog so we can initialize the PLL */
468 out_be16(&wdog_reg->wcr, 0);
470 /* FlexBus Chipselect */
472 #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
474 #ifdef CONFIG_SYS_I2C_FSL
475 CFG_SYS_I2C_PINMUX_REG &= CFG_SYS_I2C_PINMUX_CLR;
476 CFG_SYS_I2C_PINMUX_REG |= CFG_SYS_I2C_PINMUX_SET;
479 /* enable instruction cache now */
484 * initialize higher level parts of CPU like timers
491 void uart_port_conf(int port)
493 gpio_t *gpio = (gpio_t *) MMAP_GPIO;
498 clrbits_be16(&gpio->par_uart, UART0_ENABLE_MASK);
499 setbits_be16(&gpio->par_uart, UART0_ENABLE_MASK);
502 clrbits_be16(&gpio->par_uart, UART1_ENABLE_MASK);
503 setbits_be16(&gpio->par_uart, UART1_ENABLE_MASK);
506 clrbits_be16(&gpio->par_uart, UART2_ENABLE_MASK);
507 setbits_be16(&gpio->par_uart, UART2_ENABLE_MASK);
512 #if defined(CONFIG_CMD_NET)
513 int fecpin_setclear(fec_info_t *info, int setclear)
515 gpio_t *gpio = (gpio_t *)MMAP_GPIO;
518 if (fec_get_base_addr(0, &fec0_base))
522 /* Enable Ethernet pins */
523 if (info->iobase == fec0_base) {
524 setbits_be16(&gpio->par_feci2c, 0x0f00);
525 setbits_8(&gpio->par_fec0hl, 0xc0);
527 setbits_be16(&gpio->par_feci2c, 0x00a0);
528 setbits_8(&gpio->par_fec1hl, 0xc0);
531 if (info->iobase == fec0_base) {
532 clrbits_be16(&gpio->par_feci2c, 0x0f00);
533 clrbits_8(&gpio->par_fec0hl, 0xc0);
535 clrbits_be16(&gpio->par_feci2c, 0x00a0);
536 clrbits_8(&gpio->par_fec1hl, 0xc0);
542 #endif /* CONFIG_CMD_NET */
543 #endif /* #if defined(CONFIG_M5275) */
545 #if defined(CONFIG_M5282)
547 * Breath some life into the CPU...
549 * Set up the memory map,
550 * initialize a bunch of registers,
551 * initialize the UPM's
553 void cpu_init_f(void)
555 #ifndef CONFIG_WATCHDOG
556 /* disable watchdog if we aren't using it */
560 #ifndef CONFIG_MONITOR_IS_IN_RAM
563 MCFCLOCK_SYNCR_MFD(CFG_SYS_MFD) |
564 MCFCLOCK_SYNCR_RFD(CFG_SYS_RFD);
565 while (!(MCFCLOCK_SYNSR & MCFCLOCK_SYNSR_LOCK)) ;
567 MCFGPIO_PBCDPAR = 0xc0;
569 /* Set up the GPIO ports */
570 #ifdef CONFIG_SYS_PEPAR
571 MCFGPIO_PEPAR = CONFIG_SYS_PEPAR;
573 #ifdef CONFIG_SYS_PFPAR
574 MCFGPIO_PFPAR = CONFIG_SYS_PFPAR;
577 MCFGPIO_PJPAR = CFG_SYS_PJPAR;
579 #ifdef CONFIG_SYS_PSDPAR
580 MCFGPIO_PSDPAR = CONFIG_SYS_PSDPAR;
582 #ifdef CFG_SYS_PASPAR
583 MCFGPIO_PASPAR = CFG_SYS_PASPAR;
585 #ifdef CFG_SYS_PEHLPAR
586 MCFGPIO_PEHLPAR = CFG_SYS_PEHLPAR;
588 #ifdef CONFIG_SYS_PQSPAR
589 MCFGPIO_PQSPAR = CONFIG_SYS_PQSPAR;
591 #ifdef CONFIG_SYS_PTCPAR
592 MCFGPIO_PTCPAR = CONFIG_SYS_PTCPAR;
594 #if defined(CONFIG_SYS_PORTTC)
595 MCFGPIO_PORTTC = CONFIG_SYS_PORTTC;
597 #if defined(CONFIG_SYS_DDRTC)
598 MCFGPIO_DDRTC = CONFIG_SYS_DDRTC;
600 #ifdef CONFIG_SYS_PTDPAR
601 MCFGPIO_PTDPAR = CONFIG_SYS_PTDPAR;
603 #ifdef CFG_SYS_PUAPAR
604 MCFGPIO_PUAPAR = CFG_SYS_PUAPAR;
607 #if defined(CONFIG_SYS_DDRD)
608 MCFGPIO_DDRD = CONFIG_SYS_DDRD;
611 MCFGPIO_DDRUA = CFG_SYS_DDRUA;
614 /* FlexBus Chipselect */
617 #endif /* CONFIG_MONITOR_IS_IN_RAM */
619 /* defer enabling cache until boot (see do_go) */
620 /* icache_enable(); */
624 * initialize higher level parts of CPU like timers
631 void uart_port_conf(int port)
636 MCFGPIO_PUAPAR &= 0xFc;
637 MCFGPIO_PUAPAR |= 0x03;
640 MCFGPIO_PUAPAR &= 0xF3;
641 MCFGPIO_PUAPAR |= 0x0C;
644 MCFGPIO_PASPAR &= 0xFF0F;
645 MCFGPIO_PASPAR |= 0x00A0;
650 #if defined(CONFIG_CMD_NET)
651 int fecpin_setclear(fec_info_t *info, int setclear)
654 MCFGPIO_PASPAR |= 0x0F00;
655 MCFGPIO_PEHLPAR = CFG_SYS_PEHLPAR;
657 MCFGPIO_PASPAR &= 0xF0FF;
658 MCFGPIO_PEHLPAR &= ~CFG_SYS_PEHLPAR;
662 #endif /* CONFIG_CMD_NET */
665 #if defined(CONFIG_M5249)
667 * Breath some life into the CPU...
669 * Set up the memory map,
670 * initialize a bunch of registers,
671 * initialize the UPM's
673 void cpu_init_f(void)
676 * NOTE: by setting the GPIO_FUNCTION registers, we ensure that the UART pins
677 * (UART0: gpio 30,27, UART1: gpio 31, 28) will be used as UART pins
678 * which is their primary function.
681 mbar2_writeLong(MCFSIM_GPIO_FUNC, CFG_SYS_GPIO_FUNC);
682 mbar2_writeLong(MCFSIM_GPIO1_FUNC, CFG_SYS_GPIO1_FUNC);
683 mbar2_writeLong(MCFSIM_GPIO_EN, CFG_SYS_GPIO_EN);
684 mbar2_writeLong(MCFSIM_GPIO1_EN, CFG_SYS_GPIO1_EN);
685 mbar2_writeLong(MCFSIM_GPIO_OUT, CFG_SYS_GPIO_OUT);
686 mbar2_writeLong(MCFSIM_GPIO1_OUT, CFG_SYS_GPIO1_OUT);
690 * You can verify these values by using dBug's 'ird'
691 * (Internal Register Display) command
695 mbar_writeByte(MCFSIM_MPARK, 0x30); /* 5249 Internal Core takes priority over DMA */
696 mbar_writeByte(MCFSIM_SYPCR, 0x00);
697 mbar_writeByte(MCFSIM_SWIVR, 0x0f);
698 mbar_writeByte(MCFSIM_SWSR, 0x00);
699 mbar_writeLong(MCFSIM_IMR, 0xfffffbff);
700 mbar_writeByte(MCFSIM_SWDICR, 0x00);
701 mbar_writeByte(MCFSIM_TIMER1ICR, 0x00);
702 mbar_writeByte(MCFSIM_TIMER2ICR, 0x88);
703 mbar_writeByte(MCFSIM_I2CICR, 0x00);
704 mbar_writeByte(MCFSIM_UART1ICR, 0x00);
705 mbar_writeByte(MCFSIM_UART2ICR, 0x00);
706 mbar_writeByte(MCFSIM_ICR6, 0x00);
707 mbar_writeByte(MCFSIM_ICR7, 0x00);
708 mbar_writeByte(MCFSIM_ICR8, 0x00);
709 mbar_writeByte(MCFSIM_ICR9, 0x00);
710 mbar_writeByte(MCFSIM_QSPIICR, 0x00);
712 mbar2_writeLong(MCFSIM_GPIO_INT_EN, 0x00000080);
713 mbar2_writeByte(MCFSIM_INTBASE, 0x40); /* Base interrupts at 64 */
714 mbar2_writeByte(MCFSIM_SPURVEC, 0x00);
715 mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020); /* Enable a 1 cycle pre-drive cycle on CS1 */
717 /* Setup interrupt priorities for gpio7 */
718 /* mbar2_writeLong(MCFSIM_INTLEV5, 0x70000000); */
720 /* IDE Config registers */
721 mbar2_writeLong(MCFSIM_IDECONFIG1, 0x00000020);
722 mbar2_writeLong(MCFSIM_IDECONFIG2, 0x00000000);
724 /* FlexBus Chipselect */
727 /* enable instruction cache now */
732 * initialize higher level parts of CPU like timers
739 void uart_port_conf(int port)
742 #endif /* #if defined(CONFIG_M5249) */