8250-platform.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
  7. */
  8. #include <linux/init.h>
  9. #include <linux/serial_8250.h>
  10. #define PORT(base, int) \
  11. { \
  12. .iobase = base, \
  13. .irq = int, \
  14. .uartclk = 1843200, \
  15. .iotype = UPIO_PORT, \
  16. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
  17. .regshift = 0, \
  18. }
  19. static struct plat_serial8250_port uart8250_data[] = {
  20. PORT(0x3F8, 4),
  21. PORT(0x2F8, 3),
  22. PORT(0x3E8, 4),
  23. PORT(0x2E8, 3),
  24. { },
  25. };
  26. static struct platform_device uart8250_device = {
  27. .name = "serial8250",
  28. .id = PLAT8250_DEV_PLATFORM,
  29. .dev = {
  30. .platform_data = uart8250_data,
  31. },
  32. };
  33. static int __init uart8250_init(void)
  34. {
  35. return platform_device_register(&uart8250_device);
  36. }
  37. module_init(uart8250_init);
  38. MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
  39. MODULE_LICENSE("GPL");
  40. MODULE_DESCRIPTION("Generic 8250 UART probe driver");