mach-imx51.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. imx51_ipu_mipi_setup();
  47. imx_src_init();
  48. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  49. platform_device_register_full(&devinfo);
  50. }
  51. static void __init imx51_init_late(void)
  52. {
  53. mx51_neon_fixup();
  54. imx51_pm_init();
  55. }
  56. static const char * const imx51_dt_board_compat[] __initconst = {
  57. "fsl,imx51",
  58. NULL
  59. };
  60. DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
  61. .init_early = imx51_init_early,
  62. .init_irq = tzic_init_irq,
  63. .init_machine = imx51_dt_init,
  64. .init_late = imx51_init_late,
  65. .dt_compat = imx51_dt_board_compat,
  66. MACHINE_END