Greg Ungerer | 0d2fe94 | 2011-12-24 01:17:10 +1000 | [diff] [blame^] | 1 | /* |
| 2 | * device.c -- common ColdFire SoC device support |
| 3 | * |
| 4 | * (C) Copyright 2011, Greg Ungerer <gerg@uclinux.org> |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file COPYING in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/io.h> |
| 14 | #include <asm/traps.h> |
| 15 | #include <asm/coldfire.h> |
| 16 | #include <asm/mcfsim.h> |
| 17 | #include <asm/mcfuart.h> |
| 18 | |
| 19 | static struct mcf_platform_uart mcf_uart_platform_data[] = { |
| 20 | { |
| 21 | .mapbase = MCFUART_BASE0, |
| 22 | .irq = MCF_IRQ_UART0, |
| 23 | }, |
| 24 | { |
| 25 | .mapbase = MCFUART_BASE1, |
| 26 | .irq = MCF_IRQ_UART1, |
| 27 | }, |
| 28 | #ifdef MCFUART_BASE2 |
| 29 | { |
| 30 | .mapbase = MCFUART_BASE2, |
| 31 | .irq = MCF_IRQ_UART2, |
| 32 | }, |
| 33 | #endif |
| 34 | #ifdef MCFUART_BASE3 |
| 35 | { |
| 36 | .mapbase = MCFUART_BASE3, |
| 37 | .irq = MCF_IRQ_UART3, |
| 38 | }, |
| 39 | #endif |
| 40 | { }, |
| 41 | }; |
| 42 | |
| 43 | static struct platform_device mcf_uart = { |
| 44 | .name = "mcfuart", |
| 45 | .id = 0, |
| 46 | .dev.platform_data = mcf_uart_platform_data, |
| 47 | }; |
| 48 | |
| 49 | static struct platform_device *mcf_devices[] __initdata = { |
| 50 | &mcf_uart, |
| 51 | }; |
| 52 | |
| 53 | static int __init mcf_init_devices(void) |
| 54 | { |
| 55 | platform_add_devices(mcf_devices, ARRAY_SIZE(mcf_devices)); |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | arch_initcall(mcf_init_devices); |
| 60 | |