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