s3c2416.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // SPDX-License-Identifier: GPL-2.0+
  2. //
  3. // Copyright (c) 2009 Yauhen Kharuzhy <[email protected]>,
  4. // as part of OpenInkpot project
  5. // Copyright (c) 2009 Promwad Innovation Company
  6. // Yauhen Kharuzhy <[email protected]>
  7. //
  8. // Samsung S3C2416 Mobile CPU support
  9. #include <linux/kernel.h>
  10. #include <linux/types.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/list.h>
  13. #include <linux/timer.h>
  14. #include <linux/init.h>
  15. #include <linux/gpio.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/serial_core.h>
  18. #include <linux/device.h>
  19. #include <linux/syscore_ops.h>
  20. #include <linux/clk.h>
  21. #include <linux/io.h>
  22. #include <linux/reboot.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/map.h>
  25. #include <asm/mach/irq.h>
  26. #include "map.h"
  27. #include "gpio-samsung.h"
  28. #include <asm/proc-fns.h>
  29. #include <asm/irq.h>
  30. #include <asm/system_misc.h>
  31. #include "regs-s3c2443-clock.h"
  32. #include "rtc-core-s3c24xx.h"
  33. #include "gpio-core.h"
  34. #include "gpio-cfg.h"
  35. #include "gpio-cfg-helpers.h"
  36. #include "devs.h"
  37. #include "cpu.h"
  38. #include "sdhci.h"
  39. #include "pm.h"
  40. #include "iic-core.h"
  41. #include "adc-core.h"
  42. #include "s3c24xx.h"
  43. #include "fb-core-s3c24xx.h"
  44. #include "nand-core-s3c24xx.h"
  45. #include "spi-core-s3c24xx.h"
  46. static struct map_desc s3c2416_iodesc[] __initdata __maybe_unused = {
  47. IODESC_ENT(WATCHDOG),
  48. IODESC_ENT(CLKPWR),
  49. IODESC_ENT(TIMER),
  50. };
  51. struct bus_type s3c2416_subsys = {
  52. .name = "s3c2416-core",
  53. .dev_name = "s3c2416-core",
  54. };
  55. static struct device s3c2416_dev = {
  56. .bus = &s3c2416_subsys,
  57. };
  58. int __init s3c2416_init(void)
  59. {
  60. printk(KERN_INFO "S3C2416: Initializing architecture\n");
  61. /* change WDT IRQ number */
  62. s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
  63. s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
  64. /* the i2c devices are directly compatible with s3c2440 */
  65. s3c_i2c0_setname("s3c2440-i2c");
  66. s3c_i2c1_setname("s3c2440-i2c");
  67. s3c_fb_setname("s3c2443-fb");
  68. s3c_adc_setname("s3c2416-adc");
  69. s3c_rtc_setname("s3c2416-rtc");
  70. #ifdef CONFIG_PM_SLEEP
  71. register_syscore_ops(&s3c2416_pm_syscore_ops);
  72. register_syscore_ops(&s3c24xx_irq_syscore_ops);
  73. register_syscore_ops(&s3c2416_irq_syscore_ops);
  74. #endif
  75. return device_register(&s3c2416_dev);
  76. }
  77. void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  78. {
  79. s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
  80. s3c_nand_setname("s3c2412-nand");
  81. }
  82. /* s3c2416_map_io
  83. *
  84. * register the standard cpu IO areas, and any passed in from the
  85. * machine specific initialisation.
  86. */
  87. void __init s3c2416_map_io(void)
  88. {
  89. s3c24xx_gpiocfg_default.set_pull = samsung_gpio_setpull_updown;
  90. s3c24xx_gpiocfg_default.get_pull = samsung_gpio_getpull_updown;
  91. /* initialize device information early */
  92. s3c2416_default_sdhci0();
  93. s3c2416_default_sdhci1();
  94. s3c24xx_spi_setname("s3c2443-spi");
  95. iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
  96. }
  97. /* need to register the subsystem before we actually register the device, and
  98. * we also need to ensure that it has been initialised before any of the
  99. * drivers even try to use it (even if not on an s3c2416 based system)
  100. * as a driver which may support both 2443 and 2440 may try and use it.
  101. */
  102. static int __init s3c2416_core_init(void)
  103. {
  104. return subsys_system_register(&s3c2416_subsys, NULL);
  105. }
  106. core_initcall(s3c2416_core_init);