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. static struct resource uart_resources[] = {
  13. {
  14. .start = -1, /* filled at runtime */
  15. .end = -1, /* filled at runtime */
  16. .flags = IORESOURCE_MEM,
  17. },
  18. {
  19. .start = -1, /* filled at runtime */
  20. .flags = IORESOURCE_IRQ,
  21. },
  22. };
  23. static struct platform_device bcm63xx_uart_device = {
  24. .name = "bcm63xx_uart",
  25. .id = 0,
  26. .num_resources = ARRAY_SIZE(uart_resources),
  27. .resource = uart_resources,
  28. };
  29. int __init bcm63xx_uart_register(void)
  30. {
  31. uart_resources[0].start = bcm63xx_regset_address(RSET_UART0);
  32. uart_resources[0].end = uart_resources[0].start;
  33. uart_resources[0].end += RSET_UART_SIZE - 1;
  34. uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
  35. return platform_device_register(&bcm63xx_uart_device);
  36. }
  37. arch_initcall(bcm63xx_uart_register);