9a2b2bd299283283e9b21792b4002ba0cc294a16
[openwrt/svn-archive/archive.git] / target / linux / gemini / patches / 003-wbd111-static-flash-map.patch
1 --- a/arch/arm/mach-gemini/board-wbd111.c
2 +++ b/arch/arm/mach-gemini/board-wbd111.c
3 @@ -15,6 +15,7 @@
4 #include <linux/input.h>
5 #include <linux/gpio_keys.h>
6 #include <linux/mdio-gpio.h>
7 +#include <linux/mtd/partitions.h>
8 #include <asm/mach-types.h>
9 #include <asm/mach/arch.h>
10 #include <asm/mach/time.h>
11 @@ -101,11 +102,50 @@ static struct sys_timer wbd111_timer = {
12 .init = gemini_timer_init,
13 };
14
15 +#ifdef CONFIG_MTD_PARTITIONS
16 +static struct mtd_partition wbd111_partitions[] = {
17 + {
18 + .name = "RedBoot",
19 + .offset = 0,
20 + .size = 0x020000,
21 + .mask_flags = MTD_WRITEABLE,
22 + } , {
23 + .name = "kernel",
24 + .offset = 0x020000,
25 + .size = 0x100000,
26 + } , {
27 + .name = "rootfs",
28 + .offset = 0x120000,
29 + .size = 0x6a0000,
30 + } , {
31 + .name = "VCTL",
32 + .offset = 0x7c0000,
33 + .size = 0x010000,
34 + .mask_flags = MTD_WRITEABLE,
35 + } , {
36 + .name = "cfg",
37 + .offset = 0x7d0000,
38 + .size = 0x010000,
39 + .mask_flags = MTD_WRITEABLE,
40 + } , {
41 + .name = "FIS",
42 + .offset = 0x7e0000,
43 + .size = 0x010000,
44 + .mask_flags = MTD_WRITEABLE,
45 + }
46 +};
47 +#define wbd111_num_partitions ARRAY_SIZE(wbd111_partitions)
48 +#else
49 +#define wbd111_partitions NULL
50 +#define wbd111_num_partitions 0
51 +#endif /* CONFIG_MTD_PARTITIONS */
52 +
53 static void __init wbd111_init(void)
54 {
55 gemini_gpio_init();
56 platform_register_uart();
57 - platform_register_pflash(SZ_8M, NULL, 0);
58 + platform_register_pflash(SZ_8M, wbd111_partitions,
59 + wbd111_num_partitions);
60 platform_device_register(&wbd111_leds_device);
61 platform_device_register(&wbd111_keys_device);
62 platform_device_register(&wbd111_phy_device);