blob: 0a59f4088a713d24f4b3cf3e3d998d494cb0d20e [file] [log] [blame]
Larry Johnson6433fa22008-03-17 11:10:35 -05001The Korat board has two NOR flashes, FLASH0 and FLASH1, which are connected to
2chip select 0 and 1, respectively. FLASH0 contains 16 MiB, and is mapped to
3addresses 0xFF000000 - 0xFFFFFFFF as U-Boot Flash Bank #2. FLASH1 contains
4from 16 to 128 MiB, and is mapped to 0xF?000000 - 0xF7FFFFFF as U-Boot Flash
5Bank #1 (with the starting address depending on the flash size detected at
6runtime). The write-enable pin on FLASH0 is disabled, so the contents of FLASH0
7cannot be modified in the field. This also prevents FLASH0 from executing
8commands to return chip information, so its configuration is hard-coded in
9U-Boot.
10
11There are two versions of U-Boot for Korat: "permanent" and "upgradable". The
12permanent U-Boot is pre-programmed at the top of FLASH0, e.g., at addresses
130xFFFA0000 - 0xFFFFFFFF for the current 384 KiB size. The upgradable U-Boot is
14located 256 KiB from the top of FLASH1, e.g. at addresses 0xF7F6000 - 0xF7FC0000
15for the current 384 KiB size. FLASH1 addresses 0xF7FE0000 - 0xF7FF0000 are
16used for the U-Boot environmental parameters, and addresses 0xF7FC0000 -
170xF7FDFFFF are used for the redundant copy of the parameters. These locations
18are used by both versions of U-Boot.
19
20On booting, the permanent U-Boot in FLASH0 begins executing. After performing
21minimal setup, it monitors the state of the board's Reset switch (GPIO47). If
22the switch is sensed as open before a timeout period, then U-Boot branches to
23address 0xF7FBFFFC. This causes the upgradable U-Boot to execute from the
24beginning. If the switch remains closed thoughout the timeout period, the
25permanent U-Boot activates the on-board buzzer until the switch is sensed as
26opened. It then continues to execute without branching to FLASH1. The effect
27of this is that normally the Korat board boots its upgradable U-Boot, but, if
28this has been corrupted, the user can boot the permanent U-Boot, which can then
29be used to erase and reload FLASH1 as needed.
30
31Note that it is not necessary for the permanent U-Boot to have all the latest
32features, but only that it have sufficient functionality (working "tftp",
33"erase", "cp.b", etc.) to repair FLASH1. Also, the permanent U-Boot makes no
34assumptions about the size of FLASH1 or the size of the upgradable U-Boot: it is
35sufficient that the upgradable U-Boot can be started by a branch to 0xF7FBFFFC.
36
37The build sequence:
38
39 make korat_config
40 make all perm=1
41
42builds the permanent U-Boot by selecting loader file "u-boot.lds" and defining
43preprocessor symbol "CONFIG_KORAT_PERMANENT". The default build:
44
45 make korat_config
46 make all
47
48creates the upgradable U-Boot but selecting loader file "u-boot-F7FC.lds" and
49leaving preprocessor symbol "CONFIG_KORAT_PERMANENT" undefined.
50
512008-02-22, Larry Johnson <lrj@acm.org>