s3c2410.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // SPDX-License-Identifier: GPL-2.0
  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. #include <linux/kernel.h>
  8. #include <linux/types.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/list.h>
  11. #include <linux/timer.h>
  12. #include <linux/init.h>
  13. #include <linux/gpio.h>
  14. #include <linux/clk.h>
  15. #include <linux/device.h>
  16. #include <linux/syscore_ops.h>
  17. #include <linux/serial_core.h>
  18. #include <linux/serial_s3c.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/reboot.h>
  21. #include <linux/io.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/map.h>
  24. #include <asm/mach/irq.h>
  25. #include <mach/hardware.h>
  26. #include <mach/gpio-samsung.h>
  27. #include <asm/irq.h>
  28. #include <asm/system_misc.h>
  29. #include <plat/cpu-freq.h>
  30. #include <mach/regs-clock.h>
  31. #include <plat/cpu.h>
  32. #include <plat/devs.h>
  33. #include <plat/pm.h>
  34. #include <plat/gpio-core.h>
  35. #include <plat/gpio-cfg.h>
  36. #include <plat/gpio-cfg-helpers.h>
  37. #include "common.h"
  38. /* Initial IO mappings */
  39. static struct map_desc s3c2410_iodesc[] __initdata = {
  40. IODESC_ENT(CLKPWR),
  41. IODESC_ENT(TIMER),
  42. IODESC_ENT(WATCHDOG),
  43. };
  44. /* our uart devices */
  45. /* uart registration process */
  46. void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  47. {
  48. s3c24xx_init_uartdevs("s3c2410-uart", s3c2410_uart_resources, cfg, no);
  49. }
  50. /* s3c2410_map_io
  51. *
  52. * register the standard cpu IO areas, and any passed in from the
  53. * machine specific initialisation.
  54. */
  55. void __init s3c2410_map_io(void)
  56. {
  57. s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
  58. s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
  59. iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
  60. }
  61. struct bus_type s3c2410_subsys = {
  62. .name = "s3c2410-core",
  63. .dev_name = "s3c2410-core",
  64. };
  65. /* Note, we would have liked to name this s3c2410-core, but we cannot
  66. * register two subsystems with the same name.
  67. */
  68. struct bus_type s3c2410a_subsys = {
  69. .name = "s3c2410a-core",
  70. .dev_name = "s3c2410a-core",
  71. };
  72. static struct device s3c2410_dev = {
  73. .bus = &s3c2410_subsys,
  74. };
  75. /* need to register the subsystem before we actually register the device, and
  76. * we also need to ensure that it has been initialised before any of the
  77. * drivers even try to use it (even if not on an s3c2410 based system)
  78. * as a driver which may support both 2410 and 2440 may try and use it.
  79. */
  80. static int __init s3c2410_core_init(void)
  81. {
  82. return subsys_system_register(&s3c2410_subsys, NULL);
  83. }
  84. core_initcall(s3c2410_core_init);
  85. static int __init s3c2410a_core_init(void)
  86. {
  87. return subsys_system_register(&s3c2410a_subsys, NULL);
  88. }
  89. core_initcall(s3c2410a_core_init);
  90. int __init s3c2410_init(void)
  91. {
  92. printk("S3C2410: Initialising architecture\n");
  93. #ifdef CONFIG_PM_SLEEP
  94. register_syscore_ops(&s3c2410_pm_syscore_ops);
  95. register_syscore_ops(&s3c24xx_irq_syscore_ops);
  96. #endif
  97. return device_register(&s3c2410_dev);
  98. }
  99. int __init s3c2410a_init(void)
  100. {
  101. s3c2410_dev.bus = &s3c2410a_subsys;
  102. return s3c2410_init();
  103. }