wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 1 | |
| 2 | Nios Development Kit |
| 3 | Cyclone Editions |
| 4 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 5 | Last Update: January 2, 2004 |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 6 | ==================================================================== |
| 7 | |
| 8 | This file contains information regarding U-Boot and the Altera |
| 9 | Nios Development Kit, Cyclone Edition (DK-1C20). For general Nios |
| 10 | information see doc/README.nios. |
| 11 | |
| 12 | For those interested in contributing ... see HELP WANTED section |
| 13 | in doc/README.nios. |
| 14 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 15 | Contents: |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 16 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 17 | 1. Files |
| 18 | 2. Memory Organization |
| 19 | 3. Examples |
| 20 | 4. Programming U-Boot into FLASH with GERMS |
| 21 | 5. Active Serial Memory Interface (ASMI) Support |
| 22 | |
| 23 | ==================================================================== |
| 24 | |
| 25 | 1. Files |
| 26 | ========= |
wdenk | c0bc2e1 | 2004-02-09 23:12:24 +0000 | [diff] [blame] | 27 | board/altera/dk1c20/* |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 28 | include/configs/DK1C20.h |
| 29 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 30 | 2. Memory Organization |
| 31 | ======================= |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 32 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 33 | -The heap is placed below the monitor (U-Boot code). |
| 34 | -Global data is placed below the heap. |
| 35 | -The stack is placed below global data (&grows down). |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 36 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 37 | 3. Examples |
| 38 | ============ |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 39 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 40 | The hello_world example works fine. The default load address |
| 41 | is 0x0100_0000 (the start of SDRAM). |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 42 | |
| 43 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 44 | 4. Programming U-Boot into FLASH with GERMS |
| 45 | ============================================ |
| 46 | The current version of the DK-1C20 port with the default |
| 47 | configuration settings occupies about 81 KBytes of flash. |
| 48 | A minimal configuration occupies less than 60 KByte (asmi |
| 49 | and network support disabled). |
wdenk | 3da587e | 2003-10-19 23:22:11 +0000 | [diff] [blame] | 50 | |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 51 | To program U-Boot into the DK-1C20 flash using GERMS do the |
| 52 | following: |
| 53 | |
| 54 | 1. From the command line, download U-Boot using the nios-run: |
| 55 | |
| 56 | $ nios-run -r u-boot.srec |
| 57 | |
| 58 | This takes about 45 seconds (GERMS is not very speedy here). |
| 59 | After u-boot is downloaded it will be executed. You should |
| 60 | see the following: |
| 61 | |
| 62 | U-Boot 1.0.0-pre (Oct 4 2003 - 07:39:24) |
| 63 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 64 | CPU: Nios-32 Rev. 3.3 (0x3038) |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 65 | Reg file size: 256 LO_LIMIT/HI_LIMIT: 2/14 |
| 66 | Board: Altera Nios 1C20 Development Kit |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 67 | In: serial |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 68 | Out: serial |
| 69 | Err: serial |
| 70 | ==> |
| 71 | |
| 72 | |
| 73 | 2. Quit nios-run and start your terminal application (e.g. start |
| 74 | Hyperterminal or minicom). |
| 75 | |
wdenk | c0bc2e1 | 2004-02-09 23:12:24 +0000 | [diff] [blame] | 76 | 3. Download the u-boot code to RAM. When using Hyperterminal, do the |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 77 | following: |
| 78 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 79 | a. From the u-boot command prompt start a binary download to SRAM: |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 80 | |
| 81 | ==> loadb 800000 |
| 82 | |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 83 | b. Download u-boot.bin using kermit. |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 84 | |
wdenk | c0bc2e1 | 2004-02-09 23:12:24 +0000 | [diff] [blame] | 85 | 4. From the U-Boot command prompt, erase flash 0x40000 to 0x5ffff: |
| 86 | |
| 87 | ==> erase 1:4-5 |
| 88 | |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 89 | 5. Copy the binary image from SRAM to flash: |
| 90 | |
| 91 | ==> cp.b 800000 40000 10000 |
| 92 | |
| 93 | U-Boot will now automatically start when the board is powered on or |
| 94 | reset using the Standard-32 configuration. To start U-Boot with the |
| 95 | Safe-32 configuration, enter the following GERMS command: |
| 96 | |
| 97 | + g 40000 |
wdenk | ad276f2 | 2004-01-04 16:28:35 +0000 | [diff] [blame] | 98 | |
| 99 | 5. Active Serial Memory Interface (ASMI) Support |
| 100 | ================================================ |
| 101 | ASMI is fully supported in U-Boot. Please note that ASMI is supported |
| 102 | only on Cyclone devices. Do not expect ASMI to work with Stratix or |
| 103 | APEX devices. |
| 104 | |
| 105 | ************* IMPORTANT ************* |
| 106 | =================================================== |
| 107 | IN ORDER FOR THE NIOS ASMI TO OPERATE PROPERLY, THE |
| 108 | CYCLONE DEVICE MUST BE CONFIGURED USING JTAG OR ASMI. |
| 109 | |
| 110 | There are two techniques you can use to bootstrap the ASMI. The |
| 111 | first is to use the program_epcs utility that is part of Altera's SDK. |
| 112 | But I've found program_epcs to be slow and cumbersome at best. |
| 113 | |
| 114 | An undocumented alternative is to use the Quartus device programing |
| 115 | interface: |
| 116 | |
| 117 | 1. Select "Active Serial" mode. |
| 118 | |
| 119 | 2. Choose the xxx.pof file. For example, for the standard_32 |
| 120 | configuration use the "standard_32.pof" file. |
| 121 | |
| 122 | 3. Attach your ByteBlaster to J28. Make sure you have the |
| 123 | cable attached properly -- the orientation of J28 is |
| 124 | different than J24 (the JTAG header). On J28, pin 1 is on |
| 125 | the bottom row, left-most pin. |
| 126 | |
| 127 | 4. Press and hold the "Power-On Reset" switch (SW10). You will |
| 128 | see the green "Loading" and red "Error" LEDs (LED3 and LED4) |
| 129 | in the on state. |
| 130 | |
| 131 | 5. While holding down the "Power-On Reset" switch, start the |
| 132 | programming sequence. This only takes about 10 seconds. |
| 133 | |
| 134 | 6. After programming is complete, release the "Power-On Reset" |
| 135 | switch. The Cyclone device should now load its configuration |
| 136 | from the EPCS4 (U59). The green "User" LED (LED 1) should be |
| 137 | blinking if the device was successfully loaded via ASMI. |
| 138 | |
| 139 | 7. Remove the ByteBlaster cable. The cable must be removed to |
| 140 | allow the Nios ASMI access to the EPCS4 device. |
| 141 | |
| 142 | After you have successfully programmed a configuration into the |
| 143 | EPCS4, the ASMI will be used to load the Cyclone configuration |
| 144 | unless the "Force Safe" switch (SW9) is pressed. |
| 145 | |
| 146 | NOTE: To maximize the amount of space available for program use, |
| 147 | you can enable configuration compression in Quartus. With compression |
| 148 | enabled, the size of the standard_32 configuration data is |
| 149 | approximately 192 KBytes. |
| 150 | |
| 151 | To use the U-Boot ASMI commands, try typing "help asmi" at the |
| 152 | command prompt. The command "asmi info" will show the current |
| 153 | status of the ASMI. |