Skip to contentSkip to conversation

MTD lock support for AMD_STD flash.

DISCUSSION Pantelis Antoniou 2 participants 2 messages Sep 13, 2004 – Sep 15, 2004 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi there

While trying to get MTD in 2.6 working in my board I stubbled on this.

The lock/unlock logic does not seem to work for AMD STD jedec flashes.

Quoted 11 lines
Oops: kernel access of bad area, sig: 11 [#1]
NIP: C00F5354 LR: C00F5348 SP: C03FFDF0 REGS: c03ffd40 TRAP: 0300    Not tainted

MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
DAR: C4CD1002, DSISR: 00018C09
TASK = c0341980[107] 'fw_saveenv' THREAD: c03fe000Last syscall: 54
GPR00: 00000000 C03FFDF0 C0341980 00000014 C01D9C24 00000007 91FE2C56 00000000
GPR08: C01D9C28 C5061000 C03ABF0C C03FFD20 00021555 20000900 03FCF500 03FCA31C
GPR16: 007FFE30 03FCF478 03F7E438 7FFFFB00 00000000 C00F52D0 C03FFE68 C01A5E68
GPR24: 00000000 C3FF4D90 C3FDEF20 C01A5E68 C03FFE68 00000000 C3FF4DC8 FFC70002 NIP [c00f5354] do_xxlock_oneblock+0x84/0xbc
LR [c00f5348] do_xxlock_oneblock+0x78/0xbc

Quoted 9 lines
Call trace:
 [c00f4944] cfi_amdstd_varsize_frob+0x1c4/0x260
 [c00f5404] cfi_amdstd_unlock_varsize+0x34/0x44
 [c00ee09c] part_unlock+0x64/0x7c
 [c00f1140] mtd_ioctl+0x860/0xa14
 [c006235c] sys_ioctl+0x424/0x450
 [c00037b0] ret_from_syscall+0x0/0x44
Kernel panic - not syncing: Aiee, killing interrupt handler!
 <0>Rebooting in 180 seconds..

This happens when trying to lock a block for MX29LV040C, and I think will happen with all AMD STD flashes.

The thing is that these chips don't have support for locking, but I can't find a way to declare it in the command set.

So the way to avoid this I set the lock & unlock methods in my map file.

This is a gross hack however and I'm wondering if there's an easier way...

Regards

Pantelis

#1 lore raw
Quoted 6 lines · Pantelis Antoniou

Hi there

While trying to get MTD in 2.6 working in my board I stubbled on this.

The lock/unlock logic does not seem to work for AMD STD jedec flashes.

Right. We got away with this for a while because the on devices without lock/unlock methods people usually don't call them.

Quoted 9 lines

This happens when trying to lock a block for MX29LV040C, and I think will happen with all AMD STD flashes.

The thing is that these chips don't have support for locking, but I can't find a way to declare it in the command set.

So the way to avoid this I set the lock & unlock methods in my map file.

This is a gross hack however and I'm wondering if there's an easier way...

Yes. It should already be committed into MTD cvs. Please check it out. With a little luck I will start pushing these changes to 2.6 in the next day or so.

Eric