dev-uart.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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) 2008 Maxime Bizon <mbizon@freebox.fr>
  7. */
  8. #include <linux/init.h>
  9. #include <linux/kernel.h>
  10. #include <linux/platform_device.h>
  11. #include <bcm63xx_cpu.h>
  12. #include <bcm63xx_dev_uart.h>
  13. static struct resource uart_resources[] = {
  14. {
  15. .start = -1, /* filled at runtime */
  16. .end = -1, /* filled at runtime */
  17. .flags = IORESOURCE_MEM,
  18. },
  19. {
  20. .start = -1, /* filled at runtime */
  21. .flags = IORESOURCE_IRQ,
  22. },
  23. };
  24. static struct platform_device bcm63xx_uart_device = {
  25. .name = "bcm63xx_uart",
  26. .id = 0,
  27. .num_resources = ARRAY_SIZE(uart_resources),
  28. .resource = uart_resources,
  29. };
  30. int __init bcm63xx_uart_register(void)
  31. {
  32. uart_resources[0].start = bcm63xx_regset_address(RSET_UART0);
  33. uart_resources[0].end = uart_resources[0].start;
  34. uart_resources[0].end += RSET_UART_SIZE - 1;
  35. uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
  36. return platform_device_register(&bcm63xx_uart_device);
  37. }