eMMC编程基础 -(二)eMMC基础介绍

1 eMMC 简介

eMMC 是 embedded MultiMediaCard 的简称。 eMMC 是对 MMC 的一个拓展,以满足更高标准的性能、成本、体积、稳定、易用等的需求。主要针对手机、数码相机、平板电脑等产品。eMMC主要是为了简化手机内存储器的设计,节省电路板的面积。eMMC是将NAND Flash、控制器和MMC标准接口封装到一块芯片上。
主机与设备之间的所有通信都由主机(master)控制。主机会发送一个命令,从而导致设备响应。为eMMC系统(主机和设备)定义了五种操作模式:

  •  Boot mode:
    The device will be in boot mode after power cycle, reception of CMD0 with argument of 0xF0F0F0F0 or the assertion of hardware reset signal.
  •  Device identification mode
    The device will be in device identification mode after boot operation mode is finished or if host
    and/or device does not support boot operation mode. The device will be in this mode, until the SET_RCA command (CMD3) is received.
  •  Interrupt mode Host and device enter and exit interrupt mode simultaneously. In interrupt mode there is no data transfer. The only message allowed is an interrupt service request from the device or the host.
  •  Data transfer mode The device will enter data transfer mode once an RCA is assigned to it. The host will enter data transfer mode after identifying the device on the bus.
  •  Inactive mode The device will enter inactive mode if either the device operating voltage range or access mode is not valid. The device can also enter inactive mode with GO_INACTIVE_STATE command (CMD15). The device will reset to Pre-idle state with power cycle.
    Table 5 shows the dependencies between bus modes, operation modes and device states. Each state in the e•MMC state diagram (see Figure 25 and Figure 27) is associated with one bus mode and one operation mode.

1.1 eMMC系统概述

在这里插入图片描述

1.2 eMMC 的整体架构如下图片所示:

在这里插入图片描述
eMMC 内部主要可以分为 Flash MemoryFlash Controller 以及 Host Interface 三大部分。

2 Flash Memory

flash是一种非易失的存储器,其存储结构如下所示:
在这里插入图片描述
The embedded device also offers the host the possibility to configure additional local memory partitions with independent address spaces, starting from logical address 0x00000000, for different usage models.
Therefore the memory block areas can be classified as follows:
 Two Boot Area Partitions, whose size is multiple of 128 KB and where booting from e•MMC can be performed.
 One RPMB Partition accessed through a trusted mechanism, whose size is defined as multiple of 128 KB.
 Four General Purpose Area Partitions to store sensitive data or for other host usage models, whose sizes are a multiple of a Write Protect Group.

Each of the General Purpose Area Partitions can be implemented with enhanced or extended
technological features (such as better reliability) that distinguish them from the default storage media. If the enhanced storage media feature is supported by the device, boot and RPMB Area Partitions shall be implemented as enhanced storage media by default.

Boot Area Partition 1 & 2
此分区主要是为了支持从 eMMC 启动系统而设计的。
该分区的数据,在 eMMC 上电后,可以通过很简单的协议就可以读取出来。同时,大部分的 SOC 都可以通过 GPIO 或者 FUSE 的配置,让 ROM 代码在上电后,将 eMMC BOOT 分区的内容加载到 SOC 内部的 SRAM 中执行。

RPMB Partition
RPMB 是 Replay Protected Memory Block 的简称,它通过 HMAC SHA-256 和 Write Counter 来保证保存在 RPMB 内部的数据不被非法篡改。
在实际应用中,RPMB 分区通常用来保存安全相关的数据,例如指纹数据、安全支付相关的密钥等。

General Purpose Partition 1~4
此区域则主要用于存储系统或者用户数据。 General Purpose Partition 在芯片出厂时,通常是不存在的,需要主动进行配置后,才会存在。

User Data Area
此区域则主要用于存储系统和用户数据。
User Data Area 通常会进行再分区,例如 Android 系统中,通常在此区域分出 boot、system、userdata 等分区。

3 Flash Controller

NAND Flash 直接接入 Host 时,Host 端通常需要有 NAND Flash Translation Layer,即 NFTL 或者 NAND Flash 文件系统来做坏块管理、ECC等的功能。

eMMC 则在其内部集成了 Flash Controller,用于完成擦写均衡、坏块管理、ECC校验等功能。相比于直接将 NAND Flash 接入到 Host 端,eMMC 屏蔽了 NAND Flash 的物理特性,可以减少 Host 端软件的复杂度,让 Host 端专注于上层业务,省去对 NAND Flash 进行特殊的处理。同时,eMMC 通过使用 Cache、Memory Array 等技术,在读写性能上也比 NAND Flash 要好很多。
在这里插入图片描述
图片:NAND Flash 与 eMMC

4 Host Interface

eMMC 与 Host 之间的连接如下图所示:在这里插入图片描述
在这里插入图片描述

图片:eMMC Interface

各个信号的用途如下所示:

CLK
用于同步的时钟信号

Data Strobe
此信号是从 Device 端输出的时钟信号,频率和 CLK 信号相同,用于同步从 Device 端输出的数据。该信号在 eMMC 5.0 中引入。

CMD
此信号用于发送 Host 的 command 和 Device 的 response。

DAT0-7
用于传输数据的 8 bit 总线。

Host 与 eMMC 之间的通信都是 Host 以一个 Command 开始发起的。针对不同的 Command,Device 会做出不同的响应。

参考文章:

  1. eMMC简介
  2. eMMC编程
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值