s3c2443.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright (c) 2007 Simtec Electronics
  4. // Ben Dooks <[email protected]>
  5. //
  6. // Samsung S3C2443 Mobile CPU support
  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/platform_device.h>
  15. #include <linux/serial_core.h>
  16. #include <linux/device.h>
  17. #include <linux/clk.h>
  18. #include <linux/io.h>
  19. #include <linux/reboot.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach/map.h>
  22. #include <asm/mach/irq.h>
  23. #include "map.h"
  24. #include "gpio-samsung.h"
  25. #include "irqs.h"
  26. #include <asm/irq.h>
  27. #include <asm/system_misc.h>
  28. #include "regs-s3c2443-clock.h"
  29. #include "rtc-core-s3c24xx.h"
  30. #include "gpio-core.h"
  31. #include "gpio-cfg.h"
  32. #include "gpio-cfg-helpers.h"
  33. #include "devs.h"
  34. #include "cpu.h"
  35. #include "adc-core.h"
  36. #include "s3c24xx.h"
  37. #include "fb-core-s3c24xx.h"
  38. #include "nand-core-s3c24xx.h"
  39. #include "spi-core-s3c24xx.h"
  40. static struct map_desc s3c2443_iodesc[] __initdata __maybe_unused = {
  41. IODESC_ENT(WATCHDOG),
  42. IODESC_ENT(CLKPWR),
  43. IODESC_ENT(TIMER),
  44. };
  45. struct bus_type s3c2443_subsys = {
  46. .name = "s3c2443-core",
  47. .dev_name = "s3c2443-core",
  48. };
  49. static struct device s3c2443_dev = {
  50. .bus = &s3c2443_subsys,
  51. };
  52. int __init s3c2443_init(void)
  53. {
  54. printk("S3C2443: Initialising architecture\n");
  55. s3c_nand_setname("s3c2412-nand");
  56. s3c_fb_setname("s3c2443-fb");
  57. s3c_adc_setname("s3c2443-adc");
  58. s3c_rtc_setname("s3c2443-rtc");
  59. /* change WDT IRQ number */
  60. s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
  61. s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
  62. return device_register(&s3c2443_dev);
  63. }
  64. void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  65. {
  66. s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
  67. }
  68. /* s3c2443_map_io
  69. *
  70. * register the standard cpu IO areas, and any passed in from the
  71. * machine specific initialisation.
  72. */
  73. void __init s3c2443_map_io(void)
  74. {
  75. s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
  76. s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
  77. /* initialize device information early */
  78. s3c24xx_spi_setname("s3c2443-spi");
  79. iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
  80. }
  81. /* need to register the subsystem before we actually register the device, and
  82. * we also need to ensure that it has been initialised before any of the
  83. * drivers even try to use it (even if not on an s3c2443 based system)
  84. * as a driver which may support both 2443 and 2440 may try and use it.
  85. */
  86. static int __init s3c2443_core_init(void)
  87. {
  88. return subsys_system_register(&s3c2443_subsys, NULL);
  89. }
  90. core_initcall(s3c2443_core_init);