/*
+ * $Id$
+ *
* Parse MyLoader-style flash partition tables and produce a Linux partition
* array to match.
*
#include <linux/mtd/partitions.h>
#include <linux/byteorder/generic.h>
-#include <asm/mach-adm5120/myloader.h>
+
+#include <prom/myloader.h>
#define NAME_LEN_MAX 20
#define NAME_MYLOADER "MyLoader"
/* Partition Table is always located on the second erase block */
offset = blocklen;
- printk(KERN_NOTICE "Searching for MyLoader partition table "
- "in %s at offset 0x%lx\n", master->name, offset);
-
- ret = master->read(master, offset, sizeof(*tab), &retlen,
- (void *)tab);
+ printk(KERN_NOTICE "%s: searching for MyLoader partition table at "
+ "offset 0x%lx\n", master->name, offset);
+ ret = master->read(master, offset, sizeof(*tab), &retlen, (void *)tab);
if (ret)
goto out;
/* Check for Partition Table magic number */
if (tab->magic != le32_to_cpu(MYLO_MAGIC_PARTITIONS)) {
- printk(KERN_NOTICE "No MyLoader partition table detected "
- "in %s\n", master->name);
+ printk(KERN_NOTICE "%s: no MyLoader partition table found\n",
+ master->name);
ret = 0;
goto out_free_buf;
}
num_parts++;
}
-
mtd_parts = kzalloc((num_parts*sizeof(*mtd_part) + num_parts*NAME_LEN_MAX),
GFP_KERNEL);
mtd_part->name = names;
mtd_part->offset = 0;
mtd_part->size = blocklen;
+ mtd_part->mask_flags = MTD_WRITEABLE;
mtd_part++;
names += NAME_LEN_MAX;
mtd_part->name = names;
mtd_part->offset = blocklen;
mtd_part->size = blocklen;
+ mtd_part->mask_flags = MTD_WRITEABLE;
mtd_part++;
names += NAME_LEN_MAX;
continue;
sprintf(names, "partition%d", i);
- mtd_part->name = names;
mtd_part->offset = le32_to_cpu(part->addr);
mtd_part->size = le32_to_cpu(part->size);
+ mtd_part->name = names;
mtd_part++;
names += NAME_LEN_MAX;
}