Does the MTD driver support an unlock or an erase operation for new nor banks? I have been unable to erase or unlock either of the two NOR banks added.
flash_unlock: error!: could not unlock device: /dev/mtd3
error 95 (Operation not supported)
Unless there is a read only flag in the device tree, then we may be missing the necessary support for erasing either bank. Is there a read only flag set for either of the two new NOR banks in the device tree? I didn’t see anything.
Here is a similar issue:
https://stackoverflow.com/questions/19706584/erasing-flash-nor-ioctlmemunlock-return-status
root@ls1043ardb:~# cat /sys/class/mtd/mtd3/flags
0xc00
A hexadecimal value representing the device flags, ORed
together:
0x0400: MTD_WRITEABLE - device is writable
0x0800: MTD_BIT_WRITEABLE - single bits can be flipped
0x1000: MTD_NO_ERASE - no erase necessary
0x2000: MTD_POWERUP_LOCK - always locked after reset
root@ls1043ardb:~# cat /sys/class/mtd/mtd3/dev
90:6
Major and minor numbers of the character device corresponding
to the read-only variant of this MTD device (in
<major>:<minor> format). In this case <minor> will be odd.
root@ls1043ardb:~# ls -lia /dev/mtd3*
1322 crw------- 1 root root 90, 6 Jan 1 1970 /dev/mtd3
1323 crw------- 1 root root 90, 7 Jan 1 1970 /dev/mtd3ro
1326 brw-rw---- 1 root disk 31, 3 Jan 24 05:42 /dev/mtdblock3
root@ls1043ardb:~# ls -l /dev/mtd*
crw------- 1 root root 90, 0 Jan 1 1970 /dev/mtd0
crw------- 1 root root 90, 1 Jan 1 1970 /dev/mtd0ro
crw------- 1 root root 90, 2 Jan 1 1970 /dev/mtd1
crw------- 1 root root 90, 3 Jan 1 1970 /dev/mtd1ro
crw------- 1 root root 90, 4 Jan 1 1970 /dev/mtd2
crw------- 1 root root 90, 5 Jan 1 1970 /dev/mtd2ro
crw------- 1 root root 90, 6 Jan 1 1970 /dev/mtd3
crw------- 1 root root 90, 7 Jan 1 1970 /dev/mtd3ro
brw-rw---- 1 root disk 31, 0 Jan 1 1970 /dev/mtdblock0
brw-rw---- 1 root disk 31, 1 Jan 1 1970 /dev/mtdblock1
brw-rw---- 1 root disk 31, 2 Jan 1 1970 /dev/mtdblock2
brw-rw---- 1 root disk 31, 3 Jan 24 05:42 /dev/mtdblock3
The minor numbers for /dev/mtdX look fine. /dev/mtd0 should have a minor
- of 0, /dev/mtd1 should have 2, /dev/mtd2 should have 4 etc. The
odd-numbered minor numbers are intended for read-only devices.
These devices should be writable and the minor number appear fine. Is there MTD driver support for the new NORs? This may need to be added to the driver.