config.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /***************************************************************************/
  2. /*
  3. * linux/arch/m68knommu/platform/5307/config.c
  4. *
  5. * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
  6. * Copyright (C) 2000, Lineo (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/mcfwdebug.h>
  17. /***************************************************************************/
  18. /*
  19. * Some platforms need software versions of the GPIO data registers.
  20. */
  21. unsigned short ppdata;
  22. unsigned char ledbank = 0xff;
  23. /***************************************************************************/
  24. void m5307_cpu_reset(void)
  25. {
  26. local_irq_disable();
  27. /* Set watchdog to soft reset, and enabled */
  28. __raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR);
  29. for (;;)
  30. /* wait for watchdog to timeout */;
  31. }
  32. /***************************************************************************/
  33. void __init config_BSP(char *commandp, int size)
  34. {
  35. #if defined(CONFIG_NETtel) || \
  36. defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
  37. /* Copy command line from FLASH to local buffer... */
  38. memcpy(commandp, (char *) 0xf0004000, size);
  39. commandp[size-1] = 0;
  40. #endif
  41. mach_reset = m5307_cpu_reset;
  42. mach_sched_init = hw_timer_init;
  43. /* Only support the external interrupts on their primary level */
  44. mcf_mapirq2imr(25, MCFINTC_EINT1);
  45. mcf_mapirq2imr(27, MCFINTC_EINT3);
  46. mcf_mapirq2imr(29, MCFINTC_EINT5);
  47. mcf_mapirq2imr(31, MCFINTC_EINT7);
  48. #ifdef CONFIG_BDM_DISABLE
  49. /*
  50. * Disable the BDM clocking. This also turns off most of the rest of
  51. * the BDM device. This is good for EMC reasons. This option is not
  52. * incompatible with the memory protection option.
  53. */
  54. wdebug(MCFDEBUG_CSR, MCFDEBUG_CSR_PSTCLK);
  55. #endif
  56. }
  57. /***************************************************************************/