cpu.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /* linux/arch/arm/mach-s5pc100/cpu.c
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com
  5. *
  6. * Copyright 2009 Samsung Electronics Co.
  7. * Byungho Min <bhmin@samsung.com>
  8. *
  9. * Based on mach-s3c6410/cpu.c
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/types.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/list.h>
  19. #include <linux/timer.h>
  20. #include <linux/init.h>
  21. #include <linux/clk.h>
  22. #include <linux/io.h>
  23. #include <linux/sysdev.h>
  24. #include <linux/serial_core.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/sched.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <asm/mach/irq.h>
  30. #include <asm/proc-fns.h>
  31. #include <mach/hardware.h>
  32. #include <mach/map.h>
  33. #include <asm/irq.h>
  34. #include <plat/regs-serial.h>
  35. #include <mach/regs-clock.h>
  36. #include <plat/cpu.h>
  37. #include <plat/devs.h>
  38. #include <plat/clock.h>
  39. #include <plat/ata-core.h>
  40. #include <plat/iic-core.h>
  41. #include <plat/sdhci.h>
  42. #include <plat/adc-core.h>
  43. #include <plat/onenand-core.h>
  44. #include <plat/fb-core.h>
  45. #include <plat/s5pc100.h>
  46. /* Initial IO mappings */
  47. static struct map_desc s5pc100_iodesc[] __initdata = {
  48. {
  49. .virtual = (unsigned long)S5P_VA_SYSTIMER,
  50. .pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER),
  51. .length = SZ_16K,
  52. .type = MT_DEVICE,
  53. }, {
  54. .virtual = (unsigned long)S5P_VA_GPIO,
  55. .pfn = __phys_to_pfn(S5PC100_PA_GPIO),
  56. .length = SZ_4K,
  57. .type = MT_DEVICE,
  58. }, {
  59. .virtual = (unsigned long)VA_VIC0,
  60. .pfn = __phys_to_pfn(S5PC100_PA_VIC0),
  61. .length = SZ_16K,
  62. .type = MT_DEVICE,
  63. }, {
  64. .virtual = (unsigned long)VA_VIC1,
  65. .pfn = __phys_to_pfn(S5PC100_PA_VIC1),
  66. .length = SZ_16K,
  67. .type = MT_DEVICE,
  68. }, {
  69. .virtual = (unsigned long)VA_VIC2,
  70. .pfn = __phys_to_pfn(S5PC100_PA_VIC2),
  71. .length = SZ_16K,
  72. .type = MT_DEVICE,
  73. }, {
  74. .virtual = (unsigned long)S3C_VA_UART,
  75. .pfn = __phys_to_pfn(S3C_PA_UART),
  76. .length = SZ_512K,
  77. .type = MT_DEVICE,
  78. }, {
  79. .virtual = (unsigned long)S5PC100_VA_OTHERS,
  80. .pfn = __phys_to_pfn(S5PC100_PA_OTHERS),
  81. .length = SZ_4K,
  82. .type = MT_DEVICE,
  83. }
  84. };
  85. static void s5pc100_idle(void)
  86. {
  87. if (!need_resched())
  88. cpu_do_idle();
  89. local_irq_enable();
  90. }
  91. /* s5pc100_map_io
  92. *
  93. * register the standard cpu IO areas
  94. */
  95. void __init s5pc100_map_io(void)
  96. {
  97. iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
  98. /* initialise device information early */
  99. s5pc100_default_sdhci0();
  100. s5pc100_default_sdhci1();
  101. s5pc100_default_sdhci2();
  102. s3c_adc_setname("s3c64xx-adc");
  103. /* the i2c devices are directly compatible with s3c2440 */
  104. s3c_i2c0_setname("s3c2440-i2c");
  105. s3c_i2c1_setname("s3c2440-i2c");
  106. s3c_onenand_setname("s5pc100-onenand");
  107. s3c_fb_setname("s5pc100-fb");
  108. s3c_cfcon_setname("s5pc100-pata");
  109. }
  110. void __init s5pc100_init_clocks(int xtal)
  111. {
  112. printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
  113. s3c24xx_register_baseclocks(xtal);
  114. s5p_register_clocks(xtal);
  115. s5pc100_register_clocks();
  116. s5pc100_setup_clocks();
  117. }
  118. void __init s5pc100_init_irq(void)
  119. {
  120. u32 vic[] = {~0, ~0, ~0};
  121. /* VIC0, VIC1, and VIC2 are fully populated. */
  122. s5p_init_irq(vic, ARRAY_SIZE(vic));
  123. }
  124. static struct sysdev_class s5pc100_sysclass = {
  125. .name = "s5pc100-core",
  126. };
  127. static struct sys_device s5pc100_sysdev = {
  128. .cls = &s5pc100_sysclass,
  129. };
  130. static int __init s5pc100_core_init(void)
  131. {
  132. return sysdev_class_register(&s5pc100_sysclass);
  133. }
  134. core_initcall(s5pc100_core_init);
  135. int __init s5pc100_init(void)
  136. {
  137. printk(KERN_INFO "S5PC100: Initializing architecture\n");
  138. /* set idle function */
  139. pm_idle = s5pc100_idle;
  140. return sysdev_register(&s5pc100_sysdev);
  141. }