ddb5477-platform.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/module.h>
  10. #include <linux/serial_8250.h>
  11. #include <asm/ddb5xxx/ddb5477.h>
  12. #define DDB_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
  13. #define DDB5477_PORT(base, int) \
  14. { \
  15. .mapbase = base, \
  16. .irq = int, \
  17. .uartclk = 1843200, \
  18. .iotype = UPIO_MEM, \
  19. .flags = DDB_UART_FLAGS, \
  20. .regshift = 3, \
  21. }
  22. static struct plat_serial8250_port uart8250_data[] = {
  23. DDB5477_PORT(0xbfa04200, VRC5477_IRQ_UART0),
  24. DDB5477_PORT(0xbfa04240, VRC5477_IRQ_UART1),
  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("8250 UART probe driver for the NEC DDB5477");