cpu.c 2.2 KB

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