Linux 2.6.28 kernel SD card initialization process

Source: Internet
Author: User

 

Recently, we are studying the driver of pxa300 SD card.Program, Figured out the SD card initialization process, the record is as follows

 

1. The pxamci_probe () function calls mmc_alloc_host () to allocate the mmc_host structure and initializes the mmc_rescan latency task.

2. initialize the mmc_host structure, initialize the MMC hardware controller registers, interrupt registration, and DMA initialization.

3. At the end of pxamci_probe (), call mmc_add_host () to set the driver model of the mmc_host device, and execute mmc_host_start ()

The mmc_rescan delayed task is started.

4. Then run the mmc_rescan () function, send related commands, and scan the sdio, SD, and MMC devices on the MMC controller in sequence.

5. After scanning the SD card, the system will obtain the information about the SD card from the response of the relevant command, initialize the SD card, and assign the mmc_card structure to describe the related features of the card,

And register mmc_card to the device layer of the "MMC" bus.

6. When mmc_card is registered to the device layer of the "MMC" bus, find the mmc_driver named "mmcblk" on the "MMC" Bus Based on the device driver model,

Call the mmc_blk_probe () function in mmc_drivcer.

7. In the mmc_blk_probe () function, the data structure related to the MMC block device is allocated to the SD card, device nodes and device numbers are allocated to the SD card, and the SD card is added

The block device layer initializes all SD cards.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.