diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2005-07-10 14:44:53 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-07-10 14:44:53 -0400 |
commit | 28187f2ce39eb2158c35a46696af03cdfd14310a (patch) | |
tree | 921c08ec59ff6842602dfbc9c740c3bf2b684d8f /arch/arm/mach-ixp2000/core.c | |
parent | f179bc77d09b9087bfc559d0368bba350342ac76 (diff) |
[PATCH] ARM: 2793/1: platform serial support for ixp2000
Patch from Lennert Buytenhek
This patch converts the ixp2000 serial port over to a platform
serial device.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp2000/core.c')
-rw-r--r-- | arch/arm/mach-ixp2000/core.c | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c index 4b9d841e04c..45b18658499 100644 --- a/arch/arm/mach-ixp2000/core.c +++ b/arch/arm/mach-ixp2000/core.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/serial.h> | 23 | #include <linux/serial.h> |
24 | #include <linux/tty.h> | 24 | #include <linux/tty.h> |
25 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
26 | #include <linux/serial_core.h> | 26 | #include <linux/serial_8250.h> |
27 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
28 | 28 | ||
29 | #include <asm/types.h> | 29 | #include <asm/types.h> |
@@ -125,19 +125,6 @@ static struct map_desc ixp2000_io_desc[] __initdata = { | |||
125 | } | 125 | } |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static struct uart_port ixp2000_serial_port = { | ||
129 | .membase = (char *)(IXP2000_UART_VIRT_BASE + 3), | ||
130 | .mapbase = IXP2000_UART_PHYS_BASE + 3, | ||
131 | .irq = IRQ_IXP2000_UART, | ||
132 | .flags = UPF_SKIP_TEST, | ||
133 | .iotype = UPIO_MEM, | ||
134 | .regshift = 2, | ||
135 | .uartclk = 50000000, | ||
136 | .line = 0, | ||
137 | .type = PORT_XSCALE, | ||
138 | .fifosize = 16 | ||
139 | }; | ||
140 | |||
141 | void __init ixp2000_map_io(void) | 128 | void __init ixp2000_map_io(void) |
142 | { | 129 | { |
143 | extern unsigned int processor_id; | 130 | extern unsigned int processor_id; |
@@ -157,12 +144,50 @@ void __init ixp2000_map_io(void) | |||
157 | } | 144 | } |
158 | 145 | ||
159 | iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc)); | 146 | iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc)); |
160 | early_serial_setup(&ixp2000_serial_port); | ||
161 | 147 | ||
162 | /* Set slowport to 8-bit mode. */ | 148 | /* Set slowport to 8-bit mode. */ |
163 | ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1); | 149 | ixp2000_reg_write(IXP2000_SLOWPORT_FRM, 1); |
164 | } | 150 | } |
165 | 151 | ||
152 | |||
153 | /************************************************************************* | ||
154 | * Serial port support for IXP2000 | ||
155 | *************************************************************************/ | ||
156 | static struct plat_serial8250_port ixp2000_serial_port[] = { | ||
157 | { | ||
158 | .mapbase = IXP2000_UART_PHYS_BASE, | ||
159 | .membase = (char *)(IXP2000_UART_VIRT_BASE + 3), | ||
160 | .irq = IRQ_IXP2000_UART, | ||
161 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, | ||
162 | .iotype = UPIO_MEM, | ||
163 | .regshift = 2, | ||
164 | .uartclk = 50000000, | ||
165 | }, | ||
166 | { }, | ||
167 | }; | ||
168 | |||
169 | static struct resource ixp2000_uart_resource = { | ||
170 | .start = IXP2000_UART_PHYS_BASE, | ||
171 | .end = IXP2000_UART_PHYS_BASE + 0xffff, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }; | ||
174 | |||
175 | static struct platform_device ixp2000_serial_device = { | ||
176 | .name = "serial8250", | ||
177 | .id = 0, | ||
178 | .dev = { | ||
179 | .platform_data = ixp2000_serial_port, | ||
180 | }, | ||
181 | .num_resources = 1, | ||
182 | .resource = &ixp2000_uart_resource, | ||
183 | }; | ||
184 | |||
185 | void __init ixp2000_uart_init(void) | ||
186 | { | ||
187 | platform_device_register(&ixp2000_serial_device); | ||
188 | } | ||
189 | |||
190 | |||
166 | /************************************************************************* | 191 | /************************************************************************* |
167 | * Timer-tick functions for IXP2000 | 192 | * Timer-tick functions for IXP2000 |
168 | *************************************************************************/ | 193 | *************************************************************************/ |