You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3c90x.txt 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. Instructions for use of the 3C90X driver for EtherBoot
  2. Original 3C905B support by:
  3. Greg Beeley (Greg.Beeley@LightSys.org),
  4. LightSys Technology Services, Inc.
  5. February 11, 1999
  6. Updates for 3C90X family by:
  7. Steve Smith (steve.smith@juno.com)
  8. October 1, 1999
  9. Minor documentation updates by
  10. Greg Beeley (Greg.Beeley@LightSys.org)
  11. March 29, 2000
  12. -------------------------------------------------------------------------------
  13. I OVERVIEW
  14. The 3c90X series ethernet cards are a group of high-performance busmaster
  15. DMA cards from 3Com. This particular driver supports both the 3c90x and
  16. the 3c90xB revision cards. 3C90xC family support has been tested to some
  17. degree but not extensively.
  18. Here's the licensing information:
  19. This program Copyright (C) 1999 LightSys Technology Services, Inc.
  20. Portions Copyright (C) 1999 Steve Smith.
  21. This program may be re-distributed in source or binary form, modified,
  22. sold, or copied for any purpose, provided that the above copyright message
  23. and this text are included with all source copies or derivative works, and
  24. provided that the above copyright message and this text are included in the
  25. documentation of any binary-only distributions. This program is
  26. distributed WITHOUT ANY WARRANTY, without even the warranty of FITNESS FOR
  27. A PARTICULAR PURPOSE or MERCHANTABILITY. Please read the associated
  28. documentation "3c90x.txt" before compiling and using this driver.
  29. II FLASH PROMS
  30. The 3c90xB cards, according to the 3Com documentation, only accept the
  31. following flash memory chips:
  32. Atmel AT29C512 (64 kilobyte)
  33. Atmel AT29C010 (128 kilobyte)
  34. The 3c90x cards, according to the 3Com documentation, accept the
  35. following flash memory chips capacities:
  36. 64 kb (8 kB)
  37. 128 kb (16 kB)
  38. 256 kb (32 kB) and
  39. 512 kb (64 kB)
  40. Atmel AT29C512 (64 kilobyte) chips are specifically listed for both
  41. adapters, but flashing on the 3c905b cards would only be supported
  42. through the Atmel parts. Any device, of the supported size, should
  43. be supported when programmed by a dedicated PROM programmer (e.g.
  44. not the card).
  45. To use this driver in such a PROM, visit Atmel's web site and download
  46. their .PDF file containing a list of their distributors. Contact the
  47. distributors for pricing information. The prices are quite reasonable
  48. (about $3 US each for the 64 kB part), and are comparable to what one would
  49. expect for similarly sized standard EPROMs. And, the flash chips are much
  50. easier to work with, as they don't need to be UV-erased to be reprogrammed.
  51. The 3C905B card actually provides a method to program the flash memory
  52. while it is resident on board the card itself; if someone would like to
  53. write a small DOS program to do the programming, I can provide the
  54. information about the registers and so forth.
  55. A utility program, 3c90xutil, is provided with Etherboot in the 'contrib'
  56. directory that allows for the on-board flashing of the ROM while Linux
  57. is running. The program has been successfully used under Linux, but I
  58. have heard problem reports of its use under FreeBSD. Anyone willing to
  59. make it work under FreeBSD is more than welcome to do so!
  60. You also have the option of using EPROM chips - the 3C905B-TX-NM has been
  61. successfully tested with 27C256 (32kB) and 27C512 (64kB) chips with a
  62. specified access time of 100ns and faster.
  63. III GENERAL USE
  64. Normally, the basic procedure for using this driver is as follows:
  65. 1. Run the 3c90xcfg program on the driver diskette to enable the
  66. boot PROM and set it to 64k or 128k, as appropriate.
  67. 2. Build the appropriate 3c90x.fd0 or 3c90x.fd0 floppy image with
  68. possibly the value CFG_3C90X_XCVR defined to the transceiver type that
  69. you want to use (i.e., 10/100 rj45, AUI, coax, MII).
  70. 3. Run the floppy image on the PC to be network booted, to get
  71. it configured, and to verify that it will boot properly.
  72. 4. Build the 3c90x.rom or 3c90x.lzrom PROM image and program
  73. it into the flash or EPROM memory chip.
  74. 5. Put the PROM in the ethernet card, boot and enable 'boot from
  75. network first' in the system BIOS, save and reboot.
  76. Here are some issues to be aware of:
  77. 1. If you experience crashes or different behaviour when using the
  78. boot PROM, add the setting CFG_3C90X_BOOTROM_FIX and go through the
  79. steps 2-5 above. This works around a bug in some 3c905B cards (see
  80. below), but has some side-effects which may not be desirable.
  81. Please note that you have to boot off a floppy (not PROM!) once for
  82. this fix to take effect.
  83. 2. The possible need to manually set the CFG_3C90X_XCVR value to
  84. configure the transceiver type. Values are listed below.
  85. 3. The possible need to define CFG_3C90X_PRESERVE_XCVR for use in
  86. operating systems that don't intelligently determine the
  87. transceiver type.
  88. Some things that are on the 'To-Do' list, perhaps for me, but perhaps
  89. for any other volunteers out there:
  90. 1. Extend the driver to fully implement the auto-select
  91. algorithm if the card has multiple media ports.
  92. 2. Fix any bugs in the code <grin>....
  93. 3. Extend the driver to support the 3c905c revision cards
  94. "officially". Right now, the support has been primarily empirical
  95. and not based on 3c905C documentation.
  96. Now for the details....
  97. This driver has been tested on roughly 300 systems. The main two
  98. configuration issues to contend with are:
  99. 1. Ensure that PCI Busmastering is enabled for the adapter (configured
  100. in the CMOS setup)
  101. 2. Some systems don't work properly with the adapter when plug and
  102. play OS is enabled; I always set it to "No" or "Disabled" -- this makes
  103. it easier and really doesn't adversely affect anything.
  104. Roughly 95% of the systems worked when configured properly. A few
  105. have issues with booting locally once the boot PROM has been installed
  106. (this number has been less than 2%). Other configuration issues that
  107. to check:
  108. 1. Newer BIOS's actually work correctly with the network boot order.
  109. Set the network adapter first. Most older BIOS's automatically go to
  110. the network boot PROM first.
  111. 2. For systems where the adapter was already installed and is just
  112. having the PROM installed, try setting the "reset configuration data"
  113. to yes in the CMOS setup if the BIOS isn't seen at first. If your BIOS
  114. doesn't have this option, remove the card, start the system, shut down,
  115. install the card and restart (or switch to a different PCI slot).
  116. 3. Make sure the CMOS security settings aren't preventing a boot.
  117. The 3c905B cards have a significant 'bug' that relates to the flash prom:
  118. unless the card is set internally to the MII transceiver, it will only
  119. read the first 8k of the PROM image. Don't ask why -- it seems really
  120. obscure, but it has to do with the way they mux'd the address lines
  121. from the PCI bus to the ROM. Unfortunately, most of us are not using
  122. MII transceivers, and even the .lzrom image ends up being just a little
  123. bit larger than 8k. Note that the workaround for this is disabled by
  124. default, because the Windows NT 4.0 driver does not like it (no packets
  125. are transmitted).
  126. So, the solution that I've used is to internally set the card's nvram
  127. configuration to use MII when it boots. The 3c905b driver does this
  128. automatically. This way, the 16k prom image can be loaded into memory,
  129. and then the 3c905b driver can set the temporary configuration of the
  130. card to an appropriate value, either configurable by the user or chosen
  131. by the driver.
  132. To enable the 3c905B bugfix, which is necessary for these cards when
  133. booting from the Flash ROM, define -DCFG_3C90X_BOOTROM_FIX when building,
  134. create a floppy image and boot it once.
  135. Thereafter, the card should accept the larger prom image.
  136. The driver should choose an appropriate transceiver on the card. However,
  137. if it doesn't on your card or if you need to, for instance, set your
  138. card to 10mbps when connected to an unmanaged 10/100 hub, you can specify
  139. which transceiver you want to use. To do this, build the 3c905b.fd0
  140. image with -DCFG_3C90X_XCVR=x, where 'x' is one of the following
  141. values:
  142. 0 10Base-T
  143. 1 10mbps AUI
  144. 3 10Base-2 (thinnet/coax)
  145. 4 100Base-TX
  146. 5 100Base-FX
  147. 6 MII
  148. 8 Auto-negotiation 10Base-T / 100Base-TX (usually the default)
  149. 9 MII External MAC Mode
  150. 255 Allow driver to choose an 'appropriate' media port.
  151. Then proceed from step 2 in the above 'general use' instructions. The
  152. .rom image can be built with CFG_3C90X_XCVR set to a value, but you
  153. normally don't want to do this, since it is easier to change the
  154. transceiver type by rebuilding a new floppy, changing the BIOS to floppy
  155. boot, booting, and then changing the BIOS back to network boot. If
  156. CFG_3C90X_XCVR is not set in a particular build, it just uses the
  157. current configuration (either its 'best guess' or whatever the stored
  158. CFG_3C90X_XCVR value was from the last time it was set).
  159. [[ Note for the more technically inclined: The CFG_3C90X_XCVR value is
  160. programmed into a register in the card's NVRAM that was reserved for
  161. LanWorks PROM images to use. When the driver boots, the card comes
  162. up in MII mode, and the driver checks the LanWorks register to find
  163. out if the user specified a transceiver type. If it finds that
  164. information, it uses that, otherwise it picks a transceiver that the
  165. card has based on the 3c905b's MediaOptions register. This driver isn't
  166. quite smart enough to always determine which media port is actually
  167. _connected_; maybe someone else would like to take on that task (it
  168. actually involves sending a self-directed packet and seeing if it
  169. comes back. IF it does, that port is connected). ]]
  170. Another issue to keep in mind is that it is possible that some OS'es
  171. might not be happy with the way I've handled the PROM-image hack with
  172. setting MII mode on bootup. Linux 2.0.35 does not have this problem.
  173. Behavior of other systems may vary. The 3com documentation specifically
  174. says that, at least with the card that I have, the device driver in the
  175. OS should auto-select the media port, so other drivers should work fine
  176. with this 'hack'. However, if yours doesn't seem to, you can try defining
  177. CFG_3C90X_PRESERVE_XCVR when building to cause Etherboot to keep the
  178. working setting (that allowed the bootp/tftp process) across the eth_reset
  179. operation.
  180. IV FOR DEVELOPERS....
  181. If you would like to fix/extend/etc. this driver, feel free to do so; just
  182. be sure you can test the modified version on the 3c905B-TX cards that the
  183. driver was originally designed for. This section of this document gives
  184. some information that might be relevant to a programmer.
  185. A. Main Entry Point
  186. a3c90x_probe is the main entry point for this driver. It is referred
  187. to in an array in 'config.c'.
  188. B. Other Important Functions
  189. The functions a3c90x_transmit, a3c90x_poll, a3c90x_reset, and
  190. a3c90x_disable are static functions that EtherBoot finds out about
  191. as a result of a3c90x_probe setting entries in the nic structure
  192. for them. The EtherBoot framework does not use interrupts. It is
  193. polled. All transmit and receive operations are initiated by the
  194. etherboot framework, not by an interrupt or by the driver.
  195. C. Internal Functions
  196. The following functions are internal to the driver:
  197. a3c90x_internal_IssueCommand - sends a command to the 3c905b card.
  198. a3c90x_internal_SetWindow - shifts between one of eight register
  199. windows onboard the 3c90x. The bottom 16 bytes of the card's
  200. I/O space are multiplexed among 128 bytes, only 16 of which are
  201. visible at any one time. This SetWindow function selects one of
  202. the eight sets.
  203. a3c90x_internal_ReadEeprom - reads a word (16 bits) from the
  204. card's onboard nvram. This is NOT the BIOS boot rom. This is
  205. where the card stores such things as its hardware address.
  206. a3c90x_internal_WriteEeprom - writes a word (16 bits) to the
  207. card's nvram, and recomputes the eeprom checksum.
  208. a3c90x_internal_WriteEepromWord - writes a word (16 bits) to the
  209. card's nvram. Used by the above routine.
  210. a3c90x_internal_WriteEepromWord - writes a word (16 bits) to the
  211. card's nvram. Used by the above routine.
  212. D. Globals
  213. All global variables are inside a global structure named INF_3C90X.
  214. So, wherever you see that structure referenced, you know the variable
  215. is a global. Just keeps things a little neater.
  216. E. Enumerations
  217. There are quite a few enumerated type definitions for registers and
  218. so forth, many for registers that I didn't even touch in the driver.
  219. Register types start with 'reg', window numbers (for SetWindow)
  220. start with 'win', and commands (for IssueCommand) start with 'cmd'.
  221. Register offsets also include an indication in the name as to the
  222. size of the register (_b = byte, _w = word, _l = long), and which
  223. window the register is in, if it is windowed (0-7).
  224. F. Why the 'a3c90x' name?
  225. I had to come up with a letter at the beginning of all of the
  226. identifiers, since 3com so conveniently had their name start with a
  227. number. Another driver used 't' (for 'three'?); I chose 'a' for
  228. no reason at all.
  229. Addendum by Jorge L. deLyra <delyra@latt.if.usp.br>, 22Nov2000 re
  230. working around the 3C905 hardware bug mentioned above:
  231. Use this floppy to fix any 3COM model 3C905B PCI 10/100 Ethernet cards
  232. that fail to load and run the boot program the first time around. If
  233. they have a "Lucent" rather than a "Broadcom" chipset these cards have
  234. a configuration bug that causes a hang when trying to load the boot
  235. program from the PROM, if you try to use them right out of the box.
  236. The boot program in this floppy is the file named 3c905b-tpo100.rom
  237. from Etherboot version 4.6.10, compiled with the bugfix parameter
  238. CFG_3C90X_BOOTROM_FIX
  239. You have to take the chip off the card and boot the system once using
  240. this floppy. Once loaded from the floppy, the boot program will access
  241. the card and change some setting in it, correcting the problem. After
  242. that you may use either this boot program or the normal one, compiled
  243. without this bugfix parameter, to boot the machine from the PROM chip.
  244. [Any recent Etherboot version should do, not just 4.6.10 - Ed.]