wdenk | aaf224a | 2004-03-14 15:20:55 +0000 | [diff] [blame] | 1 | |
| 2 | SSV ADNP/ESC1 Embedded Softcore Computing |
| 3 | Nios Softcore, Altera Cyclone FPGA |
| 4 | |
| 5 | Last Update: February 27, 2004 |
| 6 | ==================================================================== |
| 7 | |
| 8 | This file contains information regarding U-Boot and the SSV Embedded |
| 9 | Nios Softcore Computing platform ADNP/ESC1. For general Nios |
| 10 | information see doc/README.nios. |
| 11 | |
| 12 | Most stuff of this file was borrowed and based on README.dk1s10, |
| 13 | the Altera DK-1S10 related information file. |
| 14 | |
| 15 | For those interested in contributing ... see HELP WANTED section |
| 16 | in doc/README.nios. |
| 17 | |
| 18 | Contents: |
| 19 | |
| 20 | 1. Files |
| 21 | 2. Memory Organization |
| 22 | 3. CPU Variations |
| 23 | 4. Examples |
| 24 | 5. Programming U-Boot into FLASH with GERMS |
| 25 | 6. Autoboot |
| 26 | 7. U-Boot environment convention and update philosophy |
| 27 | |
| 28 | ==================================================================== |
| 29 | |
| 30 | 1. Files |
| 31 | ========= |
| 32 | board/ssv/adnpesc1/* |
| 33 | include/configs/ADNPESC1.h |
| 34 | include/configs/ADNPESC1_base_32.h |
| 35 | |
| 36 | |
| 37 | 2. Memory Organization |
| 38 | ======================= |
| 39 | |
| 40 | For the most part, you can put things pretty much anywhere. |
| 41 | This is pretty flexible for Nios. So here we make some arbitrary |
| 42 | choices & assume that the monitor is placed at the end of a memory |
| 43 | resource. So you must make sure TEXT_BASE is chosen appropriately. |
| 44 | This is very important if you plan to move your memory to another |
| 45 | place as configured at this time! |
wdenk | 42dfe7a | 2004-03-14 22:25:36 +0000 | [diff] [blame] | 46 | |
wdenk | aaf224a | 2004-03-14 15:20:55 +0000 | [diff] [blame] | 47 | -The heap is placed below the monitor (U-Boot code). |
| 48 | -Global data is placed below the heap. |
| 49 | -The stack is placed below global data (&grows down). |
| 50 | |
| 51 | (see doc/README.adnpesc1_base32 too) |
| 52 | |
| 53 | |
| 54 | 3. CPU Variations |
| 55 | ================= |
| 56 | |
| 57 | There are more than one NIOS CPU variation for the ADNP/ESC1 possible. |
| 58 | U-Boot supports the following CPU configurations: |
| 59 | |
| 60 | - SSV Basis 32 (make ADNPESC1_base_32_config) |
| 61 | - SSV Basis 32 at DNP evaluation base board 2 |
| 62 | (make ADNPESC1_DNPEVA2_base_32_config) |
| 63 | |
| 64 | |
| 65 | 4. Examples |
| 66 | ============ |
| 67 | |
| 68 | The hello_world example works fine. To try out you have to change |
| 69 | the default load address from 0x0100_0000 to 0x0204_0000 in |
| 70 | examples/Makefile (the real SDRAM for default board configuration). |
| 71 | |
| 72 | |
| 73 | 5. Programming U-Boot into FLASH with GERMS |
| 74 | ============================================ |
| 75 | |
| 76 | The current version of the ADNP/ESC1 port with the default |
| 77 | configuration settings occupies about 97 KBytes of flash. |
| 78 | A minimal configuration occupies less than 70 KByte |
| 79 | (network, SPI, POST and board command support disabled). You |
| 80 | can save more memory by deactivating the Hu-Shell support and |
| 81 | long command help (CFG_HUSH_PARSER, CFG_LONGHELP). |
| 82 | |
| 83 | To program U-Boot into the ADNP/ESC1 flash using GERMS do the |
| 84 | following: |
| 85 | |
| 86 | 1. Download U-Boot to its target run space in SDRAM: |
| 87 | |
| 88 | a. Close jumper RCM_EN# and push the reset button. |
| 89 | |
| 90 | b. From the command line, download U-Boot using the |
| 91 | nios-run: |
| 92 | |
| 93 | $ nios-run -r u-boot.srec |
| 94 | |
| 95 | NOTE: In some cases this want fail. I don't know why, |
| 96 | but try again. |
| 97 | |
| 98 | This takes about 1 minute (GERMS is not very speedy here). |
| 99 | After u-boot is downloaded it will be executed. You should |
| 100 | see the following: |
| 101 | |
| 102 | U-Boot 1.0.2 (Jan 30 2004 - 12:59:15) |
| 103 | |
| 104 | CPU: Nios-32 Rev. 3.3 (0x3038) |
| 105 | Reg file size: 512 LO_LIMIT/HI_LIMIT: 1/30 |
| 106 | Board: SSV DilNetPC ADNP/ESC1 |
| 107 | Conf.: SSV Base 32 (nios_32) |
| 108 | In: serial |
| 109 | Out: serial |
| 110 | Err: serial |
| 111 | ADNPESC1 > |
| 112 | |
| 113 | |
| 114 | 2. Quit nios-run and start your terminal application (e.g. start |
| 115 | Hyperterminal or minicom). |
| 116 | |
| 117 | 3. Download the u-boot code to RAM. When using Hyperterminal, do the |
| 118 | following: |
| 119 | |
| 120 | a. From the u-boot command prompt start a binary download to SDRAM: |
| 121 | |
| 122 | at the SSV Basis 32 to SDRAM: |
| 123 | |
| 124 | ==> loadb 2000100 |
| 125 | |
| 126 | b. Download u-boot.bin using kermit. |
| 127 | |
| 128 | 4. From the U-Boot command prompt, erase flash: |
| 129 | |
| 130 | at the SSV Basis 32 from 0x1000000 to 0x103ffff: |
| 131 | |
| 132 | ==> protect off 1:0-3 |
| 133 | ==> erase 1:0-3 |
| 134 | |
| 135 | 5. Copy the binary image from SDRAM to flash: |
| 136 | |
| 137 | at the SSV Basis 32 from SDRAM: |
| 138 | |
| 139 | ==> cp.b 2000100 1000000 $filesize |
| 140 | |
| 141 | U-Boot will now automatically start when the board is powered on or |
| 142 | reset using the SSV Basis 32 configuration without closed RCM jumper. |
| 143 | To start U-Boot with closed RCM Jumper, enter the following GERMS |
| 144 | command: |
| 145 | |
| 146 | + g 1000000 |
| 147 | |
| 148 | |
| 149 | 6. Autoboot |
| 150 | =========== |
| 151 | |
| 152 | U-Boot will try to boot a valid Nios application from Flash. For this |
| 153 | it will use the deposited Hu-Shell script in environment variable |
| 154 | 'bootcmd' which is looking for a valid Nios application identifier |
| 155 | string in Flash and go on at even its entry address. For more |
| 156 | information see the next chapter. |
| 157 | |
| 158 | |
| 159 | 7. U-Boot environment convention and update philosophy |
| 160 | ====================================================== |
| 161 | |
| 162 | U-Boot for the SSV ADNP/ESC1 target knows about many environment |
| 163 | variables used to control the startup process, update process for |
| 164 | raw Nios applications, and optionally file system image updates. |
| 165 | In default configuration there are two Hu-Shell scripts to update |
| 166 | the Nios application and/or the file system image: |
| 167 | |
| 168 | 1. Update Nios application (ex. the uCLinux kernel): |
| 169 | |
| 170 | run 'appl_update' |
| 171 | |
| 172 | 2. Update optional file system image (ex. RomFS image used by uCLinux): |
| 173 | |
| 174 | run 'fs_update' |
| 175 | |
| 176 | The Nios application can be any programm code generated in relation |
| 177 | to the Nios application identifier -- the string "Nios" at offset |
| 178 | address 0x0c. To use the scripts like described above in a secure way |
| 179 | you have to check-up the next environment variables: |
| 180 | |
| 181 | 1. update_allowed |
| 182 | |
| 183 | - Update switch -- must be set to '1' (one) to allow any update |
| 184 | - default is '0' (zero) |
| 185 | |
| 186 | NOTE: You should avoid to save this variable with non zero |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame^] | 187 | value to Flash. Otherwise it would be allow any |
wdenk | aaf224a | 2004-03-14 15:20:55 +0000 | [diff] [blame] | 188 | update process at any time! |
| 189 | |
| 190 | 2. appl_entry_addr |
| 191 | |
| 192 | - Nios application area start address (usually in Flash) |
wdenk | 42dfe7a | 2004-03-14 22:25:36 +0000 | [diff] [blame] | 193 | - this is the startup address for autoboot |
wdenk | aaf224a | 2004-03-14 15:20:55 +0000 | [diff] [blame] | 194 | - each Nios application code we want to update will be copied |
| 195 | to this address |
| 196 | - default is CFG_ADNPESC1_NIOS_APPL_ENTRY |
| 197 | |
| 198 | 3. appl_end_addr |
| 199 | |
| 200 | - Nios application area end address (usually in Flash) |
| 201 | - will be used to unprotect/erase the Flash area while updating |
| 202 | - default is CFG_ADNPESC1_NIOS_APPL_END |
| 203 | |
| 204 | 4. appl_ident_addr |
| 205 | |
| 206 | - address of the Nios application identification string |
| 207 | - this is the address checked-up by autoboot |
| 208 | - default is CFG_ADNPESC1_NIOS_APPL_IDENT |
| 209 | |
| 210 | 5. appl_ident_str |
| 211 | |
| 212 | - the Nios application identification string itself |
| 213 | - default is CFG_ADNPESC1_NIOS_IDENTIFIER |
| 214 | |
| 215 | 6. appl_name |
| 216 | |
| 217 | - name of file we have to download/update |
| 218 | - default is ADNPESC1/base32/linux.bin |
| 219 | |
| 220 | 7. fs_base_addr |
| 221 | |
| 222 | - optionally file system area start address (usually in Flash) |
| 223 | - each file system we want to update will be copied to this address |
| 224 | - default is CFG_ADNPESC1_FILESYSTEM_BASE |
| 225 | |
| 226 | 8. fs_end_addr |
| 227 | |
| 228 | - optionally file system area end address (usually in Flash) |
| 229 | - will be used to unprotect/erase the Flash area while updating |
| 230 | - default is CFG_ADNPESC1_FILESYSTEM_END |
| 231 | |
| 232 | 9. fs_name |
| 233 | |
| 234 | - name of file we have to download/update |
| 235 | - default is ADNPESC1/base32/romfs.img |