1 This is the readme for the Das U-Boot standalone program smc91111
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
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
17 1. Ensuring U-boot's MAC address can be set in hardware
18 --------------------------------------------------------------------------
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
26 To find out who has a MAC address, or to purchase MAC addresses, goto
28 http://standards.ieee.org/regauth/oui/index.shtml
30 To change your MAC address, there can not be a MAC address predefined in
31 U-Boot. To ensure that this does not occur, check your
32 include/configs/<board_name>.h file, and check to see that the following
33 settings are _not_ or commented out there.
35 #define HARDCODE_MAC 1
36 #define CONFIG_ETHADDR 02:80:ad:20:31:b8
38 The purpose of HARDCODE_MAC is to hardcode the MAC address in software,
39 (not what we want), or to preset it to 02:80:ad:20:31:b8 (not what we
42 You can check this in a running U-Boot, by doing a power cycle, then
43 before U-Boot tries to do any networking, running the 'printenv' command
47 ethaddr=02:80:ad:20:31:b8
49 If you see the 'ethaddr' variable show up, like the above, you need to
50 recompile U-Boot, with the above settings commented out of the
51 include/configs/<board_name>.h file.
53 2. Running the smc91111_eeprom program
54 ---------------------------------------------------------------------
56 After Uboot is compiled, there should be three files of interest:
57 -rwxr-xr-x 1 8806 2004-10-11 14:00 smc91111_eeprom <- ELF
58 -rwxr-xr-x 1 3440 2004-10-11 14:00 smc91111_eeprom.bin <- BIN
59 -rwxr-xr-x 1 9524 2004-10-11 14:00 smc91111_eeprom.srec <- SREC
61 if there is not, check the examples/Makefile, and ensure there is something
62 like for your architecture:
64 ifeq ($(ARCH),blackfin)
65 SREC += smc91111_eeprom.srec
66 BIN += smc91111_eeprom.bin smc91111_eeprom
69 To load the files: there are two methods: a) serial or b) network. Since
70 it is not a good idea to start doing things on the network before the
71 MAC address is set, this example will do things over serial.
73 a) Loading the elf file via the serial port
74 --------------------------------------------
75 Loading the elf is very easy - just ensure that the location
76 you specify things to load as is not the load address specified
81 ## Ready for binary (kermit) download to 0x01000000 at 57600 bps...
84 (Back at local machine)
85 ----------------------------------------------------
86 Kermit>send ~/u-boot_1.1.1/examples/smc91111_eeprom
89 Connecting to /dev/ttyS0, speed 57600
90 Escape character: Ctrl-\ (ASCII 28, FS): enabled
91 Type the escape character followed by C to get back,
92 or followed by ? to see other options.
93 ----------------------------------------------------
94 ## Total Size = 0x00002266 = 8806 Bytes
95 ## Start Addr = 0x01000000
97 BOOT> bootelf 0x1000000
99 Loading .text @ 0x00001000 (3440 bytes)
100 ## Starting application at 0x000010d8 ...
104 b) Loading the binary file via the serial port
105 -----------------------------------------------
106 For many toolchains, the entry point is not the load point.
107 The Load point is a hard coded address from the
108 examples/Makefile. The entry point can be found by doing something
111 u-boot_1.1.1/examples> bfin-elf-objdump -d smc91111_eeprom |less
113 smc91111_eeprom: file format elf32-bfin
115 Disassembly of section .text:
117 00001000 <smc91111_eeprom-0xd8>:
119 000010d8 <smc91111_eeprom>:
121 You can see that the entry point (or the address that should be
122 jumped to is 0x10d8). This is also the same as the entry point
125 Now we load it to the actual load location:
129 ## Ready for binary (kermit) download to 0x00001000 at 57600 bps...
131 (Back at pinky.dsl-only.net)
132 ----------------------------------------------------
133 Kermit>send /tftpboot/eeprom.bin
136 Connecting to /dev/ttyS0, speed 57600
137 Escape character: Ctrl-\ (ASCII 28, FS): enabled
138 Type the escape character followed by C to get back,
139 or followed by ? to see other options.
140 ----------------------------------------------------
141 ## Total Size = 0x00000d70 = 3440 Bytes
142 ## Start Addr = 0x00001000
146 ## Starting application at 0x000010D8 ...
150 3. Setting MAC addresses
151 --------------------------------------------------------------------------
153 The MAC address can be stored in four locations:
155 -Boot environmental variable in Flash <- can not change, without
157 U-Boot environmental variable <- can not change, without
158 resetting board/U-Boot
159 LAN91C111 Registers <- volatile
160 LAN91C111 EEPROM <- Non-volatile
162 If you have not activated the network, and do not have a hardcoded
163 or pre-assigned MAC address in U-boot, the environmental variables
164 should be blank, and allow you to set things one time.
166 To set the EEPROM MAC address to 12:34:56:78:9A:BC
168 SMC91111> W E 20 3412
170 Writing EEPROM register 20 with 3412
171 SMC91111> W E 21 7856
173 Writing EEPROM register 21 with 7856
174 SMC91111> W E 22 BC9A
176 Writing EEPROM register 22 with bc9a
177 EEPROM contents copied to MAC
180 Current MAC Address in SMSC91111 12:34:56:78:9a:bc
181 Current MAC Address in EEPROM 12:34:56:78:9a:bc
184 SMC91111> ## Application terminated, rc = 0x0
187 U-Boot 1.1.1 (gcc version: 3.3.3)
188 Release Version Beta released on Oct 10 2004 - 00:34:35
189 Blackfin support by LG Soft India
190 For further information please check this link http://www.blackfin.uclinux.org
191 BOOT> ping 192.168.0.4
193 Using MAC Address 12:34:56:78:9A:BC
194 host 192.168.0.4 is alive
197 4. Other things that you can do
198 --------------------------------------------------------------------------
199 After the stand alone application is running, there are a few options:
201 - D : Dump the LAN91C111 EEPROM contents
202 - M : Dump the LAN91C111 MAC contents
203 - C : Copies the MAC address from the EEPROM to the LAN91C111
204 - W : Write a register in the EEPROM or in the MAC
208 Current MAC Address in SMSC91111 12:34:56:78:9a:bc
209 Current MAC Address in EEPROM 12:34:56:78:9a:bc
213 IOS2-0 000 001 002 003 004 005 006 007
214 CONFIG 00:ffff 04:ffff 08:ffff 0c:ffff 10:ffff 14:ffff 18:ffff 1c:ffff
215 BASE 01:ffff 05:ffff 09:ffff 0d:ffff 11:ffff 15:ffff 19:ffff 1d:ffff
216 02:ffff 06:ffff 0a:ffff 0e:0020 12:ffff 16:ffff 1a:ffff 1e:ffff
217 03:ffff 07:ffff 0b:ffff 0f:ffff 13:ffff 17:ffff 1b:ffff 1f:ffff
219 20:3412 21:7856 22:bc9a 23:ffff 24:ffff 25:ffff 26:ffff 27:ffff
220 28:ffff 29:ffff 2a:ffff 2b:ffff 2c:ffff 2d:ffff 2e:ffff 2f:ffff
221 30:ffff 31:ffff 32:ffff 33:ffff 34:ffff 35:ffff 36:ffff 37:ffff
222 38:ffff 39:ffff 3a:ffff 3b:ffff 3c:ffff 3d:ffff 3e:ffff 3f:ffff
226 Bank0 Bank1 Bank2 Bank3
227 00 0000 a0b1 3332 0000
228 02 0000 1801 8000 0000
229 04 0000 3412 8080 0000
230 06 0000 7856 003f 0000
231 08 0404 bc9a 02df 3332
232 0a 0000 ffff 02df 3391
233 0c 0000 1214 0004 001f
234 0e 3300 3301 3302 3303
238 EEPROM contents copied to MAC
240 SMC91111> W E 2A ABCD
242 Writing EEPROM register 2a with abcd
244 SMC91111> W M 14 FF00
246 Writing MAC register bank 1, reg 04 with ff00