SlideShare a Scribd company logo
Outline
0 Storage Devices on mobile platform
(smart phones, tablets etc.)
0 RAM
0 Internal Storage Devices
0 External Storage Devices
0 What is Flash Memory ?
0 Kernel storage driver overview
(http://lxr.free-
electrons.com/source/drivers/mmc/ )
0 mmc device driver overview
0 Top view diagram
0 block diagram and Internal diagram
0 SD and SPI protocol
0 Mmc driver different Layers
0 Important functions to look
for
0 Tuning procedure
0 SD Hot-plug
0 Sdhci controller role in Data
transfer
0 SDMMC device registration
0 Sdhci probe()
0 How to configure/enable
SDHCI support
Note: To understand the few terms in this presentation, please refer
to Introduction to Kernel & Device Drivers PPT
(http://www.slideshare.net/rampalliraj/kernel-device-drivers): It
covers what is Kernel, what is a Module and what is device driver .
Storage Devices on Mobile Platforms
0 Mobile Platforms will have mainly Three storage devices for applications/users to
store the Data
0 RAM (Random Access Memory): also known as main memory and primary memory.
0 Internal Storage device (Non-removable device)
0 External Storage device (Removable device)
0 RAM is Volatile memory i.e. data present in this device will be lost when power is
removed/off.
0 Internal Storage Device: Mobile devices will have a built-in non-volatile memory
called internal storage.
0 External Storage Device: Android devices may support removable non-volatile
memory called external storage devices.
0 Example: Look at Memory & Storage specification of smartphone mobile.
RAM: 2GB
Internal Storage:
16GB
External storage:
upto 128GB
Snapshot taken from Flipkart Samsung j5-6 mobile spec.
What is Flash Memory ?
0 Flash Memory is a non-volatile, solid state storage device i.e. keeps
its data without power.
0 Flash Memory is being used in wide range of devices. Examples are
0 Internal storage devices (eMMC or UFS)
0 USB sticks and SD Memory Cards
0 Digital audio players
0 Flash memory offers very high speed access to data.
0 Advantage: Flash memory, when packaged in a "memory card", is
very resilient to damage, unlike many other storage devices. It can
withstand extremes of temperature, being immersed in water or
being accidentally dropped [2].
0 Disadvantage: It has a limited number of read/write cycles which
limits its useful life span.
Internal Storage Device
0 Internal Storage mostly holds the android operating
system so that the android device is able to access
input and output devices.
0 System memory (see image)
0 It is also called as Device Memory (internal memory).
0 Go to settings page and select Storage option and you will
see the internal storage capacity of your device.
0 It also stores the applications or data that user saves in
it.
0 The data stored in internal storage can be accesses
much faster than the data present in external storage
device.
0 Internal storage device is directly connected to the
mother board where as the external device connected
through a hardware interface.
0 Disadvantage: If device fails to boot then all the data
present in the internal storage device may be lost.
Internal Storage Devices
0 Following are the storage devices which are mainly used for
main storage devices on mobile platforms
0 eMMC: embedded Multi-Media Controller, refers to a package
consisting of both flash memory and a flash memory controller
integrated on the same silicon die.
0 UFS: Universal Flash Storage (UFS) is a flash storage like eMMC
device with higher data rates compared to it.
0 SATA: Serial ATA is a computer bus interface that connects host
bus adapters to mass storage devices such as hard disk drives,
optical drives, and solid-state drives.
0 Will cover Linux Kernel eMMC (MMC storage)device drivers
in this presentation.
External Storage Device
0 Android devices may support
the capability of adding more
external storage via removable
cards like SD memory cards.
0 SD card: Secure Digital (SD) is
a non-volatile memory card
format developed by the SD
Card Association (SDA) for use
in portable devices.
0 Advantage: External storage
devices are portal i.e. data can
be easily moved from one
location to other location.
0 These storage devices are
used for data backup
0 Disadvantage: Data transfer
rate is slow compared to
internal storage devices.
SD card details found in
settings->storage android
How to identify SD card’s class?
Preferable card: class 10 or UHS-I cards
Class
Minimum
Serial Data
Writing
Speed
Symbol on
SD card
Class 2 2MB/s
Class 4 4MB/s
Class 6 6MB/s
Class 10 10MB/s
UHS Speed
Class 1 (U1)
10MB/s
SD Memory card architecture
Card Info
registers
Usage
CID Card identification number
RCA Relative card address published by
the card during card identification
process.
DSR Driver stage register
CSD Max data transfer rate and defines
data format, error correction type,
maximum data access/transfer time,
Maximum read/write block length.
SCR SD configuration register
OCR Operation condition reg
SSR SD status register
CSR Card status register
SD and SPI protocol
SPI Protocol SD Protocol
Design simple Complex
Loss of performance: 1bit mode Wide bus option. Supports 1bit and 4bit
modes.
Card identification and addressing
methods replaced by the h/w chip select
CS signal
Its own Card Identification process
No broadcast commands Available
Uses only 7 pins
DAT1 and DAT2 are not used
DAT3 used as CS
DAT0 data transfer
CLK line
DataIn line (Host to card line)
9 pins model:
DAT0-DAT3 lines for data transfer
CLK line – clock line
CMD line – command line
3 Power lines – supply voltage lines
Storage Device Driver for
eMMC and SD devices
0 Storage Device Driver ($kernel/drivers/mmc) is common
for eMMC devices (internal storage device) and for SD
memory cards (external storage device).
0 eMMC and SD are block devices i.e. mmc device driver
communicates with these devices in the form of blocks of
data (512 bytes)
0 Character device is one with which the driver communicates
by sending/receiving single characters (bytes), eg:
0 mmc drivers receives the block requests from generic block
layer (upper layer)
mmc Device Driver Top View
Kernel
Space
User Space
Virtual File System Layer
Generic Block Layer
mmc device driver
Hardware
devices
eMMC device SD memory card
User applications
mmc Device Driver block diagram
Kernel
Space
Virtual File System Layer
Generic Block Layer
Hardware
devices
eMMC device SD memory card
mmc device driver
mmc Block/Queue driver
mmc core driver
mmc host driver
SDHCI Host driver
/mmc/card/block.c
/mmc/card/queue.c
/mmc/core/core.c
/mmc/core/mmc.c
/mmc/core/sd.c
/mmc/host/sdhci.c
mmc device driver overview
0 mmc queue receives block read/write/erase
requests from the generic core block layer
0 mmc queue driver picks up one request from its
queue and assign it to mmc block driver
0 mmc block driver analyze the type of request and
forwards the request to mmc core driver.
0 mmc core driver has the protocol implementation
for eMMC/SD devices detection, enumeration and
data transfers to communicated with the actual
Hardware device.
0 mmc core driver receives the request from block
driver, prepares a mmc_request and forwards it to
the mmc host driver.
0 mmc host driver initiates the transfer to device by
programming Hardware controller registers.
0 Once the request get processed by the hardware
controller, an interrupt gets generated .
0 mmc host driver receives request complete
interrupt, analyzes it and pass the response to block
driver. This process continues for all block requests.
mmc Queue driver
(queue.c)
mmc core driver
(core.c, mmc.c, sd.c)
mmc host (controller)
driver
SDHCI Host driver
sdhci.c
mmc Block driver
(block.c)
mmc queue layer
(/drivers/mmc/card/queue.c)
0 Important functions:
0 mmc_init_queue()
0 initializes the device queue
0 Creates and run the kernel thread (mmc_queue_thread)
“mmcqd” to fetch block I/O requests from core block
layer and pass it mmc block layer.
0 mmc_queue_thread()
0 Fetch block I/O requests using blk_fetch_request()
0 Pass the request to mmc block layer using callback
issue_fn() -> redirects to -> mmc_blk_issue_rq() in
mmc block driver
mmc block layer (/drivers/mmc/card/block.c)
0 Important functions: 1) mmc_blk_probe()
0 Calls the mmc_queue_initialize() to initialize mmc queue.
0 Allocates the block devices (eMMC and SD card) and its partitions.
0 Initializes the mmc_blk_data (md) structure with required function callbacks for
I/O requests, assigns MAJOR/MINOR info.
md->queue.issue_fn = mmc_blk_issue_rq; md->disk->major =
MMC_BLOCK_MAJOR; md->disk->first_minor = devidx * perdev_minors;
0 2) mmc_blk_issue_rq() – receives block I/O request from mmc queue thread
from mmc queue driver. If I/O request type is ERASE then it calls
mmc_blk_issue_discard_rq(). If I/O request is READ/WRITE then calls
mmc_blk_issue_rw_rq()
0 2A) mmc_blk_issue_rw_rq() – prepares mmc block request and responsible
for followings: Sets data block size to 512 (FIXED)
0 Retrieve block count information using blk_rq_sectors()
0 Assigns appropriate command flags and data flags
0 Sets the timeout for a Data command using mmc_set_data_timeout() function
(defined in mmc core driver)
0 Assign the mmc block request to mmc core driver by calling mmc_start_req()
function.
mmc core layer
(/drivers/mmc/core/*)
0 It Implements all SD/eMMC-dependent functionality, entire
communication protocol is implemented in this layer.
0 Receives request in mmc_start_req() from mmc block layer
0 Before starting this new request, it checks for any ongoing
request. Holds this new request until the ongoing request is
processed.
0 It calls mmc host layer function sdhci_request() to program the
command and its dependant parameters in the mmc controller
register for initiating the command transfer.
(/drivers/mmc/host/sdhci.c)
mmc host layer (drivers/mmc/host/*)
0 It implements the driver for most known platform controllers and
is platform dependent.
0 Important functions:
0 sdhci_add_host() : adds the sdhci host controller with the driver model.
It initializes the sdhci h/w controller and enables sdhci interrupts.
0 sdhci_request(): It initiates the data transfer of received request by
programming the command details in the corresponding h/w register.
0 Sets the SW timer to ensure that there is no infinite wait for the transfer
complete interrupt
0 Prepares the data and sets SDMA or ADMA mode
0 sdhci_irq(): It receives the transfer complete interrupt and analyzes it
for any errors. It sends the response of the transfer to block layer.
0 sdhci_execute_tuning(): Tuning procedure: It is required for reliable data
transfers when interface freq is more than 50MHz. It determines the TAP value by
issuing CMD19.
0 Controller issues CMD19 (SD/SDIO) or CMD21(eMMC) to get card’s tuning block at the
current tap value X. Compares with its tuning block
0 If matches - Tuning is passed for the tap value X
0 Else - Tuning is not passed for the tap value X, try next tap X+1
SD Host controller role @Data Transfer
0 Data location of system memory  DMA_SYSTEM_ADDR (If DMA supported)
0 Set Block size  BLOCK_SIZE
0 Set Block count  BLOCK_COUNT
0 Set argument value  ARGUMENT
0 Set TRANSFER_MODE value, determines
0 Single/Multi-Block transfer
0 Block count enabled ?
0 Data transfer direction
0 ACMD12(eMMC/SD) or CMD52(SDIO) enabled ?
0 DMA enabled ?
0 Set COMMAND  execution started
0 Wait for CMD complete Interrupt
0 Write 1 to the CMD_COMPLETE in Normal status Interrupt Register
0 Based on Read/Write CMD, the associated Registers/Interrupts enabled
0 Wait for Buffer Read Ready or Buffer Write Ready Interrupt
0 Clear Buffer Read Ready Status or Buffer Write Ready Status
0 Wait for TRANSFER_COMPLETE Interrupt
0 Clear TRANSFER_COMPLETE Status
Mmc driver features
0 Host-Device interface is reliable when FREQ limits upto 50MHz
0 SD: High speed (HS) SD cards, class 4 cards
0 eMMC: eMMC devices with versions 4.41 or below
0 Tuning procedure is required when host-device interface runs at more
than 50MHz.
0 SD: Ultra High Speed (UHS) SD cards, and class 10 SD cards.
0 eMMC: eMMC devices with versions 4.5 or more supports tuning
0 Mmc driver supports SD hot-plug feature, so that SD card can be inserted
into already running device without powering of the device.
0 MMC driver supports voltage switching feature, if SD cards of type 10 or
UHS-I inserted then voltage switching is invoked to switch voltage from
3.3 V to 1.8V for power optimization.
0 UHS SD cards runs at 1.8V
0 Clock gating is enabled: If there are no transactions on eMMC/SD interface
then clock supply will be off, to save the power of the device.
SDMMC devices registration
0 Device registration requires both device name and driver name should
match
0 Device registration is done in board-<board-name>-sdhci.c
0 platform_device_register(&tegra_sdhci_device3); /* eMMC */
platform_device_register(&tegra_sdhci_device2); /* SD/SDIO */
platform_device_register(&tegra_sdhci_device0); /* SDIO/SD */
0 Platform_device Structure:
static struct platform_device tegra_sdhci_deviceX = {
.name = "sdhci-tegra",
.id = X, /* X = 0 or 1 or 2 or 3 */
.resource = sdhci_resourceX,
.num_resources = ARRAY_SIZE(sdhci_resourceX),
.dev = { .platform_data = &tegra_sdhci_platform_data3, },
};
0 As part of device enumeration, we use discovery method to identify
whether the device is eMMC or SD or SDIO.
SDHCI probe()
Probe() is called when device is recognized by the platform
Driver’s init function gives kernel a list of devices it is able to
service, along with a pointer to a probe function. Kernel then calls
the driver’s probe function one for each device.
0 probe function starts the per-device initialization:
0 initializing hardware, allocating resources, and
0 registering the device with the kernel as a block device.
0 Kernel/drivers/mmc/host/sdhic-tegra.c  sdhci_tegra_probe()
0 Host controller initialization at
kernel/drivers/mmc/host/sdhci.c  sdhci_add_host()
0 Device initialization starts in
kernel/drivers/mmc/core/core.c  mmc_rescan()
0 Starts execution when Host detects the device.
0 mmc_attach_sdio()  sdio.c [core driver]
0 mmc_attach_sd()  sd.c [core driver]
0 mmc_attach_mmc()  mmc.c [core driver]
How to enable SDHCI controller:
MMC/SD Card support Configuration
0 Configure below variables for mmc devices (eMMC
and SD devices share same sdhci controller)
0 MMC
0 MMC_SDHCI
0 MMC_SDHCI_PLTFM
0 Optional
0 MMC_DEBUG
0 MMC_BLOCK
0 drivers/mmc/Kconfig
Conclusion
0 eMMC device is used for internal storage on mobile platforms
0 SD device (external SD cards) is used for external storage on
mobile platforms
0 eMMC device and SD device both uses same driver on Linux
platform. Pointer to this driver is
http://lxr.free-electrons.com/source/drivers/mmc/
0 eMMC and SD devices registers with block layer as a block devices.
0 Mmc driver sub-divided into three layers block (or queue)
subsystem, core layer and host layer.
0 eMMC and SD uses SD protocol for communication.
0 Sdhci host controller communicates with eMMC and SD devices.
0 Class 10 or UHS-I type SD cards are preferable for high data rates.
References
1. Wikipedia:
https://en.wikipedia.org/wiki/Secure_Digital
2. TEACH-ICT – The very best KS3, GCSE and A Level
Computer Science resources.
3. SAMSUNG Galaxy J5 - 6 (New 2016 Edition)(Black,
16 GB) Specification snapshot from flipkart.com
4. SD Specifications Part A2 SD Host Controller
Standard Specification Version 3.0
5. JEDEC STANDARD EMBEDDED MULTI-MEDIA CARD
(e•MMC), ELECTRICAL STANDARD (4.5 device)
THANK YOU 
Have a look at
My PPTs:
http://www.slideshare.net/rampalliraj/
My Blog: http://practicepeople.blogspot.in/

More Related Content

What's hot

Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
GlobalLogic Ukraine
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
Pankaj Suryawanshi
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
RajKumar Rampelli
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
艾鍗科技
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
Satpal Parmar
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
Linaro
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?
Michelle Holley
 
Pcie drivers basics
Pcie drivers basicsPcie drivers basics
Pcie drivers basics
Venkatesh Malla
 
Interrupts
InterruptsInterrupts
Interrupts
Anil Kumar Pugalia
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators
Hao-Ran Liu
 
Qemu device prototyping
Qemu device prototypingQemu device prototyping
Qemu device prototyping
Yan Vugenfirer
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
Adrian Huang
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Linux : PSCI
Linux : PSCILinux : PSCI
Linux : PSCI
Mr. Vengineer
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
Wave Digitech
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
艾鍗科技
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
 

What's hot (20)

Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?
 
Pcie drivers basics
Pcie drivers basicsPcie drivers basics
Pcie drivers basics
 
Interrupts
InterruptsInterrupts
Interrupts
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators
 
Qemu device prototyping
Qemu device prototypingQemu device prototyping
Qemu device prototyping
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Linux : PSCI
Linux : PSCILinux : PSCI
Linux : PSCI
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 

Similar to Linux Kernel MMC Storage driver Overview

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
艾鍗科技
 
Introduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides pptIntroduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides ppt
Osama Yousaf
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersProfessorLance
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersProfessorLance
 
Internal memory
Internal memoryInternal memory
Internal memory
Federico Garcia
 
Basicarchitecturememory
BasicarchitecturememoryBasicarchitecturememory
BasicarchitecturememoryAditya Narang
 
ESXi on Dell internal dual SD module
ESXi on Dell internal dual SD moduleESXi on Dell internal dual SD module
ESXi on Dell internal dual SD module
David Pasek
 
Android Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android AppsAndroid Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android AppsMoe Tanabian
 
Nickcelle
NickcelleNickcelle
Nickcelle
xskullcandyx
 
Microprocessors evolution introduction to microprocessor
Microprocessors  evolution introduction to microprocessorMicroprocessors  evolution introduction to microprocessor
Microprocessors evolution introduction to microprocessor
Vijay Kumar
 
I/O Management
I/O ManagementI/O Management
I/O Management
Keyur Vadodariya
 
11 & 12
11 & 1211 & 12
11 & 12vonnej
 
ICT: Computer Hardware Services - Lesson 2 perform mesuration and calculation
ICT: Computer Hardware Services - Lesson 2 perform mesuration and calculationICT: Computer Hardware Services - Lesson 2 perform mesuration and calculation
ICT: Computer Hardware Services - Lesson 2 perform mesuration and calculation
Je-Jireh Silva
 
What is CANopen? | ElmoMC
What is CANopen? | ElmoMCWhat is CANopen? | ElmoMC
What is CANopen? | ElmoMC
Elmo Motion Control
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Ron Munitz
 
Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...Alex Matrosov
 
Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...
Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...
Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...
Positive Hack Days
 
SCOSTA (Smart Card Operating System for Transport Applications)
SCOSTA (Smart Card Operating System for Transport Applications)SCOSTA (Smart Card Operating System for Transport Applications)
SCOSTA (Smart Card Operating System for Transport Applications)
ALOK GUPTA
 
Grade11_Q1_W8_PerformMensuration_final.pdf
Grade11_Q1_W8_PerformMensuration_final.pdfGrade11_Q1_W8_PerformMensuration_final.pdf
Grade11_Q1_W8_PerformMensuration_final.pdf
Victor Sinangote
 
Microcomputer & RAM Model
Microcomputer & RAM ModelMicrocomputer & RAM Model
Microcomputer & RAM Model
Gaurav Bisht
 

Similar to Linux Kernel MMC Storage driver Overview (20)

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
Introduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides pptIntroduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides ppt
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
Internal memory
Internal memoryInternal memory
Internal memory
 
Basicarchitecturememory
BasicarchitecturememoryBasicarchitecturememory
Basicarchitecturememory
 
ESXi on Dell internal dual SD module
ESXi on Dell internal dual SD moduleESXi on Dell internal dual SD module
ESXi on Dell internal dual SD module
 
Android Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android AppsAndroid Forensics: Exploring Android Internals and Android Apps
Android Forensics: Exploring Android Internals and Android Apps
 
Nickcelle
NickcelleNickcelle
Nickcelle
 
Microprocessors evolution introduction to microprocessor
Microprocessors  evolution introduction to microprocessorMicroprocessors  evolution introduction to microprocessor
Microprocessors evolution introduction to microprocessor
 
I/O Management
I/O ManagementI/O Management
I/O Management
 
11 & 12
11 & 1211 & 12
11 & 12
 
ICT: Computer Hardware Services - Lesson 2 perform mesuration and calculation
ICT: Computer Hardware Services - Lesson 2 perform mesuration and calculationICT: Computer Hardware Services - Lesson 2 perform mesuration and calculation
ICT: Computer Hardware Services - Lesson 2 perform mesuration and calculation
 
What is CANopen? | ElmoMC
What is CANopen? | ElmoMCWhat is CANopen? | ElmoMC
What is CANopen? | ElmoMC
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
 
Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...Проведение криминалистической экспертизы и анализа руткит-программ на примере...
Проведение криминалистической экспертизы и анализа руткит-программ на примере...
 
Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...
Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...
Positive Hack Days. Матросов. Мастер-класс: Проведение криминалистической экс...
 
SCOSTA (Smart Card Operating System for Transport Applications)
SCOSTA (Smart Card Operating System for Transport Applications)SCOSTA (Smart Card Operating System for Transport Applications)
SCOSTA (Smart Card Operating System for Transport Applications)
 
Grade11_Q1_W8_PerformMensuration_final.pdf
Grade11_Q1_W8_PerformMensuration_final.pdfGrade11_Q1_W8_PerformMensuration_final.pdf
Grade11_Q1_W8_PerformMensuration_final.pdf
 
Microcomputer & RAM Model
Microcomputer & RAM ModelMicrocomputer & RAM Model
Microcomputer & RAM Model
 

More from RajKumar Rampelli

Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
RajKumar Rampelli
 
Introduction to Python - Running Notes
Introduction to Python - Running NotesIntroduction to Python - Running Notes
Introduction to Python - Running Notes
RajKumar Rampelli
 
Learn python - for beginners - part-2
Learn python - for beginners - part-2Learn python - for beginners - part-2
Learn python - for beginners - part-2
RajKumar Rampelli
 
Learn python – for beginners
Learn python – for beginnersLearn python – for beginners
Learn python – for beginners
RajKumar Rampelli
 
Linux watchdog timer
Linux watchdog timerLinux watchdog timer
Linux watchdog timer
RajKumar Rampelli
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
RajKumar Rampelli
 
Linux GIT commands
Linux GIT commandsLinux GIT commands
Linux GIT commands
RajKumar Rampelli
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
RajKumar Rampelli
 
Network security and cryptography
Network security and cryptographyNetwork security and cryptography
Network security and cryptography
RajKumar Rampelli
 
Tasklet vs work queues (Deferrable functions in linux)
Tasklet vs work queues (Deferrable functions in linux)Tasklet vs work queues (Deferrable functions in linux)
Tasklet vs work queues (Deferrable functions in linux)
RajKumar Rampelli
 
Sql injection attack
Sql injection attackSql injection attack
Sql injection attack
RajKumar Rampelli
 
Turing awards seminar
Turing awards seminarTuring awards seminar
Turing awards seminar
RajKumar Rampelli
 
Higher education importance
Higher education importanceHigher education importance
Higher education importance
RajKumar Rampelli
 
C compilation process
C compilation processC compilation process
C compilation process
RajKumar Rampelli
 

More from RajKumar Rampelli (14)

Writing Character driver (loadable module) in linux
Writing Character driver (loadable module) in linuxWriting Character driver (loadable module) in linux
Writing Character driver (loadable module) in linux
 
Introduction to Python - Running Notes
Introduction to Python - Running NotesIntroduction to Python - Running Notes
Introduction to Python - Running Notes
 
Learn python - for beginners - part-2
Learn python - for beginners - part-2Learn python - for beginners - part-2
Learn python - for beginners - part-2
 
Learn python – for beginners
Learn python – for beginnersLearn python – for beginners
Learn python – for beginners
 
Linux watchdog timer
Linux watchdog timerLinux watchdog timer
Linux watchdog timer
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Linux GIT commands
Linux GIT commandsLinux GIT commands
Linux GIT commands
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Network security and cryptography
Network security and cryptographyNetwork security and cryptography
Network security and cryptography
 
Tasklet vs work queues (Deferrable functions in linux)
Tasklet vs work queues (Deferrable functions in linux)Tasklet vs work queues (Deferrable functions in linux)
Tasklet vs work queues (Deferrable functions in linux)
 
Sql injection attack
Sql injection attackSql injection attack
Sql injection attack
 
Turing awards seminar
Turing awards seminarTuring awards seminar
Turing awards seminar
 
Higher education importance
Higher education importanceHigher education importance
Higher education importance
 
C compilation process
C compilation processC compilation process
C compilation process
 

Recently uploaded

Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

Linux Kernel MMC Storage driver Overview

  • 1.
  • 2. Outline 0 Storage Devices on mobile platform (smart phones, tablets etc.) 0 RAM 0 Internal Storage Devices 0 External Storage Devices 0 What is Flash Memory ? 0 Kernel storage driver overview (http://lxr.free- electrons.com/source/drivers/mmc/ ) 0 mmc device driver overview 0 Top view diagram 0 block diagram and Internal diagram 0 SD and SPI protocol 0 Mmc driver different Layers 0 Important functions to look for 0 Tuning procedure 0 SD Hot-plug 0 Sdhci controller role in Data transfer 0 SDMMC device registration 0 Sdhci probe() 0 How to configure/enable SDHCI support Note: To understand the few terms in this presentation, please refer to Introduction to Kernel & Device Drivers PPT (http://www.slideshare.net/rampalliraj/kernel-device-drivers): It covers what is Kernel, what is a Module and what is device driver .
  • 3. Storage Devices on Mobile Platforms 0 Mobile Platforms will have mainly Three storage devices for applications/users to store the Data 0 RAM (Random Access Memory): also known as main memory and primary memory. 0 Internal Storage device (Non-removable device) 0 External Storage device (Removable device) 0 RAM is Volatile memory i.e. data present in this device will be lost when power is removed/off. 0 Internal Storage Device: Mobile devices will have a built-in non-volatile memory called internal storage. 0 External Storage Device: Android devices may support removable non-volatile memory called external storage devices. 0 Example: Look at Memory & Storage specification of smartphone mobile. RAM: 2GB Internal Storage: 16GB External storage: upto 128GB Snapshot taken from Flipkart Samsung j5-6 mobile spec.
  • 4. What is Flash Memory ? 0 Flash Memory is a non-volatile, solid state storage device i.e. keeps its data without power. 0 Flash Memory is being used in wide range of devices. Examples are 0 Internal storage devices (eMMC or UFS) 0 USB sticks and SD Memory Cards 0 Digital audio players 0 Flash memory offers very high speed access to data. 0 Advantage: Flash memory, when packaged in a "memory card", is very resilient to damage, unlike many other storage devices. It can withstand extremes of temperature, being immersed in water or being accidentally dropped [2]. 0 Disadvantage: It has a limited number of read/write cycles which limits its useful life span.
  • 5. Internal Storage Device 0 Internal Storage mostly holds the android operating system so that the android device is able to access input and output devices. 0 System memory (see image) 0 It is also called as Device Memory (internal memory). 0 Go to settings page and select Storage option and you will see the internal storage capacity of your device. 0 It also stores the applications or data that user saves in it. 0 The data stored in internal storage can be accesses much faster than the data present in external storage device. 0 Internal storage device is directly connected to the mother board where as the external device connected through a hardware interface. 0 Disadvantage: If device fails to boot then all the data present in the internal storage device may be lost.
  • 6. Internal Storage Devices 0 Following are the storage devices which are mainly used for main storage devices on mobile platforms 0 eMMC: embedded Multi-Media Controller, refers to a package consisting of both flash memory and a flash memory controller integrated on the same silicon die. 0 UFS: Universal Flash Storage (UFS) is a flash storage like eMMC device with higher data rates compared to it. 0 SATA: Serial ATA is a computer bus interface that connects host bus adapters to mass storage devices such as hard disk drives, optical drives, and solid-state drives. 0 Will cover Linux Kernel eMMC (MMC storage)device drivers in this presentation.
  • 7. External Storage Device 0 Android devices may support the capability of adding more external storage via removable cards like SD memory cards. 0 SD card: Secure Digital (SD) is a non-volatile memory card format developed by the SD Card Association (SDA) for use in portable devices. 0 Advantage: External storage devices are portal i.e. data can be easily moved from one location to other location. 0 These storage devices are used for data backup 0 Disadvantage: Data transfer rate is slow compared to internal storage devices. SD card details found in settings->storage android
  • 8. How to identify SD card’s class? Preferable card: class 10 or UHS-I cards Class Minimum Serial Data Writing Speed Symbol on SD card Class 2 2MB/s Class 4 4MB/s Class 6 6MB/s Class 10 10MB/s UHS Speed Class 1 (U1) 10MB/s
  • 9. SD Memory card architecture Card Info registers Usage CID Card identification number RCA Relative card address published by the card during card identification process. DSR Driver stage register CSD Max data transfer rate and defines data format, error correction type, maximum data access/transfer time, Maximum read/write block length. SCR SD configuration register OCR Operation condition reg SSR SD status register CSR Card status register
  • 10. SD and SPI protocol SPI Protocol SD Protocol Design simple Complex Loss of performance: 1bit mode Wide bus option. Supports 1bit and 4bit modes. Card identification and addressing methods replaced by the h/w chip select CS signal Its own Card Identification process No broadcast commands Available Uses only 7 pins DAT1 and DAT2 are not used DAT3 used as CS DAT0 data transfer CLK line DataIn line (Host to card line) 9 pins model: DAT0-DAT3 lines for data transfer CLK line – clock line CMD line – command line 3 Power lines – supply voltage lines
  • 11. Storage Device Driver for eMMC and SD devices 0 Storage Device Driver ($kernel/drivers/mmc) is common for eMMC devices (internal storage device) and for SD memory cards (external storage device). 0 eMMC and SD are block devices i.e. mmc device driver communicates with these devices in the form of blocks of data (512 bytes) 0 Character device is one with which the driver communicates by sending/receiving single characters (bytes), eg: 0 mmc drivers receives the block requests from generic block layer (upper layer)
  • 12. mmc Device Driver Top View Kernel Space User Space Virtual File System Layer Generic Block Layer mmc device driver Hardware devices eMMC device SD memory card User applications
  • 13. mmc Device Driver block diagram Kernel Space Virtual File System Layer Generic Block Layer Hardware devices eMMC device SD memory card mmc device driver mmc Block/Queue driver mmc core driver mmc host driver SDHCI Host driver /mmc/card/block.c /mmc/card/queue.c /mmc/core/core.c /mmc/core/mmc.c /mmc/core/sd.c /mmc/host/sdhci.c
  • 14. mmc device driver overview 0 mmc queue receives block read/write/erase requests from the generic core block layer 0 mmc queue driver picks up one request from its queue and assign it to mmc block driver 0 mmc block driver analyze the type of request and forwards the request to mmc core driver. 0 mmc core driver has the protocol implementation for eMMC/SD devices detection, enumeration and data transfers to communicated with the actual Hardware device. 0 mmc core driver receives the request from block driver, prepares a mmc_request and forwards it to the mmc host driver. 0 mmc host driver initiates the transfer to device by programming Hardware controller registers. 0 Once the request get processed by the hardware controller, an interrupt gets generated . 0 mmc host driver receives request complete interrupt, analyzes it and pass the response to block driver. This process continues for all block requests. mmc Queue driver (queue.c) mmc core driver (core.c, mmc.c, sd.c) mmc host (controller) driver SDHCI Host driver sdhci.c mmc Block driver (block.c)
  • 15. mmc queue layer (/drivers/mmc/card/queue.c) 0 Important functions: 0 mmc_init_queue() 0 initializes the device queue 0 Creates and run the kernel thread (mmc_queue_thread) “mmcqd” to fetch block I/O requests from core block layer and pass it mmc block layer. 0 mmc_queue_thread() 0 Fetch block I/O requests using blk_fetch_request() 0 Pass the request to mmc block layer using callback issue_fn() -> redirects to -> mmc_blk_issue_rq() in mmc block driver
  • 16. mmc block layer (/drivers/mmc/card/block.c) 0 Important functions: 1) mmc_blk_probe() 0 Calls the mmc_queue_initialize() to initialize mmc queue. 0 Allocates the block devices (eMMC and SD card) and its partitions. 0 Initializes the mmc_blk_data (md) structure with required function callbacks for I/O requests, assigns MAJOR/MINOR info. md->queue.issue_fn = mmc_blk_issue_rq; md->disk->major = MMC_BLOCK_MAJOR; md->disk->first_minor = devidx * perdev_minors; 0 2) mmc_blk_issue_rq() – receives block I/O request from mmc queue thread from mmc queue driver. If I/O request type is ERASE then it calls mmc_blk_issue_discard_rq(). If I/O request is READ/WRITE then calls mmc_blk_issue_rw_rq() 0 2A) mmc_blk_issue_rw_rq() – prepares mmc block request and responsible for followings: Sets data block size to 512 (FIXED) 0 Retrieve block count information using blk_rq_sectors() 0 Assigns appropriate command flags and data flags 0 Sets the timeout for a Data command using mmc_set_data_timeout() function (defined in mmc core driver) 0 Assign the mmc block request to mmc core driver by calling mmc_start_req() function.
  • 17. mmc core layer (/drivers/mmc/core/*) 0 It Implements all SD/eMMC-dependent functionality, entire communication protocol is implemented in this layer. 0 Receives request in mmc_start_req() from mmc block layer 0 Before starting this new request, it checks for any ongoing request. Holds this new request until the ongoing request is processed. 0 It calls mmc host layer function sdhci_request() to program the command and its dependant parameters in the mmc controller register for initiating the command transfer. (/drivers/mmc/host/sdhci.c)
  • 18. mmc host layer (drivers/mmc/host/*) 0 It implements the driver for most known platform controllers and is platform dependent. 0 Important functions: 0 sdhci_add_host() : adds the sdhci host controller with the driver model. It initializes the sdhci h/w controller and enables sdhci interrupts. 0 sdhci_request(): It initiates the data transfer of received request by programming the command details in the corresponding h/w register. 0 Sets the SW timer to ensure that there is no infinite wait for the transfer complete interrupt 0 Prepares the data and sets SDMA or ADMA mode 0 sdhci_irq(): It receives the transfer complete interrupt and analyzes it for any errors. It sends the response of the transfer to block layer. 0 sdhci_execute_tuning(): Tuning procedure: It is required for reliable data transfers when interface freq is more than 50MHz. It determines the TAP value by issuing CMD19. 0 Controller issues CMD19 (SD/SDIO) or CMD21(eMMC) to get card’s tuning block at the current tap value X. Compares with its tuning block 0 If matches - Tuning is passed for the tap value X 0 Else - Tuning is not passed for the tap value X, try next tap X+1
  • 19. SD Host controller role @Data Transfer 0 Data location of system memory  DMA_SYSTEM_ADDR (If DMA supported) 0 Set Block size  BLOCK_SIZE 0 Set Block count  BLOCK_COUNT 0 Set argument value  ARGUMENT 0 Set TRANSFER_MODE value, determines 0 Single/Multi-Block transfer 0 Block count enabled ? 0 Data transfer direction 0 ACMD12(eMMC/SD) or CMD52(SDIO) enabled ? 0 DMA enabled ? 0 Set COMMAND  execution started 0 Wait for CMD complete Interrupt 0 Write 1 to the CMD_COMPLETE in Normal status Interrupt Register 0 Based on Read/Write CMD, the associated Registers/Interrupts enabled 0 Wait for Buffer Read Ready or Buffer Write Ready Interrupt 0 Clear Buffer Read Ready Status or Buffer Write Ready Status 0 Wait for TRANSFER_COMPLETE Interrupt 0 Clear TRANSFER_COMPLETE Status
  • 20. Mmc driver features 0 Host-Device interface is reliable when FREQ limits upto 50MHz 0 SD: High speed (HS) SD cards, class 4 cards 0 eMMC: eMMC devices with versions 4.41 or below 0 Tuning procedure is required when host-device interface runs at more than 50MHz. 0 SD: Ultra High Speed (UHS) SD cards, and class 10 SD cards. 0 eMMC: eMMC devices with versions 4.5 or more supports tuning 0 Mmc driver supports SD hot-plug feature, so that SD card can be inserted into already running device without powering of the device. 0 MMC driver supports voltage switching feature, if SD cards of type 10 or UHS-I inserted then voltage switching is invoked to switch voltage from 3.3 V to 1.8V for power optimization. 0 UHS SD cards runs at 1.8V 0 Clock gating is enabled: If there are no transactions on eMMC/SD interface then clock supply will be off, to save the power of the device.
  • 21. SDMMC devices registration 0 Device registration requires both device name and driver name should match 0 Device registration is done in board-<board-name>-sdhci.c 0 platform_device_register(&tegra_sdhci_device3); /* eMMC */ platform_device_register(&tegra_sdhci_device2); /* SD/SDIO */ platform_device_register(&tegra_sdhci_device0); /* SDIO/SD */ 0 Platform_device Structure: static struct platform_device tegra_sdhci_deviceX = { .name = "sdhci-tegra", .id = X, /* X = 0 or 1 or 2 or 3 */ .resource = sdhci_resourceX, .num_resources = ARRAY_SIZE(sdhci_resourceX), .dev = { .platform_data = &tegra_sdhci_platform_data3, }, }; 0 As part of device enumeration, we use discovery method to identify whether the device is eMMC or SD or SDIO.
  • 22. SDHCI probe() Probe() is called when device is recognized by the platform Driver’s init function gives kernel a list of devices it is able to service, along with a pointer to a probe function. Kernel then calls the driver’s probe function one for each device. 0 probe function starts the per-device initialization: 0 initializing hardware, allocating resources, and 0 registering the device with the kernel as a block device. 0 Kernel/drivers/mmc/host/sdhic-tegra.c  sdhci_tegra_probe() 0 Host controller initialization at kernel/drivers/mmc/host/sdhci.c  sdhci_add_host() 0 Device initialization starts in kernel/drivers/mmc/core/core.c  mmc_rescan() 0 Starts execution when Host detects the device. 0 mmc_attach_sdio()  sdio.c [core driver] 0 mmc_attach_sd()  sd.c [core driver] 0 mmc_attach_mmc()  mmc.c [core driver]
  • 23. How to enable SDHCI controller: MMC/SD Card support Configuration 0 Configure below variables for mmc devices (eMMC and SD devices share same sdhci controller) 0 MMC 0 MMC_SDHCI 0 MMC_SDHCI_PLTFM 0 Optional 0 MMC_DEBUG 0 MMC_BLOCK 0 drivers/mmc/Kconfig
  • 24. Conclusion 0 eMMC device is used for internal storage on mobile platforms 0 SD device (external SD cards) is used for external storage on mobile platforms 0 eMMC device and SD device both uses same driver on Linux platform. Pointer to this driver is http://lxr.free-electrons.com/source/drivers/mmc/ 0 eMMC and SD devices registers with block layer as a block devices. 0 Mmc driver sub-divided into three layers block (or queue) subsystem, core layer and host layer. 0 eMMC and SD uses SD protocol for communication. 0 Sdhci host controller communicates with eMMC and SD devices. 0 Class 10 or UHS-I type SD cards are preferable for high data rates.
  • 25. References 1. Wikipedia: https://en.wikipedia.org/wiki/Secure_Digital 2. TEACH-ICT – The very best KS3, GCSE and A Level Computer Science resources. 3. SAMSUNG Galaxy J5 - 6 (New 2016 Edition)(Black, 16 GB) Specification snapshot from flipkart.com 4. SD Specifications Part A2 SD Host Controller Standard Specification Version 3.0 5. JEDEC STANDARD EMBEDDED MULTI-MEDIA CARD (e•MMC), ELECTRICAL STANDARD (4.5 device)
  • 26. THANK YOU  Have a look at My PPTs: http://www.slideshare.net/rampalliraj/ My Blog: http://practicepeople.blogspot.in/

Editor's Notes

  1. Platform devices represent devices that are usually integrated into a given chip and therefore are always there. The platform-specific initialization code statically initializes such arrays of platform devices and then registers them in a row using platform_register. Therefore there is no need for sophisticated probing. Instead, the string contained in platform_device.name is compared platform_driver.driver.name and a match is assumed if they are equal.
  2. MMC support selects the generic Secure Digital Host Controller Interface. If you have a controller with this interface, say Y or M here. Selects the common helper functions support for SD host controller based platform and OF drivers Selects the Tegra SD/MMC controller.  If you have a Tegra platform with SD or MMC devices, say Y or M here.