uart.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * arch/arm/mach-iop33x/uart.c
  3. *
  4. * Author: Dave Jiang (dave.jiang@intel.com)
  5. * Copyright (C) 2004 Intel Corporation.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/mm.h>
  12. #include <linux/init.h>
  13. #include <linux/major.h>
  14. #include <linux/fs.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/serial.h>
  17. #include <linux/tty.h>
  18. #include <linux/serial_8250.h>
  19. #include <linux/io.h>
  20. #include <asm/pgtable.h>
  21. #include <asm/page.h>
  22. #include <asm/mach/map.h>
  23. #include <asm/setup.h>
  24. #include <asm/system.h>
  25. #include <asm/memory.h>
  26. #include <mach/hardware.h>
  27. #include <asm/hardware/iop3xx.h>
  28. #include <asm/mach/arch.h>
  29. #define IOP33X_UART_XTAL 33334000
  30. static struct plat_serial8250_port iop33x_uart0_data[] = {
  31. {
  32. .membase = (char *)IOP33X_UART0_VIRT,
  33. .mapbase = IOP33X_UART0_PHYS,
  34. .irq = IRQ_IOP33X_UART0,
  35. .uartclk = IOP33X_UART_XTAL,
  36. .regshift = 2,
  37. .iotype = UPIO_MEM,
  38. .flags = UPF_SKIP_TEST,
  39. },
  40. { },
  41. };
  42. static struct resource iop33x_uart0_resources[] = {
  43. [0] = {
  44. .start = IOP33X_UART0_PHYS,
  45. .end = IOP33X_UART0_PHYS + 0x3f,
  46. .flags = IORESOURCE_MEM,
  47. },
  48. [1] = {
  49. .start = IRQ_IOP33X_UART0,
  50. .end = IRQ_IOP33X_UART0,
  51. .flags = IORESOURCE_IRQ,
  52. },
  53. };
  54. struct platform_device iop33x_uart0_device = {
  55. .name = "serial8250",
  56. .id = PLAT8250_DEV_PLATFORM,
  57. .dev = {
  58. .platform_data = iop33x_uart0_data,
  59. },
  60. .num_resources = 2,
  61. .resource = iop33x_uart0_resources,
  62. };
  63. static struct resource iop33x_uart1_resources[] = {
  64. [0] = {
  65. .start = IOP33X_UART1_PHYS,
  66. .end = IOP33X_UART1_PHYS + 0x3f,
  67. .flags = IORESOURCE_MEM,
  68. },
  69. [1] = {
  70. .start = IRQ_IOP33X_UART1,
  71. .end = IRQ_IOP33X_UART1,
  72. .flags = IORESOURCE_IRQ,
  73. },
  74. };
  75. static struct plat_serial8250_port iop33x_uart1_data[] = {
  76. {
  77. .membase = (char *)IOP33X_UART1_VIRT,
  78. .mapbase = IOP33X_UART1_PHYS,
  79. .irq = IRQ_IOP33X_UART1,
  80. .uartclk = IOP33X_UART_XTAL,
  81. .regshift = 2,
  82. .iotype = UPIO_MEM,
  83. .flags = UPF_SKIP_TEST,
  84. },
  85. { },
  86. };
  87. struct platform_device iop33x_uart1_device = {
  88. .name = "serial8250",
  89. .id = PLAT8250_DEV_PLATFORM1,
  90. .dev = {
  91. .platform_data = iop33x_uart1_data,
  92. },
  93. .num_resources = 2,
  94. .resource = iop33x_uart1_resources,
  95. };