diff options
Diffstat (limited to 'arch/mips/sgi-ip32/ip32-platform.c')
-rw-r--r-- | arch/mips/sgi-ip32/ip32-platform.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c index 120b15932caf..ba3697ee7ff6 100644 --- a/arch/mips/sgi-ip32/ip32-platform.c +++ b/arch/mips/sgi-ip32/ip32-platform.c | |||
@@ -1,5 +1,53 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #include <linux/module.h> | ||
1 | #include <linux/init.h> | 9 | #include <linux/init.h> |
2 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
11 | #include <linux/serial_8250.h> | ||
12 | |||
13 | #include <asm/ip32/mace.h> | ||
14 | #include <asm/ip32/ip32_ints.h> | ||
15 | |||
16 | /* | ||
17 | * .iobase isn't a constant (in the sense of C) so we fill it in at runtime. | ||
18 | */ | ||
19 | #define MACE_PORT(int) \ | ||
20 | { \ | ||
21 | .irq = int, \ | ||
22 | .uartclk = 1843200, \ | ||
23 | .iotype = UPIO_MEM, \ | ||
24 | .flags = UPF_SKIP_TEST, \ | ||
25 | .regshift = 8, \ | ||
26 | } | ||
27 | |||
28 | static struct plat_serial8250_port uart8250_data[] = { | ||
29 | MACE_PORT(MACEISA_SERIAL1_IRQ), | ||
30 | MACE_PORT(MACEISA_SERIAL2_IRQ), | ||
31 | { }, | ||
32 | }; | ||
33 | |||
34 | static struct platform_device uart8250_device = { | ||
35 | .name = "serial8250", | ||
36 | .id = PLAT8250_DEV_PLATFORM, | ||
37 | .dev = { | ||
38 | .platform_data = uart8250_data, | ||
39 | }, | ||
40 | }; | ||
41 | |||
42 | static int __init uart8250_init(void) | ||
43 | { | ||
44 | uart8250_data[0].iobase = (unsigned long) &mace->isa.serial1; | ||
45 | uart8250_data[1].iobase = (unsigned long) &mace->isa.serial1; | ||
46 | |||
47 | return platform_device_register(&uart8250_device); | ||
48 | } | ||
49 | |||
50 | device_initcall(uart8250_init); | ||
3 | 51 | ||
4 | static __init int meth_devinit(void) | 52 | static __init int meth_devinit(void) |
5 | { | 53 | { |
@@ -18,3 +66,7 @@ static __init int meth_devinit(void) | |||
18 | } | 66 | } |
19 | 67 | ||
20 | device_initcall(meth_devinit); | 68 | device_initcall(meth_devinit); |
69 | |||
70 | MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>"); | ||
71 | MODULE_LICENSE("GPL"); | ||
72 | MODULE_DESCRIPTION("8250 UART probe driver for SGI IP32 aka O2"); | ||