m5407.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // SPDX-License-Identifier: GPL-2.0
  2. /***************************************************************************/
  3. /*
  4. * m5407.c -- platform support for ColdFire 5407 based boards
  5. *
  6. * Copyright (C) 1999-2002, Greg Ungerer ([email protected])
  7. * Copyright (C) 2000, Lineo (www.lineo.com)
  8. */
  9. /***************************************************************************/
  10. #include <linux/clkdev.h>
  11. #include <linux/kernel.h>
  12. #include <linux/param.h>
  13. #include <linux/init.h>
  14. #include <linux/io.h>
  15. #include <asm/machdep.h>
  16. #include <asm/coldfire.h>
  17. #include <asm/mcfsim.h>
  18. #include <asm/mcfclk.h>
  19. /***************************************************************************/
  20. DEFINE_CLK(pll, "pll.0", MCF_CLK);
  21. DEFINE_CLK(sys, "sys.0", MCF_BUSCLK);
  22. static struct clk_lookup m5407_clk_lookup[] = {
  23. CLKDEV_INIT(NULL, "pll.0", &clk_pll),
  24. CLKDEV_INIT(NULL, "sys.0", &clk_sys),
  25. CLKDEV_INIT("mcftmr.0", NULL, &clk_sys),
  26. CLKDEV_INIT("mcftmr.1", NULL, &clk_sys),
  27. CLKDEV_INIT("mcfuart.0", NULL, &clk_sys),
  28. CLKDEV_INIT("mcfuart.1", NULL, &clk_sys),
  29. CLKDEV_INIT("imx1-i2c.0", NULL, &clk_sys),
  30. };
  31. /***************************************************************************/
  32. static void __init m5407_i2c_init(void)
  33. {
  34. #if IS_ENABLED(CONFIG_I2C_IMX)
  35. writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL5 | MCFSIM_ICR_PRI0,
  36. MCFSIM_I2CICR);
  37. mcf_mapirq2imr(MCF_IRQ_I2C0, MCFINTC_I2C);
  38. #endif /* IS_ENABLED(CONFIG_I2C_IMX) */
  39. }
  40. /***************************************************************************/
  41. void __init config_BSP(char *commandp, int size)
  42. {
  43. mach_sched_init = hw_timer_init;
  44. /* Only support the external interrupts on their primary level */
  45. mcf_mapirq2imr(25, MCFINTC_EINT1);
  46. mcf_mapirq2imr(27, MCFINTC_EINT3);
  47. mcf_mapirq2imr(29, MCFINTC_EINT5);
  48. mcf_mapirq2imr(31, MCFINTC_EINT7);
  49. m5407_i2c_init();
  50. clkdev_add_table(m5407_clk_lookup, ARRAY_SIZE(m5407_clk_lookup));
  51. }
  52. /***************************************************************************/