common.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Defines machines for CSR SiRFprimaII
  3. *
  4. * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
  5. *
  6. * Licensed under GPLv2 or later.
  7. */
  8. #include <linux/clocksource.h>
  9. #include <linux/init.h>
  10. #include <linux/kernel.h>
  11. #include <asm/sizes.h>
  12. #include <asm/mach-types.h>
  13. #include <asm/mach/arch.h>
  14. #include <linux/of.h>
  15. #include <linux/of_platform.h>
  16. #include "common.h"
  17. static struct of_device_id sirfsoc_of_bus_ids[] __initdata = {
  18. { .compatible = "simple-bus", },
  19. {},
  20. };
  21. void __init sirfsoc_mach_init(void)
  22. {
  23. of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL);
  24. }
  25. void __init sirfsoc_init_late(void)
  26. {
  27. sirfsoc_pm_init();
  28. }
  29. static __init void sirfsoc_init_time(void)
  30. {
  31. /* initialize clocking early, we want to set the OS timer */
  32. sirfsoc_of_clk_init();
  33. clocksource_of_init();
  34. }
  35. static __init void sirfsoc_map_io(void)
  36. {
  37. sirfsoc_map_lluart();
  38. sirfsoc_map_scu();
  39. }
  40. #ifdef CONFIG_ARCH_ATLAS6
  41. static const char *atlas6_dt_match[] __initdata = {
  42. "sirf,atlas6",
  43. NULL
  44. };
  45. DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
  46. /* Maintainer: Barry Song <baohua.song@csr.com> */
  47. .nr_irqs = 128,
  48. .map_io = sirfsoc_map_io,
  49. .init_time = sirfsoc_init_time,
  50. .init_machine = sirfsoc_mach_init,
  51. .init_late = sirfsoc_init_late,
  52. .dt_compat = atlas6_dt_match,
  53. .restart = sirfsoc_restart,
  54. MACHINE_END
  55. #endif
  56. #ifdef CONFIG_ARCH_PRIMA2
  57. static const char *prima2_dt_match[] __initdata = {
  58. "sirf,prima2",
  59. NULL
  60. };
  61. DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
  62. /* Maintainer: Barry Song <baohua.song@csr.com> */
  63. .nr_irqs = 128,
  64. .map_io = sirfsoc_map_io,
  65. .init_time = sirfsoc_init_time,
  66. .dma_zone_size = SZ_256M,
  67. .init_machine = sirfsoc_mach_init,
  68. .init_late = sirfsoc_init_late,
  69. .dt_compat = prima2_dt_match,
  70. .restart = sirfsoc_restart,
  71. MACHINE_END
  72. #endif
  73. #ifdef CONFIG_ARCH_MARCO
  74. static const char *marco_dt_match[] __initdata = {
  75. "sirf,marco",
  76. NULL
  77. };
  78. DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
  79. /* Maintainer: Barry Song <baohua.song@csr.com> */
  80. .smp = smp_ops(sirfsoc_smp_ops),
  81. .map_io = sirfsoc_map_io,
  82. .init_time = sirfsoc_init_time,
  83. .init_machine = sirfsoc_mach_init,
  84. .init_late = sirfsoc_init_late,
  85. .dt_compat = marco_dt_match,
  86. .restart = sirfsoc_restart,
  87. MACHINE_END
  88. #endif