s3c2410.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* linux/arch/arm/mach-s3c2410/s3c2410.c
  2. *
  3. * Copyright (c) 2003-2005 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * http://www.simtec.co.uk/products/EB2410ITX/
  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/gpio.h>
  19. #include <linux/clk.h>
  20. #include <linux/device.h>
  21. #include <linux/syscore_ops.h>
  22. #include <linux/serial_core.h>
  23. #include <linux/serial_s3c.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/reboot.h>
  26. #include <linux/io.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <asm/mach/irq.h>
  30. #include <mach/hardware.h>
  31. #include <mach/gpio-samsung.h>
  32. #include <asm/irq.h>
  33. #include <asm/system_misc.h>
  34. #include <plat/cpu-freq.h>
  35. #include <mach/regs-clock.h>
  36. #include <plat/cpu.h>
  37. #include <plat/devs.h>
  38. #include <plat/clock.h>
  39. #include <plat/pll.h>
  40. #include <plat/pm.h>
  41. #include <plat/watchdog-reset.h>
  42. #include <plat/gpio-core.h>
  43. #include <plat/gpio-cfg.h>
  44. #include <plat/gpio-cfg-helpers.h>
  45. #include "common.h"
  46. /* Initial IO mappings */
  47. static struct map_desc s3c2410_iodesc[] __initdata = {
  48. IODESC_ENT(CLKPWR),
  49. IODESC_ENT(TIMER),
  50. IODESC_ENT(WATCHDOG),
  51. };
  52. /* our uart devices */
  53. /* uart registration process */
  54. void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  55. {
  56. s3c24xx_init_uartdevs("s3c2410-uart", s3c2410_uart_resources, cfg, no);
  57. }
  58. /* s3c2410_map_io
  59. *
  60. * register the standard cpu IO areas, and any passed in from the
  61. * machine specific initialisation.
  62. */
  63. void __init s3c2410_map_io(void)
  64. {
  65. s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
  66. s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
  67. iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
  68. }
  69. void __init_or_cpufreq s3c2410_setup_clocks(void)
  70. {
  71. }
  72. struct bus_type s3c2410_subsys = {
  73. .name = "s3c2410-core",
  74. .dev_name = "s3c2410-core",
  75. };
  76. /* Note, we would have liked to name this s3c2410-core, but we cannot
  77. * register two subsystems with the same name.
  78. */
  79. struct bus_type s3c2410a_subsys = {
  80. .name = "s3c2410a-core",
  81. .dev_name = "s3c2410a-core",
  82. };
  83. static struct device s3c2410_dev = {
  84. .bus = &s3c2410_subsys,
  85. };
  86. /* need to register the subsystem before we actually register the device, and
  87. * we also need to ensure that it has been initialised before any of the
  88. * drivers even try to use it (even if not on an s3c2410 based system)
  89. * as a driver which may support both 2410 and 2440 may try and use it.
  90. */
  91. static int __init s3c2410_core_init(void)
  92. {
  93. return subsys_system_register(&s3c2410_subsys, NULL);
  94. }
  95. core_initcall(s3c2410_core_init);
  96. static int __init s3c2410a_core_init(void)
  97. {
  98. return subsys_system_register(&s3c2410a_subsys, NULL);
  99. }
  100. core_initcall(s3c2410a_core_init);
  101. int __init s3c2410_init(void)
  102. {
  103. printk("S3C2410: Initialising architecture\n");
  104. #ifdef CONFIG_PM
  105. register_syscore_ops(&s3c2410_pm_syscore_ops);
  106. register_syscore_ops(&s3c24xx_irq_syscore_ops);
  107. #endif
  108. return device_register(&s3c2410_dev);
  109. }
  110. int __init s3c2410a_init(void)
  111. {
  112. s3c2410_dev.bus = &s3c2410a_subsys;
  113. return s3c2410_init();
  114. }
  115. void s3c2410_restart(enum reboot_mode mode, const char *cmd)
  116. {
  117. if (mode == REBOOT_SOFT) {
  118. soft_restart(0);
  119. }
  120. samsung_wdt_reset();
  121. /* we'll take a jump through zero as a poor second */
  122. soft_restart(0);
  123. }