mach-imx51.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright 2011 Linaro Ltd.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/io.h>
  13. #include <linux/irq.h>
  14. #include <linux/of_irq.h>
  15. #include <linux/of_platform.h>
  16. #include <asm/mach/arch.h>
  17. #include <asm/mach/time.h>
  18. #include "common.h"
  19. #include "hardware.h"
  20. static void __init imx51_init_early(void)
  21. {
  22. mxc_set_cpu_type(MXC_CPU_MX51);
  23. }
  24. /*
  25. * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
  26. * the Freescale marketing division. However this did not remove the
  27. * hardware from the chip which still needs to be configured for proper
  28. * IPU support.
  29. */
  30. #define MX51_MIPI_HSC_BASE 0x83fdc000
  31. static void __init imx51_ipu_mipi_setup(void)
  32. {
  33. void __iomem *hsc_addr;
  34. hsc_addr = ioremap(MX51_MIPI_HSC_BASE, SZ_16K);
  35. WARN_ON(!hsc_addr);
  36. /* setup MIPI module to legacy mode */
  37. __raw_writel(0xf00, hsc_addr);
  38. /* CSI mode: reserved; DI control mode: legacy (from Freescale BSP) */
  39. __raw_writel(__raw_readl(hsc_addr + 0x800) | 0x30ff,
  40. hsc_addr + 0x800);
  41. iounmap(hsc_addr);
  42. }
  43. static void __init imx51_dt_init(void)
  44. {
  45. struct platform_device_info devinfo = { .name = "cpufreq-dt", };
  46. mxc_arch_reset_init_dt();
  47. imx51_ipu_mipi_setup();
  48. imx_src_init();
  49. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  50. platform_device_register_full(&devinfo);
  51. }
  52. static void __init imx51_init_late(void)
  53. {
  54. mx51_neon_fixup();
  55. imx51_pm_init();
  56. }
  57. static const char * const imx51_dt_board_compat[] __initconst = {
  58. "fsl,imx51",
  59. NULL
  60. };
  61. DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
  62. .init_early = imx51_init_early,
  63. .init_irq = tzic_init_irq,
  64. .init_machine = imx51_dt_init,
  65. .init_late = imx51_init_late,
  66. .dt_compat = imx51_dt_board_compat,
  67. .restart = mxc_restart,
  68. MACHINE_END