Download presentation
Presentation is loading. Please wait.
1
1 Linux SD/MMC Driver Stack Champ Yen http://champyen.blogspot.com champ.yen@gmail.com
2
2 Core SDIOSDMMC BLOCK Device UART (SDIO) BlueTooth (SDIO) WIFI (SDIO) Host AITOMAPS3C...... Device ● Implement specific subsystem devices(ex: UART, WIFI) by utilizing Core API. Core -Diagnosing SD/MMC/SDIO device -SD/MMC/SDIO Protocol Layer implementation -Power Management Policy Host -Hardware dependent interface -Handling requests from Core layer. SD/MMC Stack Architecture
3
3 Host Structure struct mmc_host { …… const struct mmc_host_ops*ops; /* minimum frequency */ unsigned intf_min; /* maximum frequency */ unsigned intf_max; /* provided voltages */ u32ocr_avail; unsigned longcaps; /* host specific block data */ unsigned intmax_seg_size; unsigned shortmax_hw_segs; unsigned shortmax_phys_segs; unsigned shortunused; unsigned intmax_req_size; unsigned intmax_blk_size; unsigned intmax_blk_count; …… };
4
4 host allocation struct mmc_host *mmc; //private host data, hw dependent info is saved here. struct foo_host *host; //allocate mmc_host structure with private data size //pdev is the pointer of platform_device mmc = mmc_alloc_host(sizeof(struct foo_host), &pdev->dev); ////////////// initialization after allocation /////////////////// ////////////// private host data pointer is get as below struct foo_host *host; host = mmc_priv(mmc);
5
5 Host Operations struct mmc_host_ops { /* request handler */ void(*request)(struct mmc_host *host, struct mmc_request *req); /* host controller setting function */ void(*set_ios)(struct mmc_host *host, struct mmc_ios *ios); /* read-only detection, return 1: read-only, 0: read-write */ int(*get_ro)(struct mmc_host *host); /* card detection return 1: Card Inserted, 0: Card Not Inserted */ int(*get_cd)(struct mmc_host *host); /* enable SDIO irq */ void(*enable_sdio_irq)(struct mmc_host *host, int enable); };
6
6 request struct mmc_request { /* command to be issued */ struct mmc_command*cmd; /* data transmission, NULL means no transmission */ struct mmc_data*data; /*stop command after data transmission */ struct mmc_command*stop; /* completion data, used by core layer for sync. */ void *done_data; /* request post processing function */ void (*done)(struct mmc_request *); };
7
7 request handling flow req->data == NULLsendcmd(req->cmd) Data Transmissionreq>stop == NULL mmc_request_done sendcmd(req->stop) N Y Y N mmc_request cmd data stop
8
8 Q&A
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.