cpu.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 <asm/proc-fns.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/mach/irq.h>
  27. #include <mach/hardware.h>
  28. #include <mach/map.h>
  29. #include <asm/irq.h>
  30. #include <plat/cpu-freq.h>
  31. #include <plat/regs-serial.h>
  32. #include <plat/regs-power.h>
  33. #include <plat/cpu.h>
  34. #include <plat/devs.h>
  35. #include <plat/clock.h>
  36. #include <plat/sdhci.h>
  37. #include <plat/iic-core.h>
  38. #include <plat/s5pc100.h>
  39. /* Initial IO mappings */
  40. static struct map_desc s5pc100_iodesc[] __initdata = {
  41. };
  42. static void s5pc100_idle(void)
  43. {
  44. unsigned long tmp;
  45. tmp = __raw_readl(S5PC100_PWR_CFG);
  46. tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
  47. tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
  48. tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
  49. __raw_writel(tmp, S5PC100_PWR_CFG);
  50. tmp = __raw_readl(S5PC100_OTHERS);
  51. tmp |= S5PC100_PMU_INT_DISABLE;
  52. __raw_writel(tmp, S5PC100_OTHERS);
  53. cpu_do_idle();
  54. }
  55. /* s5pc100_map_io
  56. *
  57. * register the standard cpu IO areas
  58. */
  59. void __init s5pc100_map_io(void)
  60. {
  61. iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
  62. /* initialise device information early */
  63. s5pc100_default_sdhci0();
  64. s5pc100_default_sdhci1();
  65. s5pc100_default_sdhci2();
  66. /* the i2c devices are directly compatible with s3c2440 */
  67. s3c_i2c0_setname("s3c2440-i2c");
  68. s3c_i2c1_setname("s3c2440-i2c");
  69. }
  70. void __init s5pc100_init_clocks(int xtal)
  71. {
  72. printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
  73. s3c24xx_register_baseclocks(xtal);
  74. s5pc1xx_register_clocks();
  75. s5pc100_register_clocks();
  76. s5pc100_setup_clocks();
  77. }
  78. void __init s5pc100_init_irq(void)
  79. {
  80. u32 vic_valid[] = {~0, ~0, ~0};
  81. /* VIC0, VIC1, and VIC2 are fully populated. */
  82. s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
  83. }
  84. struct sysdev_class s5pc100_sysclass = {
  85. .name = "s5pc100-core",
  86. };
  87. static struct sys_device s5pc100_sysdev = {
  88. .cls = &s5pc100_sysclass,
  89. };
  90. static int __init s5pc100_core_init(void)
  91. {
  92. return sysdev_class_register(&s5pc100_sysclass);
  93. }
  94. core_initcall(s5pc100_core_init);
  95. int __init s5pc100_init(void)
  96. {
  97. printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
  98. s5pc1xx_idle = s5pc100_idle;
  99. return sysdev_register(&s5pc100_sysdev);
  100. }