- amazon_partitions[2].offset = UBOOT_SIZE + find_uImage_size(amazon_partitions[1].offset);
- amazon_partitions[1].size = mymtd->size - amazon_partitions[1].offset - (2 * mymtd->erasesize);
- amazon_partitions[2].size = mymtd->size - amazon_partitions[2].offset - (2 * mymtd->erasesize);
+
+ /* Some Samsung devices are containing a 16 MB flash chip with a bigger U-Boot partition. */
+ if(mymtd->size == 0x01000000 && mymtd->erasesize == 0x00020000) {
+ printk(KERN_INFO "amazon_mtd: Found big flash chip!\n");
+ amazon_partitions[0].size = 0x60000;
+ amazon_partitions[1].offset = 0x60000;
+ uimage_size = find_uImage_size(amazon_partitions[1].offset);
+ amazon_partitions[1].size = uimage_size;
+ amazon_partitions[2].offset = 0x60000 + uimage_size;
+ amazon_partitions[2].size = mymtd->size - amazon_partitions[2].offset - mymtd->erasesize;
+ } else {
+ printk(KERN_INFO "amazon_mtd: Found small flash chip!\n");
+ uimage_size = find_uImage_size(amazon_partitions[1].offset);
+ amazon_partitions[1].size = uimage_size;
+ amazon_partitions[2].offset = UBOOT_SIZE + uimage_size;
+ amazon_partitions[2].size = mymtd->size - amazon_partitions[2].offset - (2 * mymtd->erasesize);
+ }
+