I'm experimenting with 2nd flash memory in my WNDR4500. It does
contain TRX at offset 0x0 (it is possible, because bootloader is
placed on 1st flash memory).

As you know TRX size is 224B (V1) or 256B (V2) [0]. In case of V1 it
means that first partition data start at 224/8 == 0x1C.

So during my experiments I've made partitioner driver register mtd
partition starting at 0x1C. It exactly matches the place where
partition data start. Unfortunately mtd subsystem doesn't like such a
partitions:

Creating 2 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000001c-0x00000028a3b4 : "linux"
mtd: partition "linux" doesn't start on an erase block boundary --
force read-only
0x00000028a3b4-0x000008000000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary --
force read-only

I can see we tend to rounding down offset to the eraseblock size. So
instead registering mtd partition starting at 0x1C we register it with
start at 0x00. This way we get some "garbages" at the beginning of
partition, and hope filesystem (squashfs/jffs2) can skip that.

I've some doubts if this is a correct behavior. If filesystem can work
with real data starting at unaligned offset (like 0x1C), I think mtd
should just accept such a offsets. That way I'm sure I register
correct range as partition and nothing will touch/break my TRX header.

What do you think about this? Can we fix mtd to accept unaligned offsets?

[0] http://wiki.openwrt.org/doc/techref/header

-- 
Rafał
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to