⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 binding4.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    Writing Socket Component Drivers and MTDs   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="binding.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="binding3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="binding5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="97928">3.4  &nbsp;&nbsp;Writing an MTD </a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="86771"> </a>An MTD is a software module that provides the basic read, write, erase, and map functionality that TrueFFS needs in order to program flash memory. This module also provides an identification utility, a routine that probes a flash device for its type. If the flash type is appropriate to the MTD, the MTD provides TrueFFS with data and pointers to the functions (map, read, write, and erase) that it needs to program that flash device. </p><dd><p class="Body"><a name="100434"> </a>In the process of creating a logical block device for a flash memory array, TrueFFS tries to match an MTD to the flash device. To do this, TrueFFS calls the identification routine from each MTD until one reports a match. The first reported match is the one taken. If no MTD reports a match, TrueFFS falls back on a default read-only MTD that reads from the flash device by copying from the socket window. </p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="100582">Assumptions You Can Make within an MTD Function</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="100571"> </a>When any MTD function is called, assume the following:</p></dl><dl class="margin"><ul class="BulletSingle" type="disc"><li><a name="100572"> </a>There is a card in the socket. </li></ul><ul class="BulletSingle" type="disc"><li><a name="100573"> </a>Vcc is on. </li></ul><ul class="BulletSingle" type="disc"><li><a name="100574"> </a>Vpp is off (until you turn it on). </li></ul><ul class="BulletSingle" type="disc"><li><a name="100575"> </a>The <b class="symbol_lc">FLSocket</b> passed into the function belongs to the currently active drive.</li></ul></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="98451">3.4.1  &nbsp;&nbsp;Writing an MTD Identification Routine </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="98999"> </a>The MTD identification routine is guaranteed to be called prior to any other routine in the MTD. An MTD identification routine is of the following format: </p></dl><dl class="margin"><dd><pre class="Code"><b><a name="99000">FLStatus <i class="textVariable">xxx</i>Identify(FLFlash vol) </a></b></pre></dl><dl class="margin"><dd><p class="Body"><a name="99066"> </a>Within an MTD identify routine, you must probe the device to determine its type. How you do this depends on the hardware. If the type is not appropriate to this MTD, return failure. Otherwise, set the members of the <b class="symbol_lc">FLFlash</b> structure listed below:</p></dl><dl class="margin"><dd><div class="Item"><a name="98530"> </a><b class="symbol_lc">type</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98743"> </a>See <a href="binding2.html#93277"><i class="title">type</i></a>.  <br>See also the description of <b class="routine"><i class="routine">flIntelIdentify</i></b><b>(&nbsp;)</b> given below, as well as the discussion of using <b class="routine"><i class="routine">flMap</i></b><b>(&nbsp;)</b> to read the CIS. </div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98878"> </a><b class="symbol_lc">erasableBlockSize</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98879"> </a>See <a href="binding2.html#93303"><i class="title">erasableBlockSize</i></a>. </div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98880"> </a><b class="symbol_lc">chipSize</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98740"> </a>See <a href="binding2.html#94121"><i class="title">chipSize</i></a>. </div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98533"> </a><b class="symbol_lc">noOfChips</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98739"> </a>See <a href="binding2.html#93510"><i class="title">noOfChips</i></a>.  <br>See also the description of <b class="routine"><i class="routine">flIntelSize</i></b><b>(&nbsp;)</b> given below.</div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98534"> </a><b class="symbol_lc">interleaving</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98738"> </a>See <a href="binding2.html#94551"><i class="title">interleaving</i></a>.  <br>See also the description of <b class="routine"><i class="routine">flIntelIdentify</i></b><b>(&nbsp;)</b> given below.</div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98535"> </a><b class="symbol_lc">write</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98737"> </a>See <a href="binding4.html#100542"><i class="title">3.4.4&nbsp;Writing Write and Erase Functions for an MTD</i></a>, and <a href="binding2.html#93435"><i class="title">write</i></a>. </div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98536"> </a><b class="symbol_lc">erase</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent5"><a name="98736"> </a>See <a href="binding4.html#100542"><i class="title">3.4.4&nbsp;Writing Write and Erase Functions for an MTD</i></a>, and <a href="binding2.html#93444"><i class="title">erase</i></a>. </div><br></dl></dl></dl></dl></dl><dd><div class="Item"><a name="98537"> </a><b class="symbol_lc">map</b> </div><dl class="margin"><dl class="margin">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -