#include <linux/magic.h>
#include <linux/platform_device.h>
-#include <asm/ifxmips/ifxmips.h>
-#include <asm/ifxmips/ifxmips_prom.h>
-#include <asm/ifxmips/ifxmips_ebu.h>
+#include <ifxmips.h>
+#include <ifxmips_prom.h>
+#include <ifxmips_ebu.h>
#ifndef CONFIG_MTD_PARTITIONS
#error Please enable CONFIG_MTD_PARTITIONS
{
.name = "uboot_env",
.offset = 0x00020000,
- .size = 0x00010000,
+ .size = 0x0,
},
{
.name = "kernel",
- .offset = 0x00030000,
+ .offset = 0x0,
.size = 0x0,
},
{
rootfs_part = i;
}
} else {
+ /* if the flash is 64k sectors, the kernel will reside at 0xb0030000
+ if the flash is 128k sectors, the kernel will reside at 0xb0040000 */
+ ifxmips_partitions[1].size = ifxmips_mtd->erasesize;
+ ifxmips_partitions[2].offset = ifxmips_partitions[1].offset + ifxmips_mtd->erasesize;
parts = &ifxmips_partitions[0];
}
if (detect_squashfs_partition(parts[kernel_part].offset + uimage_size)) {
printk(KERN_INFO "ifxmips_mtd: found a squashfs following the uImage\n");
} else {
- uimage_size &= ~0xffff;
- uimage_size += 0x10000;
+ uimage_size &= ~(ifxmips_mtd->erasesize -1);
+ uimage_size += ifxmips_mtd->erasesize;
}
parts[kernel_part].size = uimage_size;
parts[3].size -= ifxmips_mtd->erasesize;
parts[4].offset = ifxmips_mtd->size - ifxmips_mtd->erasesize;
parts[4].size = ifxmips_mtd->erasesize;
+ ifxmips_meta_partition.size -= ifxmips_mtd->erasesize;
} else {
num_parts--;
}
add_mtd_partitions(ifxmips_mtd, &ifxmips_meta_partition, 1);
printk(KERN_INFO "ifxmips_mtd: added %s flash with %dMB\n",
- ifxmips_map.name, ifxmips_mtd->size >> 20);
+ ifxmips_map.name, ((int)ifxmips_mtd->size) >> 20);
return 0;
}