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