[ar71xx] WP543: add static mtd partitions
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 18 Sep 2008 12:38:53 +0000 (12:38 +0000)
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 18 Sep 2008 12:38:53 +0000 (12:38 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12624 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/ar71xx/files/arch/mips/ar71xx/mach-wp543.c

index 9044011..4abecd8 100644 (file)
@@ -10,6 +10,8 @@
  */
 
 #include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/input.h>
 
 #define WP543_BUTTONS_POLL_INTERVAL    20
 
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition wp543_partitions[] = {
+       {
+               .name   = "myloader",
+               .offset = 0,
+               .size   = 0x20000,
+               .mask_flags = MTD_WRITEABLE,
+       } , {
+               .name   = "kernel",
+               .offset = 0x30000,
+               .size   = 0xd0000,
+       } , {
+               .name   = "rootfs",
+               .offset = 0x100000,
+               .size   = 0x100000,
+       }
+};
+#endif /* CONFIG_MTD_PARTITIONS */
+
 static struct flash_platform_data wp543_flash_data = {
-       /* TODO: add partition map */
+#ifdef CONFIG_MTD_PARTITIONS
+       .parts          = wp543_partitions,
+       .nr_parts       = ARRAY_SIZE(wp543_partitions),
+#endif
 };
 
 static struct spi_board_info wp543_spi_info[] = {
This page took 0.028384 seconds and 4 git commands to generate.