Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
| 13 | #include <asm/irq.h> |
| 14 | |
Russell King | cba774a | 2007-09-30 17:39:05 +0100 | [diff] [blame] | 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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | static struct plat_serial8250_port serial_platform_data[] = { |
| 49 | { |
| 50 | .iobase = 0x3f8, |
| 51 | .irq = IRQ_ISA_UART, |
| 52 | .uartclk = 1843200, |
| 53 | .regshift = 0, |
| 54 | .iotype = UPIO_PORT, |
| 55 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
| 56 | }, |
| 57 | { |
| 58 | .iobase = 0x2f8, |
| 59 | .irq = IRQ_ISA_UART2, |
| 60 | .uartclk = 1843200, |
| 61 | .regshift = 0, |
| 62 | .iotype = UPIO_PORT, |
| 63 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
| 64 | }, |
| 65 | { }, |
| 66 | }; |
| 67 | |
| 68 | static struct platform_device serial_device = { |
| 69 | .name = "serial8250", |
Russell King | 6df29de | 2005-09-08 16:04:41 +0100 | [diff] [blame] | 70 | .id = PLAT8250_DEV_PLATFORM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | .dev = { |
| 72 | .platform_data = serial_platform_data, |
| 73 | }, |
Russell King | cba774a | 2007-09-30 17:39:05 +0100 | [diff] [blame] | 74 | .resource = serial_resources, |
| 75 | .num_resources = ARRAY_SIZE(serial_resources), |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | static int __init footbridge_isa_init(void) |
| 79 | { |
Russell King | cba774a | 2007-09-30 17:39:05 +0100 | [diff] [blame] | 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; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | arch_initcall(footbridge_isa_init); |