* MTD partitions vs erase regions
@ 2016-10-27 12:19 Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-10-28 0:14 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Krzeminski, Marcin (Nokia - PL/Wroclaw) @ 2016-10-27 12:19 UTC (permalink / raw)
To: Marek Vašut; +Cc: linux-mtd@lists.infradead.org
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@0 {
label = "all";
reg = <0x00000000 0x08000000>;
};
partition@1 {
label = "small";
reg = <0x00000000 0x00008000>;
};
partition@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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: MTD partitions vs erase regions
2016-10-27 12:19 MTD partitions vs erase regions Krzeminski, Marcin (Nokia - PL/Wroclaw)
@ 2016-10-28 0:14 ` Marek Vasut
2016-10-28 4:50 ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2016-10-28 0:14 UTC (permalink / raw)
To: Krzeminski, Marcin (Nokia - PL/Wroclaw); +Cc: linux-mtd@lists.infradead.org
On 10/27/2016 02:19 PM, Krzeminski, Marcin (Nokia - PL/Wroclaw) wrote:
> Hi Marek,
Hi,
> 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.
Which flash is that ?
> 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@0 {
> label = "all";
> reg = <0x00000000 0x08000000>;
> };
>
> partition@1 {
> label = "small";
> reg = <0x00000000 0x00008000>;
> };
>
> partition@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
>
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: MTD partitions vs erase regions
2016-10-28 0:14 ` Marek Vasut
@ 2016-10-28 4:50 ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-10-28 5:08 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Krzeminski, Marcin (Nokia - PL/Wroclaw) @ 2016-10-28 4:50 UTC (permalink / raw)
To: Marek Vasut; +Cc: linux-mtd@lists.infradead.org
Marek,
> -----Original Message-----
> From: Marek Vasut [mailto:marex@denx.de]
> Sent: Friday, October 28, 2016 2:15 AM
> To: Krzeminski, Marcin (Nokia - PL/Wroclaw)
> <marcin.krzeminski@nokia.com>
> Cc: linux-mtd@lists.infradead.org
> Subject: Re: MTD partitions vs erase regions
>
> On 10/27/2016 02:19 PM, Krzeminski, Marcin (Nokia - PL/Wroclaw) wrote:
> > Hi Marek,
>
> Hi,
>
> > 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.
>
> Which flash is that ?
Sorry - forgot to mention: MT25Q00 (64KiB erase size).
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is disabled.
Regards,
Marcin
>
> > Erase regions configuration:
> >
> > nor->eraseregions[0].erasesize = 4096; eraseregions[0].numblocks = 8;
> > nor->eraseregions[0].offset = 0x0;
> >
> > nor->eraseregions[1].erasesize = 32*1024; eraseregions[1].numblocks =
> > nor->1; eraseregions[1].offset = 32*1024;
> >
> > nor->eraseregions[2].erasesize = 64*1024; eraseregions[2].numblocks =
> > nor->div_u64_rem(mtd->size - 64*1024, info->sector_size, &rem);
> > nor->eraseregions[2].offset = 64*1024;
> >
> > Device tree (mtd):
> >
> > partition@0 {
> > label = "all";
> > reg = <0x00000000 0x08000000>;
> > };
> >
> > partition@1 {
> > label = "small";
> > reg = <0x00000000 0x00008000>;
> > };
> >
> > partition@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
> >
>
>
> --
> Best regards,
> Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: MTD partitions vs erase regions
2016-10-28 4:50 ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
@ 2016-10-28 5:08 ` Marek Vasut
0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2016-10-28 5:08 UTC (permalink / raw)
To: Krzeminski, Marcin (Nokia - PL/Wroclaw); +Cc: linux-mtd@lists.infradead.org
On 10/28/2016 06:50 AM, Krzeminski, Marcin (Nokia - PL/Wroclaw) wrote:
> Marek,
>
>> -----Original Message-----
>> From: Marek Vasut [mailto:marex@denx.de]
>> Sent: Friday, October 28, 2016 2:15 AM
>> To: Krzeminski, Marcin (Nokia - PL/Wroclaw)
>> <marcin.krzeminski@nokia.com>
>> Cc: linux-mtd@lists.infradead.org
>> Subject: Re: MTD partitions vs erase regions
>>
>> On 10/27/2016 02:19 PM, Krzeminski, Marcin (Nokia - PL/Wroclaw) wrote:
>>> Hi Marek,
>>
>> Hi,
>>
>>> 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.
>>
>> Which flash is that ?
>
> Sorry - forgot to mention: MT25Q00 (64KiB erase size).
> CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is disabled.
I think this is expected then, the subsystem is not ready for device
with variable eraseblock length.
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-28 5:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-27 12:19 MTD partitions vs erase regions Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-10-28 0:14 ` Marek Vasut
2016-10-28 4:50 ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-10-28 5:08 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox