新四季網

emmc壽命到了就廢了嗎(eMMC深入淺出第五章)

2023-05-31 15:24:38

emmc壽命到了就廢了嗎?Today we are going to talk about the PoN (Power Off Notification).今天我們來聊聊PoN(掉電提示),下面我們就來聊聊關於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帶卡選擇參數。

,
同类文章
葬禮的夢想

葬禮的夢想

夢見葬禮,我得到了這個夢想,五個要素的五個要素,水火只好,主要名字在外面,職業生涯良好,一切都應該對待他人治療誠意,由於小,吉利的冬天夢想,秋天的夢是不吉利的
找到手機是什麼意思?

找到手機是什麼意思?

找到手機是什麼意思?五次選舉的五個要素是兩名士兵的跡象。與他溝通很好。這是非常財富,它擅長運作,職業是仙人的標誌。單身男人有這個夢想,主要生活可以有人幫忙
我不怎麼想?

我不怎麼想?

我做了什麼意味著看到米飯烹飪?我得到了這個夢想,五線的主要土壤,但是Tu Ke水是錢的跡象,職業生涯更加真誠。他真誠地誠實。這是豐富的,這是夏瑞的巨星
夢想你的意思是什麼?

夢想你的意思是什麼?

你是什​​麼意思夢想的夢想?夢想,主要木材的五個要素,水的跡象,主營業務,主營業務,案子應該抓住魅力,不能疏忽,春天夢想的吉利夢想夏天的夢想不幸。詢問學者夢想
拯救夢想

拯救夢想

拯救夢想什麼意思?你夢想著拯救人嗎?拯救人們的夢想有一個現實,也有夢想的主觀想像力,請參閱週宮官方網站拯救人民夢想的詳細解釋。夢想著敵人被拯救出來
2022愛方向和生日是在[質量個性]中

2022愛方向和生日是在[質量個性]中

[救生員]有人說,在出生88天之前,胎兒已經知道哪天的出生,如何有優質的個性,將走在什麼樣的愛情之旅,將與生活生活有什么生活。今天
夢想切割剪裁

夢想切割剪裁

夢想切割剪裁什麼意思?你夢想切你的手是好的嗎?夢想切割手工切割手有一個真正的影響和反應,也有夢想的主觀想像力。請參閱官方網站夢想的細節,以削減手
夢想著親人死了

夢想著親人死了

夢想著親人死了什麼意思?你夢想夢想你的親人死嗎?夢想有一個現實的影響和反應,還有夢想的主觀想像力,請參閱夢想世界夢想死亡的親屬的詳細解釋
夢想搶劫

夢想搶劫

夢想搶劫什麼意思?你夢想搶劫嗎?夢想著搶劫有一個現實的影響和反應,也有夢想的主觀想像力,請參閱週恭吉夢官方網站的詳細解釋。夢想搶劫
夢想缺乏缺乏紊亂

夢想缺乏缺乏紊亂

夢想缺乏缺乏紊亂什麼意思?你夢想缺乏異常藥物嗎?夢想缺乏現實世界的影響和現實,還有夢想的主觀想像,請看官方網站的夢想組織缺乏異常藥物。我覺得有些東西缺失了