s3c2443.c 2.9 KB

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