cpu.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* linux/arch/arm/mach-s5p6442/cpu.c
  2. *
  3. * Copyright (c) 2010 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 <linux/sched.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/map.h>
  24. #include <asm/mach/irq.h>
  25. #include <asm/proc-fns.h>
  26. #include <mach/hardware.h>
  27. #include <mach/map.h>
  28. #include <asm/irq.h>
  29. #include <plat/regs-serial.h>
  30. #include <mach/regs-clock.h>
  31. #include <plat/cpu.h>
  32. #include <plat/devs.h>
  33. #include <plat/clock.h>
  34. #include <plat/s5p6442.h>
  35. /* Initial IO mappings */
  36. static struct map_desc s5p6442_iodesc[] __initdata = {
  37. {
  38. .virtual = (unsigned long)S5P_VA_SYSTIMER,
  39. .pfn = __phys_to_pfn(S5P6442_PA_SYSTIMER),
  40. .length = SZ_16K,
  41. .type = MT_DEVICE,
  42. }, {
  43. .virtual = (unsigned long)VA_VIC2,
  44. .pfn = __phys_to_pfn(S5P6442_PA_VIC2),
  45. .length = SZ_16K,
  46. .type = MT_DEVICE,
  47. }
  48. };
  49. static void s5p6442_idle(void)
  50. {
  51. if (!need_resched())
  52. cpu_do_idle();
  53. local_irq_enable();
  54. }
  55. /* s5p6442_map_io
  56. *
  57. * register the standard cpu IO areas
  58. */
  59. void __init s5p6442_map_io(void)
  60. {
  61. iotable_init(s5p6442_iodesc, ARRAY_SIZE(s5p6442_iodesc));
  62. }
  63. void __init s5p6442_init_clocks(int xtal)
  64. {
  65. printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
  66. s3c24xx_register_baseclocks(xtal);
  67. s5p_register_clocks(xtal);
  68. s5p6442_register_clocks();
  69. s5p6442_setup_clocks();
  70. }
  71. void __init s5p6442_init_irq(void)
  72. {
  73. /* S5P6442 supports 3 VIC */
  74. u32 vic[3];
  75. /* VIC0, VIC1, and VIC2: some interrupt reserved */
  76. vic[0] = 0x7fefffff;
  77. vic[1] = 0X7f389c81;
  78. vic[2] = 0X1bbbcfff;
  79. s5p_init_irq(vic, ARRAY_SIZE(vic));
  80. }
  81. struct sysdev_class s5p6442_sysclass = {
  82. .name = "s5p6442-core",
  83. };
  84. static struct sys_device s5p6442_sysdev = {
  85. .cls = &s5p6442_sysclass,
  86. };
  87. static int __init s5p6442_core_init(void)
  88. {
  89. return sysdev_class_register(&s5p6442_sysclass);
  90. }
  91. core_initcall(s5p6442_core_init);
  92. int __init s5p6442_init(void)
  93. {
  94. printk(KERN_INFO "S5P6442: Initializing architecture\n");
  95. /* set idle function */
  96. pm_idle = s5p6442_idle;
  97. return sysdev_register(&s5p6442_sysdev);
  98. }