/arch/arm/mach-s3c2410/mach-rx3715.c

https://bitbucket.org/evzijst/gittest · C · 141 lines · 104 code · 16 blank · 21 comment · 0 complexity · ec7569db56e149e7538608ef478cecdf MD5 · raw file

  1. /* linux/arch/arm/mach-s3c2410/mach-rx3715.c
  2. *
  3. * Copyright (c) 2003,2004 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * http://www.handhelds.org/projects/rx3715.html
  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. * Modifications:
  13. * 16-Sep-2004 BJD Copied from mach-h1940.c
  14. * 25-Oct-2004 BJD Updates for 2.6.10-rc1
  15. * 10-Jan-2005 BJD Removed include of s3c2410.h s3c2440.h
  16. * 14-Jan-2005 BJD Added new clock init
  17. * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
  18. * 14-Mar-2005 BJD Fixed __iomem warnings
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/types.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/list.h>
  24. #include <linux/timer.h>
  25. #include <linux/init.h>
  26. #include <linux/tty.h>
  27. #include <linux/console.h>
  28. #include <linux/serial_core.h>
  29. #include <linux/serial.h>
  30. #include <asm/mach/arch.h>
  31. #include <asm/mach/map.h>
  32. #include <asm/mach/irq.h>
  33. #include <asm/hardware.h>
  34. #include <asm/hardware/iomd.h>
  35. #include <asm/io.h>
  36. #include <asm/irq.h>
  37. #include <asm/mach-types.h>
  38. #include <asm/arch/regs-serial.h>
  39. #include <asm/arch/regs-gpio.h>
  40. #include "clock.h"
  41. #include "devs.h"
  42. #include "cpu.h"
  43. #include "pm.h"
  44. static struct map_desc rx3715_iodesc[] __initdata = {
  45. /* dump ISA space somewhere unused */
  46. { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS3, SZ_16M, MT_DEVICE },
  47. { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS3, SZ_16M, MT_DEVICE },
  48. };
  49. static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
  50. [0] = {
  51. .name = "fclk",
  52. .divisor = 0,
  53. .min_baud = 0,
  54. .max_baud = 0,
  55. }
  56. };
  57. static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
  58. [0] = {
  59. .hwport = 0,
  60. .flags = 0,
  61. .ucon = 0x3c5,
  62. .ulcon = 0x03,
  63. .ufcon = 0x51,
  64. .clocks = rx3715_serial_clocks,
  65. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  66. },
  67. [1] = {
  68. .hwport = 1,
  69. .flags = 0,
  70. .ucon = 0x3c5,
  71. .ulcon = 0x03,
  72. .ufcon = 0x00,
  73. .clocks = rx3715_serial_clocks,
  74. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  75. },
  76. /* IR port */
  77. [2] = {
  78. .hwport = 2,
  79. .uart_flags = UPF_CONS_FLOW,
  80. .ucon = 0x3c5,
  81. .ulcon = 0x43,
  82. .ufcon = 0x51,
  83. .clocks = rx3715_serial_clocks,
  84. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  85. }
  86. };
  87. static struct platform_device *rx3715_devices[] __initdata = {
  88. &s3c_device_usb,
  89. &s3c_device_lcd,
  90. &s3c_device_wdt,
  91. &s3c_device_i2c,
  92. &s3c_device_iis,
  93. };
  94. static struct s3c24xx_board rx3715_board __initdata = {
  95. .devices = rx3715_devices,
  96. .devices_count = ARRAY_SIZE(rx3715_devices)
  97. };
  98. void __init rx3715_map_io(void)
  99. {
  100. s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
  101. s3c24xx_init_clocks(16934000);
  102. s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
  103. s3c24xx_set_board(&rx3715_board);
  104. }
  105. void __init rx3715_init_irq(void)
  106. {
  107. s3c24xx_init_irq();
  108. }
  109. #ifdef CONFIG_PM
  110. static void __init rx3715_init_machine(void)
  111. {
  112. s3c2410_pm_init();
  113. }
  114. #else
  115. #define rx3715_init_machine NULL
  116. #endif
  117. MACHINE_START(RX3715, "IPAQ-RX3715")
  118. MAINTAINER("Ben Dooks <ben@fluff.org>")
  119. BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART)
  120. BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
  121. MAPIO(rx3715_map_io)
  122. INITIRQ(rx3715_init_irq)
  123. INIT_MACHINE(rx3715_init_machine)
  124. .timer = &s3c24xx_timer,
  125. MACHINE_END