]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blob - arch/m68k/coldfire/mcf548x-devices.c
Current (FEC from 2.6.31 port, no CAN, no I2C, no PCI)
[mcf548x/linux.git] / arch / m68k / coldfire / mcf548x-devices.c
1 /*
2  * arch/m68k/coldfire/mcf5445x-devices.c
3  *
4  * Coldfire M5445x Platform Device Configuration
5  *
6  * Based on the Freescale MXC devices.c
7  *
8  * Copyright (c) 2007 Freescale Semiconductor, Inc.
9  *      Kurt Mahan <kmahan@freescale.com>
10  */
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/mtd/physmap.h>
15 #include <linux/platform_device.h>
16 #include <linux/fsl_devices.h>
17
18 #include <asm/coldfire.h>
19 #include <asm/mcfsim.h>
20
21 static struct resource coldfire_i2c_resources[] = {
22         [0] = {         /* I/O */
23                 .start          = MCF_MBAR + 0x008F00,
24                 .end            = MCF_MBAR + 0x008F20,
25                 .flags          = IORESOURCE_MEM,
26         },
27         [2] = {         /* IRQ */
28                 .start          = 40,
29                 .end            = 40,
30                 .flags          = IORESOURCE_IRQ,
31         },
32 };
33
34 static struct platform_device coldfire_i2c_device = {
35         .name                   = "MCF548X-i2c",
36         .id                     = -1,
37         .num_resources          = ARRAY_SIZE(coldfire_i2c_resources),
38         .resource               = coldfire_i2c_resources,
39 };
40
41 static struct resource coldfire_sec_resources[] = {
42         [0] = {         /* I/O */
43                 .start          = MCF_MBAR + 0x00020000,
44                 .end            = MCF_MBAR + 0x00033000,
45                 .flags          = IORESOURCE_MEM,
46         },
47         [2] = {         /* IRQ */
48                 .start          = ISC_SEC,
49                 .end            = ISC_SEC,
50                 .flags          = IORESOURCE_IRQ,
51         },
52 };
53
54 static struct platform_device coldfire_sec_device = {
55         .name                   = "fsl-sec1",
56         .id                     = -1,
57         .num_resources          = ARRAY_SIZE(coldfire_sec_resources),
58         .resource               = coldfire_sec_resources,
59 };
60
61 #if defined(CONFIG_MTD_PHYSMAP)
62 static struct physmap_flash_data mcf5485_flash_data = {
63         .width          = 2,
64 };
65
66 static struct resource mcf5485_flash_resource = {
67         .start          = 0xf8000000,
68         .end            = 0xf80fffff,
69         .flags          = IORESOURCE_MEM,
70 };
71
72 static struct platform_device mcf5485_flash_device = {
73         .name           = "physmap-flash",
74         .id             = 0,
75         .dev            = {
76                 .platform_data  = &mcf5485_flash_data,
77         },
78         .num_resources  = 1,
79         .resource       = &mcf5485_flash_resource,
80 };
81 #endif
82
83 static int __init mcf5485_init_devices(void)
84 {
85         printk(KERN_INFO "MCF5485x INIT_DEVICES\n");
86
87         platform_device_register(&coldfire_i2c_device);
88         platform_device_register(&coldfire_sec_device);
89 /*#if defined(CONFIG_MTD_PHYSMAP)
90         platform_device_register(&mcf5485_flash_device);
91 #endif*/
92         return 0;
93 }
94 arch_initcall(mcf5485_init_devices);