バックナンバーはこちら。
https://www.simulationroom999.com/blog/In-vehicle-external-storage-backnumber/
はじめに
SDカードのPERFORMANCE_ENHANCEの話。
ホスト主導、カード主導のセルフメンテナンス起動と有効化について。
Performance Enhancement Registerがキモとなる。
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
セルフメンテナンス起動

セルフメンテナンスの起動は
ホスト主導とカード主導があるんだったよね。

そうそう。
言い換えると、
ホスト主導が明示的で
カード主導が暗黙的。
言っても良いかな。

(ようわからんが、話聞けばわかるんかな・・・。)
セルフメンテナンス有効化について

で、それぞれのセルフメンテナンスはどうやって起動するの?

起動する前に有効化する必要がる。
有効化するには、
Performance Enhancement Register
の該当ビットへの書き込みが必要となる。

(出たよ、出たよ、唐突に新しい単語!)
Performance Enhancement Register

まぁたぶんわからんと思ってるだろうから、
Performance Enhancement Register
を書き出そう。
Byte Offset | Bits | Name | Description |
---|---|---|---|
0 | – | Performance Enhancement Function Revision | 00h:Revison 1 |
1 | [0] | FX_EVENT Support | 0:Not support,1:Supported |
2 | [0] | Card Initiated Maintenance Support | 0:Not support,1:Supported |
2 | [1] | Host Initiated maintenance Support | 0:Not support,1:Supported |
3 | [1:0] | Card maintenance Urgency 00b:None, 01b:Mild, 10b:Middle, 11b:Urgent | |
4 | [0] | Cache Support | 0:Not support,1:Supported |
5 | – | Reserved | – |
6 | – | CQ Support and Depth | 00h:CA is not supported,01h:depth=2(ID=0,1),…,1Fh:depth=32(ID 0~31) |
7 | – | Reserved | – |
8-15 | – | Task Error Status | 00h:No Error,01h:Error,Other:Reserved |
16-256 | – | Reserved | – |
257 | 0 | FX_EVENT Enable | 0:Disable,1Enable |
258 | 0 | Card Initiated maintenance Enable | 0:Disable,1Enable |
258 | 1 | Host Initiated maintenance Enable | 0:Disable,1Enable |
259 | 0 | Start Host-Initiated Maintenance | 1:Starts host-initiated maintenance.0:By card indicates the break of maintenance.(break within 1 secomd.) |
260 | 0 | Flush Cache | 1:Start Cache flush.0:By card indicates the end of Cache flush.(flush within 1 second.) |
262 | 0 | Enable CQ | 0:Disable,1Enable |
262 | 1 | CQ Mode | 0:Voluntary mode, 1:Sequential Mode |
263-511 | – | Reserved | – |

この情報って、どうやって読み書きするの?

CMD48(READ_EXTR_SINGLE)、CMD49(WRITE_EXTR_SINGLE)
を使う。
上記のコマンドのパラメータにMIO(Memory or I/O)、FNO(Function No)ってパラメータがあるんで、
MIOをMemory指定(=0b)、FNOを02h指定で読み書きができる。

なるほど。
特殊な用途の特殊なコマンドがあるんだね。

で、
- Card Initiated maintenance Enable
- Host Initiated maintenance Enable
ってのがあるから、これを有効にすれば、メンテナンスモードが有効になるってわけか。

そうなるね。
まぁそれぞれがどのように振舞うのかは次回説明だな。
まとめ

まとめだよ。
- セルフメンテナンスは2種類。
- ホスト主導で明示的実行。
- カード主導で暗黙的実行。
- セルフメンテナンスを有効化するにはPerformance Enhancement Registerを制御する必要がある。
- CMD48(READ_EXTR_SINGLE)、CMD49(WRITE_EXTR_SINGLE)を使用する。
バックナンバーはこちら。
コメント