Skip to contentSkip to conversation

Intel P30, locked sectors?

DISCUSSION Nils Faerber 3 participants 8 messages Sep 6, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi!
I now did a kernel update (in fact, I started over with a new kernel) and am now using 2.6.18-RC6 from kernel.org.

I have read access to the flash, rootfs is mounted correctly but at first write attempt I get:

[42949375.150000] Freeing init memory: 96K
[42949376.480000] Erase at 0x00cc0000 failed immediately: -EROFS. Is the
sector locked?
[42949377.520000] Erase at 0x00c80000 failed immediately: -EROFS. Is the
sector locked?
[42949378.560000] Erase at 0x00c40000 failed immediately: -EROFS. Is the
sector locked?
[42949379.600000] Erase at 0x00c00000 failed immediately: -EROFS. Is the

sector locked?

I had hoped that the P30 chips would be supported now, but it seems they are not fully. How can I unlock the sectors, if that is really the issue here.

This is really starting to scare me a little ;)

Thanks in advance!

Cheers
nils faerber

Signature · 4 lines
kernel concepts GbR      Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          Mob: +49-176-21024535
--
#1 lore raw
Quoted 4 lines · Nils Faerber

I had hoped that the P30 chips would be supported now, but it seems they are not fully. How can I unlock the sectors, if that is really the issue here.

P30 flash is supported in that it supports CFI. You can read and write to it as long as it's unlocked. CFI does not support automatic unlocking, it assumes if it's locked, it's locked for a reason. The bootloader has to ensure that the sectors occupied by the rootfs are unlocked before mounting the filesystem. We're using P30 here without problems.

Justin.

#2 lore raw
Quoted 10 lines · Justin Clacherty
Quoted 3 lines · Nils Faerber

I had hoped that the P30 chips would be supported now, but it seems they are not fully. How can I unlock the sectors, if that is really the issue here.

P30 flash is supported in that it supports CFI. You can read and write to it as long as it's unlocked. CFI does not support automatic unlocking, it assumes if it's locked, it's locked for a reason. The bootloader has to ensure that the sectors occupied by the rootfs are unlocked before mounting the filesystem. We're using P30 here without problems.

Hmm... OK.
Just in theory, can one write to a locked sector?

I ask because I flashed the very same rootfs to the chip using the bootloader. The bootloader, which is BLOB BTW, seems to be able to write to the chips and the contents written also seems to be OK (since I can boot and mount the rootfs).

Quoted 1 line

Justin.

Cheers
nils faerber

Signature · 4 lines
kernel concepts GbR      Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          Mob: +49-176-21024535
--
#3 lore raw
Quoted 2 lines · Nils Faerber

Just in theory, can one write to a locked sector?

No.

Quoted 5 lines

I ask because I flashed the very same rootfs to the chip using the bootloader. The bootloader, which is BLOB BTW, seems to be able to write to the chips and the contents written also seems to be OK (since I can boot and mount the rootfs).

Not sure how blob works, maybe it unlocks, writes, then relocks...

#4 lore raw
In reply to Nils Faerber
Quoted 10 lines · Nils Faerber

Hi!
I now did a kernel update (in fact, I started over with a new kernel) and am now using 2.6.18-RC6 from kernel.org.

I have read access to the flash, rootfs is mounted correctly but at first write attempt I get:

[42949375.150000] Freeing init memory: 96K
[42949376.480000] Erase at 0x00cc0000 failed immediately: -EROFS. Is the

sector locked?

Before the first write attempt you need to run flash-unlock on the corresponding flash partition.

Nicolas

#5 lore raw
Quoted 10 lines · Nicolas Pitre
Quoted 7 lines · Nils Faerber

I now did a kernel update (in fact, I started over with a new kernel) and am now using 2.6.18-RC6 from kernel.org.
I have read access to the flash, rootfs is mounted correctly but at first write attempt I get:

[42949375.150000] Freeing init memory: 96K
[42949376.480000] Erase at 0x00cc0000 failed immediately: -EROFS. Is the

sector locked?

Before the first write attempt you need to run flash-unlock on the corresponding flash partition.

Ah, cool, thanks!
I guess that this tool is part of mtd-utils, right?

Will be tested ASAP! But I fear that will have to wait until tomorrow, gotta go soon.

Thanks again!

Quoted 1 line

Nicolas

Cheers
nils faerber

Signature · 4 lines
kernel concepts GbR      Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          Mob: +49-176-21024535
--
#6 lore raw
In reply to Nicolas Pitre
Quoted 3 lines · Nicolas Pitre

Before the first write attempt you need to run flash-unlock on the corresponding flash partition.

Will this work if it's your rootfs? ie. it will need to be mounted and possibly written to before you get to the point where you can run flash-unlock. I guess if you mount ro then there won't be any writes.

Justin.

#7 lore raw
Quoted 7 lines · Justin Clacherty
Quoted 3 lines · Nicolas Pitre

Before the first write attempt you need to run flash-unlock on the corresponding flash partition.

Will this work if it's your rootfs? ie. it will need to be mounted and possibly written to before you get to the point where you can run flash-unlock.

Up to you to manage for flash-unlock to be executed before writes.

Quoted 1 line

I guess if you mount ro then there won't be any writes.

Yes, And then you can remount rw.

Nicolas