Today we are going to talk about the PoN (Power Off Notification).今天我们来聊聊PoN(掉电提示),下面我们就来聊聊关于emmc寿命到了就废了吗?接下来我们就一起去了解一下吧!

emmc寿命到了就废了吗(eMMC深入浅出第五章)

emmc寿命到了就废了吗

Section 4 Power Off Notification第四节 掉电提示

Today we are going to talk about the PoN (Power Off Notification).

今天我们来聊聊PoN(掉电提示)。

Before we start, I have 3 questions, why we need PoN? Who will get this notification? and from whom? Like the three old classic philosophic questions by ancient Greek philosopher Pluto, ‘who am I? where am I from? where will I go?’ Luckily, we are in the digit logical world this time, it is much easier for us to answer the ‘0’’1’ question. PoN is sent from Host to eMMC device, as Host need to know when it could shut off the power by inform eMMC device in advance so that eMMC device could end its work on hand (we call it BKOPS, the abbreviation for Background Operation) within defined time.

在开始之前我有三个问题,为什么需要PoN掉电提示?谁要接收这个提示?从谁那儿接收?就像古希腊哲学家柏拉图的三个古老的经典哲学问题,‘我是谁?我从哪里来?要到哪里去?’ 幸运的是我们这次是在数字逻辑世界,回到‘0’‘1’的问题简单得多。PoN是从主机到eMMC器件,因为主机需要知道什么时候可以断电,它通过断电之前提前通知eMMC器件以便eMMC器件在规定时间里结束自己的手头工作(我们称之为BKOPS,后台操作的缩写)。

Power here refers to VCC (Voltage Common Collector) and VCCQ (Voltage Common Collector for Data signals, Q here represent data signal, sometimes we use DQ to mean data line). In the eMMC Specification, VCC is power supply for eMMC device core, while VCCQ is power supply for eMMC interface I/O(input/output). Then what exactly is this core and I/O? Core usually means the memory media that is used, here it refer to NAND flash. I/O is the part of eMMC controller. So we could simply translate it into VCC is for NAND flash while VCCQ is for controller.

这里的电源指的是VCC(共集电极电压)和VCCQ(给数据线的共集电极电压,这里Q代表数据信号, 有时候我们用DQ表示数据线)。在eMMC规范里面,VCC是给eMMC器件核心供电用的,而VCCQ是给eMMC的接口I/O(输入/输出)供电用的。那么到底是什么是核心和I/O?核心通常意味着所用的存储介质,这里指的是NAND闪存。I/O是eMMC器件的主控的一部分。所以我们可以简单翻译成,VCC是给NAND用的而VCCQ是给主控用的。

How host send this notification to eMMC device is through CMD6(SWITCH) command to access eMMC Ext_CSD byte 34. There are total 5 allowed setting.

主机是通过CMD6(切换)指令访问Ext_CSD的字节34来把这个提示发送给eMMC器件的。一共有5种容许的参数。

The default one is 0x00 which means PoN is not supported by Host. Note that eMMC device should always support for this feature as this is defined by eMMC specification and eMMC will definitely benefit from it. However, host could vary widely. Then what if host does not support this? If that is the case, eMMC device could only finger cross to pray not get too much hurt (internal firmware crash) at the end (power loss) of this relationship, and try to recover (fix the mess when next power on initialization) from the pain (last power loss).

默认的0x00指的是主句不支持PoN。注意eMMC器件应该根据eMMC规范支持这个特性,因为这个绝对会对eMMC有好处。然后,主机是多种多样的。那么如果主机不支持这个会怎样呢?如果是那样,eMMC器件只能合十祈祷在这段感情中最终(掉电)不被伤害太深(内部的固件损坏),然后从痛苦(上次掉电)中恢复(在下次上电初始化的时候修复这一团糟的场面)。

So for the nowadays system design, although not forcedly required, host should implement this feature as setting 0x01 to the Ext_CSD byte 34 when system booting to let eMMC know.

所以在今天的系统设计中,虽然不被强制要求,主机应该要实现这个特性,通过在系统上电的时候Ext_CSD字节34里写0x01来让eMMC知道。

The next following two setting 0x02 and 0x03 are the Power off Notification to the eMMC device how long time that Host could wait before power off. Setting 0x02 is named as ‘SHORT’ and setting 0x03 ‘LONG’. ‘SHORT’ and ‘LONG’ parameter define the maximum time out tolerable by host, ‘SHORT’ time is defined in the Ext_CSD byte 248, while ‘LONG’ is in Ext_CSD Byte 247. Once host send one of above two to the eMMC device, host will wait for the maximum agreed time by both sides as set.

后面跟着的两个设置0x2和0x03是发给eMMC的掉电提示主机到底在断电之前能够等待多久。0x02设置的名字叫‘短’,0x03叫‘长’。‘长’和‘短’‘的参数定义了主机容忍的最大的超时时间,‘短’时间定义在Ext_CSD的字节248,而‘长’时间定义在Ext_CSD的字节247. 一旦主机发送了上述两个中的一个给eMMC器件,主机会根据设定等待双方达成一致的最大时间。

What eMMC device need to do is to finish its work on hand as soon as possible within this limited time, by pulling down the D0 (Data Line 0) signal to show its busy status. Once finish earlier than time out setting, it should inform host by pulling up the D0 signal to save host waiting time. On the contrary, if eMMC device expire this time, host will not wait and could shut down power (VCC and VCCQ together) at any time. This is the daily life mode between the master(host) and slave(eMMC), slave gets the master’s order to execute immediately but will get punished once not finishing in time.

eMMC器件所要做的是在有限时间里尽快完成自己的手头工作,通过把D0(数据线0)信号拉低表示忙状态。一旦在超时设置前完成,它需要通过拉高D0信号线来通知主机以节省主机的等待时间。反之,如果eMMC超过了这个时间,主机将不会等待而可以在任何时候切断电源(VCC和VCCQ一起)。这个就是主导方(主机)和从属方(eMMC)的日常生活模式。从属方得到主导方指令并立即执行,但是会因为没有及时完成而受到惩罚。

The last one 0x04 is a little different then brothers ‘SHORT’ and ‘LONG’. It is called sleep notification introduced in eMMC specification 5.0. Sleep means only power supply VCC for NAND flash could be cut off after this notification interaction is done, but power supply VCCQ for controller remains on so that eMMC device could be waked up and not go through the full initialization procedure next time. eMMC device receive this sleep notification and after that host will send CMD7 with parameter card deselection to release the device and then send CMD5 with parameter sleep to the eMMC device. Finally host wait eMMC device busy end indication on D0 to know it is in sleep mode and could shut down the VCCQ.

最后一个0x04和之前的 ‘短’‘长’两兄弟不太一样。它在eMMC规范5.0被引入,称为睡眠通知。睡眠指的是在这个通知之后可以仅仅是NAND闪存的供电电压VCC被关掉,而主控的供电电压VCCQ保持打开,这样eMMC可以在下次不需要走完整的初始化流程而仅仅是被唤醒就可以了。eMMC接受到这个睡眠提示,然后主机会用CMD7带卡选空参数来释放,然后发送给eMMC器件CMD5带睡眠参数。最后主机会等待eMMC器件在D0上提示忙结束知道它已经进入睡眠模式,然后关掉VCCQ。

The main benefit for the sleep is to save the power consumption, and also save the next wakeup time if no need duplicated initialization. By the way, wakeup is also with CMD5 and CMD7 combination with different parameter which is CMD5 with parameter wakeup and CMD7 with parameter card selection.

睡眠的主要好处是为了节省功耗,同时因为不需要再重复初始化也节省了下次唤醒的时间。

顺便提一下,唤醒同样用的是CMD5和CMD7的组合,只不过参数不同。CMD5带唤醒参数,而CMD7带卡选择参数。

,