8250-platform.c 1.1 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/module.h>
  9. #include <linux/init.h>
  10. #include <linux/serial_8250.h>
  11. #define PORT(base, int) \
  12. { \
  13. .iobase = base, \
  14. .irq = int, \
  15. .uartclk = 1843200, \
  16. .iotype = UPIO_PORT, \
  17. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
  18. .regshift = 0, \
  19. }
  20. static struct plat_serial8250_port uart8250_data[] = {
  21. PORT(0x3F8, 4),
  22. PORT(0x2F8, 3),
  23. PORT(0x3E8, 4),
  24. PORT(0x2E8, 3),
  25. { },
  26. };
  27. static struct platform_device uart8250_device = {
  28. .name = "serial8250",
  29. .id = PLAT8250_DEV_PLATFORM,
  30. .dev = {
  31. .platform_data = uart8250_data,
  32. },
  33. };
  34. static int __init uart8250_init(void)
  35. {
  36. return platform_device_register(&uart8250_device);
  37. }
  38. module_init(uart8250_init);
  39. MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
  40. MODULE_LICENSE("GPL");
  41. MODULE_DESCRIPTION("Generic 8250 UART probe driver");