diff options
author | mokopatches <mokopatches@openmoko.org> | 2008-11-19 17:03:09 +0000 |
---|---|---|
committer | warmcat <andy@warmcat.com> | 2008-11-19 17:03:09 +0000 |
commit | 6f9153da18b2f9180b4381cff3785e3dba01c7e7 (patch) | |
tree | 0922ffa5d776cf8039b2e5af07d4a908fef5ea86 | |
parent | 04c8cf939d95c88f5fce5d69fba6a3da62f9e255 (diff) |
gta01-no_nand_partitions.patch
[PATCH] support mtd NAND commandline partitions for S3C2410
This patch adds support for the mtd NAND core standard method of passing
partition table information from the bootloader into the kernel by using
the kernel commandline.
The board specific code can still manually override and provide a fixed
partition table, so this patch will behave backwards compatible.
Signed-off-by: Harald Welte <laforge@openmoko.org>
Acked-byt: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 098f5162388..1858a10c4ea 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c @@ -645,17 +645,31 @@ static int s3c2410_nand_remove(struct platform_device *pdev) } #ifdef CONFIG_MTD_PARTITIONS +const char *part_probes[] = { "cmdlinepart", NULL }; static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, struct s3c2410_nand_mtd *mtd, struct s3c2410_nand_set *set) { + struct mtd_partition *part_info; + int nr_part = 0; + if (set == NULL) return add_mtd_device(&mtd->mtd); - if (set->nr_partitions > 0 && set->partitions != NULL) { - return add_mtd_partitions(&mtd->mtd, set->partitions, set->nr_partitions); + if (set->nr_partitions == 0) { + mtd->mtd.name = set->name; + nr_part = parse_mtd_partitions(&mtd->mtd, part_probes, + &part_info, 0); + } else { + if (set->nr_partitions > 0 && set->partitions != NULL) { + nr_part = set->nr_partitions; + part_info = set->partitions; + } } + if (nr_part > 0 && part_info) + return add_mtd_partitions(&mtd->mtd, part_info, nr_part); + return add_mtd_device(&mtd->mtd); } #else |