mach-imx51.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. imx_writel(0xf00, hsc_addr);
  38. /* CSI mode: reserved; DI control mode: legacy (from Freescale BSP) */
  39. imx_writel(imx_readl(hsc_addr + 0x800) | 0x30ff, hsc_addr + 0x800);
  40. iounmap(hsc_addr);
  41. }
  42. static void __init imx51_dt_init(void)
  43. {
  44. imx51_ipu_mipi_setup();
  45. imx_src_init();
  46. imx_aips_allow_unprivileged_access("fsl,imx51-aipstz");
  47. }
  48. static void __init imx51_init_late(void)
  49. {
  50. mx51_neon_fixup();
  51. imx51_pm_init();
  52. }
  53. static const char * const imx51_dt_board_compat[] __initconst = {
  54. "fsl,imx51",
  55. NULL
  56. };
  57. DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
  58. .init_early = imx51_init_early,
  59. .init_machine = imx51_dt_init,
  60. .init_late = imx51_init_late,
  61. .dt_compat = imx51_dt_board_compat,
  62. MACHINE_END