m5206.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // SPDX-License-Identifier: GPL-2.0
  2. /***************************************************************************/
  3. /*
  4. * m5206.c -- platform support for ColdFire 5206 based boards
  5. *
  6. * Copyright (C) 1999-2002, Greg Ungerer ([email protected])
  7. * Copyright (C) 2000-2001, Lineo Inc. (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 m5206_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 m5206_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. void __init config_BSP(char *commandp, int size)
  41. {
  42. #if defined(CONFIG_NETtel)
  43. /* Copy command line from FLASH to local buffer... */
  44. memcpy(commandp, (char *) 0xf0004000, size);
  45. commandp[size-1] = 0;
  46. #endif /* CONFIG_NETtel */
  47. mach_sched_init = hw_timer_init;
  48. /* Only support the external interrupts on their primary level */
  49. mcf_mapirq2imr(25, MCFINTC_EINT1);
  50. mcf_mapirq2imr(28, MCFINTC_EINT4);
  51. mcf_mapirq2imr(31, MCFINTC_EINT7);
  52. m5206_i2c_init();
  53. clkdev_add_table(m5206_clk_lookup, ARRAY_SIZE(m5206_clk_lookup));
  54. }
  55. /***************************************************************************/