[PATCH 1/2] Update ts72xx to use generic platform nand driver

H Hartley Sweeten hartleys at visionengravers.com
Wed Oct 7 13:09:10 EDT 2009


On Wednesday, October 07, 2009 1:16 AM, Alexander Clouter wrote:
> Hi,

[snip]

> These struct's are almost identical so could you not...

[snip]

> -----------
> static struct mtd_partition ts72xx_part_info[] = {
> 	{
> 		/* gut feeling for *Joe Public* is to go MTD_WRITABLE */
> 		.name		= "TS-BOOTROM",
> 		.offset		= 0,
> 		.size		= TS72XX_BOOTROM_PART_SIZE,
> 	}, {
> 		.name		= "Linux",
> 		.offset		= MTDPART_OFS_APPEND,
> 		/* to be filled in later */
> 		.size		= 0,
> 	}, {
> 		/* mask MTD_WRITABLE here too? */
> 		.name		= "Redboot",
> 		.offset		= MTDPART_OFS_APPEND,
> 		.size		= MTDPART_SIZ_FULL,
> 	}
> };
> 
> static void ts72xx_nand_set_parts(....)
> {
> 	....
> 
> 	/* or I guess you could just bailout... */
> 	if (size != SZ_32M && size != SZ_128M)
> 		pr_warning("ts72xx: Unknown nand disk size:%lluMB\n", size >> 20);
> 
> 	chip->partitions = ts72xx_part_info;
> 	chip->nr_partitions = ARRAY_SIZE(ts72xx_part_info);
> 
> 	ts72xx_part_info[1].size = size - TS72XX_REDBOOT_PART_SIZE;
> }

Thanks for pointing that out.  I like your change and will modify the patch.

I didn't think about making the "TS-BOOTROM" and "RedBoot" partitions read-only.
Probably a good idea, I'll add that also.

Updated patch coming soon.

Regards,
Hartley



More information about the linux-arm-kernel mailing list