cpu.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* linux/arch/arm/mach-s5p6440/cpu.c
  2. *
  3. * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/list.h>
  14. #include <linux/timer.h>
  15. #include <linux/init.h>
  16. #include <linux/clk.h>
  17. #include <linux/io.h>
  18. #include <linux/sysdev.h>
  19. #include <linux/serial_core.h>
  20. #include <linux/platform_device.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/map.h>
  23. #include <asm/mach/irq.h>
  24. #include <asm/proc-fns.h>
  25. #include <mach/hardware.h>
  26. #include <mach/map.h>
  27. #include <asm/irq.h>
  28. #include <plat/regs-serial.h>
  29. #include <mach/regs-clock.h>
  30. #include <plat/cpu.h>
  31. #include <plat/devs.h>
  32. #include <plat/clock.h>
  33. #include <plat/s5p6440.h>
  34. #include <plat/adc-core.h>
  35. static void s5p6440_idle(void)
  36. {
  37. unsigned long val;
  38. if (!need_resched()) {
  39. val = __raw_readl(S5P_PWR_CFG);
  40. val &= ~(0x3<<5);
  41. val |= (0x1<<5);
  42. __raw_writel(val, S5P_PWR_CFG);
  43. cpu_do_idle();
  44. }
  45. local_irq_enable();
  46. }
  47. /* s5p6440_map_io
  48. *
  49. * register the standard cpu IO areas
  50. */
  51. void __init s5p6440_map_io(void)
  52. {
  53. /* initialize any device information early */
  54. s3c_adc_setname("s3c64xx-adc");
  55. }
  56. void __init s5p6440_init_clocks(int xtal)
  57. {
  58. printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
  59. s3c24xx_register_baseclocks(xtal);
  60. s5p_register_clocks(xtal);
  61. s5p6440_register_clocks();
  62. s5p6440_setup_clocks();
  63. }
  64. void __init s5p6440_init_irq(void)
  65. {
  66. /* S5P6440 supports only 2 VIC */
  67. u32 vic[2];
  68. /*
  69. * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
  70. * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
  71. */
  72. vic[0] = 0xff800ae7;
  73. vic[1] = 0xffbf23e5;
  74. s5p_init_irq(vic, ARRAY_SIZE(vic));
  75. }
  76. struct sysdev_class s5p6440_sysclass = {
  77. .name = "s5p6440-core",
  78. };
  79. static struct sys_device s5p6440_sysdev = {
  80. .cls = &s5p6440_sysclass,
  81. };
  82. static int __init s5p6440_core_init(void)
  83. {
  84. return sysdev_class_register(&s5p6440_sysclass);
  85. }
  86. core_initcall(s5p6440_core_init);
  87. int __init s5p6440_init(void)
  88. {
  89. printk(KERN_INFO "S5P6440: Initializing architecture\n");
  90. /* set idle function */
  91. pm_idle = s5p6440_idle;
  92. return sysdev_register(&s5p6440_sysdev);
  93. }