1. Kernel MMC/SD driver framework
There are three subdirectories under the kernel drivers/mmc directory: card/, core/, and host/, which just represent the three levels of MMC/SD drivers, as follows:
1) Block layer
Provides file operation interfaces to the file system layer and user space. The main file is block.c in the card/directory. queue.c provides it with several functions to operate the queue.
The block layer calls the interfaces provided by core.c and sysfs.c in the core/directory to identify the partitions of the storage card, read and write the storage card, and other functions.
2) Core layer
The core layer code is in the core/directory. It encapsulates the MMC/SD commands and implements the MMC/SD protocol. It calls the interface of the host controller layer to complete the identification, setting, reading and writing of the memory card.
It can be seen that the MMC/SD interface connection on the development board is: nCD is connected to the external interrupt pin EINT16, and an interrupt will be triggered when the memory card is connected or removed.
Porting the MMC/SD/SDIO controller driver is divided into three steps: patching, adding MMC/SD platform devices, and modifying the host controller driver to specify the nCD interrupt in the above figure.
1) Patch the kernel
2) Add MMC/SD platform equipment
Previous article:Some concepts of arm (the difference between ARM7 and Cortex-M)
Next article:IDE interface driver porting
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【National Technology N32G430】02 Small expansion, communication from top to bottom
- PCB and PCB LAYOUT (dry goods sharing)
- BlueNRG beacon+serial port transparent transmission
- KiCad Diff Tool
- Engineers must know: "5 types" of production processes that must be considered before PCB layout!
- Patent application
- 【Portable Programmable Meter】Project Submission
- There is a basic question about AD9
- After current sampling, the inverted ratio is amplified by 2 times (U9A), and then the output is connected to the form of a hysteresis comparator (U9B), which is...
- DSP-BIOS usage from environment to building the first project