Zaurus: Fix PROM partition table for spitz
Subsystems (3)
PATCH 1/1 Zaurus: Fix PROM partition table for spitz
Attached patch fixes partition table of the Zaurus PROM. It works on terrier, but I guess it is common for all Zaurus models.
The partition marked ??"Boot PROM Filesystem" is a fact a database file for EN-JP dictionary. Designers decided to put the English-Japanese translation dictionary to the remaining part of the PROM.
Changes:
Newly mapped the bootloader system as "Boot PROM System".
Already mapped EN-JP dictionary changes its name from ?"Boot PROM Filesystem" to "EN-JP Data File".
How to verify the layout on other models:
?root at zaurus:~# modprobe physmap
root at zaurus:~# file -s /dev/mtd4/dev/mtd4: DBase 3 data file (1031668283 records)
arch/arm/mach-pxa/spitz.c +5 -1
@@ -658,7 +696,11 @@ static struct platform_device sharpsl_nand_device = {static struct mtd_partition sharpsl_rom_parts[] = { { - .name ="Boot PROM Filesystem" , + .name ="Boot PROM System" , + .offset =0x00100000 , + }, + { + .name ="EN-JP Data File" , .offset =0x00140000 , .size =MTDPART_SIZ_FULL , },
________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus
PATCH 1/1 Zaurus: Fix PROM partition table for spitz
I'm a bit upset that some things else may depend on the original layout (though that's incorrect), and this possibly breaks the sequence numbering of /dev/mtd?.
Quoted 46 lines · Stanislav Brabec
Attached patch fixes partition table of the Zaurus PROM. It works on terrier, but I guess it is common for all Zaurus models.
The partition marked ??"Boot PROM Filesystem" is a fact a database file for EN-JP dictionary. Designers decided to put the English-Japanese translation dictionary to the remaining part of the PROM.
Changes:
Newly mapped the bootloader system as "Boot PROM System".
Already mapped EN-JP dictionary changes its name from ?"Boot PROM Filesystem" to "EN-JP Data File".
How to verify the layout on other models:
?root at zaurus:~# modprobe physmap
root at zaurus:~# file -s/dev/mtd4/dev/mtd4: DBase 3 data file (1031668283 records)Signed-off-by Stanislav Brabec <[email protected]>arch/arm/mach-pxa/spitz.c +5
-1@@ -658,7 +696,11 @@ static struct platform_device sharpsl_nand_device = { ?static struct mtd_partition sharpsl_rom_parts[] = { ? ? ? ?{ - ? ? ? ? ? ? ? .name ? ="Boot PROM Filesystem", + ? ? ? ? ? ? ? .name ? ="Boot PROM System", + ? ? ? ? ? ? ? .offset = 0x00100000, + ? ? ? }, + ? ? ? { + ? ? ? ? ? ? ? .name ? ="EN-JP Data File", ? ? ? ? ? ? ? ?.offset = 0x00140000, ? ? ? ? ? ? ? ?.size ? = MTDPART_SIZ_FULL, ? ? ? ?},________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus
PATCH 1/1 Zaurus: Fix PROM partition table for spitz
Quoted 3 lines · Eric Miao
I'm a bit upset that some things else may depend on the original layout (though that's incorrect), and this possibly breaks the sequence numbering of
/dev/mtd?.
It can break in many ways, e. g. by compiling one as module and another into kernel, and depends on order of modules load.
That is why software should search partitions by name.
AFAIK, nothing uses the EN-JP or initial bootloader data in the 2.6.x distros, so it should be just safe housekeeping.
________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx
PATCH 1/1 Zaurus: Fix PROM partition table for spitz
Quoted 10 lines · Stanislav Brabec
Quoted 3 lines · Eric Miao
I'm a bit upset that some things else may depend on the original layout (though that's incorrect), and this possibly breaks the sequence numbering of
/dev/mtd?.It can break in many ways, e. g. by compiling one as module and another into kernel, and depends on order of modules load.
That is why software should search partitions by name.
But there might be software that doesn't. I'd be a little bit conservative about this.
Quoted 3 lines
AFAIK, nothing uses the EN-JP or initial bootloader data in the 2.6.x distros, so it should be just safe housekeeping.
This, on the other hand, says it's also safe not to inserting some additional partition in between :-)
(I won't refuse some comments to make this more clear in the code though).
PATCH 1/1 Zaurus: Fix PROM partition table for spitz
Quoted 19 lines · Eric Miao
Quoted 10 lines · Stanislav Brabec
Quoted 3 lines · Eric Miao
I'm a bit upset that some things else may depend on the original layout (though that's incorrect), and this possibly breaks the sequence numbering of
/dev/mtd?.It can break in many ways, e. g. by compiling one as module and another into kernel, and depends on order of modules load.
That is why software should search partitions by name.
But there might be software that doesn't. I'd be a little bit conservative about this.
Quoted 3 lines
AFAIK, nothing uses the EN-JP or initial bootloader data in the 2.6.x distros, so it should be just safe housekeeping.
Quoted 5 lines
This, on the other hand, says it's also safe not to inserting some additional partition in between :-)
(I won't refuse some comments to make this more clear in the code though).
I don't know. If the table is wrong, we should fix it. Yes, it may break someone, but it probably will not.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
PATCH 1/1 Zaurus: Fix PROM partition table for spitz
Quoted 6 lines · On 2009-10-29 23:45:11 Pavel Machek wrote:
Quoted 2 lines · Eric Miao
(I won't refuse some comments to make this more clear in the code though).
I don't know. If the table is wrong, we should fix it. Yes, it may break someone, but it probably will not.
This change is not worse than change in .config, as there is no guarantee of order of loading NAND and PROM maps.
I just looked at original 2.4 kernel. There were:
PROM EN-JP as "Filesystem", bootloader not mapped
NAND partitions as "smf", "root", "home"
This is an output of cat /proc/mtd on vendor's 2.4.20.
dev: size erasesize name
mtd0: 006b0000 00020000 "Filesystem"
mtd1: 00700000 00020000 "smf"
mtd2: 02b00000 00020000 "root"
mtd3: 04e00000 00020000 "home"
We never were compatible:
Guessing from "file" output, EN-JP partition is just a file, not a filesystem. I am OK with keeping of name "Boot PROM Filesystem" and calling the new partition as "PROM Bootloader", but EN-JP in the name cleanly describes the surprising contents. Adding bootloader data partition has probably a single use case: Being easily able to grab the PROM contents for the emulator.
Signature · 2 lines
Stanislav Brabec http://www.penguin.cz/~utx/zaurus