firmware-7400-boot.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <section id='firmware-7400-boot'>
  2. <title>
  3. Boot from Host (AR7400)
  4. </title>
  5. <para>
  6. The <productname>AR7400</productname> boot-from-host method downloads and executes a device configuration applet then downloads runtime parameters and firmware from a local host and starts firmware execution. This method is initiated by the <application>Bootloader</application> after reset on a device having no flash memory, blank flash memory or corrupted flash memory. The method requires <application>Bootloader</application> aware software running on the local host in order to complete.
  7. </para>
  8. <para>
  9. The <productname>AR7400</productname> boot-from-host method is similar to the <productname>INT6400</productname> boot-from-host method but it uses the <constant>VS_WRITE_AND_EXECUTE</constant> message instead of the <constant>VS_WR_MEM</constant> message write into SDRAM and start firmware execution. This eliminates the need for the <constant>VS_ST_MAC</constant> message. The <constant>VS_WR_MEM</constant> and <constant>VS_ST_MAC</constant> message types will no longer be recognized by bootloaders after the <productname>QCA7420</productname> chipset.
  10. </para>
  11. <para>
  12. The <productname>AR7400</productname> boot-from-host method works on <productname>AR6400</productname> and will continue to work on <productname>QCA7420</productname> and planned successors. Customers should implement this boot-from-host method now to avoid building obsolete products.
  13. </para>
  14. <para>
  15. The <productname>AR7400</productname> does not have a unique hardware address until the firmware starts and assigns one read from the PIB. Until that time, the <application>Bootloader</application> will only acknowledge messages addressed to 00:B0:52:00:00:01. In addition, the <application>Bootloader</application> does not know the hardware address of the local host and so it addresses all <constant>VS_HOST_ACTION</constant> messages to FF:FF:FF:FF:FF:FF; however, these messages are not transmitted over the powerline.
  16. </para>
  17. <figure>
  18. <title>
  19. Boot from Host (AR7400)
  20. </title>
  21. <programlisting><![CDATA[
  22. AR7400 LOCAL-HOST
  23. [01] | |
  24. [02] |-------- VS_HOST_ACTION.IND ------->| [03]
  25. [05] |<------- VS_HOST_ACTION.RSP --------| [04]
  26. | | [06]
  27. |<---- VS_WRITE_AND_EXECUTE.REQ -----| [07]
  28. [08] |----- VS_WRITE_AND_EXECUTE.CNF ---->|
  29. |<-----------------------------------| [09]
  30. [10] |----------------------------------->| [11]
  31. [12] | |
  32. [13] |-------- VS_HOST_ACTION.IND ------->| [14]
  33. [16] |<------- VS_HOST_ACTION.RSP --------| [15]
  34. | | [16]
  35. |<-VS_WRITE_AND_EXECUTE_APPLET.REQ --| [17]
  36. [18] |--VS_WRITE_AND_EXECUTE_APPLET.CNF ->|
  37. |<-----------------------------------| [19]
  38. [20] |----------------------------------->|
  39. |<-VS_WRITE_AND_EXECUTE_APPLET.REQ --| [21]
  40. [22] |--VS_WRITE_AND_EXECUTE_APPLET.CNF ->|
  41. |<-----------------------------------| [23]
  42. [24] |----------------------------------->|
  43. [25] | |
  44. ]]></programlisting>
  45. </figure>
  46. <orderedlist>
  47. <listitem>
  48. <para>
  49. The bootloader automatically starts after device reset and attempts to read the runtime firmware image from flash memory, write it into <acronym>SDRAM</acronym> and start execution. If it succeeds then normal operation begins and no further action is required. If it fails, for any reason, then the bootloader initiates the boot-from-host sequence.
  50. </para>
  51. </listitem>
  52. <listitem>
  53. <para>
  54. The bootloader broadcasts <constant>VS_HOST_ACTION.IND</constant> with <varname>HOST_ACTION_REQ</varname> set to <constant>0x04</constant> to indicate that it is waiting to be configured. The bootloader continues to broadcast this message message every <constant>750</constant> milliseconds which differs from that of other chips.
  55. </para>
  56. </listitem>
  57. <listitem>
  58. <para>
  59. The local host receives the <constant>VS_HOST_ACTION.IND</constant> and inspects <varname>HOST_ACTION_REQ</varname> field to determine the required action. The local host must be programmed to listen and act appropriately.
  60. </para>
  61. </listitem>
  62. <listitem>
  63. <para>
  64. The local host sends a <constant>VS_HOST_ACTION.RSP</constant> message with <varname>MSTATUS</varname> set to <constant>0</constant> to indicate the start of sequence.
  65. </para>
  66. </listitem>
  67. <listitem>
  68. <para>
  69. The bootloader receives the <constant>VS_HOST_ACTION.RSP</constant> message, stops broadcasting <constant>VS_HOST_ACTION.IND</constant> messages and waits indefinitely for the local host to act.
  70. </para>
  71. </listitem>
  72. <listitem>
  73. <para>
  74. The local host retrieves the firmware chain and extracts the configuration applet image from the chain. The firmware chain may be stored on disk or in memory depending on how the local host is programmed.
  75. </para>
  76. </listitem>
  77. <listitem>
  78. <para>
  79. The local host sends a <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message with <varname>FLAGS</varname> set to <constant>2</constant> and <varname>ALLOWED_MEM_TYPES</varname> to <constant>1</constant> to download the applet in absolute address mode. Alternately, setting <varname>FLAGS</varname> to <constant>0</constant> and <varname>CURR_PART_OFFSET</varname> to <constant>0</constant> will download the applet in relative address mode. The <varname>TOTAL_LENGTH</varname> will be the applet image header <varname>IMAGELENGTH</varname> but <varname>CURR_PART_LENGTH</varname> cannot exceed <constant>1400</constant> bytes.
  80. </para>
  81. </listitem>
  82. <listitem>
  83. <para>
  84. The bootloader acknowledges each <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message with a <constant>VS_WRITE_AND_EXECUTE.CNF</constant> message having <varname>MSTATUS</varname> set to <constant>0</constant>.
  85. </para>
  86. </listitem>
  87. <listitem>
  88. <para>
  89. The local host continues to increment <varname>CURR_PART_OFFSET</varname> and download the configuration applet in <constant>1400</constant> byte blocks until the last block is reached. The local host then sets <varname>START_ADDR</varname> to the applet image header <varname>ENTRYPOINT</varname>, the <varname>CHECKSUM</varname> to the applet image header <varname>IMAGECHECKSUM</varname> and the execute bit in <varname>FLAGS</varname> to <constant>1</constant> in the last message frame.
  90. </para>
  91. </listitem>
  92. <listitem>
  93. <para>
  94. The bootloader receives the last <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message, confirms the configuration applet checksum then acknowledges with a <constant>VS_WRITE_AND_EXECUTE.CNF</constant> message having <varname>MSTATUS</varname> set to <constant>0</constant>.
  95. </para>
  96. </listitem>
  97. <listitem>
  98. <para>
  99. The local host exists the boot from host sequence and returns to listening mode.
  100. </para>
  101. </listitem>
  102. <listitem>
  103. <para>
  104. The bootloader executes the configuration applet. The device hardware address is <constant>00:B0:52:00:00:01</constant> in this state.
  105. </para>
  106. </listitem>
  107. <listitem>
  108. <para>
  109. The bootloader broadcasts a <constant>VS_HOST_ACTION.IND</constant> message with <varname>HOST_ACTION_REQ</varname> set to <constant>0</constant> to indicate that it is waiting for runtime parameters and firmware.
  110. </para>
  111. </listitem>
  112. <listitem>
  113. <para>
  114. The local host receives a <constant>VS_HOST_ACTION.IND</constant> message and inspects the <varname>HOST_ACTION_REQ</varname> field to determine the required action. The local host must be programmed to listen and act appropriately.
  115. </para>
  116. </listitem>
  117. <listitem>
  118. <para>
  119. The bootloader receives the <constant>VS_HOST_ACTION.RSP</constant> message, stops broadcasting <constant>VS_HOST_ACTION.IND</constant> messages and waits indefinitely for the local host to act.
  120. </para>
  121. </listitem>
  122. <listitem>
  123. <para>
  124. The local host locates the parameter chain and firmware chain. The chains may be stored on disk or in memory depending on how the local host is programmed.
  125. </para>
  126. </listitem>
  127. <listitem>
  128. <para>
  129. The local host sends a <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message with <varname>FLAGS</varname> set to <constant>2</constant> and <varname>ALLOWED_MEM_TYPES</varname> set to <constant>1</constant> to download parameters in absolute address mode. Alternately, setting <varname>FLAGS</varname> to <constant>0</constant> and <varname>CURR_PART_OFFSET</varname> to <constant>0</constant> will download parameters in relative address mode. The <varname>TOTAL_LENGTH</varname> will be the entire parameter file length but the <varname>CURR_PART_LENGTH</varname> cannot exceed <constant>1400</constant> bytes.
  130. </para>
  131. </listitem>
  132. <listitem>
  133. <para>
  134. The bootloader acknowledges each <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message with a <constant>VS_WRITE_AND_EXECUTE.CNF</constant> message having <varname>MSTATUS</varname> set to <constant>0</constant>.
  135. </para>
  136. </listitem>
  137. <listitem>
  138. <para>
  139. The local host continues to <varname>CURR_PART_OFFSET</varname> and download the parameter chain in <constant>1400</constant> byte blocks until the last block is reached. The local host then sets the <varname>START_ADDR</varname> field to the parameter image header <varname>ENTRYPOINT</varname>, the <varname>CHECKSUM</varname> to the parameter image header <varname>IMAGECHECKSUM</varname> and the execute bit in <varname>FLAGS</varname> to <constant>1</constant> in the last message frame.
  140. </para>
  141. </listitem>
  142. <listitem>
  143. <para>
  144. The bootloader receives the last <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message, confirms the parameter chain checksum and acknowledges with a <constant>VS_WRITE_AND_EXECUTE.CNF</constant> message having <varname>MSTATUS</varname> set to <constant>0</constant>.
  145. </para>
  146. </listitem>
  147. <listitem>
  148. <para>
  149. The local host sends a <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message with <varname>FLAGS</varname> set to <constant>2</constant> and <varname>ALLOWED_MEM_TYPES</varname> to <constant>1</constant> to download firmware in absolute address mode. Alternately, setting <varname>FLAGS</varname> to <constant>0</constant> and <varname>CURR_PART_OFFSET</varname> to <constant>0</constant> will download firmware in relative address mode. The <varname>TOTAL_LENGTH</varname> will be the firmware image header <varname>IMAGELENGTH</varname> but the <varname>CURR_PART_LENGTH</varname> cannot exceed <constant>1400</constant> bytes.
  150. </para>
  151. </listitem>
  152. <listitem>
  153. <para>
  154. The bootloader acknowledges each <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message with a <constant>VS_WRITE_AND_EXECUTE.CNF</constant> message having the <varname>MSTATUS</varname> field set to <constant>0</constant>.
  155. </para>
  156. </listitem>
  157. <listitem>
  158. <para>
  159. The local host continues to increment <varname>CURR_PART_OFFSET</varname> and download the parameter chain in <constant>1400</constant> byte blocks until the last block is reached. The local host then sets <varname>START_ADDR</varname> to the parameter image header <varname>ENTRYPOINT</varname>, the <varname>CHECKSUM</varname> to the parameter image header <varname>IMAGECHECKSUM</varname> and the execute bit in <varname>FLAGS</varname> to <constant>1</constant> in the last message frame.
  160. </para>
  161. </listitem>
  162. <listitem>
  163. <para>
  164. The bootloader receives the last <constant>VS_WRITE_AND_EXECUTE.REQ</constant> message, confirms the firmware chain checksum and acknowledges with a <constant>VS_WRITE_AND_EXECUTE.CNF</constant> message having the <varname>MSTATUS</varname> field set to <constant>0</constant>.
  165. </para>
  166. </listitem>
  167. <listitem>
  168. <para>
  169. The bootloader executes the runtime firmware and the device begins operation. The device hardware address will become that programmed into the parameter inforamtion block.
  170. </para>
  171. </listitem>
  172. </orderedlist>
  173. </section>