README.smc91111_eeprom 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. This is the readme for the Das U-Boot standalone program smc91111
  2. The main purpose of this is to manage MAC addresses on platforms
  3. which include the SMC91111 integrated 10/100 MAC Phy, with attached
  4. EEPROMs.
  5. Contents:
  6. ------------------------
  7. 1. Ensuring U-boot's MAC address can be set in hardware
  8. 2. Running the smc91111_eeprom program
  9. 3. Setting MAC addresses
  10. 4. Other things you can do with this
  11. 5. Things to be done.
  12. 1. Ensuring U-boot's MAC address can be set in hardware
  13. --------------------------------------------------------------------------
  14. On the Internet - MAC addresses are very important. Short for Media
  15. Access Control address, a hardware address that uniquely identifies
  16. each node of a network. When things are not unique - bad things
  17. can happen. This is why U-Boot makes it difficult to change MAC
  18. addresses.
  19. To find out who has a MAC address, or to purchase MAC addresses, goto
  20. the IEEE, at:
  21. http://standards.ieee.org/regauth/oui/index.shtml
  22. To change your MAC address, there can not be a MAC address predefined in
  23. U-Boot. To ensure that this does not occur, check your
  24. include/configs/<board_name>.h file, and check to see that the following
  25. settings are _not_ or commented out there.
  26. #define HARDCODE_MAC 1
  27. #define CONFIG_ETHADDR 02:80:ad:20:31:b8
  28. The purpose of HARDCODE_MAC is to hardcode the MAC address in software,
  29. (not what we want), or to preset it to 02:80:ad:20:31:b8 (not what we
  30. want either).
  31. You can check this in a running U-Boot, by doing a power cycle, then
  32. before U-Boot tries to do any networking, running the 'printenv' command
  33. BOOT> printenv
  34. ethaddr=02:80:ad:20:31:b8
  35. If you see the 'ethaddr' variable show up, like the above, you need to
  36. recompile U-Boot, with the above settings commented out of the
  37. include/configs/<board_name>.h file.
  38. 2. Running the smc91111_eeprom program
  39. ---------------------------------------------------------------------
  40. After Uboot is compiled, there should be three files of interest:
  41. -rwxr-xr-x 1 8806 2004-10-11 14:00 smc91111_eeprom <- ELF
  42. -rwxr-xr-x 1 3440 2004-10-11 14:00 smc91111_eeprom.bin <- BIN
  43. -rwxr-xr-x 1 9524 2004-10-11 14:00 smc91111_eeprom.srec <- SREC
  44. if there is not, check the examples/Makefile, and ensure there is something
  45. like for your architecture:
  46. ifeq ($(ARCH),blackfin)
  47. SREC += smc91111_eeprom.srec
  48. BIN += smc91111_eeprom.bin smc91111_eeprom
  49. endif
  50. To load the files: there are two methods: a) serial or b) network. Since
  51. it is not a good idea to start doing things on the network before the
  52. MAC address is set, this example will do things over serial.
  53. a) Loading the elf file via the serial port
  54. --------------------------------------------
  55. Loading the elf is very easy - just ensure that the location
  56. you specify things to load as is not the load address specified
  57. in the Makefile.
  58. BOOT> loadb 0x1000000
  59. ## Ready for binary (kermit) download to 0x01000000 at 57600 bps...
  60. (type CNTL-\ then C)
  61. (Back at local machine)
  62. ----------------------------------------------------
  63. Kermit>send ~/u-boot_1.1.1/examples/smc91111_eeprom
  64. Kermit>connect
  65. Connecting to /dev/ttyS0, speed 57600
  66. Escape character: Ctrl-\ (ASCII 28, FS): enabled
  67. Type the escape character followed by C to get back,
  68. or followed by ? to see other options.
  69. ----------------------------------------------------
  70. ## Total Size = 0x00002266 = 8806 Bytes
  71. ## Start Addr = 0x01000000
  72. BOOT> bootelf 0x1000000
  73. Loading .text @ 0x00001000 (3440 bytes)
  74. ## Starting application at 0x000010d8 ...
  75. SMC91111>
  76. b) Loading the binary file via the serial port
  77. -----------------------------------------------
  78. For many toolchains, the entry point is not the load point.
  79. The Load point is a hard coded address from the
  80. examples/Makefile. The entry point can be found by doing something
  81. like:
  82. u-boot_1.1.1/examples> bfin-elf-objdump -d smc91111_eeprom |less
  83. smc91111_eeprom: file format elf32-bfin
  84. Disassembly of section .text:
  85. 00001000 <smc91111_eeprom-0xd8>:
  86. 1000:
  87. 000010d8 <smc91111_eeprom>:
  88. You can see that the entry point (or the address that should be
  89. jumped to is 0x10d8). This is also the same as the entry point
  90. of the elf file.
  91. Now we load it to the actual load location:
  92. BOOT> loadb 0x1000
  93. ## Ready for binary (kermit) download to 0x00001000 at 57600 bps...
  94. (Back at pinky.dsl-only.net)
  95. ----------------------------------------------------
  96. Kermit>send /tftpboot/eeprom.bin
  97. Kermit>connect
  98. Connecting to /dev/ttyS0, speed 57600
  99. Escape character: Ctrl-\ (ASCII 28, FS): enabled
  100. Type the escape character followed by C to get back,
  101. or followed by ? to see other options.
  102. ----------------------------------------------------
  103. ## Total Size = 0x00000d70 = 3440 Bytes
  104. ## Start Addr = 0x00001000
  105. BOOT> go 0x10D8
  106. ## Starting application at 0x000010D8 ...
  107. SMC91111>
  108. 3. Setting MAC addresses
  109. --------------------------------------------------------------------------
  110. The MAC address can be stored in four locations:
  111. -Boot environmental variable in Flash <- can not change, without
  112. re-flashing U-boot.
  113. U-Boot environental variable <- can not change, without
  114. resetting board/U-Boot
  115. LAN91C111 Registers <- volitle
  116. LAN91C111 EEPROM <- Non Volitle
  117. If you have not activated the network, and do not have a hardcoded
  118. or pre-assigned MAC address in U-boot, the environmental variables
  119. should be blank, and allow you to set things one time.
  120. To set the EEPROM MAC address to 12:34:56:78:9A:BC
  121. SMC91111> W E 20 3412
  122. Writing EEPROM register 20 with 3412
  123. SMC91111> W E 21 7856
  124. Writing EEPROM register 21 with 7856
  125. SMC91111> W E 22 BC9A
  126. Writing EEPROM register 22 with bc9a
  127. EEPROM contents copied to MAC
  128. SMC91111> P
  129. Current MAC Address in SMSC91111 12:34:56:78:9a:bc
  130. Current MAC Address in EEPROM 12:34:56:78:9a:bc
  131. (CNTRL-C to exit)
  132. SMC91111> ## Application terminated, rc = 0x0
  133. BOOT> reset
  134. U-Boot 1.1.1 (gcc version: 3.3.3)
  135. Release Version Beta released on Oct 10 2004 - 00:34:35
  136. Blackfin support by LG Soft India
  137. For further information please check this link http://www.blackfin.uclinux.org
  138. BOOT> ping 192.168.0.4
  139. Using MAC Address 12:34:56:78:9A:BC
  140. host 192.168.0.4 is alive
  141. 4. Other things that you can do
  142. --------------------------------------------------------------------------
  143. After the stand alone application is running, there are a few options:
  144. - P : Print the MAC
  145. - D : Dump the LAN91C111 EEPROM contents
  146. - M : Dump the LAN91C111 MAC contents
  147. - C : Copies the MAC address from the EEPROM to the LAN91C111
  148. - W : Write a register in the EEPROM or in the MAC
  149. SMC91111> P
  150. Current MAC Address in SMSC91111 12:34:56:78:9a:bc
  151. Current MAC Address in EEPROM 12:34:56:78:9a:bc
  152. SMC91111> D
  153. IOS2-0 000 001 002 003 004 005 006 007
  154. CONFIG 00:ffff 04:ffff 08:ffff 0c:ffff 10:ffff 14:ffff 18:ffff 1c:ffff
  155. BASE 01:ffff 05:ffff 09:ffff 0d:ffff 11:ffff 15:ffff 19:ffff 1d:ffff
  156. 02:ffff 06:ffff 0a:ffff 0e:0020 12:ffff 16:ffff 1a:ffff 1e:ffff
  157. 03:ffff 07:ffff 0b:ffff 0f:ffff 13:ffff 17:ffff 1b:ffff 1f:ffff
  158. 20:3412 21:7856 22:bc9a 23:ffff 24:ffff 25:ffff 26:ffff 27:ffff
  159. 28:ffff 29:ffff 2a:ffff 2b:ffff 2c:ffff 2d:ffff 2e:ffff 2f:ffff
  160. 30:ffff 31:ffff 32:ffff 33:ffff 34:ffff 35:ffff 36:ffff 37:ffff
  161. 38:ffff 39:ffff 3a:ffff 3b:ffff 3c:ffff 3d:ffff 3e:ffff 3f:ffff
  162. SMC91111> M
  163. Bank0 Bank1 Bank2 Bank3
  164. 00 0000 a0b1 3332 0000
  165. 02 0000 1801 8000 0000
  166. 04 0000 3412 8080 0000
  167. 06 0000 7856 003f 0000
  168. 08 0404 bc9a 02df 3332
  169. 0a 0000 ffff 02df 3391
  170. 0c 0000 1214 0004 001f
  171. 0e 3300 3301 3302 3303
  172. SMC91111> C
  173. EEPROM contents copied to MAC
  174. SMC91111> W E 2A ABCD
  175. Writing EEPROM register 2a with abcd
  176. SMC91111> W M 14 FF00
  177. Writing MAC register bank 1, reg 04 with ff00