firmware.xml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. <chapter id='firmware'>
  2. <title>
  3. Firmware
  4. </title>
  5. <section id='firmware-intro'>
  6. <title>
  7. Introduction
  8. </title>
  9. <para>
  10. An Atheros chipset consists of an integral <acronym>CPU</acronym>, <acronym>ROM</acronym> and proprietary circuitry. The <acronym>CPU</acronym> requires a minimum amount of external <acronym>SDRAM</acronym> to execute runtime software and store runtime configuration parameters. The <productname>INT6000</productname> chipset also requires a minimum amount of external flash memory in order to start. The <productname>INT6300</productname> can use external flash memory in the same way as the <productname>INT6000</productname> or it can use a local host processor as surrogate flash memory.
  11. </para>
  12. <para>
  13. On startup, the SDRAM memory controller must be configured before runtime firmware and parameters are loaded. On the <productname>INT6000</productname>, runtime firmware and configuration parameters must be loaded from external flash memory. On the <productname>INT6300</productname>, it may be loaded from external flash memory or from a external host processor. Runtime firmware determines device capability. Runtime configuration parameters determine device network identity and personality.
  14. </para>
  15. <para>
  16. The following sections identify and describe firmware related components and discuss some of the routine actions required to manage them. Consult the Atheros <citetitle>HomePlug AV Hardware Technical Reference Manual</citetitle> and <citetitle>HomePlug AV Firmware Technical Reference Manual</citetitle> for more information.
  17. </para>
  18. </section>
  19. <section id="firmware-components">
  20. <title>Firmware Components</title>
  21. <para>
  22. Device initialization involves the following components. They are described here and then referenced throughout the toolkit documentation. You may want to read and re-read this page.
  23. </para>
  24. <section id="firmware-bootloader">
  25. <title>
  26. Bootloader
  27. </title>
  28. <para>
  29. The <application>Bootloader</application> is permanent software burned into the chipset. The <productname>INT6000</productname> and <productname>INT6300</productname> both have a <application>Bootloader</application> program but they behave differently because the <productname>INT6000</productname> needs flash memory and the <productname>INT6300</productname> does not. Neither the <productname>INT6000</productname> <application>Bootloader</application> nor the <productname>INT6300</productname> <application>Bootloader</application> can write to flash memory.
  30. </para>
  31. <para>
  32. On startup, the <productname>INT6000</productname> <application>Bootloader</application> attempts to load runtime firmware from flash memory into <acronym>SDRAM</acronym>. If flash memory is not available, or the runtime firmware stored there cannot be loaded, then the <productname>INT6000</productname> <application>Bootloader</application> cannot continue so the device cannot function.
  33. </para>
  34. <para>
  35. On startup, the <productname>INT6300</productname> <application>Bootloader</application> attempts to load runtime firmware from flash memory into <acronym>SDRAM</acronym>. If flash memory is not available, or the runtime firmware stored there cannot be loaded, then <application>Bootloader</application> will request runtime firmware from the local host processor.
  36. </para>
  37. </section>
  38. <section id="firmware-softloader">
  39. <title>
  40. Softloader
  41. </title>
  42. <para>
  43. An optional program stored in flash memory in place of runtime firmware. This program is used on the <productname>INT6000</productname> to support the Boot From Host operation, if needed. It is not used on the <productname>INT6300</productname> because the <productname>INT6300</productname> <application>Bootloader</application> now performs similar functions. The Softloader cannot write to flash memory.
  44. </para>
  45. <para>
  46. On startup, the <productname>INT6000</productname> <application>Bootloader</application> loads the <application>Softloader</application> from flash memory into <acronym>SDRAM</acronym>, as it would do with runtime firmware. The <application>Softloader</application> then requests the actual runtime firmware from local host.
  47. </para>
  48. </section>
  49. <section id="firmware-memory-configuration">
  50. <title>
  51. Memory Configuration Parameters
  52. </title>
  53. <para>
  54. A small block of information that describes the type, size and characteristics of the <acronym>SDRAM</acronym> available for the benefit of the <acronym>Bootloader</acronym>. On the INT6000, <acronym>SDRAM</acronym> configuration must be stored in flash memory. On the INT6300, it may be stored in flash memory or on the local host. The <productname>INT6300</productname> <application>Bootloader</application> attempts to read configuration information from flash memory when it is present; otherwise, it requests that information from the local host using a VS_HST_ACTION message and so the host must store this information until it is requested.
  55. </para>
  56. <para>
  57. There are two <acronym>SDRAM</acronym> configuration file formats. The first format is used by the <application>Windows Device Manager</application> and the <ulink url='int6k2.7.html'>
  58. <application>int6k2</application>
  59. </ulink> program and typically has a <filename>.config</filename> file extension. The second format is used by the <ulink url='int6k.7.html'>
  60. <application>int6k</application>
  61. </ulink> program and <ulink url='int6kf.7.html'>
  62. <application>int6kf</application>
  63. </ulink> program and typically has a <filename>.cfg</filename> file extension. The latter format is more robust and should eventually replace the format.
  64. </para>
  65. <para>
  66. The Windows Device Manager form consists of 64 hexadecimal ASCII characters. Files are at least 64 bytes but only the first 64 bytes are used. Files can be modified using a text editor. ASCII hex to binary conversion and checksum computation is needed on input. The <ulink url="config2cfg.7.html">
  67. <application>config2cfg</application>
  68. </ulink> program can be used to convert this format to Open Powerline Toolkit format.
  69. </para>
  70. <para>
  71. The Open Powerline Toolkit format consists of 32 binary bytes plus a 4 byte checksum. The file size is exactly 36 bytes. No conversion or checksum computation is needed on input. The <ulink url="chkcfg.7.html">
  72. <application>chkcfg</application>
  73. </ulink> program can be used the validate this file format because it contains a checksum.
  74. </para>
  75. <para>
  76. The <productname>INT6400</productname> chipset does not need a memory configuration parameter file because it has a different memory controller than earlier chipsets. <acronym>SDRAM</acronym> is now configured dynamically by an applets stored in the <filename>.nvm</filename> file.
  77. </para>
  78. </section>
  79. <section id="firmware-runtime">
  80. <title>
  81. Runtime Firmware (MAC Software)
  82. </title>
  83. <para>
  84. The executable image that determines <productname>INT6000</productname> or <productname>INT6300</productname> capability and functionality. Runtime firmware refers to any executable image except the <link linkend="firmware-bootloader">Bootloader</link> which is considered to be boot firmware. Firmware files have a .nvm extension and can contain multiple firmware images. One of these images could be the parameter information block but Atheros currently distributes that as a separate file. The <ulink url='chknvm.7.html'>chknvm</ulink> program can be used to detect obsolete or corrupt .nvm files. Runtime firmware can write to flash memory and must be running in order to re-program the chipset.
  85. </para>
  86. </section>
  87. <section id="firmware-configuration">
  88. <title>
  89. Parameter Information Block (PIB)
  90. </title>
  91. <para>
  92. The configuration image that determines device network identity, functional capability and operational mode. The PIB structure often changes from one major firmware release to the next and often is not portable across major releases. Parameter information files have a <filename>.pib</filename> extension by convention and contain one parameter set. The <ulink url='chkpib.7.html'>chkpib</ulink> program can be used to detect obsolete or corrupt PIB files.
  93. </para>
  94. <para>
  95. Recent firmware releases support two <acronym>PIB</acronym> images in flash memory: the Factory <acronym>PIB</acronym> and the User <acronym>PIB</acronym>. The Factory <acronym>PIB</acronym> is the first <acronym>PIB</acronym> image written to flash memory. Once written, the Factory <acronym>PIB</acronym> cannot be changed without special software. The User <acronym>PIB</acronym> is created and over-written whenever the device needs to save new <acronym>PIB</acronym> parameters. Factory default values are restored by erasing the User <acronym>PIB</acronym> and rebooting the device. When a device reboots, it attempts to load the User <acronym>PIB</acronym> from flash memory. Failing that, it attempts to load the Factory <acronym>PIB</acronym> from flash memory. Failing that, it loads a Default <acronym>PIB</acronym> having minimum functionality. The loaded <acronym>PIB</acronym> becomes the Working <acronym>PIB</acronym> and determines runtime device identity and behavior.
  96. </para>
  97. </section>
  98. </section>
  99. <section id='firmware-architecture'>
  100. <title>
  101. Architecture Overview
  102. </title>
  103. <para>
  104. The following figure illustrates a hypothetical powerline network consisting of two devices. Each device has an <productname>INT6300</productname> with optional dedicated flash memory and an onboard processor with associated storage. The processor in each device is the local host for that device and the remote host for the other device. The processor storage is unspecified but it must be persistent. The two devices are connected via coax or powerline. The flash memory is optional in this design because it uses the <productname>INT6300</productname> chipset.
  105. </para>
  106. <figure>
  107. <title>
  108. Simple Network
  109. </title>
  110. <mediaobject>
  111. <imageobject>
  112. <imagedata fileref='SimpleNetwork.png' format='PNG' align='center' />
  113. </imageobject>
  114. </mediaobject>
  115. </figure>
  116. <para>
  117. The Boot Loader is permanent program that executes on startup. It detects the presence of flash memory and attempts to read <acronym>SDRAM</acronym> configuration from flash memory then load and runtime the firmware image and <acronym>PIB</acronym> from flash memory. On success, the Boot runtime firmware starts and the device assumes HomePlug AV compliant behavior. On failure, the Boot Loader requests <acronym>SDRAM</acronym> configuration, runtime firmware image and <acronym>PIB</acronym> from the local host. The local host must be prepared to respond to these requests.
  118. </para>
  119. <para>
  120. On a system having no flash memory, the Boot Loader will request SDRAM configuration information from the local host. Once that is received, the Boot Loader will request a firmware image and <acronym>PIB</acronym> from the local host. The local host determines which firmware image and <acronym>PIB</acronym> to download, manages the download sequence and starts firmware execution.
  121. </para>
  122. <para>
  123. Atheros software, such as the Windows Device Manager, Linux Flash Utility and Embedded API all support the <emphasis>Boot from Host</emphasis> configuration.
  124. </para>
  125. <para>
  126. Once the firmware is running on the <productname>INT6300</productname> , a remote host can forward runtime firmware and <acronym>PIB</acronym> to the local host via the <productname>INT6300</productname> firmware. The remote host might reside on another<productname>INT6300</productname> device, as shown in the previous figure, or be located anywhere on the <productname class='registered'>HomePlug</productname> AV network. In either case, the operations described are the same.
  127. </para>
  128. </section>
  129. <section id='firmware-bootload'>
  130. <title>
  131. Firmware Boot Process
  132. </title>
  133. <para>
  134. The <productname>INT6300</productname> can boot HomePlug AV firmware from either dedicated flash memory or a local host processor. This means that dedicated flash memory in not necessary when an onboard processor having persistent storage is available. The absence of dedicated flash memory and availability of an onboard host processor is called a <emphasis>Boot from Host</emphasis> configuration.
  135. </para>
  136. <para>
  137. The Boot from Host configuration is of interest to customers who are committed to using a host processor in their <productname>INT6300</productname> based product and want to use it to eliminate the additional cost of dedicated flash memory to store HomePlug AV firmware for <productname>INT6300</productname> devices.
  138. </para>
  139. <para>
  140. The Boot from Host configuration supports three operations: <link linkend="firmware-6000-flash">Upgrade Device</link>, <link linkend="firmware-6000-upload">Update Local Host</link> and <link linkend="firmware-6000-boot">Boot from Host</link>. Product designers must write host software to support all three operations as described later in this document. Atheros provides an Embedded Application Program Interface to assist product designers with this effort. Obtain a copy of the <citetitle>HomePlug AV Application Programming Interface User's Guide</citetitle> from Atheros Communications, Ocala FL USA for more information.
  141. </para>
  142. <para>
  143. Readers should not confuse a Boot from Host configuration with the <link linkend="firmware-6000-boot">Boot from Host</link> operation. The former is a hardware configuration having an <productname>INT6300</productname> with no dedicated flash memory available. The latter is the process of downloading configuration information, firmware and <acronym>PIB</acronym> from the local host to the device and starting firmware execution on startup.
  144. </para>
  145. <para>
  146. This discussion assumes that the reader is familiar with the following:
  147. </para>
  148. <orderedlist spacing="compact">
  149. <listitem>
  150. <para>
  151. The distinction between a local and remote host
  152. </para>
  153. </listitem>
  154. <listitem>
  155. <para>
  156. The relationship between the powerline device H1, M1 and PHY interfaces.
  157. </para>
  158. </listitem>
  159. <listitem>
  160. <para>
  161. The structure of the following Atheros Management Message types: <constant>VS_HST_ACTION</constant>, <constant>VS_SET_SDRAM</constant>, <constant>VS_WR_MEM</constant>, <constant>VS_WR_MOD</constant>, <constant>VS_RS_DEV</constant>, <constant>VS_ST_MAC</constant> and <constant>VS_WRITE_AND_EXECUTE</constant>. Be aware that message types <constant>VS_SET_SDRAM</constant>, <constant>VS_WR_MEM</constant>, <constant>VS_WR_MOD</constant> and <constant>VS_ST_MAC</constant> are deprecated and will no longer be supported by the newest firmware.
  162. </para>
  163. </listitem>
  164. <listitem>
  165. <para>
  166. Hardware architecture covered in the <citetitle>QCA Powerline Hardware Technical Reference Manual</citetitle> and the management message formats covered in the <citetitle>QCA Powerline Firmware Technical Reference Manual</citetitle>.
  167. </para>
  168. </listitem>
  169. </orderedlist>
  170. </section>
  171. <section id='firmware-boot-from-host'>
  172. <title>
  173. Boot from Host Configuration
  174. </title>
  175. <para>
  176. The Boot from Host configuration requires a permanent connection between the powerline device and a local host having some type of persistent storage. In most cases, the powerline device and local host are co-located, possibly on the same board or same chip, and act together as an integral unit. Essentially, the local host provides persistent memory for the device.
  177. </para>
  178. <para>
  179. The Boot from Host configuration lets the local host decide which runtime parameters and firmware to download on startup. This offers a considerable degree of product adaptability, allowing different parameter and firmware combinations to be downloaded based on external factors.
  180. </para>
  181. <para>
  182. In a Boot from Host configuration, the processor must act as local host while the device is booting but it can also act as remote host when upgrading other devices. The former is a design requirement and latter is a design option.
  183. </para>
  184. </section>
  185. <section id="bootload-rules">
  186. <title>
  187. Things to Remember
  188. </title>
  189. <para>
  190. The Boot from Host configuration offers design flexibility but also increases the possibilities. Remember that the processes described here are based on simple rules that ultimately dictate why each process step is needed. Readers may find it helpful to review these rules.
  191. </para>
  192. <orderedlist>
  193. <listitem>
  194. <para>
  195. <emphasis>
  196. The softloader and bootloader programs have limited vocabulary.
  197. </emphasis>
  198. </para>
  199. <para>
  200. The <productname>INT6000</productname> softloader recognizes only the <constant>VS_SW_VER</constant>, <constant>VS_ST_MAC</constant>, <constant>VS_RS_DEV</constant>, <constant>VS_WR_MOD</constant> requests. It does not recognize <constant>VS_WR_MEM</constant>.
  201. </para>
  202. <para>
  203. The <productname>INT6300</productname> bootloader recognizes only the <constant>VS_SW_VER</constant>, <constant>VS_WR_MEM</constant>, <constant>VS_ST_MAC</constant>, <constant>VS_RS_DEV</constant> and <constant>VS_SET_SDRAM</constant> requests. It does not recognize <constant>VS_WR_MOD</constant>.
  204. </para>
  205. <para>
  206. The <productname>INT6400</productname> bootloader recognizes only the <constant>VS_SW_VER</constant>, <constant>VS_WR_MEM</constant>, <constant>VS_ST_MAC</constant>, <constant>VS_RS_DEV</constant> requests. It recognizes <constant>VS_SET_SDRAM</constant> and responds to it but ignores it. It does not recognize <constant>VS_WR_MOD</constant>.
  207. </para>
  208. <para>
  209. The <productname>AR7400</productname> bootloader recognizes only <constant>VS_SW_VER</constant>, <constant>VS_WR_MEM</constant>, <constant>VS_ST_MAC</constant>, <constant>VS_RS_DEV</constant> requests. It recognizes <constant>VS_SET_SDRAM</constant> and responds to it but ignores it. It does not recognize <constant>VS_WR_MOD</constant>.
  210. </para>
  211. <para>
  212. The <productname>AR7420</productname> bootloader recognizes only <constant>VS_SW_VER</constant>, <constant>VS_RS_DEV</constant>, <constant>VS_WRITE_AND_EXECUTE</constant> and <constant>VS_RAND_MAC_ADDRESS</constant> requests. Early versions recognize <constant>VS_WRITE_MEM</constant> and <constant>VS_ST_MAC</constant> requests but they must not be used.
  213. </para>
  214. <table>
  215. <title>
  216. Softloader/Bootloader MMEs
  217. </title>
  218. <tgroup cols="4">
  219. <colspec colname='bootload-code' />
  220. <colspec colname='bootload-name' />
  221. <colspec colname='bootload-softloader' />
  222. <colspec colname='bootload-bootloader1' />
  223. <colspec colname='bootload-bootloader2' />
  224. <colspec colname='bootload-firmware' />
  225. <thead>
  226. <row>
  227. <entry>
  228. MME
  229. </entry>
  230. <entry>
  231. NAME
  232. </entry>
  233. <entry>
  234. INT6000 Softloader
  235. </entry>
  236. <entry>
  237. INT6300 Bootloader
  238. </entry>
  239. <entry>
  240. INT6400 Bootloader
  241. </entry>
  242. <entry>
  243. AR7400 Bootloader
  244. </entry>
  245. <entry>
  246. AR7420 Bootloader
  247. </entry>
  248. </row>
  249. </thead>
  250. <tbody>
  251. <row>
  252. <entry>
  253. 0xA000
  254. </entry>
  255. <entry>
  256. VS_SW_VER
  257. </entry>
  258. <entry>
  259. Yes
  260. </entry>
  261. <entry>
  262. Yes
  263. </entry>
  264. <entry>
  265. Yes
  266. </entry>
  267. <entry>
  268. Yes
  269. </entry>
  270. <entry>
  271. Yes
  272. </entry>
  273. </row>
  274. <row>
  275. <entry>
  276. 0xA008
  277. </entry>
  278. <entry>
  279. VS_WR_MEM
  280. </entry>
  281. <entry>
  282. No
  283. </entry>
  284. <entry>
  285. Yes
  286. </entry>
  287. <entry>
  288. Yes
  289. </entry>
  290. <entry>
  291. Yes
  292. </entry>
  293. <entry>
  294. Deprecated
  295. </entry>
  296. </row>
  297. <row>
  298. <entry>
  299. 0xA00C
  300. </entry>
  301. <entry>
  302. VS_ST_MAC
  303. </entry>
  304. <entry>
  305. Yes
  306. </entry>
  307. <entry>
  308. Yes
  309. </entry>
  310. <entry>
  311. Yes
  312. </entry>
  313. <entry>
  314. Yes
  315. </entry>
  316. <entry>
  317. Deprecated
  318. </entry>
  319. </row>
  320. <row>
  321. <entry>
  322. 0xA01C
  323. </entry>
  324. <entry>
  325. VS_RS_DEV
  326. </entry>
  327. <entry>
  328. Yes
  329. </entry>
  330. <entry>
  331. Yes
  332. </entry>
  333. <entry>
  334. Yes
  335. </entry>
  336. <entry>
  337. Yes
  338. </entry>
  339. <entry>
  340. Yes
  341. </entry>
  342. </row>
  343. <row>
  344. <entry>
  345. 0xA020
  346. </entry>
  347. <entry>
  348. VS_WR_MOD
  349. </entry>
  350. <entry>
  351. Yes
  352. </entry>
  353. <entry>
  354. No
  355. </entry>
  356. <entry>
  357. No
  358. </entry>
  359. <entry>
  360. No
  361. </entry>
  362. <entry>
  363. No
  364. </entry>
  365. </row>
  366. <row>
  367. <entry>
  368. 0xA05C
  369. </entry>
  370. <entry>
  371. VS_SDRAM
  372. </entry>
  373. <entry>
  374. No
  375. </entry>
  376. <entry>
  377. Yes
  378. </entry>
  379. <entry>
  380. Ignored
  381. </entry>
  382. <entry>
  383. Ignored
  384. </entry>
  385. <entry>
  386. No
  387. </entry>
  388. </row>
  389. <row>
  390. <entry>
  391. 0xA060
  392. </entry>
  393. <entry>
  394. VS_HOST_ACTION
  395. </entry>
  396. <entry>
  397. No
  398. </entry>
  399. <entry>
  400. Yes
  401. </entry>
  402. <entry>
  403. Yes
  404. </entry>
  405. <entry>
  406. Yes
  407. </entry>
  408. <entry>
  409. Yes
  410. </entry>
  411. </row>
  412. <row>
  413. <entry>
  414. 0xA098
  415. </entry>
  416. <entry>
  417. VS_WRITE_AND_EXECUTE
  418. </entry>
  419. <entry>
  420. No
  421. </entry>
  422. <entry>
  423. No
  424. </entry>
  425. <entry>
  426. No
  427. </entry>
  428. <entry>
  429. Yes
  430. </entry>
  431. <entry>
  432. Yes
  433. </entry>
  434. </row>
  435. <row>
  436. <entry>
  437. 0xA0D4
  438. </entry>
  439. <entry>
  440. VS_RAND_MAC_ADDRESS
  441. </entry>
  442. <entry>
  443. No
  444. </entry>
  445. <entry>
  446. No
  447. </entry>
  448. <entry>
  449. No
  450. </entry>
  451. <entry>
  452. Yes
  453. </entry>
  454. <entry>
  455. Yes
  456. </entry>
  457. </row>
  458. </tbody>
  459. </tgroup>
  460. </table>
  461. </listitem>
  462. <listitem>
  463. <para>
  464. <emphasis>The Softloader, Bootloader and runtime firmware may treat the same MME differently</emphasis> because each is a different program. A notorious obvious example is the <constant>VS_SW_VER</constant> message type. This means that one may need to be aware of the device state when anticipating device behaviour or interpreting device response.
  465. </para>
  466. </listitem>
  467. <listitem>
  468. <para>
  469. <emphasis>The local host is surrogate flash memory</emphasis>. When dedicated flash memory is not available to a device, the device will request firmware and parameter storage services from the local host using <constant>VS_HST_ACTION</constant> messages. The local host must be programmed to detect and respond to these messages or the firmware will appear to hang. See program <link linkend='program-int6khost'>int6khost</link>, <link linkend='program-int64host'>int64host</link>, <link linkend='program-amphost'>amphost</link> or <link linkend='program-plchost'>plchost</link> to demonstrate and experiment with this interaction.
  470. </para>
  471. </listitem>
  472. <listitem>
  473. <para>
  474. <emphasis>Only runtime firmware can write flash memory</emphasis>. Runtime firmware must be executing in order to write flash memory or upload to the local host. The Softloader and Bootloader cannot perform either operation.
  475. </para>
  476. </listitem>
  477. <listitem>
  478. <para>
  479. <emphasis>All <acronym>PIB</acronym> changes must be written in flash memory</emphasis>. There are several things that can cause <acronym>PIB</acronym> changes. When a <acronym>PIB</acronym> change is needed, the Working <acronym>PIB</acronym> is copied to a scratch area and modified there. The Scratch <acronym>PIB</acronym> must then be written to flash memory or sent to the local host for storage. The device then resets causing the stored <acronym>PIB</acronym> to replace the Working <acronym>PIB</acronym>. If a freshly downloaded <acronym>PIB</acronym> changes for any reason then the cycle will repeat, automatically.
  480. </para>
  481. </listitem>
  482. <listitem>
  483. <para>
  484. <emphasis>Runtime firmware updates the PIB after joining and before leaving an AVLN</emphasis>. This will cause a device reset in each case. If the device is using the local host for persistent storage, runtime firmware will send the associated <constant>VS_HST_ACTION</constant> messages to the host and the host will send the associated <constant>VS_RD_MOD</constant> and <constant>VS_RS_DEV</constant> messages as per <link linkend="firmware-6000-upload">Update Local Host</link>.
  485. </para>
  486. </listitem>
  487. </orderedlist>
  488. </section>
  489. <section id="firmware-caveats-1">
  490. <title>
  491. Every Little Bit Hurts
  492. </title>
  493. <para>
  494. With the addition of <application>Push Button Encryption</application>, and other planned features, runtime firmware can now modify the PIB. Consequently, host applications must not assume that the <acronym>PIB</acronym> has not changed since it was last downloaded. Atheros strongly recommends that applications always perform a <emphasis>read-modify-write</emphasis> when making <acronym>PIB</acronym> modifications. Failure to do so can result in infinite reset loops caused when a device modifies the <acronym>PIB</acronym> that has just been downloaded.
  495. </para>
  496. <para>
  497. As one example, recent <acronym>PIB</acronym>s contain a network membership bit to indicate that the device has successfully joined the network associated with the current <acronym>NMK</acronym>. If the firmware detects the network and discovers that the membership bit is clear then it will join the network and set the bit. The firmware will then attempt to preserve the change by sending a <constant>VS_HOST_ACTION</constant> message to the local host. If the host application does not upload and store the changed <acronym>PIB</acronym> (as the device requested) before resetting the device then the original <acronym>PIB</acronym> will be downloaded again, after reset, and the process will repeat. Of course, a similar situation will occur when the device leaves the network and again when it joins another network.
  498. </para>
  499. </section>
  500. <section id="firmware-caveats-2">
  501. <title>
  502. Liar! Liar! Pants on Fire!
  503. </title>
  504. <para>
  505. It is important to use the right Boot from Host sequence for each type of Atheros device. This means that you should query the device using a <varname>VS_SW_VER</varname> message beforehand to determine or confirm the device type. Although this should be a simple operation, there have been several changes that complicate matters.
  506. </para>
  507. <orderedlist>
  508. <listitem>
  509. <para>
  510. The <productname>INT6300</productname> <application>Bootloader</application> incorrectly identifies the chipset as an <productname>INT6000</productname> chipset in the <varname>MDEVICEID</varname> field of the <varname>VS_SW_VER</varname> message.
  511. </para>
  512. </listitem>
  513. <listitem>
  514. <para>
  515. The <productname>AR7400</productname> <application>Bootloader</application> incorrectly identifies the chipset as an <productname>INT6400</productname> chipset in the <varname>MDEVICEID</varname> field of the <varname>VS_SW_VER</varname> message.
  516. </para>
  517. </listitem>
  518. <listitem>
  519. <para>
  520. The <application>Bootloader</application>, for <productname>INT6400</productname> chipsets and later, returns two additional field, <varname>IDENT</varname> and <varname>STEP_NUMBER</varname> in the <varname>VS_SW_VER</varname> confirmation message. These fields, the hardware identifier and step number, are correct but are not returned in earlier chipsets.
  521. </para>
  522. </listitem>
  523. </orderedlist>
  524. <para>
  525. The table below illustrates what is reported by various firmware, in the <varname>DEVICEID</varname> field of the <varname>VS_SW_VER</varname> message, on each type of hardware platform.
  526. </para>
  527. <table>
  528. <title>
  529. Legacy Device Identification
  530. </title>
  531. <tgroup cols="5">
  532. <colspec colname='bootload-device' />
  533. <colspec colname='bootload-platform' />
  534. <colspec colname='bootload-softloader' />
  535. <colspec colname='bootload-bootloader' />
  536. <colspec colname='bootload-firmware' />
  537. <thead>
  538. <row>
  539. <entry>
  540. Chipset
  541. </entry>
  542. <entry>
  543. DEVICEID/IDENT (Bootloader)
  544. </entry>
  545. <entry>
  546. MVERSION (Bootloader)
  547. </entry>
  548. <entry>
  549. DEVICEID/IDENT (Firmware)
  550. </entry>
  551. <entry>
  552. MVERSION (Firmware)
  553. </entry>
  554. </row>
  555. </thead>
  556. <tbody>
  557. <row>
  558. <entry>
  559. INT6000
  560. </entry>
  561. <entry>
  562. 0x01 / 0x00000042
  563. </entry>
  564. <entry>
  565. BootLoader
  566. </entry>
  567. <entry>
  568. 0x01 / na
  569. </entry>
  570. <entry>
  571. INT6000-MAC-0-0-3213-1206-20071224-FINAL
  572. </entry>
  573. </row>
  574. <row>
  575. <entry>
  576. INT6300
  577. </entry>
  578. <entry>
  579. 0x02 / 0x00006300
  580. </entry>
  581. <entry>
  582. BootLoader
  583. </entry>
  584. <entry>
  585. 0x02 / na
  586. </entry>
  587. <entry>
  588. INT6300-MAC-0-0-4203-00-4089-20091105-FINAL
  589. </entry>
  590. </row>
  591. <row>
  592. <entry>
  593. INT6400
  594. </entry>
  595. <entry>
  596. 0x03 / 0x00006400
  597. </entry>
  598. <entry>
  599. BootLoader
  600. </entry>
  601. <entry>
  602. 0x03 / na
  603. </entry>
  604. <entry>
  605. INT6400-MAC-4-3-4304-01-4397-20100924-FINAL
  606. </entry>
  607. </row>
  608. <row>
  609. <entry>
  610. INT7400
  611. </entry>
  612. <entry>
  613. 0x03 / 0x00007400
  614. </entry>
  615. <entry>
  616. BootLoader
  617. </entry>
  618. <entry>
  619. 0x04 / na
  620. </entry>
  621. <entry>
  622. INT7400-MAC-5-2-5213-01-1027-20110428-FINAL
  623. </entry>
  624. </row>
  625. <row>
  626. <entry>
  627. INT7450
  628. </entry>
  629. <entry>
  630. 0x03 / 0x0F001D1A
  631. </entry>
  632. <entry>
  633. BootLoader
  634. </entry>
  635. <entry>
  636. 0x20 / 0x00001D1A
  637. </entry>
  638. <entry>
  639. QCA7450-MAC-5-2-5213-01-1027-20110428-FINAL
  640. </entry>
  641. </row>
  642. <row>
  643. <entry>
  644. INT7451
  645. </entry>
  646. <entry>
  647. 0x03 / 0x00007400
  648. </entry>
  649. <entry>
  650. BootLoader
  651. </entry>
  652. <entry>
  653. 0x20 / 0x0E001D1A
  654. </entry>
  655. <entry>
  656. QCA7451-MAC-5-2-5213-01-1027-20110428-FINAL
  657. </entry>
  658. </row>
  659. <row>
  660. <entry>
  661. AR6405
  662. </entry>
  663. <entry>
  664. 0x03 / 0x00006400
  665. </entry>
  666. <entry>
  667. BootLoader
  668. </entry>
  669. <entry>
  670. 0x05 / na
  671. </entry>
  672. <entry>
  673. INT6405-MAC-4-3-4304-01-4397-20100924-FINAL
  674. </entry>
  675. </row>
  676. <row>
  677. <entry>
  678. AR7420
  679. </entry>
  680. <entry>
  681. 0x05 / 0x001CFCFC
  682. </entry>
  683. <entry>
  684. BootLoader
  685. </entry>
  686. <entry>
  687. 0x20 / 0x001CFCFC
  688. </entry>
  689. <entry>
  690. MAC-QCA7420-2.5.14.2259-23-20110621-FINAL
  691. </entry>
  692. </row>
  693. <row>
  694. <entry>
  695. QCA6410
  696. </entry>
  697. <entry>
  698. 0x05 / 0x001B58EC
  699. </entry>
  700. <entry>
  701. BootLoader
  702. </entry>
  703. <entry>
  704. 0x21 / 0x001B58EC
  705. </entry>
  706. <entry>
  707. MAC-QCA6410-2.5.14.2259-23-20110621-FINAL
  708. </entry>
  709. </row>
  710. <row>
  711. <entry>
  712. QCA6411
  713. </entry>
  714. <entry>
  715. 0x05 / 0x001B58BC
  716. </entry>
  717. <entry>
  718. BootLoader
  719. </entry>
  720. <entry>
  721. 0x21 / 0x001B58BC
  722. </entry>
  723. <entry>
  724. MAC-QCA6411-2.5.14.2259-23-20110621-FINAL
  725. </entry>
  726. </row>
  727. <row>
  728. <entry>
  729. QCA7000
  730. </entry>
  731. <entry>
  732. 0x05 / 0x001B589C
  733. </entry>
  734. <entry>
  735. BootLoader
  736. </entry>
  737. <entry>
  738. 0x22 / 0x001B589C
  739. </entry>
  740. <entry>
  741. MAC-QCA7000-1.4.13.3259-43-20110621-FINAL
  742. </entry>
  743. </row>
  744. </tbody>
  745. </tgroup>
  746. </table>
  747. <para>
  748. To properly detect the correct chipset perform the following steps.
  749. </para>
  750. <orderedlist>
  751. <listitem>
  752. <para>
  753. Send a <varname>VS_SW_VER</varname> request message from the local host to the local device using the Atheros Local Management Address.
  754. </para>
  755. </listitem>
  756. <listitem>
  757. <para>
  758. Read the <varname>VS_SW_VER</varname> confirm message returned to the host by the device.
  759. </para>
  760. </listitem>
  761. <listitem>
  762. <para>
  763. Extract and save the <varname>MDEVICEID</varname> field (a small integer) and the <varname>MVERSION</varname> field (a string).
  764. </para>
  765. </listitem>
  766. <listitem>
  767. <para>
  768. If the <varname>MVERSION</varname> string is <quote>SoftLoader</quote> then the <varname>MDEVICEID</varname> field is valid.
  769. </para>
  770. </listitem>
  771. <listitem>
  772. <para>
  773. If the <varname>MVERSION</varname> string is not <quote>BootLoader</quote> then the <varname>MDEVICEID</varname> field is valid unless it is <constant>0x07</constant>. In that case, set the stored <varname>DEVICEID</varname> to <constant>0x04</constant> to indicate an <productname>AR7400</productname>. Do not inspect the <varname>IDENT</varname> field because it does not exist in the firmware version of the <varname>VS_SW_VER</varname> message on any platform.
  774. </para>
  775. </listitem>
  776. <listitem>
  777. <para>
  778. If the <varname>MDEVICEID</varname> field is <constant>1</constant>, indicating an <productname>INT6000</productname>, then the chipset is actually an <productname>INT6300</productname>. Set the stored <varname>MDEVICEID</varname> to <constant>2</constant>, indicating an <productname>INT6300</productname>. Do not inspect the <varname>IDENT</varname> field because it does not exist in the <application>BootLoader</application> version of the <varname>VS_SW_VER</varname> message for either of these two chipsets.
  779. </para>
  780. </listitem>
  781. <listitem>
  782. <para>
  783. If the <varname>MDEVICEID</varname> field is <constant>3</constant>, indicating an <productname>INT6400</productname>, then the chipset could be either an <productname>INT6300</productname> or an <productname>AR7400</productname>. Inspect the <varname>IDENT</varname> field.
  784. </para>
  785. </listitem>
  786. <listitem>
  787. <para>
  788. If the <varname>IDENT</varname> field is <constant>0x6400</constant>, indicating an <productname>INT6400</productname>, then the stored <varname>MDEVICEID</varname> is valid.
  789. </para>
  790. </listitem>
  791. <listitem>
  792. <para>
  793. If the <varname>IDENT</varname> field is <constant>0x7400</constant>, indicating an <productname>AR7400</productname>, then set the stored <varname>MDEVICEID</varname> to <constant>4</constant>, indicating an <productname>AR7400</productname>.
  794. </para>
  795. </listitem>
  796. </orderedlist>
  797. <para>
  798. Having performed the previous conversions, the expression (<constant>1</constant> &lt;&lt; (<varname>DEVICEID</varname> - <constant>1</constant>)) now indicates the proper <varname>IGNORE</varname> bit found in each <acronym>NVM</acronym> file header. Unfortunately, this only works for <varname>DeviceID</varname> values from <constant>0x01</constant> through <constant>0x06</constant>. After that, the device identification scheme changes.
  799. </para>
  800. </section>
  801. <section id="firmware-caveats-3">
  802. <title>
  803. But wait! There's more ...
  804. </title>
  805. <para>
  806. Starting with the <productname>AR7420</productname>, the <varname>DeviceID</varname> field in <constant>VS_SW_VER</constant> is now the <varname>DEVICE_CLASS</varname> field and identifies the <quote>Device Family</quote>, not the device type. Instead, the <varname>IDENT</varname> field in <constant>VS_SW_VER</constant> identifies the device type and the <varname>IDENT</varname> field is located at a variable offset within the message frame. Previously, the <varname>IDENT</varname> was located a fixed offset within the frame.
  807. </para>
  808. <table>
  809. <title>
  810. Device Identification
  811. </title>
  812. <tgroup cols="5">
  813. <colspec colname='ident-device' />
  814. <colspec colname='ident-softloader' />
  815. <colspec colname='ident-bootloader' />
  816. <colspec colname='ident-firmware' />
  817. <colspec colname='ident-identity' />
  818. <thead>
  819. <row>
  820. <entry>
  821. Chipset
  822. </entry>
  823. <entry>
  824. Softloader
  825. </entry>
  826. <entry>
  827. Bootloader
  828. </entry>
  829. <entry>
  830. Firmware
  831. </entry>
  832. <entry>
  833. Identity
  834. </entry>
  835. </row>
  836. </thead>
  837. <tbody>
  838. <row>
  839. <entry>
  840. INT6000
  841. </entry>
  842. <entry>
  843. 0x01
  844. </entry>
  845. <entry>
  846. &nbsp;
  847. </entry>
  848. <entry>
  849. 0x01
  850. </entry>
  851. <entry>
  852. 0x00000042
  853. </entry>
  854. </row>
  855. <row>
  856. <entry>
  857. INT6300
  858. </entry>
  859. <entry>
  860. &nbsp;
  861. </entry>
  862. <entry>
  863. 0x01
  864. </entry>
  865. <entry>
  866. 0x02
  867. </entry>
  868. <entry>
  869. 0x00006300
  870. </entry>
  871. </row>
  872. <row>
  873. <entry>
  874. INT6400
  875. </entry>
  876. <entry>
  877. &nbsp;
  878. </entry>
  879. <entry>
  880. 0x03
  881. </entry>
  882. <entry>
  883. 0x03
  884. </entry>
  885. <entry>
  886. 0x00006400
  887. </entry>
  888. </row>
  889. <row>
  890. <entry>
  891. AR7400
  892. </entry>
  893. <entry>
  894. &nbsp;
  895. </entry>
  896. <entry>
  897. 0x03
  898. </entry>
  899. <entry>
  900. 0x04
  901. </entry>
  902. <entry>
  903. 0x00007400
  904. </entry>
  905. </row>
  906. <row>
  907. <entry>
  908. AR6405
  909. </entry>
  910. <entry>
  911. &nbsp;
  912. </entry>
  913. <entry>
  914. 0x03
  915. </entry>
  916. <entry>
  917. 0x05
  918. </entry>
  919. <entry>
  920. 0x00006400
  921. </entry>
  922. </row>
  923. <row>
  924. <entry>
  925. AR7420
  926. </entry>
  927. <entry>
  928. &nbsp;
  929. </entry>
  930. <entry>
  931. 0x05
  932. </entry>
  933. <entry>
  934. 0x20
  935. </entry>
  936. <entry>
  937. 0x001CFCFC
  938. </entry>
  939. </row>
  940. <row>
  941. <entry>
  942. QCA6410
  943. </entry>
  944. <entry>
  945. &nbsp;
  946. </entry>
  947. <entry>
  948. 0x05
  949. </entry>
  950. <entry>
  951. 0x21
  952. </entry>
  953. <entry>
  954. 0x001B58EC
  955. </entry>
  956. </row>
  957. <row>
  958. <entry>
  959. QCA7000
  960. </entry>
  961. <entry>
  962. &nbsp;
  963. </entry>
  964. <entry>
  965. 0x05
  966. </entry>
  967. <entry>
  968. 0x22
  969. </entry>
  970. <entry>
  971. 0x001B589C
  972. </entry>
  973. </row>
  974. </tbody>
  975. </tgroup>
  976. </table>
  977. </section>
  978. &firmware-6000-flash;
  979. &firmware-6000-upload;
  980. &firmware-6000-boot;
  981. &firmware-6300-boot;
  982. &firmware-6400-boot;
  983. &firmware-7400-boot;
  984. &firmware-7420-boot;
  985. &firmware-7420-flash;
  986. </chapter>