
Added initial support Xilinx Embedded Software. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
1707 lines
80 KiB
HTML
Executable file
1707 lines
80 KiB
HTML
Executable file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>2014.1_doc: xilflash.h File Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.5 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
|
<li id="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="dirs.html"><span>Directories</span></a></li>
|
|
</ul></div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
|
</ul></div>
|
|
<div class="nav">
|
|
<a class="el" href="dir_U_3A_2Fdoxygen_5Fpublish_2Fsources_2Fsw_5Fservices_2Fxilflash_5Fv4_5F0_2Fsrc_2Finclude_2F.html">include</a></div>
|
|
<h1>xilflash.h File Reference</h1><code>#include "xil_types.h"</code><br>
|
|
<code>#include "xstatus.h"</code><br>
|
|
<code>#include "<a class="el" href="xilflash__properties_8h.html">xilflash_properties.h</a>"</code><br>
|
|
<code>#include "xparameters.h"</code><br>
|
|
<code>#include <string.h></code><br>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_flash___user_inputs.html">XFlash_UserInputs</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_flash_geometry.html">XFlashGeometry</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_flash_tag.html">XFlashTag</a></td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#362bf211e43da8bfb9642f85649dffa4">XFL_CMDSET_INTEL_STANDARD</a> 3</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#039a231b158f3bf061c0467253385e75">XFL_CMDSET_INTEL_EXTENDED</a> 1</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#852f3cbf0f5ab59bc3add486cb23e93e">XFL_CMDSET_AMD_STANDARD</a> 2</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#2a262d17c48823b084b1a7eb80f0f1a1">XFL_CMDSET_AMD_EXTENDED</a> 4</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#719d6ea5e54c2a51cd158a0fff62e21b">XFL_CMDSET_INTEL_G18</a> 0x200</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#4c78909cbdf4f6599ab7642d6e684d92">XFLASH_BUSY</a> 101</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#897cf03e8ecae3f5a65d35e6b24debc9">XFLASH_READY</a> 102</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#07d746833c29e926077ef8b87f419555">XFLASH_ERROR</a> 103</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#f00b3ca6408dced89328c5ec124286ea">XFLASH_ERASE_SUSPENDED</a> 104</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#9051cea18d547b49ef7efcf25ec6735a">XFLASH_WRITE_SUSPENDED</a> 105</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#848bcf9aff93e9c0361238ba6c855ce6">XFLASH_PART_NOT_SUPPORTED</a> 106</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#aa31e4cd84c3e8c33c4770bec7ee1871">XFLASH_NOT_SUPPORTED</a> 107</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#2a2c0ce1fabc8bc713bc87ac4d2d5f05">XFLASH_TOO_MANY_REGIONS</a> 108</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#1b6fa1fdf36397ba0a3289cb83caef86">XFLASH_TIMEOUT_ERROR</a> 109</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#9e43774fcf39d28c0162b30b0c9d0f53">XFLASH_ADDRESS_ERROR</a> 110</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#fba52e7112bcbda8c09e7942f22e6da1">XFLASH_ALIGNMENT_ERROR</a> 111</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#69458ba63e1b7736dab9e02ba82eba5a">XFLASH_BLOCKING_CALL_ERROR</a> 112</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#10bff0496a7f50240d2681198a5cea41">XFLASH_CFI_QUERY_ERROR</a> 113</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#ad1803e7153d5cf6427b9826842f49bc">XFLASH_BLOCK_PROTECTED</a> 114</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#bfe5d2d1d7b9f2de6d34f9592c94c55c">XFL_LAYOUT_X16_X8_X1</a> 0x02020101</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#9dc02bcc908762f87519514a12b79b1d">XFL_LAYOUT_X16_X16_X1</a> 0x02020201</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#394a91fe2aa0d6059a38014326cb36df">XFL_LAYOUT_X16_X16_X2</a> 0x04020202</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#6fb244bb9dc3a219d4d6bcdc80a0cc81">XFL_LAYOUT_X16_X16_X4</a> 0x08020204</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#6adb94f05acaebb6fbbe32080b803633">XFL_DEVCTL_GET_LAST_ERROR</a> 1</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#f980e92e70f5801029c07a1eac2577e6">XFL_DEVCTL_GET_GEOMETRY</a> 2</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#94ba7da6f8b6c984b9a15940b146e306">XFL_DEVCTL_GET_PROPERTIES</a> 3</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#1520d015f782051e78b1abf87901172a">XFL_DEVCTL_SET_RYBY</a> 4</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#a88427b63653573bb208232e37afd153">XFL_DEVCTL_ERASE_RESUME</a> 5</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#ec5ae0337070924b8fb67de38abeda29">XFL_DEVCTL_ERASE_SUSPEND</a> 6</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#1909fe65757eb603970b93538b0b266c">XFL_DEVCTL_ENTER_EXT_MODE</a> 7</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#467875ca3f034fcac8c86658e0673ed5">XFL_DEVCTL_EXIT_EXT_MODE</a> 8</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#ab9791abe40f7455e14f2d6d93b44f29">XFL_DEVCTL_CHIP_ERASE</a> 9</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#566b84ae47063b19152b380ab4224de0">XFL_DEVCTL_PROTECTION_STATUS</a> 10</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#be526d9182c7fddcbd0c4f6ff4ac6c92">XFL_INTEL_MAX_ERASE_REGIONS</a> 20</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#7d885d4b32e0713e7a3a4d79c4b9d7de">XFL_GEOMETRY_INCREMENT</a>(GeometryPtr, Region, Block)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#1e830b659dc392193ef98aef0fedb218">XFL_GEOMETRY_BLOCK_DIFF</a>(GeometryPtr, StartRegion, StartBlock, EndRegion, EndBlock)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#bd9d59993b320471b9c73256c4354b4d">XFL_GEOMETRY_IS_ABSOLUTE_VALID</a>(GeometryPtr, Offset) ((Offset) < (GeometryPtr)->DeviceSize)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#96c38d628a2adc625f10d48110382ebb">XFL_GEOMETRY_IS_BLOCK_VALID</a>(GeometryPtr, Region, Block, BlockOffset)</td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="struct_x_flash_tag.html">XFlashTag</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#a94a1e6bf28ceded9bf137871dda0886">XFlash</a></td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#610c8f437cec0667b0624295aa4910ed">XFlash_Initialize</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 BaseAddress, u8 BusWidth, int IsPlatformFlash)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#6f68f59948e2627e9da60dcc0fef6512">XFlash_Reset</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#f1dbc1bd39f8af51bc8841edd9e34257">XFlash_DeviceControl</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 Command, DeviceCtrlParam *Parameters)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#50969bfcb9f81978d00ef46c117a909a">XFlash_Read</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 Offset, u32 Bytes, void *DestPtr)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#565740998b53646a59f7d4938a7fcd02">XFlash_Write</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 Offset, u32 Bytes, void *SrcPtr)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#74526155b23ac3fb515ab7bdd8088f91">XFlash_Erase</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 Offset, u32 Bytes)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#e4afca07edcb164e1ef36ebdb4f54e5f">XFlash_Lock</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 Offset, u32 Bytes)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#d9b92d9197221539a9d88bb9a0519c9e">XFlash_Unlock</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr, u32 Offset, u32 Bytes)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="xilflash_8h.html#02b6780c6a9e727d666caae54dfe27ba">XFlash_IsReady</a> (<a class="el" href="struct_x_flash_tag.html">XFlash</a> *InstancePtr)</td></tr>
|
|
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
This module implements the functionality for flash memory devices that conform to the "Common Flash Interface" (CFI) standard. CFI allows a single flash library to be used for an entire family of parts.<p>
|
|
This is not a library for a specific device, but for a set of command read/write/erase algorithms. CFI allows us to determine which algorithm to utilize at runtime.<p>
|
|
<b>Library Initialization</b><p>
|
|
The function call <a class="el" href="xilflash_8h.html#610c8f437cec0667b0624295aa4910ed">XFlash_Initialize()</a> should be called by the application before any other function in the library. The initialization function checks for the device family and initializes the XFlash instance with the family specific data. The VT table (Contains the function pointers to family specific API's) is setup and family specific initialization routine is called.<p>
|
|
<b>Device Geometry</b><p>
|
|
The Device geometry varies for different flash device families. The following list describes geometry of different flash device families:<p>
|
|
<b> Intel Flash Device Geometry </b><p>
|
|
Flash memory space is segmented into areas called blocks. The size of each block is based on a power of 2. A region is defined as a contiguous set of blocks of the same size. Some parts have several regions while others have one. The arrangement of blocks and regions is refered to by this module as the part's geometry. Some Intel flash supports multiple banks on the same device. This library supports single and multiple bank flash devices.<p>
|
|
<b> AMD Flash Device Geometry </b><p>
|
|
Flash memory space is segmented into areas called banks and further in to regions and blocks. The size of each block is based on a power of 2. A region is defined as a contiguous set of blocks of the same size. Some parts have several regions while others have one. A bank is defined as a contiguous set of blocks. The bank may contain blocks of different size. The arrangement of blocks, regions and banks is referred to by this module as the part's geometry.<p>
|
|
The cells within the part can be programmed from a logic 1 to a logic 0 and not the other way around. To change a cell back to a logic 1, the entire block containing that cell must be erased. When a block is erased all bytes contain the value 0xFF. The number of times a block can be erased is finite. Eventually the block will wear out and will no longer be capable of erasure. As of this writing, the typical flash block can be erased 100,000 or more times.<p>
|
|
<b>Write Operation</b><p>
|
|
The write call can be used to write a minimum of zero bytes and a maximum entire flash. If the Offset Address specified to write is out of flash or if the number of bytes specified from the Offset address exceed flash boundaries an error is reported back to the user. The write is blocking in nature in that the control is returned back to user only after the write operation is completed successfully or an error is reported.<p>
|
|
<b>Read Operation</b><p>
|
|
The read call can be used to read a minimum of zero bytes and maximum of entire flash. If the Offset Address specified to write is out of flash boundary an error is reported back to the user. The read function reads memory locations beyond Flash boundary. Care should be taken by the user to make sure that the Number of Bytes + Offset address is within the Flash address boundaries. The write is blocking in nature in that the control is returned back to user only after the read operation is completed successfully or an error is reported.<p>
|
|
<b>Erase Operation</b><p>
|
|
The erase operations are provided to erase a Block in the Flash memory. The erase call is blocking in nature in that the control is returned back to user only after the erase operation is completed successfully or an error is reported.<p>
|
|
<b>Sector Protection</b><p>
|
|
The Flash Device is divided into Blocks. Each Block can be protected individually from unwarranted writing/erasing. The Block locking can be achieved using <a class="el" href="xilflash_8h.html#e4afca07edcb164e1ef36ebdb4f54e5f">XFlash_Lock()</a> lock. All the memory locations from the Offset address specified will be locked. The block can be unlocked using XFlash_UnLock() call. All the Blocks which are previously locked will be unlocked. The Lock and Unlock calls are blocking in nature in that the control is returned back to user only after the operation is completed successfully or an error is reported. The AMD flash device requires high voltage on Reset pin to perform lock and unlock operation. User must provide this high voltage (As defined in datasheet) to reset pin before calling lock and unlock API for AMD flash devices. Lock and Unlock features are not tested for AMD flash device.<p>
|
|
<b>Device Control</b><p>
|
|
Functionalities specific to a Flash Device Family are implemented as Device Control.<p>
|
|
The following are the Intel specific device control:<ul>
|
|
<li>Retrieve the last error data.</li><li>Get Device geometry.</li><li>Get Device properties.</li><li>Set RYBY pin mode.</li><li>Set the Configuration register (Platform Flash only).</li></ul>
|
|
<p>
|
|
The following are the AMD specific device control:<ul>
|
|
<li>Get Device geometry.</li><li>Get Device properties.</li><li>Erase Resume.</li><li>Erase Suspend.</li><li>Enter Extended Mode.</li><li>Exit Extended Mode.</li><li>Get Protection Status of Block Group.</li><li>Erase Chip.</li></ul>
|
|
<p>
|
|
<dl compact><dt><b>Note:</b></dt><dd></dd></dl>
|
|
<b>This library needs to know the type of EMC core (AXI or XPS) used to access the cfi flash, to map the correct APIs. This library should be used with the emc driver, v3_01_a and above, so that this information can be automatically obtained from the emc driver.</b><p>
|
|
This library is intended to be RTOS and processor independent. It works with physical addresses only. Any needs for dynamic memory management, threads, mutual exclusion, virtual memory, cache control, or HW write protection management must be satisfied by the layer above this library. <br>
|
|
<br>
|
|
All writes to flash occur in units of bus-width bytes. If more than one part exists on the data bus, then the parts are written in parallel. Reads from flash are performed in any width up to the width of the data bus. It is assumed that the flash bus controller or local bus supports these types of accesses.<p>
|
|
<pre>
|
|
MODIFICATION HISTORY:</pre><p>
|
|
<pre> Ver Who Date Changes
|
|
----- ---- -------- -----------------------------------------------
|
|
1.00a rmm 10/25/07 First release
|
|
1.00a mta 10/25/07 Updated to flash library
|
|
1.01a ksu 04/10/08 Added support for AMD CFI Interface
|
|
1.02a ksu 06/16/09 Added support for multiple banks in Intel flash
|
|
Removed unused defines (XFL_MAX_NUM_BANKS, XFL_BANK1,
|
|
XFL_BANK2)
|
|
Added IOCTL to set configuration register of platform
|
|
flash
|
|
1.03a ksu 10/07/09 Added support for large buffer size flash (CR535564)
|
|
2.00a ktn 12/04/09 Updated to use the HAL processor APIs/macros
|
|
2.01a ktn 03/31/10 Updated the AMD code to support uniform sector WP modes
|
|
2.02a sdm 06/30/10 Updated to support AXI EMC with Little Endian Processor
|
|
2.02a sdm 07/07/10 Updated XFlashAmd_Initialize() to NOT change the erase
|
|
region information of a top boot device, when the number
|
|
of erase regions is not more than 1.
|
|
3.00a sdm 03/03/11 Removed static parameters in mld and updated code to
|
|
determine these parameters from the CFI data.
|
|
3.00a sdm 03/23/11 Added two new parameters in mld for flash families. Users
|
|
can enable support for either of the flash devices or both
|
|
of them.
|
|
3.01a srt 03/02/12 Added support for Micron G18 Flash device to fix
|
|
CRs 648372, 648282.
|
|
Modified XFlashIntel_Reset function to reset all the
|
|
partitions.
|
|
Added DATA_SYNC to fix the CR 644750.
|
|
3.02a srt 05/30/12 Changed Implementation for Micron G18 Flash, which
|
|
fixes the CR 662317.
|
|
CR 662317 Description - Xilinx Platform Flash on ML605
|
|
fails to work.
|
|
3.03a srt 11/04/12 Increased AMD maximum erase regions (CR 668730)
|
|
Fixed CR 679937 -
|
|
Description: Non-word aligned data write to flash fails
|
|
with AXI interface.
|
|
3.04a srt 02/18/13 Fixed CR 700553.</pre><p>
|
|
<pre> </pre> <hr><h2>Define Documentation</h2>
|
|
<a class="anchor" name="2a262d17c48823b084b1a7eb80f0f1a1"></a><!-- doxytag: member="xilflash.h::XFL_CMDSET_AMD_EXTENDED" ref="2a262d17c48823b084b1a7eb80f0f1a1" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_CMDSET_AMD_EXTENDED 4 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Includes Fujitsu/STM </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="852f3cbf0f5ab59bc3add486cb23e93e"></a><!-- doxytag: member="xilflash.h::XFL_CMDSET_AMD_STANDARD" ref="852f3cbf0f5ab59bc3add486cb23e93e" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_CMDSET_AMD_STANDARD 2 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Includes Fujitsu/STM </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="039a231b158f3bf061c0467253385e75"></a><!-- doxytag: member="xilflash.h::XFL_CMDSET_INTEL_EXTENDED" ref="039a231b158f3bf061c0467253385e75" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_CMDSET_INTEL_EXTENDED 1 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Includes Micron/Sharp </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="719d6ea5e54c2a51cd158a0fff62e21b"></a><!-- doxytag: member="xilflash.h::XFL_CMDSET_INTEL_G18" ref="719d6ea5e54c2a51cd158a0fff62e21b" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_CMDSET_INTEL_G18 0x200 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Micron G18 Flash </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="362bf211e43da8bfb9642f85649dffa4"></a><!-- doxytag: member="xilflash.h::XFL_CMDSET_INTEL_STANDARD" ref="362bf211e43da8bfb9642f85649dffa4" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_CMDSET_INTEL_STANDARD 3 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Vendor command set codes. Refer to industry document "CFI publication 100" for the latest list Includes Micron/Sharp </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="ab9791abe40f7455e14f2d6d93b44f29"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_CHIP_ERASE" ref="ab9791abe40f7455e14f2d6d93b44f29" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_CHIP_ERASE 9 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Erase whole chip </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="1909fe65757eb603970b93538b0b266c"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_ENTER_EXT_MODE" ref="1909fe65757eb603970b93538b0b266c" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_ENTER_EXT_MODE 7 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Enter Extended mode </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="a88427b63653573bb208232e37afd153"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_ERASE_RESUME" ref="a88427b63653573bb208232e37afd153" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_ERASE_RESUME 5 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Resume Erase </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="ec5ae0337070924b8fb67de38abeda29"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_ERASE_SUSPEND" ref="ec5ae0337070924b8fb67de38abeda29" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_ERASE_SUSPEND 6 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Suspend Erase </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="467875ca3f034fcac8c86658e0673ed5"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_EXIT_EXT_MODE" ref="467875ca3f034fcac8c86658e0673ed5" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_EXIT_EXT_MODE 8 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Exit Extended mode </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="f980e92e70f5801029c07a1eac2577e6"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_GET_GEOMETRY" ref="f980e92e70f5801029c07a1eac2577e6" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_GET_GEOMETRY 2 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Get Device geometry </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="6adb94f05acaebb6fbbe32080b803633"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_GET_LAST_ERROR" ref="6adb94f05acaebb6fbbe32080b803633" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_GET_LAST_ERROR 1 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Retrieve the last error data </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="94ba7da6f8b6c984b9a15940b146e306"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_GET_PROPERTIES" ref="94ba7da6f8b6c984b9a15940b146e306" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_GET_PROPERTIES 3 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Get Device Properties </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="566b84ae47063b19152b380ab4224de0"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_PROTECTION_STATUS" ref="566b84ae47063b19152b380ab4224de0" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_PROTECTION_STATUS 10 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Check block protection status </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="1520d015f782051e78b1abf87901172a"></a><!-- doxytag: member="xilflash.h::XFL_DEVCTL_SET_RYBY" ref="1520d015f782051e78b1abf87901172a" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_DEVCTL_SET_RYBY 4 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Set RYBY pin mode </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="1e830b659dc392193ef98aef0fedb218"></a><!-- doxytag: member="xilflash.h::XFL_GEOMETRY_BLOCK_DIFF" ref="1e830b659dc392193ef98aef0fedb218" args="(GeometryPtr, StartRegion, StartBlock, EndRegion, EndBlock)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_GEOMETRY_BLOCK_DIFF </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">GeometryPtr, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>StartRegion, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>StartBlock, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>EndRegion, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>EndBlock </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
<b>Value:</b><div class="fragment"><pre class="fragment">(((GeometryPtr)->EraseRegion[EndRegion].AbsoluteBlock + (EndBlock)) - \
|
|
((GeometryPtr)->EraseRegion[StartRegion].AbsoluteBlock + \
|
|
(StartBlock)) + 1)
|
|
</pre></div>Calculates the number of blocks between the given start and end coordinates.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>GeometryPtr</em> </td><td>is the geometry instance that defines flash addressing. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>StartRegion</em> </td><td>is the starting region. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>StartBlock</em> </td><td>is the starting block. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>EndRegion</em> </td><td>is the ending region. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>EndBlock</em> </td><td>is the ending block.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>The number of blocks between start Region/Block and end Region/Block(inclusive). </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="7d885d4b32e0713e7a3a4d79c4b9d7de"></a><!-- doxytag: member="xilflash.h::XFL_GEOMETRY_INCREMENT" ref="7d885d4b32e0713e7a3a4d79c4b9d7de" args="(GeometryPtr, Region, Block)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_GEOMETRY_INCREMENT </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">GeometryPtr, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>Region, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>Block </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
|
|
<span class="keywordflow">if</span> ((GeometryPtr)->EraseRegion[Region].Number <= ++(Block)) \
|
|
{ \
|
|
(Region)++; \
|
|
(Block) = 0; \
|
|
} \
|
|
}
|
|
</pre></div>Increments the given Region and Block to the next block address.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>GeometryPtr</em> </td><td>is the geometry instance that defines flash addressing. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Region</em> </td><td>is the starting region. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Block</em> </td><td>is the starting block.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>Region parameter is incremented if the next block starts in a new region. Block parameter is set to zero if the next block starts in a new region, otherwise it is incremented by one. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="bd9d59993b320471b9c73256c4354b4d"></a><!-- doxytag: member="xilflash.h::XFL_GEOMETRY_IS_ABSOLUTE_VALID" ref="bd9d59993b320471b9c73256c4354b4d" args="(GeometryPtr, Offset)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_GEOMETRY_IS_ABSOLUTE_VALID </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">GeometryPtr, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>Offset </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap> ((Offset) < (GeometryPtr)->DeviceSize)</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Tests the given absolute Offset to verify it lies within the bounds of the address space defined by a geometry instance.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>GeometryPtr</em> </td><td>is the geometry instance that defines flash addressing. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Offset</em> </td><td>is the offset to test.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>0 if Offset do not lie within the address space described by GeometryPtr.</li><li>1 if Offset are within the address space. </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="96c38d628a2adc625f10d48110382ebb"></a><!-- doxytag: member="xilflash.h::XFL_GEOMETRY_IS_BLOCK_VALID" ref="96c38d628a2adc625f10d48110382ebb" args="(GeometryPtr, Region, Block, BlockOffset)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_GEOMETRY_IS_BLOCK_VALID </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">GeometryPtr, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>Region, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>Block, <tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>BlockOffset </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
<b>Value:</b><div class="fragment"><pre class="fragment">(((Region) < ( GeometryPtr)->NumEraseRegions) && \
|
|
((Block) < (GeometryPtr)->EraseRegion[Region].Number) && \
|
|
((BlockOffset) < (GeometryPtr)->EraseRegion[Region].Size))
|
|
</pre></div>Tests the given Region, Block, and Offset to verify they lie within the address space defined by a geometry instance.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>GeometryPtr</em> </td><td>is the geometry instance that defines flash addressing </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Region</em> </td><td>is the region to test </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Block</em> </td><td>is the block to test </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>BlockOffset</em> </td><td>is the offset within block</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>0 if Region, Block, & BlockOffset do not lie within the address space described by GeometryPtr.</li><li>1 if Region, Block, & BlockOffset are within the address space </li></ul>
|
|
</dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="be526d9182c7fddcbd0c4f6ff4ac6c92"></a><!-- doxytag: member="xilflash.h::XFL_INTEL_MAX_ERASE_REGIONS" ref="be526d9182c7fddcbd0c4f6ff4ac6c92" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_INTEL_MAX_ERASE_REGIONS 20 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
A block region is defined as a set of consecutive erase blocks of the same size. Most flash devices only have a handful of regions. If a part has more regions than defined by this constant, then the constant must be modified to accommodate the part. The minimum value of this constant is 1 and there is no maximum value. Note that increasing this value also increases the amount of memory used by the geometry structure approximately 12 bytes per increment. </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="9dc02bcc908762f87519514a12b79b1d"></a><!-- doxytag: member="xilflash.h::XFL_LAYOUT_X16_X16_X1" ref="9dc02bcc908762f87519514a12b79b1d" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_LAYOUT_X16_X16_X1 0x02020201 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
One 16-bit part operating in 16-bit mode. Total data bus width is 16-bits. This layout is supported in AMD and Intel flash devices </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="394a91fe2aa0d6059a38014326cb36df"></a><!-- doxytag: member="xilflash.h::XFL_LAYOUT_X16_X16_X2" ref="394a91fe2aa0d6059a38014326cb36df" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_LAYOUT_X16_X16_X2 0x04020202 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Two 16-bit parts operating in 16-bit mode. Total data bus width is 32-bits. This layout is only supported in Intel flash devices </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="6fb244bb9dc3a219d4d6bcdc80a0cc81"></a><!-- doxytag: member="xilflash.h::XFL_LAYOUT_X16_X16_X4" ref="6fb244bb9dc3a219d4d6bcdc80a0cc81" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_LAYOUT_X16_X16_X4 0x08020204 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Four 16-bit parts operating in 16-bit mode. Total data bus width is 64-bits. This layout is only supported in Intel flash devices </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="bfe5d2d1d7b9f2de6d34f9592c94c55c"></a><!-- doxytag: member="xilflash.h::XFL_LAYOUT_X16_X8_X1" ref="bfe5d2d1d7b9f2de6d34f9592c94c55c" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFL_LAYOUT_X16_X8_X1 0x02020101 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Supported part arrangements. This enumeration defines the supported arrangements of parts on the data-bus. The naming convention for these constants is as follows:<p>
|
|
XFL_LAYOUT_Xa_Xb_Xc, where<p>
|
|
Xa is the part's physical data bus width. Xb is the is the part's selected data bus width (this field is required because a x16 part can be placed in x8 mode). Xc is the number of interleaved parts. For example one part can be tied to D0-D15 and a second to data lines D15-D31.<p>
|
|
Parts arranged in series should be treated as separate instances. An example of this layout: Two X16 parts operating in X16 mode. The first part occupies address space FF000000 - FF0FFFFF and a second from FF100000 - FF1FFFFF.<p>
|
|
These constants are encoded using bit masks defined in the next section. One 16-bit part operating in 8-bit mode. Total data bus width is 8-bits. This layout is only supported in AMD flash devices </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="9e43774fcf39d28c0162b30b0c9d0f53"></a><!-- doxytag: member="xilflash.h::XFLASH_ADDRESS_ERROR" ref="9e43774fcf39d28c0162b30b0c9d0f53" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_ADDRESS_ERROR 110 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Accessed flash outside its addressable range </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="fba52e7112bcbda8c09e7942f22e6da1"></a><!-- doxytag: member="xilflash.h::XFLASH_ALIGNMENT_ERROR" ref="fba52e7112bcbda8c09e7942f22e6da1" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_ALIGNMENT_ERROR 111 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Write alignment error </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="ad1803e7153d5cf6427b9826842f49bc"></a><!-- doxytag: member="xilflash.h::XFLASH_BLOCK_PROTECTED" ref="ad1803e7153d5cf6427b9826842f49bc" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_BLOCK_PROTECTED 114 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Block is protected </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="69458ba63e1b7736dab9e02ba82eba5a"></a><!-- doxytag: member="xilflash.h::XFLASH_BLOCKING_CALL_ERROR" ref="69458ba63e1b7736dab9e02ba82eba5a" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_BLOCKING_CALL_ERROR 112 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Couldn't return immediately from write/erase function with XFL_NON_BLOCKING_WRITE/ERASE option cleared </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="4c78909cbdf4f6599ab7642d6e684d92"></a><!-- doxytag: member="xilflash.h::XFLASH_BUSY" ref="4c78909cbdf4f6599ab7642d6e684d92" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_BUSY 101 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Flash is erasing or programming </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="10bff0496a7f50240d2681198a5cea41"></a><!-- doxytag: member="xilflash.h::XFLASH_CFI_QUERY_ERROR" ref="10bff0496a7f50240d2681198a5cea41" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_CFI_QUERY_ERROR 113 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Failed to query the device </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="f00b3ca6408dced89328c5ec124286ea"></a><!-- doxytag: member="xilflash.h::XFLASH_ERASE_SUSPENDED" ref="f00b3ca6408dced89328c5ec124286ea" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_ERASE_SUSPENDED 104 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Flash is in suspended erase state </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="07d746833c29e926077ef8b87f419555"></a><!-- doxytag: member="xilflash.h::XFLASH_ERROR" ref="07d746833c29e926077ef8b87f419555" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_ERROR 103 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Flash had detected an internal error. Use XFlash_DeviceControl to retrieve device specific codes </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="aa31e4cd84c3e8c33c4770bec7ee1871"></a><!-- doxytag: member="xilflash.h::XFLASH_NOT_SUPPORTED" ref="aa31e4cd84c3e8c33c4770bec7ee1871" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_NOT_SUPPORTED 107 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Operation not supported </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="848bcf9aff93e9c0361238ba6c855ce6"></a><!-- doxytag: member="xilflash.h::XFLASH_PART_NOT_SUPPORTED" ref="848bcf9aff93e9c0361238ba6c855ce6" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_PART_NOT_SUPPORTED 106 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Flash type not supported by library </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="897cf03e8ecae3f5a65d35e6b24debc9"></a><!-- doxytag: member="xilflash.h::XFLASH_READY" ref="897cf03e8ecae3f5a65d35e6b24debc9" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_READY 102 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Flash is ready for commands </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="1b6fa1fdf36397ba0a3289cb83caef86"></a><!-- doxytag: member="xilflash.h::XFLASH_TIMEOUT_ERROR" ref="1b6fa1fdf36397ba0a3289cb83caef86" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_TIMEOUT_ERROR 109 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Programming or erase operation aborted due to a timeout </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="2a2c0ce1fabc8bc713bc87ac4d2d5f05"></a><!-- doxytag: member="xilflash.h::XFLASH_TOO_MANY_REGIONS" ref="2a2c0ce1fabc8bc713bc87ac4d2d5f05" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_TOO_MANY_REGIONS 108 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Too many erase regions </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="9051cea18d547b49ef7efcf25ec6735a"></a><!-- doxytag: member="xilflash.h::XFLASH_WRITE_SUSPENDED" ref="9051cea18d547b49ef7efcf25ec6735a" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">#define XFLASH_WRITE_SUSPENDED 105 </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Flash is in suspended write state </td>
|
|
</tr>
|
|
</table>
|
|
<hr><h2>Typedef Documentation</h2>
|
|
<a class="anchor" name="a94a1e6bf28ceded9bf137871dda0886"></a><!-- doxytag: member="xilflash.h::XFlash" ref="a94a1e6bf28ceded9bf137871dda0886" args="" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">typedef struct <a class="el" href="struct_x_flash_tag.html">XFlashTag</a> <a class="el" href="struct_x_flash_tag.html">XFlash</a> </td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
The XFlash library instance data. The user is required to allocate a variable of this type for every flash device in the system. A pointer to a variable of this type is then passed to the library API functions. </td>
|
|
</tr>
|
|
</table>
|
|
<hr><h2>Function Documentation</h2>
|
|
<a class="anchor" name="f1dbc1bd39f8af51bc8841edd9e34257"></a><!-- doxytag: member="xilflash.h::XFlash_DeviceControl" ref="f1dbc1bd39f8af51bc8841edd9e34257" args="(XFlash *InstancePtr, u32 Command, DeviceCtrlParam *Parameters)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_DeviceControl </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Command</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>DeviceCtrlParam * </td>
|
|
<td class="mdname" nowrap> <em>Parameters</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function is used to execute device specific commands. For a list of device specific commands, see the <a class="el" href="xilflash_8h.html">xilflash.h</a>.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Command</em> </td><td>is the device specific command to issue. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Parameters</em> </td><td>specifies the arguments passed to the device control function.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_NOT_SUPPORTED if the command is not recognized/supported by the device(s).</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="74526155b23ac3fb515ab7bdd8088f91"></a><!-- doxytag: member="xilflash.h::XFlash_Erase" ref="74526155b23ac3fb515ab7bdd8088f91" args="(XFlash *InstancePtr, u32 Offset, u32 Bytes)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Erase </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Offset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Bytes</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function erases the specified address range in the flash device. The number of bytes to erase can be any number as long as it is within the bounds of the device(s).<p>
|
|
The device is polled until an error or the operation completes successfully.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Offset</em> </td><td>is the offset into the device(s) address space from which to begin erasure. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Bytes</em> </td><td>is the number of bytes to erase.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_ADDRESS_ERROR if the destination address range is not completely within the addressable areas of the device(s).</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>Due to flash memory design, the range actually erased may be larger than what was specified by the Offset & Bytes parameters. This will occur if the parameters do not align to block boundaries. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="610c8f437cec0667b0624295aa4910ed"></a><!-- doxytag: member="xilflash.h::XFlash_Initialize" ref="610c8f437cec0667b0624295aa4910ed" args="(XFlash *InstancePtr, u32 BaseAddress, u8 BusWidth, int IsPlatformFlash)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Initialize </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>BaseAddress</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u8 </td>
|
|
<td class="mdname" nowrap> <em>BusWidth</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>int </td>
|
|
<td class="mdname" nowrap> <em>IsPlatformFlash</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Initializes a specific XFlash instance. The initialization entails:<ul>
|
|
<li>Check the Device family type.</li><li>Issuing the CFI query command.</li><li>Get and translate relevant CFI query information.</li><li>Set default options for the instance.</li><li>Setup the VTable.</li><li>Call the family initialize function of the instance.</li><li>Initialize the Xilinx Platform Flash XL to Async mode if the user selects to use the Platform Flash XL in the MLD. The Platform Flash XL is an Intel CFI complaint device.</li></ul>
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is a pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>BaseAddress</em> </td><td>is the base address of the flash memory. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>BusWidth</em> </td><td>is the total width of the flash memory, in bytes. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>IsPlatformFlash</em> </td><td>is used to specify if the flash is a platform flash.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_PART_NOT_SUPPORTED if the command set algorithm or Layout is not supported by any flash family compiled into the system.</li><li>XFLASH_CFI_QUERY_ERROR if the device would not enter CFI query mode. Either the device(s) do not support CFI, the wrong BaseAddress param was used, an unsupported part layout exists, or a hardware problem exists with the part.</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>BusWidth is not the width of an individual part. Its the total operating width. For example, if there are two 16-bit parts, with one tied to data lines D0-D15 and other tied to D15-D31, BusWidth would be (32 / 8) = 4. If a single 16-bit flash is in 8-bit mode, then BusWidth should be (8 / 8) = 1. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="02b6780c6a9e727d666caae54dfe27ba"></a><!-- doxytag: member="xilflash.h::XFlash_IsReady" ref="02b6780c6a9e727d666caae54dfe27ba" args="(XFlash *InstancePtr)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_IsReady </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Checks the readiness of the device, which means it has been successfully initialized.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is a pointer to the XFlash instance.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>TRUE if the device has been initialized (but not necessarily started), and FALSE otherwise.</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="e4afca07edcb164e1ef36ebdb4f54e5f"></a><!-- doxytag: member="xilflash.h::XFlash_Lock" ref="e4afca07edcb164e1ef36ebdb4f54e5f" args="(XFlash *InstancePtr, u32 Offset, u32 Bytes)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Lock </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Offset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Bytes</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function Locks the blocks in the specified range of the flash device(s).<p>
|
|
The device is polled until an error or the operation completes successfully.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Offset</em> </td><td>is the offset into the device(s) address space from which to begin block locking. The first three bytes of every block is reserved for special purpose. The offset should be atleast three bytes from start of the block. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Bytes</em> </td><td>indicates the number of bytes to Lock in the Block starting from Offset.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_ADDRESS_ERROR if the destination address range is not completely within the addressable areas of the device(s).</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>Due to flash memory design, the range actually locked may be larger than what was specified by the Offset & Bytes parameters. This will occur if the parameters do not align to block boundaries. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="50969bfcb9f81978d00ef46c117a909a"></a><!-- doxytag: member="xilflash.h::XFlash_Read" ref="50969bfcb9f81978d00ef46c117a909a" args="(XFlash *InstancePtr, u32 Offset, u32 Bytes, void *DestPtr)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Read </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Offset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Bytes</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>void * </td>
|
|
<td class="mdname" nowrap> <em>DestPtr</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function reads the data from the Flash device and copies it into the specified user buffer. The source and destination addresses can be on any alignment supported by the processor.<p>
|
|
The device is polled until an error or the operation completes successfully.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Offset</em> </td><td>is the offset into the device(s) address space from which to read. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Bytes</em> </td><td>is the number of bytes to copy. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>DestPtr</em> </td><td>is the destination address to copy data to.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_ADDRESS_ERROR if the source address does not start within the addressable areas of the device(s).</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>This function allows the transfer of data past the end of the device's address space. If this occurs, then results are undefined. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="6f68f59948e2627e9da60dcc0fef6512"></a><!-- doxytag: member="xilflash.h::XFlash_Reset" ref="6f68f59948e2627e9da60dcc0fef6512" args="(XFlash *InstancePtr)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Reset </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function resets the flash device and places it in read mode.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_BUSY if the flash devices were in the middle of an operation and could not be reset.</li><li>XFLASH_ERROR if the device(s) have experienced an internal error during the operation. <a class="el" href="xilflash_8h.html#f1dbc1bd39f8af51bc8841edd9e34257">XFlash_DeviceControl()</a> must be used to access the cause of the device specific error. condition.</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="d9b92d9197221539a9d88bb9a0519c9e"></a><!-- doxytag: member="xilflash.h::XFlash_Unlock" ref="d9b92d9197221539a9d88bb9a0519c9e" args="(XFlash *InstancePtr, u32 Offset, u32 Bytes)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Unlock </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Offset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Bytes</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function Unlocks the blocks in the specified range of the flash device(s).<p>
|
|
The device is polled until an error or the operation completes successfully.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Offset</em> </td><td>is the offset into the device(s) address space from which to begin block UnLocking. The first three bytes of every block is reserved for special purpose. The offset should be atleast three bytes from start of the block. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Bytes</em> </td><td>indicates the number of bytes to UnLock in the Block starting from Offset.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_ADDRESS_ERROR if the destination address range is not completely within the addressable areas of the device(s).</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="565740998b53646a59f7d4938a7fcd02"></a><!-- doxytag: member="xilflash.h::XFlash_Write" ref="565740998b53646a59f7d4938a7fcd02" args="(XFlash *InstancePtr, u32 Offset, u32 Bytes, void *SrcPtr)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">int XFlash_Write </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="struct_x_flash_tag.html">XFlash</a> * </td>
|
|
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Offset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u32 </td>
|
|
<td class="mdname" nowrap> <em>Bytes</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>void * </td>
|
|
<td class="mdname" nowrap> <em>SrcPtr</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
This function programs the flash device(s) with data specified in the user buffer. The source and destination address must be aligned to the width of the flash's data bus.<p>
|
|
The device is polled until an error or the operation completes successfully.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em> </td><td>is the pointer to the XFlash instance. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Offset</em> </td><td>is the offset into the device(s) address space from which to begin programming. Must be aligned to the width of the flash's data bus. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>Bytes</em> </td><td>is the number of bytes to program. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>SrcPtr</em> </td><td>is the source address containing data to be programmed. Must be aligned to the width of the flash's data bus. The SrcPtr doesn't have to be aligned to the flash width if the processor supports unaligned access. But, since this library is generic, and some processors (eg. Microblaze) do not support unaligned access; this API requires the SrcPtr to be aligned.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd><ul>
|
|
<li>XST_SUCCESS if successful.</li><li>XFLASH_ERROR if a write error occurred. This error is usually device specific. Use <a class="el" href="xilflash_8h.html#f1dbc1bd39f8af51bc8841edd9e34257">XFlash_DeviceControl()</a> to retrieve specific error conditions. When this error is returned, it is possible that the target address range was only partially programmed.</li></ul>
|
|
</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr size="1"><address style="align: right;"><small>Generated on Thu Feb 13 14:37:13 2014 for 2014.1_doc by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address>
|
|
</body>
|
|
</html>
|