	<section id='firmware-7400-boot'>
		<title>
			Boot from Host (AR7400)
			</title>
		<para>
			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.
			</para>
		<para>
			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. 
			</para>
		<para>
			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.
			</para>
		<para>
			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.
			</para>
		<figure>
			<title>
				Boot from Host (AR7400)
				</title>
<programlisting><![CDATA[

          AR7400                             LOCAL-HOST
        [01] |                                    |
        [02] |-------- VS_HOST_ACTION.IND ------->| [03]
        [05] |<------- VS_HOST_ACTION.RSP --------| [04]
             |                                    | [06]
             |<---- VS_WRITE_AND_EXECUTE.REQ -----| [07]
        [08] |----- VS_WRITE_AND_EXECUTE.CNF ---->|      
             |<-----------------------------------| [09]
        [10] |----------------------------------->| [11]
        [12] |                                    | 
        [13] |-------- VS_HOST_ACTION.IND ------->| [14]
        [16] |<------- VS_HOST_ACTION.RSP --------| [15]
             |                                    | [16]
             |<-VS_WRITE_AND_EXECUTE_APPLET.REQ --| [17]
        [18] |--VS_WRITE_AND_EXECUTE_APPLET.CNF ->|     
             |<-----------------------------------| [19]
        [20] |----------------------------------->| 
             |<-VS_WRITE_AND_EXECUTE_APPLET.REQ --| [21]
        [22] |--VS_WRITE_AND_EXECUTE_APPLET.CNF ->|     
             |<-----------------------------------| [23]
        [24] |----------------------------------->| 
        [25] |                                    |

 ]]></programlisting>
			</figure>
		<orderedlist>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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. 
					</para>
				</listitem>
			<listitem>
				<para>
					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. 
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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>.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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>.
					</para>
				</listitem>
			<listitem>
				<para>
					The local host exists the boot from host sequence and returns to listening mode.
					</para>
				</listitem>
			<listitem>
				<para>
					The bootloader executes the configuration applet. The device hardware address is <constant>00:B0:52:00:00:01</constant> in this state.
					</para>
				</listitem>
			<listitem>
				<para>
					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. 
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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. 
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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>.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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>.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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>.
					</para>
				</listitem>
			<listitem>
				<para>
					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.
					</para>
				</listitem>
			<listitem>
				<para>
					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>.
					</para>
				</listitem>
			<listitem>
				<para>
					The bootloader executes the runtime firmware and the device begins operation. The device hardware address will become that programmed into the parameter inforamtion block.
					</para>
				</listitem>
			</orderedlist>
		</section>
