s3c2440.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* linux/arch/arm/mach-s3c2440/s3c2440.c
  2. *
  3. * Copyright (c) 2004-2006 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * Samsung S3C2440 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/device.h>
  21. #include <linux/syscore_ops.h>
  22. #include <linux/gpio.h>
  23. #include <linux/clk.h>
  24. #include <linux/io.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/mach/irq.h>
  28. #include <mach/hardware.h>
  29. #include <asm/irq.h>
  30. #include <plat/devs.h>
  31. #include <plat/cpu.h>
  32. #include <plat/s3c244x.h>
  33. #include <plat/pm.h>
  34. #include <plat/watchdog-reset.h>
  35. #include <plat/gpio-core.h>
  36. #include <plat/gpio-cfg.h>
  37. #include <plat/gpio-cfg-helpers.h>
  38. static struct device s3c2440_dev = {
  39. .bus = &s3c2440_subsys,
  40. };
  41. int __init s3c2440_init(void)
  42. {
  43. printk("S3C2440: Initialising architecture\n");
  44. /* change irq for watchdog */
  45. s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
  46. s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT;
  47. /* register suspend/resume handlers */
  48. #ifdef CONFIG_PM
  49. register_syscore_ops(&s3c2410_pm_syscore_ops);
  50. #endif
  51. register_syscore_ops(&s3c244x_pm_syscore_ops);
  52. register_syscore_ops(&s3c24xx_irq_syscore_ops);
  53. /* register our system device for everything else */
  54. return device_register(&s3c2440_dev);
  55. }
  56. void __init s3c2440_map_io(void)
  57. {
  58. s3c244x_map_io();
  59. s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
  60. s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
  61. }
  62. void s3c2440_restart(char mode, const char *cmd)
  63. {
  64. if (mode == 's') {
  65. soft_restart(0);
  66. }
  67. arch_wdt_reset();
  68. /* we'll take a jump through zero as a poor second */
  69. soft_restart(0);
  70. }