uart.c 2.2 KB

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