Embedded Linux development practice (15): nand flash interface development (2)

The Universal NAND driver supports nearly all NAND-based chips and connects them to the Linux kernel's Memory Technology Device (MTD) subsystem. This interface uses the nand parallel port. You can see the devices in /dev of the shell, such as /mtd0, /mtd0ro..., mtdblock0, mtdblock1...
Insert image description here
sysfs provides several perspectives in the device hierarchy. The device must be connected to a certain bus to communicate with the CPU, so take a look at the /sys/bus directory.
Insert image description here
Insert image description here
The directory lists (actually symbolic links) all the registered devices and their drivers hanging on this particular bus. In fact, so does every other bus.
Another view into the hierarchy is through /sys/class:
Insert image description here

All subdirectories here group devices by class, build classes that will be registered and display drivers. In each subdirectory, you will see the symbollink for the device in the /sys/devices directory.
Since all symbolic links point to /sys/devices, let's check:

Guess you like

Origin blog.csdn.net/weixin_49369227/article/details/132668584