Commit fe613cdd4eb2c5b257a60d8dfb7759742318c28a

Authored by Paul Gortmaker
Committed by Kim Phillips
1 parent be9b56df02

sbc8349: combine HRCW flash and u-boot image flash

Up to this point in time, the sbc8349 board was storing the u-boot
image in flash 2x.  One for the HRCW value at the beginning of
flash (0xff80_0000), and once close to the end of flash (0xfff8_0000)
for the actual image that got executed.

This moves the TEXT_BASE to be the beginning of flash, which makes
the second copy of the image redundant, and frees up the flash
from the end of the environment storage to the end of the flash
device itself.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

Showing 3 changed files with 23 additions and 13 deletions Side-by-side Diff

board/sbc8349/config.mk
... ... @@ -24,5 +24,5 @@
24 24 # SBC8349E
25 25 #
26 26  
27   -TEXT_BASE = 0xFFF00000
  27 +TEXT_BASE = 0xFF800000
... ... @@ -21,15 +21,22 @@
21 21  
22 22 The flash type is intel 28F640Jx (4096x16) [one device]. Base address
23 23 is 0xFF80_0000 which is also where the Hardware Reset Configuration
24   -Word (HRCW) is stored. Caution should be used to not overwrite the
25   -HRCW, or "CF RCW" with a Wind River ICE will be required to restore
26   -the HRCW and allow the board to enter background mode for further
27   -steps in the flash process.
  24 +Word (HRCW) is stored. Caution should be used to not reset the
  25 +board without having a valid HRCW in place (i.e. erased flash) as
  26 +then a Wind River ICE will be required to restore the HRCW and flash
  27 +image.
28 28  
29 29  
30 30 Restoring a corrupted or missing flash image:
31 31 =============================================
32 32  
  33 +Note that U-boot versions up to and including 2009.06 had essentially
  34 +two copies of u-boot in flash; one at the very beginning, which set
  35 +the HRCW, and one at the very end, which was the image that was run.
  36 +As of this point in time, the two have been combined into just one
  37 +at the beginning of flash, which provides both the HRCW, and the image
  38 +that is executed. This frees up the remainder of flash for other uses.
  39 +Use of the u-boot command "fli" will indicate what parts are in use.
33 40 Details for storing U-boot to flash using a Wind River ICE can be found
34 41 on page 19 of the board manual (request ERG-00328-001). The following
35 42 is a summary of that information:
... ... @@ -39,9 +46,9 @@
39 46 - Select the appropriate flash type (listed above)
40 47 - Prepare a u-boot image by using the Wind River Convert utility;
41 48 by using "Convert and Add file" on the ELF file from your build.
42   - Convert from FFF0_0000 to FFFF_FFFF (or to FFF3_FFFF if you are
43   - trying to preserve your old environment settings).
44   - - Set the start address of the erase/flash process to FFF0_0000
  49 + Convert from FF80_0000 to FFFF_FFFF (or to FF83_FFFF if you are
  50 + trying to preserve your old environment settings and user flash).
  51 + - Set the start address of the erase/flash process to FF80_0000
45 52 - Set the target RAM required to 64kB.
46 53 - Select sectors for erasing (see note on enviroment below)
47 54 - Select Erase and Reprogram.
... ... @@ -59,7 +66,7 @@
59 66 use all the remaining register file content.
60 67  
61 68 If you wish to preserve your prior U-Boot environment settings,
62   -then convert (and erase to) 0xFFF3FFFF instead of 0xFFFFFFFF.
  69 +then convert (and erase to) 0xFF83FFFF instead of 0xFFFFFFFF.
63 70 The size for converting (and erasing) must be at least as large
64 71 as u-boot.bin.
65 72  
66 73  
... ... @@ -73,10 +80,13 @@
73 80  
74 81 tftp 200000 u-boot.bin
75 82 protect off all
76   - erase fff00000 fff3ffff
77   - cp.b 200000 fff00000 3ffff
  83 + erase ff800000 ff83ffff
  84 + cp.b 200000 ff800000 40000
78 85 protect on all
79 86  
  87 +You may wish to do a "md ff800000 20" operation as a prefix and postfix
  88 +to the above steps to inspect/compare the HRCW before/after as an extra
  89 +safety check before resetting the board upon completion of the reflash.
80 90  
81 91 PCI:
82 92 ====
include/configs/sbc8349.h
... ... @@ -651,8 +651,8 @@
651 651 "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;" \
652 652 "bootm\0" \
653 653 "load=tftp 100000 /tftpboot/sbc8349/u-boot.bin\0" \
654   - "update=protect off fff00000 fff3ffff; " \
655   - "era fff00000 fff3ffff; cp.b 100000 fff00000 ${filesize}\0" \
  654 + "update=protect off ff800000 ff83ffff; " \
  655 + "era ff800000 ff83ffff; cp.b 100000 ff800000 ${filesize}\0" \
656 656 "upd=run load update\0" \
657 657 "fdtaddr=400000\0" \
658 658 "fdtfile=sbc8349.dtb\0" \