I am looking to add driver for a NOR flash connected to my CPU. Any pointers on how to go about it?
I already have an image that boots Ubuntu core 18 with kernel, gadget and core snaps and has drivers (not added by me) for network, usb, tpm, eMMC etc.
Yes, this is supposed to be a kernel driver. Is there a CONFIG that I should look for in defconfig that will enable this driver. Or is there more to be done to get /dev/mtd seen?
well, in your custom kernel make sure to have all the necessary CONFIG_MTD_* options enabled (_BLOCK,_BLKDEV, _PARTITIONS,_WHATEVER) plus the right one for the actual hardware driver … if you have some BSP kernel to look at, i’d grep for CONFIG_MTD in the defconfig for the board …
well, do you have jffs2 enabled (cat /proc/filesystems) and does the disk contain a valid jffs2 image ?
(note that Ubuntu Core does not support booting from mtd disks or flash filesystems currently (this requires some non-trivial changes in the auto-rollback bootloader handling), you will only be able to use this disk as additional device under /media or /mnt)
But, maybe a valid jffs2 image is not installed on the SPI NOR flash (/dev/mtdblock1). Any way to validate / install ? I tried mkfs but could not see mkfs.jffs2 on my device.
Understood about UC. Plan is to use it to hold some certs and logs.