cpu.c 2.5 KB

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