Home | History | Annotate | only in /external/u-boot/examples/standalone
Up to higher level directory
NameDateSize
atmel_df_pow2.c22-Oct-20203.7K
hello_world.c22-Oct-2020691
Makefile22-Oct-20202.3K
mips.lds22-Oct-2020695
mips64.lds22-Oct-2020695
nds32.lds22-Oct-2020662
ppc_longjmp.S22-Oct-20201.9K
ppc_setjmp.S22-Oct-20201.9K
README.smc91111_eeprom22-Oct-20206.7K
riscv.lds22-Oct-2020642
sched.c22-Oct-20208K
smc91111_eeprom.c22-Oct-20207.2K
smc911x_eeprom.c22-Oct-20208.2K
sparc.lds22-Oct-2020569
stubs.c22-Oct-20207.1K

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 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.
    134 U-Boot environmental variable	       <- can not change, without
    135 					  resetting board/U-Boot
    136 LAN91C111 Registers		       <- volatile
    137 LAN91C111 EEPROM		       <- Non-volatile
    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
    224