ch04s17.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Flash Memory (AR6410/AR7420)</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch04.html" title="Chapter 4.  Firmware"><link rel="prev" href="ch04s16.html" title="Boot from Host (AR7420)"><link rel="next" href="ch05.html" title="Chapter 5.  Procedures"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
  2. Flash Memory (AR6410/AR7420)
  3. </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s16.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
  4. Firmware
  5. </th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table><hr></div><div class="section" title="Flash Memory (AR6410/AR7420)"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="firmware-AR7420-flash"></a>
  6. Flash Memory (AR6410/AR7420)
  7. </h2></div></div></div><p>
  8. The <code class="constant">VS_MODULE_OPERATION</code> message is now the only way of write flash memory. The legacy message types <code class="constant">VS_RD_MOD</code>, <code class="constant">VS_WR_MOD</code>, <code class="constant">VS_MOD_NVM</code> and <code class="constant">VS_PTS_NVM</code> are deprecated and will no longer be supported by runtime firmware. This means that some customers must re-write their applications to flash newer powerline devices.
  9. </p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
  10. The <code class="constant">VS_MODULE_OPERATION</code> message type has many formats and the structure differs with each format. Readers should consult the <em class="citetitle">QCA Firmware Technical Reference Manual</em> for a complete description.
  11. </p></div><p>
  12. A blank flash memory must first be programmed with a softloader module. The module consists of a manifest, the executable softloader program image and a flash memory map. The map is used to manage flash memory during initializations and upgrades. The softloader module must be written into flash memory as a separate module before parameter and firmware modules are written. After that, parameter and firmware modules may be written and re-written without re-writing the softloader module. Of course, the softloader module must be re-written if flash memory is erased.
  13. </p><div class="figure"><a name="idp21779808"></a><p class="title"><b>Figure 4.9. 
  14. Flashing the Softloader (AR7420)
  15. </b></p><div class="figure-contents"><pre class="programlisting">
  16. AR7420 LOCAL-HOST
  17. [02] |&lt;- VS_MODULE_OPERATION.REQ (Start Session) ---| [01]
  18. [03] |-- VS_MODULE_OPERATION.CNF (Start Session) --&gt;| [04]
  19. | |
  20. [06] |&lt;-- VS_MODULE_OPERATION.REQ (Write Module) ---| [05]
  21. [07] |--- VS_MODULE_OPERATION.CNF (Write Module) --&gt;| [08]
  22. |&lt;---------------------------------------------|
  23. |---------------------------------------------&gt;|
  24. | |
  25. [10] |&lt;- VS_MODULE_OPERATION.REQ (Close Session) ---| [09]
  26. [11] |-- VS_MODULE_OPERATION.CNF (Close Session) --&gt;| [12]
  27. </pre></div></div><br class="figure-break"><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
  28. The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write session request to register a session identifier and the module identifier, module length and module checksum of the softloader module. The softloader module identifier is <code class="constant">0x7003</code>. The softloader module is the entire softloader chain including manifest, softloader image and flash memory layout.
  29. </p></li><li class="listitem"><p>
  30. The device receives the request, validates the module identifier and preserves the module length and checksum until the module write session is closed. The local host has <code class="constant">30</code> minutes to complete registered module write operations and close the module write session.
  31. </p></li><li class="listitem"><p>
  32. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code>, if things went well.
  33. </p></li><li class="listitem"><p>
  34. The local host receives the confirmation and prepares to download the softloader module.
  35. </p></li><li class="listitem"><p>
  36. The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write request containing the offset, length and content of the first portion of the module being downloaded.
  37. </p></li><li class="listitem"><p>
  38. The device receives the request and write to a scrath region of flash memory awaiting session close.
  39. </p></li><li class="listitem"><p>
  40. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well.
  41. </p></li><li class="listitem"><p>
  42. The local host receives the confirmation and continues downloading the softloader in fragments using <code class="constant">VS_MODULE_OPERATION</code> write requests, advancing the offset and adjusting the length with each write.
  43. </p></li><li class="listitem"><p>
  44. The local host send a <code class="constant">VS_MODULE_OPERATION.REQ</code> close module write session request having <code class="varname">COMMIT_CODE</code> bits <code class="constant">0</code> and <code class="constant">1</code> set. to indicate <span class="quote">“<span class="quote">Force Commit</span>”</span> and <span class="quote">“<span class="quote">Commit without reset</span>”</span>, respectively.
  45. </p></li><li class="listitem"><p>
  46. The device recevies the request, verifies the module length and checksum then transfers the module from scratch memory to it's final location in flash memory.
  47. </p></li><li class="listitem"><p>
  48. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> close module write session with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well. If things did not go well then the local host must request a new write module session and start over.
  49. </p></li></ol></div><p>
  50. Once the softloader module is written, the parameter and firmware modules may be written in much the same way except that they must be written as a pair. The parameter module must be downloaded first. The firmware module cannot be committed to without a compatible parameter module.
  51. </p><p>
  52. When parameters and firmware are written together the User <acronym class="acronym">PIB</acronym>, Factory <acronym class="acronym">PIB</acronym> and firmware are modified modified. The new User <acronym class="acronym">PIB</acronym> is created by copying the old User <acronym class="acronym">PIB</acronym> over the new one. Consequently the only change comes from extra fields found at the end of the new User <acronym class="acronym">PIB</acronym>. The new Factory <acronym class="acronym">PIB</acronym> becomes the new User <acronym class="acronym">PIB</acronym> with certain fields from the old User <acronym class="acronym">PIB</acronym> preserved, such as the <acronym class="acronym">MAC</acronym>, <acronym class="acronym">DAK</acronym> and so on.
  53. </p><div class="figure"><a name="idp21795360"></a><p class="title"><b>Figure 4.10. 
  54. Flash Parameters and Firmware (AR7420)
  55. </b></p><div class="figure-contents"><pre class="programlisting">
  56. AR7420 LOCAL-HOST
  57. [02] |&lt;- VS_MODULE_OPERATION.REQ (start session) ---| [01]
  58. [03] |-- VS_MODULE_OPERATION.CNF (start session) --&gt;| [04]
  59. | |
  60. [06] |&lt;-- VS_MODULE_OPERATION.REQ (write module) ---| [05]
  61. [07] |--- VS_MODULE_OPERATION.CNF (write module) --&gt;| [08]
  62. |&lt;---------------------------------------------|
  63. |---------------------------------------------&gt;|
  64. | |
  65. [10] |&lt;-- VS_MODULE_OPERATION.REQ (write module) ---| [09]
  66. [11] |--- VS_MODULE_OPERATION.CNF (write module) --&gt;| [12]
  67. |&lt;---------------------------------------------|
  68. |---------------------------------------------&gt;|
  69. | |
  70. [14] |&lt;- VS_MODULE_OPERATION.REQ (commit modules) --| [13]
  71. [15] |-- VS_MODULE_OPERATION.CNF (commit modules) -&gt;| [16]
  72. </pre></div></div><br class="figure-break"><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
  73. The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write session request to register the session identifier, module identifiers, module lengths and module checksums. In this case, the two modules are the runtime parameters and runtime firmware. The module identifiers are <code class="constant">0x7002</code> and <code class="constant">0x7003</code>, respectively. The application running on the local must must locate these modules and determine their size and checksum.
  74. </p></li><li class="listitem"><p>
  75. The device receives the request, validates the module identifier and preserves the module lengths and checksums until the module write session is closed. The local host has <code class="constant">30</code> minutes to complete registered module write operations and close the module write session.
  76. </p></li><li class="listitem"><p>
  77. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code>, if things went well.
  78. </p></li><li class="listitem"><p>
  79. The local host receives the confirmation and prepares to download the parameter module.
  80. </p></li><li class="listitem"><p>
  81. The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write request containing the offset, length and content of the first portion of the module being downloaded.
  82. </p></li><li class="listitem"><p>
  83. The device receives the request and write to a scratch region of flash memory awaiting write session close.
  84. </p></li><li class="listitem"><p>
  85. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well.
  86. </p></li><li class="listitem"><p>
  87. The local host receives the confirmation and continues downloading the parameter module in fragments using <code class="constant">VS_MODULE_OPERATION</code> write requests, advancing the offset and adjusting the length with each write.
  88. </p></li><li class="listitem"><p>
  89. The local host receives the confirmation and prepares to download the firmware module.
  90. </p></li><li class="listitem"><p>
  91. The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write request containing the offset, length and content of the first portion of the module being downloaded.
  92. </p></li><li class="listitem"><p>
  93. The device receives the request and write to a scratch region of flash memory awaiting write session close.
  94. </p></li><li class="listitem"><p>
  95. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well.
  96. </p></li><li class="listitem"><p>
  97. The local host receives the confirmation and continues downloading the firmware module in fragments using <code class="constant">VS_MODULE_OPERATION</code> write requests, advancing the offset and adjusting the length with each write.
  98. </p></li><li class="listitem"><p>
  99. The local host send a <code class="constant">VS_MODULE_OPERATION.REQ</code> close module write session request having <code class="varname">COMMIT_CODE</code> bits <code class="constant">0</code> and <code class="constant">1</code> set. to indicate <span class="quote">“<span class="quote">force commit</span>”</span> and <span class="quote">“<span class="quote">commit without reset</span>”</span>, respectively.
  100. </p></li><li class="listitem"><p>
  101. The device receives the request, verifies the module length and checksum then transfers the module from scratch memory to it's final location in flash memory.
  102. </p></li><li class="listitem"><p>
  103. The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> close module write session with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well. If things did not go well then the local host must request a new write module session and start over.
  104. </p></li></ol></div><p>
  105. At this point, the device is ready to boot from flash memory if the power fails or the device resets.
  106. </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s16.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
  107. Boot from Host (AR7420)
  108.  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. 
  109. Procedures
  110. </td></tr></table></div></body></html>