cpu.c 2.8 KB

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