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 <asm/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 <asm/hardware.h>
  27. #include <asm/hardware/iop3xx.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/mach/arch.h>
  30. #define IOP33X_UART_XTAL 33334000
  31. static struct plat_serial8250_port iop33x_uart0_data[] = {
  32. {
  33. .membase = (char *)IOP33X_UART0_VIRT,
  34. .mapbase = IOP33X_UART0_PHYS,
  35. .irq = IRQ_IOP33X_UART0,
  36. .uartclk = IOP33X_UART_XTAL,
  37. .regshift = 2,
  38. .iotype = UPIO_MEM,
  39. .flags = UPF_SKIP_TEST,
  40. },
  41. { },
  42. };
  43. static struct resource iop33x_uart0_resources[] = {
  44. [0] = {
  45. .start = IOP33X_UART0_PHYS,
  46. .end = IOP33X_UART0_PHYS + 0x3f,
  47. .flags = IORESOURCE_MEM,
  48. },
  49. [1] = {
  50. .start = IRQ_IOP33X_UART0,
  51. .end = IRQ_IOP33X_UART0,
  52. .flags = IORESOURCE_IRQ,
  53. },
  54. };
  55. struct platform_device iop33x_uart0_device = {
  56. .name = "serial8250",
  57. .id = PLAT8250_DEV_PLATFORM,
  58. .dev = {
  59. .platform_data = iop33x_uart0_data,
  60. },
  61. .num_resources = 2,
  62. .resource = iop33x_uart0_resources,
  63. };
  64. static struct resource iop33x_uart1_resources[] = {
  65. [0] = {
  66. .start = IOP33X_UART1_PHYS,
  67. .end = IOP33X_UART1_PHYS + 0x3f,
  68. .flags = IORESOURCE_MEM,
  69. },
  70. [1] = {
  71. .start = IRQ_IOP33X_UART1,
  72. .end = IRQ_IOP33X_UART1,
  73. .flags = IORESOURCE_IRQ,
  74. },
  75. };
  76. static struct plat_serial8250_port iop33x_uart1_data[] = {
  77. {
  78. .membase = (char *)IOP33X_UART1_VIRT,
  79. .mapbase = IOP33X_UART1_PHYS,
  80. .irq = IRQ_IOP33X_UART1,
  81. .uartclk = IOP33X_UART_XTAL,
  82. .regshift = 2,
  83. .iotype = UPIO_MEM,
  84. .flags = UPF_SKIP_TEST,
  85. },
  86. { },
  87. };
  88. struct platform_device iop33x_uart1_device = {
  89. .name = "serial8250",
  90. .id = PLAT8250_DEV_PLATFORM1,
  91. .dev = {
  92. .platform_data = iop33x_uart1_data,
  93. },
  94. .num_resources = 2,
  95. .resource = iop33x_uart1_resources,
  96. };