cpu.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /* linux/arch/arm/plat-s5p/cpu.c
  2. *
  3. * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * S5P CPU Support
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/module.h>
  14. #include <mach/map.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/map.h>
  17. #include <mach/regs-clock.h>
  18. #include <plat/cpu.h>
  19. #include <plat/s5p6440.h>
  20. #include <plat/s5p6442.h>
  21. #include <plat/s5pc100.h>
  22. #include <plat/s5pv210.h>
  23. #include <plat/s5pv310.h>
  24. /* table of supported CPUs */
  25. static const char name_s5p6440[] = "S5P6440";
  26. static const char name_s5p6442[] = "S5P6442";
  27. static const char name_s5pc100[] = "S5PC100";
  28. static const char name_s5pv210[] = "S5PV210/S5PC110";
  29. static const char name_s5pv310[] = "S5PV310";
  30. static struct cpu_table cpu_ids[] __initdata = {
  31. {
  32. .idcode = 0x56440100,
  33. .idmask = 0xffffff00,
  34. .map_io = s5p6440_map_io,
  35. .init_clocks = s5p6440_init_clocks,
  36. .init_uarts = s5p6440_init_uarts,
  37. .init = s5p6440_init,
  38. .name = name_s5p6440,
  39. }, {
  40. .idcode = 0x36442000,
  41. .idmask = 0xffffff00,
  42. .map_io = s5p6442_map_io,
  43. .init_clocks = s5p6442_init_clocks,
  44. .init_uarts = s5p6442_init_uarts,
  45. .init = s5p6442_init,
  46. .name = name_s5p6442,
  47. }, {
  48. .idcode = 0x43100000,
  49. .idmask = 0xfffff000,
  50. .map_io = s5pc100_map_io,
  51. .init_clocks = s5pc100_init_clocks,
  52. .init_uarts = s5pc100_init_uarts,
  53. .init = s5pc100_init,
  54. .name = name_s5pc100,
  55. }, {
  56. .idcode = 0x43110000,
  57. .idmask = 0xfffff000,
  58. .map_io = s5pv210_map_io,
  59. .init_clocks = s5pv210_init_clocks,
  60. .init_uarts = s5pv210_init_uarts,
  61. .init = s5pv210_init,
  62. .name = name_s5pv210,
  63. }, {
  64. .idcode = 0x43200000,
  65. .idmask = 0xfffff000,
  66. .map_io = s5pv310_map_io,
  67. .init_clocks = s5pv310_init_clocks,
  68. .init_uarts = s5pv310_init_uarts,
  69. .init = s5pv310_init,
  70. .name = name_s5pv310,
  71. },
  72. };
  73. /* minimal IO mapping */
  74. static struct map_desc s5p_iodesc[] __initdata = {
  75. {
  76. .virtual = (unsigned long)S5P_VA_CHIPID,
  77. .pfn = __phys_to_pfn(S5P_PA_CHIPID),
  78. .length = SZ_4K,
  79. .type = MT_DEVICE,
  80. }, {
  81. .virtual = (unsigned long)S3C_VA_SYS,
  82. .pfn = __phys_to_pfn(S5P_PA_SYSCON),
  83. .length = SZ_64K,
  84. .type = MT_DEVICE,
  85. }, {
  86. .virtual = (unsigned long)S3C_VA_UART,
  87. .pfn = __phys_to_pfn(S3C_PA_UART),
  88. .length = SZ_512K,
  89. .type = MT_DEVICE,
  90. #ifdef CONFIG_ARM_VIC
  91. }, {
  92. .virtual = (unsigned long)VA_VIC0,
  93. .pfn = __phys_to_pfn(S5P_PA_VIC0),
  94. .length = SZ_16K,
  95. .type = MT_DEVICE,
  96. }, {
  97. .virtual = (unsigned long)VA_VIC1,
  98. .pfn = __phys_to_pfn(S5P_PA_VIC1),
  99. .length = SZ_16K,
  100. .type = MT_DEVICE,
  101. #endif
  102. }, {
  103. .virtual = (unsigned long)S3C_VA_TIMER,
  104. .pfn = __phys_to_pfn(S5P_PA_TIMER),
  105. .length = SZ_16K,
  106. .type = MT_DEVICE,
  107. }, {
  108. .virtual = (unsigned long)S5P_VA_GPIO,
  109. .pfn = __phys_to_pfn(S5P_PA_GPIO),
  110. .length = SZ_4K,
  111. .type = MT_DEVICE,
  112. }, {
  113. .virtual = (unsigned long)S3C_VA_WATCHDOG,
  114. .pfn = __phys_to_pfn(S3C_PA_WDT),
  115. .length = SZ_4K,
  116. .type = MT_DEVICE,
  117. },
  118. };
  119. /* read cpu identification code */
  120. void __init s5p_init_io(struct map_desc *mach_desc,
  121. int size, void __iomem *cpuid_addr)
  122. {
  123. unsigned long idcode;
  124. /* initialize the io descriptors we need for initialization */
  125. iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
  126. if (mach_desc)
  127. iotable_init(mach_desc, size);
  128. idcode = __raw_readl(cpuid_addr);
  129. s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
  130. }