cpu.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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)S5P_VA_GPIO,
  44. .pfn = __phys_to_pfn(S5P6442_PA_GPIO),
  45. .length = SZ_4K,
  46. .type = MT_DEVICE,
  47. }, {
  48. .virtual = (unsigned long)VA_VIC0,
  49. .pfn = __phys_to_pfn(S5P6442_PA_VIC0),
  50. .length = SZ_16K,
  51. .type = MT_DEVICE,
  52. }, {
  53. .virtual = (unsigned long)VA_VIC1,
  54. .pfn = __phys_to_pfn(S5P6442_PA_VIC1),
  55. .length = SZ_16K,
  56. .type = MT_DEVICE,
  57. }, {
  58. .virtual = (unsigned long)VA_VIC2,
  59. .pfn = __phys_to_pfn(S5P6442_PA_VIC2),
  60. .length = SZ_16K,
  61. .type = MT_DEVICE,
  62. }, {
  63. .virtual = (unsigned long)S3C_VA_UART,
  64. .pfn = __phys_to_pfn(S3C_PA_UART),
  65. .length = SZ_512K,
  66. .type = MT_DEVICE,
  67. }
  68. };
  69. static void s5p6442_idle(void)
  70. {
  71. if (!need_resched())
  72. cpu_do_idle();
  73. local_irq_enable();
  74. }
  75. /*
  76. * s5p6442_map_io
  77. *
  78. * register the standard cpu IO areas
  79. */
  80. void __init s5p6442_map_io(void)
  81. {
  82. iotable_init(s5p6442_iodesc, ARRAY_SIZE(s5p6442_iodesc));
  83. }
  84. void __init s5p6442_init_clocks(int xtal)
  85. {
  86. printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
  87. s3c24xx_register_baseclocks(xtal);
  88. s5p_register_clocks(xtal);
  89. s5p6442_register_clocks();
  90. s5p6442_setup_clocks();
  91. }
  92. void __init s5p6442_init_irq(void)
  93. {
  94. /* S5P6442 supports 3 VIC */
  95. u32 vic[3];
  96. /* VIC0, VIC1, and VIC2: some interrupt reserved */
  97. vic[0] = 0x7fefffff;
  98. vic[1] = 0X7f389c81;
  99. vic[2] = 0X1bbbcfff;
  100. s5p_init_irq(vic, ARRAY_SIZE(vic));
  101. }
  102. struct sysdev_class s5p6442_sysclass = {
  103. .name = "s5p6442-core",
  104. };
  105. static struct sys_device s5p6442_sysdev = {
  106. .cls = &s5p6442_sysclass,
  107. };
  108. static int __init s5p6442_core_init(void)
  109. {
  110. return sysdev_class_register(&s5p6442_sysclass);
  111. }
  112. core_initcall(s5p6442_core_init);
  113. int __init s5p6442_init(void)
  114. {
  115. printk(KERN_INFO "S5P6442: Initializing architecture\n");
  116. /* set idle function */
  117. pm_idle = s5p6442_idle;
  118. return sysdev_register(&s5p6442_sysdev);
  119. }