Order:
When talking about the embedded Linux driver development class, I found that many students are more interested in the SD card driver.
Interest. I will discuss it later. In many technical forums, many people have asked this question. Therefore, I want to write this article and hope it will help you learn it.
A few days ago I wrote an article titled "operating principle of Linux driver for SD Card Based on S3C2410 (I)", explaining how the Linux driver works on the Operating System
Read and Write SD cards. After learning how the operating system works, you can now think about how Linux manages and manages SD cards. In Linux, the SD driver can be divided into three layers: block device layer
(Mmc_block.c
, Mmc_sysfs.c, mmc_queue.c), MMC protocol layer (MMC. c), SD driver layer (s3c2410_sdi.c ).
The following describes the drivers:
1. s3c2410_sdi.cCodeInitialization Process;
2. Registration of SD card Block devices;
3. Implementation of request and data transmission.
The reference code for the process described below is our Huaqing Vision training center.
A set of code used in teaching. The kernel version is 2.6.8, and the process of other versions is similar.
I. Code initialization process of s3c2410_sdi.c
Ii. Registration of SD card Block devices
Iii. Implementation of request and Data Transmission