MTD partitions vs erase regions
Krzeminski, Marcin (Nokia - PL/Wroclaw)
marcin.krzeminski at nokia.com
Thu Oct 27 05:19:31 PDT 2016
Hi Marek,
I am sending mtd partition and erase regions conflict that I had.
I admit I have no investigated it, since finally all is different.
This could make some problems with your idea of having erase sizes defined from DT.
Erase regions configuration:
nor->eraseregions[0].erasesize = 4096;
nor->eraseregions[0].numblocks = 8;
nor->eraseregions[0].offset = 0x0;
nor->eraseregions[1].erasesize = 32*1024;
nor->eraseregions[1].numblocks = 1;
nor->eraseregions[1].offset = 32*1024;
nor->eraseregions[2].erasesize = 64*1024;
nor->eraseregions[2].numblocks = div_u64_rem(mtd->size - 64*1024, info->sector_size, &rem);
nor->eraseregions[2].offset = 64*1024;
Device tree (mtd):
partition at 0 {
label = "all";
reg = <0x00000000 0x08000000>;
};
partition at 1 {
label = "small";
reg = <0x00000000 0x00008000>;
};
partition at 2 {
label = "rest";
reg = <0x00008000 0x07FF8000>;
};
Logs from startup:
[ 1.187722] 0x000000000000-0x000008000000 : "all"
[ 1.188498] device: 'mtd0': device_add
[ 1.189563] device: 'mtd0ro': device_add
[ 1.192359] device: '31:0': device_add
[ 1.192810] device: 'mtdblock0': device_add
[ 1.194504] 0x000000000000-0x000000008000 : "small"
[ 1.195144] device: 'mtd1': device_add
[ 1.196667] device: 'mtd1ro': device_add
[ 1.198268] device: '31:1': device_add
[ 1.199016] device: 'mtdblock1': device_add
[ 1.200922] 0x000000008000-0x000008000000 : "rest"
[ 1.201222] mtd: partition "rest" doesn't start on an erase block boundary -- force read-only
[ 1.201613] device: 'mtd2': device_add
[ 1.202541] device: 'mtd2ro': device_add
[ 1.204659] device: '31:2': device_add
[ 1.206233] device: 'mtdblock2': device_add
Message is from here:
http://lxr.free-electrons.com/source/drivers/mtd/mtdpart.c?v=4.4#L526
Regards,
Marcin
More information about the linux-mtd
mailing list