mmc: omap: don't set wrong voltage select for mmc2
[pandora-u-boot.git] / examples / standalone / README.smc91111_eeprom
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
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.
34
35 #define HARDCODE_MAC                    1
36 #define CONFIG_ETHADDR                  02:80:ad:20:31:b8
37
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
40 want either).
41
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
44
45   BOOT> printenv
46
47   ethaddr=02:80:ad:20:31:b8
48
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.
52
53 2. Running the smc91111_eeprom program
54 ---------------------------------------------------------------------
55
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
60
61 if there is not, check the examples/Makefile, and ensure there is something
62 like for your architecture:
63
64    ifeq ($(ARCH),blackfin)
65    SREC   += smc91111_eeprom.srec
66    BIN    += smc91111_eeprom.bin smc91111_eeprom
67    endif
68
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.
72
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
77 in the Makefile.
78
79 BOOT> loadb 0x1000000
80
81 ## Ready for binary (kermit) download to 0x01000000 at 57600 bps...
82
83 (type CNTL-\ then C)
84 (Back at local machine)
85 ----------------------------------------------------
86 Kermit>send ~/u-boot_1.1.1/examples/smc91111_eeprom
87 Kermit>connect
88
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
96
97 BOOT> bootelf 0x1000000
98
99 Loading .text @ 0x00001000 (3440 bytes)
100 ## Starting application at 0x000010d8 ...
101
102 SMC91111>
103
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
109 like:
110
111   u-boot_1.1.1/examples> bfin-elf-objdump -d smc91111_eeprom |less
112
113   smc91111_eeprom:     file format elf32-bfin
114
115   Disassembly of section .text:
116
117   00001000 <smc91111_eeprom-0xd8>:
118       1000:
119   000010d8 <smc91111_eeprom>:
120
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
123 of the elf file.
124
125 Now we load it to the actual load location:
126
127 BOOT> loadb 0x1000
128
129 ## Ready for binary (kermit) download to 0x00001000 at 57600 bps...
130
131 (Back at pinky.dsl-only.net)
132 ----------------------------------------------------
133 Kermit>send /tftpboot/eeprom.bin
134 Kermit>connect
135
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
143
144 BOOT> go 0x10D8
145
146 ## Starting application at 0x000010D8 ...
147
148 SMC91111>
149
150 3. Setting MAC addresses
151 --------------------------------------------------------------------------
152
153 The MAC address can be stored in four locations:
154
155 -Boot environmental variable in Flash <- can not change, without
156                                           re-flashing U-boot.
157 U-Boot environental variable           <- can not change, without
158                                           resetting board/U-Boot
159 LAN91C111 Registers                    <- volitle
160 LAN91C111 EEPROM                       <- Non Volitle
161
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.
165
166 To set the EEPROM MAC address to 12:34:56:78:9A:BC
167
168 SMC91111> W E 20 3412
169
170 Writing EEPROM register 20 with 3412
171 SMC91111> W E 21 7856
172
173 Writing EEPROM register 21 with 7856
174 SMC91111> W E 22 BC9A
175
176 Writing EEPROM register 22 with bc9a
177 EEPROM contents copied to MAC
178 SMC91111> P
179
180 Current MAC Address in SMSC91111 12:34:56:78:9a:bc
181 Current MAC Address in EEPROM    12:34:56:78:9a:bc
182
183 (CNTRL-C to exit)
184 SMC91111> ## Application terminated, rc = 0x0
185
186 BOOT> reset
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
192
193 Using MAC Address 12:34:56:78:9A:BC
194 host 192.168.0.4 is alive
195
196
197 4. Other things that you can do
198 --------------------------------------------------------------------------
199 After the stand alone application is running, there are a few options:
200  - P : Print the MAC
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
205
206 SMC91111> P
207
208 Current MAC Address in SMSC91111 12:34:56:78:9a:bc
209 Current MAC Address in EEPROM    12:34:56:78:9a:bc
210
211 SMC91111> D
212
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
218
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
223
224 SMC91111> M
225
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
235
236 SMC91111> C
237
238 EEPROM contents copied to MAC
239
240 SMC91111> W E 2A ABCD
241
242 Writing EEPROM register 2a with abcd
243
244 SMC91111> W M 14 FF00
245
246 Writing MAC register bank 1, reg 04 with ff00