MTD start and config at runtime

3.2k views Asked by At

Got a embedded system that i have root shell access to. I can not enter the U-boot boot menu. (boot delay=0)

The device boots from a nor flash and loads the filesystem on emmc. It does not set /dev/mtd devices.

I want to access the nor flash.

There are MTD drivers on the system, so that seems the best option. (no experiance with this at all, so please correct me if i'm wrong)

drwxrwxr-x 2 1000 root  1024 Jul 29  2013 chips
drwxrwxr-x 2 1000 root  1024 Jul 29  2013 maps
-rw-rw-r-- 1 1000 1000 21544 Jul 29  2013 mtd.ko
-rw-rw-r-- 1 1000 1000  8560 Jul 29  2013 mtd_blkdevs.ko
-rw-rw-r-- 1 1000 1000  6132 Jul 29  2013 mtdblock.ko
-rw-rw-r-- 1 1000 1000  9648 Jul 29  2013 mtdchar.ko

If start MTD with modprobe, /proc/mtd is created. Nothing in dmesg.

root:/proc# cat /proc/mtd
dev:    size   erasesize  name

So no partition. How can i configure mtd to be able to access the nor flash. ( physical addresses are known )

Thanks

1

There are 1 answers

0
tarabyte On

You need to describe your NOR partitions in a board-specific file in the kernel. In u-boot, you should be able to see them with smeminfo.

In your linux kernel, you'll need to populate an array of mtd_partitions.

Find more here: http://free-electrons.com/blog/managing-flash-storage-with-linux/