Skip to contentSkip to conversation

/dev/mtd* not there with latest MTD

DISCUSSION Bernhard Priewasser 3 participants 5 messages Oct 13, 2005 – Oct 24, 2005 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hello,

I'm using a modified 2.6.11 kernel running on a Hynix eval board with NOR flash. Using the existing MTD works fine (CONFIG_MTD_BLOCK and CONFIG_MTD_CHAR enabled), MTD is using a custom map and is running fine. U-Boot uses nfsroot.

Today I patched in the latest CVS snapshot (2005-10-10). Kernel is starting without problems (MTD debug level 3):

Quoted 10 lines

H720x-MTD probing 32bit FLASH
H720X: Found 2 x16 devices at 0x0 in 32-bit bank
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
cmdlinepart partition parsing not available
Using builtin partition table
Creating 5 MTD partitions on "H720X":
0x00000000-0x00080000 : "ArMon"
mtd: Giving out device 0 to ArMon

Quoted 8 lines

0x00080000-0x000c0000 : "Env"
mtd: Giving out device 1 to Env
0x000c0000-0x00240000 : "Kernel"
mtd: Giving out device 2 to Kernel
0x00240000-0x00640000 : "Ramdisk"
mtd: Giving out device 3 to Ramdisk
0x00640000-0x02000000 : "jffs2"
mtd: Giving out device 4 to jffs2

But: there is no /dev/mtd* or /dev/mtdblock* at all!
There are no changes to u-boot or some other kernel config, only the new MTD source.

Patching the kernel with 2005-06-21 CVS results in having only /dev/mtdblock*, but no /dev/mtd*!..... very confusing.

I would be glad if someone could help, I can provide more information if needed.

Regards,
Bernhard

#1 lore raw
Quoted 4 lines · Bernhard Priewasser

But: there is no /dev/mtd* or /dev/mtdblock* at all!
There are no changes to u-boot or some other kernel config, only the new MTD source.

Patching the kernel with 2005-06-21 CVS results in having only /dev/mtdblock*, but no /dev/mtd*!..... very confusing.

You're probably using devfs to automatically create device nodes, which is on its way out. udev is the way recent 2.6 kernels do this http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

Signature · 1 line
Todd
#3 lore raw
In reply to Bernhard Priewasser
Quoted 3 lines

But: there is no /dev/mtd* or /dev/mtdblock* at all!
There are no changes to u-boot or some other kernel config, only the new MTD source.

This is no longer created by the CVS version MTD. Not wanting udev on my device (I was able to not use initrd's for years, why should I now begin?), I made some old-fanshiond mknod-style device files there. They have the same names as devfs without devfsd had, so my software just runs fine.

#4 lore raw
Quoted 2 lines

I made some old-fanshiond mknod-style device files there. They have the same names as devfs without devfsd had, so my software just runs fine.

/dev/mtdblockX works fine, but /dev/mtdX NOT.

Did you only create mtdblocks or mtds too?
Older MTD creates /dev/mtdX with minor numbers X*2; running flash_erase (for example) works fine.
Not so with same kernel, but latest CVS: creating exactly the same /dev/mtdX as mtdchar.c would do (e.g. older MTD would do), I cannot operate the flash properly. flash_erase results in an CFI error:

Quoted 6 lines
Quoted 1 line

flash_erase /dev/mtd4

Erase Total 1 Units
Performing Flash Erase of length 262144 at offset 0x0
H720X: block erase error: (status timeout)
MTD Erase failure: Input/output error
H720X: Waiting for chip to be ready timed out. Status 300080

Hm...

Regards,
Bernhard