some more kernel config cleanup.. last for today :)
[openwrt/svn-archive/archive.git] / target / linux / sibyte / patches / 001-rhone_physmap.patch
1 --- a/arch/mips/sibyte/swarm/platform.c 2009-04-30 06:48:16.000000000 +0200
2 +++ b/arch/mips/sibyte/swarm/platform.c 2009-05-01 20:54:50.000000000 +0200
3 @@ -83,3 +83,61 @@
4 device_initcall(swarm_pata_init);
5
6 #endif /* defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_LITTLESUR) */
7 +
8 +#ifdef CONFIG_SIBYTE_RHONE
9 +
10 +#include <linux/mtd/partitions.h>
11 +#include <linux/mtd/physmap.h>
12 +
13 +static struct mtd_partition flash_parts[] = {
14 + {
15 + .name = "cfe",
16 + .offset = 0x00000000,
17 + .size = 0x00200000,
18 + .mask_flags = MTD_WRITEABLE,
19 + },
20 + {
21 + .name = "os",
22 + .offset = 0x00200000,
23 + .size = 0x00d00000,
24 + },
25 + {
26 + .name = "environment",
27 + .offset = 0x00f00000,
28 + .size = 0x00100000,
29 + .mask_flags = MTD_WRITEABLE,
30 + },
31 +};
32 +
33 +static struct physmap_flash_data flash_data = {
34 + .width = 1,
35 + .nr_parts = ARRAY_SIZE(flash_parts),
36 + .parts = flash_parts,
37 +};
38 +
39 +static struct resource flash_resource = {
40 + .start = 0x1fc00000,
41 + .end = 0x20bfffff,
42 + .flags = IORESOURCE_MEM,
43 +};
44 +
45 +static struct platform_device flash_device = {
46 + .name = "physmap-flash",
47 + .id = 0,
48 + .resource = &flash_resource,
49 + .num_resources = 1,
50 + .dev = {
51 + .platform_data = &flash_data,
52 + },
53 +};
54 +
55 +static int __init flash_setup(void)
56 +{
57 + platform_device_register(&flash_device);
58 +
59 + return 0;
60 +};
61 +
62 +device_initcall(flash_setup);
63 +
64 +#endif /* CONFIG_SIBYTE_RHONE */