Linux mtd one analysis subsystem Box Overview

      Starting today, we analyze linux mtd subsystem. mtd subsystem memory technology is the device subsystems including the relevant nor flash, nand flash a flash memory device subsystems module, and for sd, tf and other storage devices, managed by the main module and create a corresponding subsystem mmc block device. And for mtd subsystem it will be based on original equipment mtd, create mtd mtd character devices and block devices, in order to associate with the upper vfs system.

 

For mtd subsystems, mainly related to introduce the following aspects:

A, MTD subsystem overview

Two, MTD device driver model associated data structures described

Three, MTD block device with the character device

Four, MTD upper interface and nor / nandflash driven association

Five, nandflash drive introduction

Six, norflash brief drive

Seven, spi nor flash drive briefly

Eight, the application layer functions to complete the image upgrade the flash storage

 

 

This part describes the concepts MTD subsystem, and a brief description of the architecture mtd subsystems, including a file system with the upper sub mtd, association and the like between the bottom drive.

 

 

FIG logical association between the device abstraction

    The figure is an association between norflash, nandflash and cpu. For NORFlash, can be associated directly with the cpu, it can also be joined by the cpu spi controller; and for NandFlash, which can, spi controlloer connected via the cpu nandflash controller.

 

      And for spi controller, spi device, and associated spi driver's abstract, it has been introduced in the previous column. And for nandflash controller, we will explain in detail later. And the model is driven by mtd to nor flash, nandflash a flash memory device abstraction, the abstract of the upper module into the apparatus into a unified model (mtd_info), then by flash mtd_info accomplish specific device driver for the binding and, thus completing the flash memory device access operations. Here mtd abstract, abstract vfs on and similar.

 

 

 

 

VFS driver model and FLASH device drivers association MTD

Mtd device driver model as follows, vfs, flash FIG association between a device driver.

      For mtd driver model, its specific storage drive for the associated file system at the main association. FIG correlation between them

As follows.

      Wherein mtd block, mtd char, is a partial mtd driven model, and FTL, NFTL not belong portion mtd driver model, implemented by the specific file system, such as when ubi file system is mounted, it is through the device file / dev / ubiX_Y to mount; yaffs2 for the file system, which may use direct / dev / mtdblockX mount it (which of course also possible without the aid of mtdblock). And for mtd char, the main achievement of sequential access to the appropriate flash device, mtd char can achieve what specific functions

It?

     Possible applications one: When we want to achieve the upgrade bootloader, kernel, file system image file in the operating system, you can read and write / dev / mtdX (mtd character device), upgrade for the bootloader, kernel, filesystem of operating.

 

      For mtd block, mtd char, which are the same mtd_info call (i.e. mtd device), the specific read and write operation flash chips.

       And mtd_info represents a flash memory or a flash chip partition, when the flash device driver initialization (NandFlash devices, NOR flash devices), will be in accordance with partitioning, the corresponding mtd_info created, and completed with the chip driver mtd_info tie given operation. In the creation of mtd_info, is created corresponding mtd char, mtd block, thereby completing associated with the vfs.

 

   Data in this chapter for mtd device driver model to make a general overview (has not been updated for more than a month, between people suddenly lazy down herein, this that is off the ground, in order to push myself to continue to update).

 

发布了145 篇原创文章 · 获赞 30 · 访问量 46万+

Guess you like

Origin blog.csdn.net/lickylin/article/details/104718529