isa.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * linux/arch/arm/mach-footbridge/isa.c
  3. *
  4. * Copyright (C) 2004 Russell King.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/serial_8250.h>
  12. #include <asm/irq.h>
  13. static struct resource rtc_resources[] = {
  14. [0] = {
  15. .start = 0x70,
  16. .end = 0x73,
  17. .flags = IORESOURCE_IO,
  18. },
  19. [1] = {
  20. .start = IRQ_ISA_RTC_ALARM,
  21. .end = IRQ_ISA_RTC_ALARM,
  22. .flags = IORESOURCE_IRQ,
  23. }
  24. };
  25. static struct platform_device rtc_device = {
  26. .name = "rtc_cmos",
  27. .id = -1,
  28. .resource = rtc_resources,
  29. .num_resources = ARRAY_SIZE(rtc_resources),
  30. };
  31. static struct resource serial_resources[] = {
  32. [0] = {
  33. .start = 0x3f8,
  34. .end = 0x3ff,
  35. .flags = IORESOURCE_IO,
  36. },
  37. [1] = {
  38. .start = 0x2f8,
  39. .end = 0x2ff,
  40. .flags = IORESOURCE_IO,
  41. },
  42. };
  43. static struct plat_serial8250_port serial_platform_data[] = {
  44. {
  45. .iobase = 0x3f8,
  46. .irq = IRQ_ISA_UART,
  47. .uartclk = 1843200,
  48. .regshift = 0,
  49. .iotype = UPIO_PORT,
  50. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  51. },
  52. {
  53. .iobase = 0x2f8,
  54. .irq = IRQ_ISA_UART2,
  55. .uartclk = 1843200,
  56. .regshift = 0,
  57. .iotype = UPIO_PORT,
  58. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  59. },
  60. { },
  61. };
  62. static struct platform_device serial_device = {
  63. .name = "serial8250",
  64. .id = PLAT8250_DEV_PLATFORM,
  65. .dev = {
  66. .platform_data = serial_platform_data,
  67. },
  68. .resource = serial_resources,
  69. .num_resources = ARRAY_SIZE(serial_resources),
  70. };
  71. static int __init footbridge_isa_init(void)
  72. {
  73. int err;
  74. err = platform_device_register(&rtc_device);
  75. if (err)
  76. printk(KERN_ERR "Unable to register RTC device: %d\n", err);
  77. err = platform_device_register(&serial_device);
  78. if (err)
  79. printk(KERN_ERR "Unable to register serial device: %d\n", err);
  80. return 0;
  81. }
  82. arch_initcall(footbridge_isa_init);