README.smc91111_eeprom 6.7 KB

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