2 * arch/m68k/coldfire/m547x/mcf548x-devices.c
4 * Coldfire M548x Platform Device Configuration
6 * Based on the Freescale MXC devices.c
8 * Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved.
10 * Kurt Mahan <kmahan@freescale.com>
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/platform_device.h>
17 #include <linux/fsl_devices.h>
19 #include <asm/coldfire.h>
20 #include <asm/mcfsim.h>
21 #include <asm/mcfuart.h>
23 static struct resource coldfire_i2c_resources
[] = {
25 .start
= MCF_MBAR
+ 0x008F00,
26 .end
= MCF_MBAR
+ 0x008F20,
27 .flags
= IORESOURCE_MEM
,
32 .flags
= IORESOURCE_IRQ
,
36 static struct platform_device coldfire_i2c_device
= {
38 .id
= 0, /*bus number*/
39 .num_resources
= ARRAY_SIZE(coldfire_i2c_resources
),
40 .resource
= coldfire_i2c_resources
,
43 static struct resource coldfire_sec_resources
[] = {
45 .start
= MCF_MBAR
+ 0x00020000,
46 .end
= MCF_MBAR
+ 0x00033000,
47 .flags
= IORESOURCE_MEM
,
52 .flags
= IORESOURCE_IRQ
,
56 static struct platform_device coldfire_sec_device
= {
59 .num_resources
= ARRAY_SIZE(coldfire_sec_resources
),
60 .resource
= coldfire_sec_resources
,
63 static struct physmap_flash_data mcf5485_flash_data
= {
67 static struct resource mcf5485_flash_resource
= {
70 .flags
= IORESOURCE_MEM
,
73 static struct platform_device mcf5485_flash_device
= {
74 .name
= "physmap-flash",
77 .platform_data
= &mcf5485_flash_data
,
80 .resource
= &mcf5485_flash_resource
,
83 static int __init
mcf5485_init_devices(void)
85 printk(KERN_INFO
"MCF5485x INIT_DEVICES\n");
87 platform_device_register(&coldfire_i2c_device
);
88 platform_device_register(&coldfire_sec_device
);
89 platform_device_register(&mcf5485_flash_device
);
92 arch_initcall(mcf5485_init_devices
);
94 static struct mcf_platform_uart m548x_uart_platform
[] = {
96 .mapbase
= MCF_MBAR
+ MCFUART_BASE1
,
97 .irq
= MCFINT_VECBASE
+ MCFINT_UART0
,
100 .mapbase
= MCF_MBAR
+ MCFUART_BASE2
,
101 .irq
= MCFINT_VECBASE
+ MCFINT_UART1
,
104 .mapbase
= MCF_MBAR
+ MCFUART_BASE3
,
105 .irq
= MCFINT_VECBASE
+ MCFINT_UART2
,
110 static struct platform_device m548x_uart
= {
113 .dev
.platform_data
= m548x_uart_platform
,
116 static struct platform_device
*m548x_devices
[] __initdata
= {
120 void m548x_uarts_init(void)
122 const int nrlines
= ARRAY_SIZE(m548x_uart_platform
);
125 /* Set GPIO port register to enable PSC(port) signals */
126 for (line
= 0; (line
< nrlines
); line
++) {
127 MCF_PAR_PSCn(line
) = (0
131 MCF_ICR(m548x_uart_platform
[line
].irq
- 64) = ILP_PSCn(line
);
134 /***************************************************************************/
136 static int __init
init_BSP(void)
139 platform_add_devices(m548x_devices
, ARRAY_SIZE(m548x_devices
));
143 arch_initcall(init_BSP
);