-+ bcm947xx_parts[1].offset = bcm947xx_parts[0].size;
-+ bcm947xx_parts[1].size = bcm947xx_parts[3].offset - bcm947xx_parts[1].offset;
++ /* do not count the elf loader, which is on one sector */
++ bcm947xx_parts[1].offset = bcm947xx_parts[0].size + bcm947xx_parts[3].size + mtd->erasesize;
++ bcm947xx_parts[1].size = size - NVRAM_SIZE - bcm947xx_parts[0].size -
++ bcm947xx_parts[3].size - mtd->erasesize;