cpu.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* linux/arch/arm/mach-s5pc100/cpu.c
  2. *
  3. * Copyright 2009 Samsung Electronics Co.
  4. * Byungho Min <bhmin@samsung.com>
  5. *
  6. * Based on mach-s3c6410/cpu.c
  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/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/list.h>
  16. #include <linux/timer.h>
  17. #include <linux/init.h>
  18. #include <linux/clk.h>
  19. #include <linux/io.h>
  20. #include <linux/sysdev.h>
  21. #include <linux/serial_core.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/sched.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/mach/irq.h>
  27. #include <asm/proc-fns.h>
  28. #include <mach/hardware.h>
  29. #include <mach/map.h>
  30. #include <asm/irq.h>
  31. #include <plat/regs-serial.h>
  32. #include <mach/regs-clock.h>
  33. #include <plat/cpu.h>
  34. #include <plat/devs.h>
  35. #include <plat/clock.h>
  36. #include <plat/ata-core.h>
  37. #include <plat/iic-core.h>
  38. #include <plat/sdhci.h>
  39. #include <plat/adc-core.h>
  40. #include <plat/onenand-core.h>
  41. #include <plat/fb-core.h>
  42. #include <plat/s5pc100.h>
  43. /* Initial IO mappings */
  44. static struct map_desc s5pc100_iodesc[] __initdata = {
  45. {
  46. .virtual = (unsigned long)S5P_VA_SYSTIMER,
  47. .pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER),
  48. .length = SZ_16K,
  49. .type = MT_DEVICE,
  50. }, {
  51. .virtual = (unsigned long)VA_VIC2,
  52. .pfn = __phys_to_pfn(S5P_PA_VIC2),
  53. .length = SZ_16K,
  54. .type = MT_DEVICE,
  55. }, {
  56. .virtual = (unsigned long)S5PC100_VA_OTHERS,
  57. .pfn = __phys_to_pfn(S5PC100_PA_OTHERS),
  58. .length = SZ_4K,
  59. .type = MT_DEVICE,
  60. }
  61. };
  62. static void s5pc100_idle(void)
  63. {
  64. if (!need_resched())
  65. cpu_do_idle();
  66. local_irq_enable();
  67. }
  68. /* s5pc100_map_io
  69. *
  70. * register the standard cpu IO areas
  71. */
  72. void __init s5pc100_map_io(void)
  73. {
  74. iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
  75. /* initialise device information early */
  76. s5pc100_default_sdhci0();
  77. s5pc100_default_sdhci1();
  78. s5pc100_default_sdhci2();
  79. s3c_adc_setname("s3c64xx-adc");
  80. /* the i2c devices are directly compatible with s3c2440 */
  81. s3c_i2c0_setname("s3c2440-i2c");
  82. s3c_i2c1_setname("s3c2440-i2c");
  83. s3c_onenand_setname("s5pc100-onenand");
  84. s3c_fb_setname("s5pc100-fb");
  85. s3c_cfcon_setname("s5pc100-pata");
  86. }
  87. void __init s5pc100_init_clocks(int xtal)
  88. {
  89. printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
  90. s3c24xx_register_baseclocks(xtal);
  91. s5p_register_clocks(xtal);
  92. s5pc100_register_clocks();
  93. s5pc100_setup_clocks();
  94. }
  95. void __init s5pc100_init_irq(void)
  96. {
  97. u32 vic[] = {~0, ~0, ~0};
  98. /* VIC0, VIC1, and VIC2 are fully populated. */
  99. s5p_init_irq(vic, ARRAY_SIZE(vic));
  100. }
  101. static struct sysdev_class s5pc100_sysclass = {
  102. .name = "s5pc100-core",
  103. };
  104. static struct sys_device s5pc100_sysdev = {
  105. .cls = &s5pc100_sysclass,
  106. };
  107. static int __init s5pc100_core_init(void)
  108. {
  109. return sysdev_class_register(&s5pc100_sysclass);
  110. }
  111. core_initcall(s5pc100_core_init);
  112. int __init s5pc100_init(void)
  113. {
  114. printk(KERN_INFO "S5PC100: Initializing architecture\n");
  115. /* set idle function */
  116. pm_idle = s5pc100_idle;
  117. return sysdev_register(&s5pc100_sysdev);
  118. }