config.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /***************************************************************************/
  2. /*
  3. * linux/arch/m68knommu/platform/5206/config.c
  4. *
  5. * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
  6. * Copyright (C) 2000-2001, Lineo Inc. (www.lineo.com)
  7. */
  8. /***************************************************************************/
  9. #include <linux/kernel.h>
  10. #include <linux/param.h>
  11. #include <linux/init.h>
  12. #include <linux/io.h>
  13. #include <asm/machdep.h>
  14. #include <asm/coldfire.h>
  15. #include <asm/mcfsim.h>
  16. #include <asm/mcfuart.h>
  17. /***************************************************************************/
  18. static void __init m5206_uarts_init(void)
  19. {
  20. /* UART0 interrupt setup */
  21. writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
  22. writeb(MCF_IRQ_UART0, MCFUART_BASE0 + MCFUART_UIVR);
  23. mcf_mapirq2imr(MCF_IRQ_UART0, MCFINTC_UART0);
  24. /* UART1 interrupt setup */
  25. writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
  26. writeb(MCF_IRQ_UART1, MCFUART_BASE1 + MCFUART_UIVR);
  27. mcf_mapirq2imr(MCF_IRQ_UART1, MCFINTC_UART1);
  28. }
  29. /***************************************************************************/
  30. static void __init m5206_timers_init(void)
  31. {
  32. /* Timer1 is always used as system timer */
  33. writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
  34. MCF_MBAR + MCFSIM_TIMER1ICR);
  35. mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
  36. #ifdef CONFIG_HIGHPROFILE
  37. /* Timer2 is to be used as a high speed profile timer */
  38. writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
  39. MCF_MBAR + MCFSIM_TIMER2ICR);
  40. mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
  41. #endif
  42. }
  43. /***************************************************************************/
  44. void m5206_cpu_reset(void)
  45. {
  46. local_irq_disable();
  47. /* Set watchdog to soft reset, and enabled */
  48. __raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR);
  49. for (;;)
  50. /* wait for watchdog to timeout */;
  51. }
  52. /***************************************************************************/
  53. void __init config_BSP(char *commandp, int size)
  54. {
  55. #if defined(CONFIG_NETtel)
  56. /* Copy command line from FLASH to local buffer... */
  57. memcpy(commandp, (char *) 0xf0004000, size);
  58. commandp[size-1] = 0;
  59. #endif /* CONFIG_NETtel */
  60. mach_reset = m5206_cpu_reset;
  61. mach_sched_init = hw_timer_init;
  62. m5206_timers_init();
  63. m5206_uarts_init();
  64. /* Only support the external interrupts on their primary level */
  65. mcf_mapirq2imr(25, MCFINTC_EINT1);
  66. mcf_mapirq2imr(28, MCFINTC_EINT4);
  67. mcf_mapirq2imr(31, MCFINTC_EINT7);
  68. }
  69. /***************************************************************************/