isa.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. #include <asm/hardware/dec21285.h>
  14. #include "common.h"
  15. static struct resource rtc_resources[] = {
  16. [0] = {
  17. .start = 0x70,
  18. .end = 0x73,
  19. .flags = IORESOURCE_IO,
  20. },
  21. [1] = {
  22. .start = IRQ_ISA_RTC_ALARM,
  23. .end = IRQ_ISA_RTC_ALARM,
  24. .flags = IORESOURCE_IRQ,
  25. }
  26. };
  27. static struct platform_device rtc_device = {
  28. .name = "rtc_cmos",
  29. .id = -1,
  30. .resource = rtc_resources,
  31. .num_resources = ARRAY_SIZE(rtc_resources),
  32. };
  33. static struct resource serial_resources[] = {
  34. [0] = {
  35. .start = 0x3f8,
  36. .end = 0x3ff,
  37. .flags = IORESOURCE_IO,
  38. },
  39. [1] = {
  40. .start = 0x2f8,
  41. .end = 0x2ff,
  42. .flags = IORESOURCE_IO,
  43. },
  44. };
  45. static struct plat_serial8250_port serial_platform_data[] = {
  46. {
  47. .iobase = 0x3f8,
  48. .irq = IRQ_ISA_UART,
  49. .uartclk = 1843200,
  50. .regshift = 0,
  51. .iotype = UPIO_PORT,
  52. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  53. },
  54. {
  55. .iobase = 0x2f8,
  56. .irq = IRQ_ISA_UART2,
  57. .uartclk = 1843200,
  58. .regshift = 0,
  59. .iotype = UPIO_PORT,
  60. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  61. },
  62. { },
  63. };
  64. static struct platform_device serial_device = {
  65. .name = "serial8250",
  66. .id = PLAT8250_DEV_PLATFORM,
  67. .dev = {
  68. .platform_data = serial_platform_data,
  69. },
  70. .resource = serial_resources,
  71. .num_resources = ARRAY_SIZE(serial_resources),
  72. };
  73. static int __init footbridge_isa_init(void)
  74. {
  75. int err = 0;
  76. if (!footbridge_cfn_mode())
  77. return 0;
  78. /* Personal server doesn't have RTC */
  79. if (!machine_is_personal_server()) {
  80. isa_rtc_init();
  81. err = platform_device_register(&rtc_device);
  82. if (err)
  83. printk(KERN_ERR "Unable to register RTC device: %d\n", err);
  84. }
  85. err = platform_device_register(&serial_device);
  86. if (err)
  87. printk(KERN_ERR "Unable to register serial device: %d\n", err);
  88. return 0;
  89. }
  90. arch_initcall(footbridge_isa_init);