[Turn from] http://www.wowotech.net/comm/mmc_framework_arch.html
1. Preface
Introduced by EMMC Basic Technology 1:MMC Introduction of MMC, SD, Sdio, the introduction of these three technologies are originated from MMC technology, there are many similarities, so the Linux kernel Unified Use MMC framework to manage all the devices related to these three technologies.
This article will be based on EMMC basic technology 1:MMC Introduction to the MMC technology, learning the Linux kernel MMC framework software architecture.
2. Software Architecture
Linux Kernel Drive Framework has two points (although the previous article has been emphasized many times, this article is to explain again, because this design idea, said 1000 times will not bother):
1) Abstract hardware (what the hardware architecture looks like, what the driver framework should look like).
2) Provide the "customer" with the API to use the hardware (the most previously mentioned customers are "application of user space", but there are other "customers", such as other driver in the kernel space, other frameworks).
As an example of this article, the software architecture of the MMC framework is shown in "Picture 1" below:
Figure 1 Linux MMC Framework software Architecture
The MMC framework has both "left-to-right" and "bottom-up" hierarchies, respectively.
1) from left to right
The MMC protocol is a bus protocol and therefore includes the host controller, bus, and card three entities (from left to right). Accordingly, the MMC framework abstracts the host, bus, and card three software entities to correspond to hardware one by one:
Host, responsible for driving the host controller, provide such as Access card register, test card Plug and write, read card and other operating methods. From the device model point of view, the host detects the insertion of the card and registers the MMC card device with the bus;
Bus, which is the virtual abstraction of MMC bus, is a standard device model, which holds MMC card and corresponding MMC driver (driver);
Card, abstract specific MMC card, by the corresponding MMC driver driver (from this point of view, you can ignore the technical details of MMC, just care about a specific function of the card device, such as memory card, WiFi card, GPS card, etc.).
2) from bottom to top
The MMC framework also has 3 levels from bottom to top (cliché):
MMC core is located in the middle, is the core implementation of the MMC framework, is responsible for abstract host, bus, card and other software entities, responsible for providing a unified, convenient to the bottom of the API to write host controller driver;
The MMC host controller driver is located on the ground floor, based on the framework provided by the MMC core, which drives the specific hardware (MMC Controller);
MMC card driver is located on the top, responsible for driving the MMC core abstraction out of the virtual card device, and docking the other core framework (such as block devices, TTY, wireless, etc.), to achieve specific functions.
3. Reference documentation
[1]http://www.wowotech.net/comm/mmc_framework_arch.html
Linux MMC framework1-software architecture