summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/parsers/Kconfig
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2017-08-31 23:05:07 +0200
committerRichard Weinberger <richard@nod.at>2017-11-13 21:39:19 +0100
commit8a4580e4d298796ffe5bcc5b0c39906c83a40499 (patch)
tree46a6ef7bed00c8fb9974a1c6aa050c1696594387 /drivers/mtd/parsers/Kconfig
parent5cdd929da53dd7347ec86afd94c3b840909c461e (diff)
downloadlinux-8a4580e4d298796ffe5bcc5b0c39906c83a40499.tar.gz
linux-8a4580e4d298796ffe5bcc5b0c39906c83a40499.tar.bz2
linux-8a4580e4d298796ffe5bcc5b0c39906c83a40499.zip
mtd: sharpslpart: Add sharpslpart partition parser
The Sharp SL Series (Zaurus) PXA handhelds have 16/64/128M of NAND flash and share the same layout of the first 7M partition, managed by Sharp FTL. GPL 2.4 sources: http://support.ezaurus.com/developer/source/source_dl.asp The purpose of this self-contained patch is to add a common parser and remove the hardcoded sizes in the board files (these devices are not yet converted to devicetree). Users will have benefits because the mtdparts= tag will not be necessary anymore and they will be free to repartition the little sized flash. The obsolete bootloader can not pass the partitioning info to modern kernels anymore so it has to be read from flash at known logical addresses. (see http://www.h5.dion.ne.jp/~rimemoon/zaurus/memo_006.htm ) In kernel, under arch/arm/mach-pxa we have already 8 machines: MACH_POODLE, MACH_CORGI, MACH_SHEPERD, MACH_HUSKY, MACH_AKITA, MACH_SPITZ, MACH_BORZOI, MACH_TOSA. Lost after the 2.4 vendor kernel are MACH_BOXER and MACH_TERRIER. Almost every model has different factory partitioning: add to this the units can be repartitioned by users with userspace tools (nandlogical) and installers for popular (back then) linux distributions. The Parameter Area in the first (boot) partition extends from 0x00040000 to 0x0007bfff (176k) and contains two copies of the partition table: ... 0x00060000: Partition Info1 16k 0x00064000: Partition Info2 16k 0x00668000: Model 16k ... The first 7M partition is managed by the Sharp FTL reserving 5% + 1 blocks for wear-leveling: some blocks are remapped and one layer of translation (logical to physical) is necessary. There isn't much documentation about this FTL in the 2.4 sources, just the MTD methods for reading and writing using logical addresses and the block management (wear-leveling, use counter). It seems this FTL was tailored with 16KiB eraesize in mind so to fit one param block exactly, to have two copies of the partition table on two blocks. Later pxa27x devices have same size but 128KiB erasesize and less blocks (56 vs. 448) but the same schema was adopted, even if the two tables are now in the same eraseblock. For the purpose of the MTD parser only the read part of the code was taken. The NAND drivers that can use this parser are sharpsl.c and tmio_nand.c. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/parsers/Kconfig')
-rw-r--r--drivers/mtd/parsers/Kconfig8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/Kconfig b/drivers/mtd/parsers/Kconfig
index d206b3c533bc..ee5ab994132f 100644
--- a/drivers/mtd/parsers/Kconfig
+++ b/drivers/mtd/parsers/Kconfig
@@ -6,3 +6,11 @@ config MTD_PARSER_TRX
may contain up to 3/4 partitions (depending on the version).
This driver will parse TRX header and report at least two partitions:
kernel and rootfs.
+
+config MTD_SHARPSL_PARTS
+ tristate "Sharp SL Series NAND flash partition parser"
+ depends on MTD_NAND_SHARPSL || MTD_NAND_TMIO || COMPILE_TEST
+ help
+ This provides the read-only FTL logic necessary to read the partition
+ table from the NAND flash of Sharp SL Series (Zaurus) and the MTD
+ partition parser using this code.