s3c2443.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/platform_device.h>
  19. #include <linux/serial_core.h>
  20. #include <linux/sysdev.h>
  21. #include <linux/clk.h>
  22. #include <linux/io.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/map.h>
  25. #include <asm/mach/irq.h>
  26. #include <mach/hardware.h>
  27. #include <asm/irq.h>
  28. #include <mach/regs-s3c2443-clock.h>
  29. #include <mach/reset.h>
  30. #include <asm/plat-s3c24xx/s3c2443.h>
  31. #include <asm/plat-s3c24xx/devs.h>
  32. #include <asm/plat-s3c24xx/cpu.h>
  33. static struct map_desc s3c2443_iodesc[] __initdata = {
  34. IODESC_ENT(WATCHDOG),
  35. IODESC_ENT(CLKPWR),
  36. IODESC_ENT(TIMER),
  37. };
  38. struct sysdev_class s3c2443_sysclass = {
  39. .name = "s3c2443-core",
  40. };
  41. static struct sys_device s3c2443_sysdev = {
  42. .cls = &s3c2443_sysclass,
  43. };
  44. static void s3c2443_hard_reset(void)
  45. {
  46. __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST);
  47. }
  48. int __init s3c2443_init(void)
  49. {
  50. printk("S3C2443: Initialising architecture\n");
  51. s3c24xx_reset_hook = s3c2443_hard_reset;
  52. s3c_device_nand.name = "s3c2412-nand";
  53. /* change WDT IRQ number */
  54. s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
  55. s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
  56. return sysdev_register(&s3c2443_sysdev);
  57. }
  58. void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  59. {
  60. s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
  61. }
  62. /* s3c2443_map_io
  63. *
  64. * register the standard cpu IO areas, and any passed in from the
  65. * machine specific initialisation.
  66. */
  67. void __init s3c2443_map_io(struct map_desc *mach_desc, int mach_size)
  68. {
  69. iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
  70. iotable_init(mach_desc, mach_size);
  71. }
  72. /* need to register class before we actually register the device, and
  73. * we also need to ensure that it has been initialised before any of the
  74. * drivers even try to use it (even if not on an s3c2443 based system)
  75. * as a driver which may support both 2443 and 2440 may try and use it.
  76. */
  77. static int __init s3c2443_core_init(void)
  78. {
  79. return sysdev_class_register(&s3c2443_sysclass);
  80. }
  81. core_initcall(s3c2443_core_init);