<div dir="ltr"><div>Hopefully I found the issue which was causing the problem. We should pass the index of the opcode to be used to that API, here they have passed the opcode itself, Hope the developers will fix this minor bug in their next release.<br>
</div><div>The code should be as follows: Pass <b>SPI_DEVICE_WRITE_STATUS_CMD_INDEX as 3rd argument instead of <span style="white-space:pre-wrap"> </span></b><b>SPI_FLASH_PART_OPCODE_WRITE_STATUS</b></div><div><b><br></b></div>
<div><div>Status = mSpiProtocol->Execute (</div><div> mSpiProtocol,</div><div> SPI_DEVICE_READ_STATUS_CMD_INDEX,</div><div> <b>SPI_DEVICE_WRITE_STATUS_CMD_INDEX</b>,</div><div> SPI_DEVICE_PREFIX_OP_WRITE_S_EN_INDEX,</div>
<div> TRUE,</div><div> TRUE,</div><div> TRUE,</div><div> 0,</div><div> sizeof (Data),</div><div> &Data,</div><div> EnumSpiRegionAll</div><div> );</div><div class="gmail_extra"><br clear="all">
<div><div dir="ltr"><div><div><span style="color:rgb(11,83,148)"><span style="font-family:'courier new',monospace">Regards<br></span></span></div><span style="color:rgb(11,83,148)"><span style="font-family:'courier new',monospace">Vijai Kumar K<br>
</span></span></div></div></div>
<br><br><div class="gmail_quote">On Wed, Jun 4, 2014 at 7:15 PM, vijaikumar k <span dir="ltr"><<a href="mailto:vijaikumar.k@mistralsolutions.com" target="_blank">vijaikumar.k@mistralsolutions.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi All,<div> In Minnowboard EFI we have got EFI_SPI_PROTOCOL, Inside IntelE6xxRuPkg/SpiDeviceDxe folder we have SpiDeviceDxe.c file. It has a function called InitSpiDevice which has the following line of code which claims to remove write protection in SPI flash chip. </div>
<div><div><b>Status = mSpiProtocol->Execute (</b></div><div><b> mSpiProtocol,</b></div><div><b> SPI_DEVICE_READ_STATUS_CMD_INDEX,</b></div><div><b><span style="white-space:pre-wrap"> </span>SPI_FLASH_PART_OPCODE_WRITE_STATUS,</b></div>
<div><b> SPI_DEVICE_PREFIX_OP_WRITE_S_EN_INDEX,</b></div><div><b> TRUE,</b></div><div><b> TRUE,</b></div><div><b> TRUE,</b></div><div><b> 0,</b></div><div><b> sizeof (Data),</b></div><div><b> &Data,</b></div>
<div><b> EnumSpiRegionAll</b></div><div><b> );</b></div></div><div>By default WinBond is Not write protected on powerup (i.e BP0 BP1 BP2 are zero). I tried writing some value (0x55) into the Status Register using the above API, when i read back I should get 54. But I get "02". Is the API actually working?? I tried wiring up a different flash "Micron" and I get the same 02 after writing 55. Has the API been validated?</div>
<div> . </div><div><div><div dir="ltr"><div><div><span style="color:rgb(11,83,148)"><span style="font-family:'courier new',monospace">Regards<br></span></span></div><span style="color:rgb(11,83,148)"><span style="font-family:'courier new',monospace">Vijai Kumar K<br>
</span></span></div></div></div>
</div></div>
</blockquote></div><br></div></div></div>