cpu.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. /* table of supported CPUs */
  24. static const char name_s5p6440[] = "S5P6440";
  25. static const char name_s5p6442[] = "S5P6442";
  26. static const char name_s5pc100[] = "S5PC100";
  27. static const char name_s5pv210[] = "S5PV210/S5PC110";
  28. static struct cpu_table cpu_ids[] __initdata = {
  29. {
  30. .idcode = 0x56440100,
  31. .idmask = 0xffffff00,
  32. .map_io = s5p6440_map_io,
  33. .init_clocks = s5p6440_init_clocks,
  34. .init_uarts = s5p6440_init_uarts,
  35. .init = s5p6440_init,
  36. .name = name_s5p6440,
  37. }, {
  38. .idcode = 0x36442000,
  39. .idmask = 0xffffff00,
  40. .map_io = s5p6442_map_io,
  41. .init_clocks = s5p6442_init_clocks,
  42. .init_uarts = s5p6442_init_uarts,
  43. .init = s5p6442_init,
  44. .name = name_s5p6442,
  45. }, {
  46. .idcode = 0x43100000,
  47. .idmask = 0xfffff000,
  48. .map_io = s5pc100_map_io,
  49. .init_clocks = s5pc100_init_clocks,
  50. .init_uarts = s5pc100_init_uarts,
  51. .init = s5pc100_init,
  52. .name = name_s5pc100,
  53. }, {
  54. .idcode = 0x43110000,
  55. .idmask = 0xfffff000,
  56. .map_io = s5pv210_map_io,
  57. .init_clocks = s5pv210_init_clocks,
  58. .init_uarts = s5pv210_init_uarts,
  59. .init = s5pv210_init,
  60. .name = name_s5pv210,
  61. },
  62. };
  63. /* minimal IO mapping */
  64. static struct map_desc s5p_iodesc[] __initdata = {
  65. {
  66. .virtual = (unsigned long)S5P_VA_CHIPID,
  67. .pfn = __phys_to_pfn(S5P_PA_CHIPID),
  68. .length = SZ_4K,
  69. .type = MT_DEVICE,
  70. }, {
  71. .virtual = (unsigned long)S3C_VA_SYS,
  72. .pfn = __phys_to_pfn(S5P_PA_SYSCON),
  73. .length = SZ_64K,
  74. .type = MT_DEVICE,
  75. }, {
  76. .virtual = (unsigned long)S3C_VA_UART,
  77. .pfn = __phys_to_pfn(S3C_PA_UART),
  78. .length = SZ_4K,
  79. .type = MT_DEVICE,
  80. }, {
  81. .virtual = (unsigned long)VA_VIC0,
  82. .pfn = __phys_to_pfn(S5P_PA_VIC0),
  83. .length = SZ_16K,
  84. .type = MT_DEVICE,
  85. }, {
  86. .virtual = (unsigned long)VA_VIC1,
  87. .pfn = __phys_to_pfn(S5P_PA_VIC1),
  88. .length = SZ_16K,
  89. .type = MT_DEVICE,
  90. }, {
  91. .virtual = (unsigned long)S3C_VA_TIMER,
  92. .pfn = __phys_to_pfn(S5P_PA_TIMER),
  93. .length = SZ_16K,
  94. .type = MT_DEVICE,
  95. }, {
  96. .virtual = (unsigned long)S5P_VA_GPIO,
  97. .pfn = __phys_to_pfn(S5P_PA_GPIO),
  98. .length = SZ_4K,
  99. .type = MT_DEVICE,
  100. },
  101. };
  102. /* read cpu identification code */
  103. void __init s5p_init_io(struct map_desc *mach_desc,
  104. int size, void __iomem *cpuid_addr)
  105. {
  106. unsigned long idcode;
  107. /* initialize the io descriptors we need for initialization */
  108. iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
  109. if (mach_desc)
  110. iotable_init(mach_desc, size);
  111. idcode = __raw_readl(cpuid_addr);
  112. s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
  113. }