cpu.c 2.4 KB

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