Commit cba774ae8731699d39cbaf979aa4a0b351045924

Authored by Russell King
Committed by Russell King
1 parent 883042d6ea

[ARM] Add rtc-cmos driver for ISA-based footbridge platforms

... but the rtc-cmos is rather broken; if PNP is enabled, it assumes
that we have ACPI (!) which is quite bogus on these platforms -
which may have ISAPNP but not ACPI.  Something to be solved in the
future.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Showing 1 changed file with 44 additions and 1 deletions Side-by-side Diff

arch/arm/mach-footbridge/isa.c
... ... @@ -12,6 +12,39 @@
12 12  
13 13 #include <asm/irq.h>
14 14  
  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 +
  28 +static struct platform_device rtc_device = {
  29 + .name = "rtc_cmos",
  30 + .id = -1,
  31 + .resource = rtc_resources,
  32 + .num_resources = ARRAY_SIZE(rtc_resources),
  33 +};
  34 +
  35 +static struct resource serial_resources[] = {
  36 + [0] = {
  37 + .start = 0x3f8,
  38 + .end = 0x3ff,
  39 + .flags = IORESOURCE_IO,
  40 + },
  41 + [1] = {
  42 + .start = 0x2f8,
  43 + .end = 0x2ff,
  44 + .flags = IORESOURCE_IO,
  45 + },
  46 +};
  47 +
15 48 static struct plat_serial8250_port serial_platform_data[] = {
16 49 {
17 50 .iobase = 0x3f8,
18 51  
... ... @@ -38,11 +71,21 @@
38 71 .dev = {
39 72 .platform_data = serial_platform_data,
40 73 },
  74 + .resource = serial_resources,
  75 + .num_resources = ARRAY_SIZE(serial_resources),
41 76 };
42 77  
43 78 static int __init footbridge_isa_init(void)
44 79 {
45   - return platform_device_register(&serial_device);
  80 + int err;
  81 +
  82 + err = platform_device_register(&rtc_device);
  83 + if (err)
  84 + printk(KERN_ERR "Unable to register RTC device: %d\n", err);
  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;
46 89 }
47 90  
48 91 arch_initcall(footbridge_isa_init);