isa.c 1.8 KB

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