cpu.c 2.8 KB

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