s3c2443.c 2.6 KB

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