Michael Walle | f214a20 | 2012-06-05 11:33:17 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2012 Michael Walle |
| 3 | # Michael Walle <michael@walle.cc> |
| 4 | # |
| 5 | # See file CREDITS for list of people who contributed to this |
| 6 | # project. |
| 7 | # |
| 8 | # This program is free software; you can redistribute it and/or |
| 9 | # modify it under the terms of the GNU General Public License as |
| 10 | # published by the Free Software Foundation; either version 2 of |
| 11 | # the License, or (at your option) any later version. |
| 12 | # |
| 13 | # This program is distributed in the hope that it will be useful, |
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | # GNU General Public License for more details. |
| 17 | # |
| 18 | # You should have received a copy of the GNU General Public License |
| 19 | # along with this program; if not, write to the Free Software |
| 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 21 | # MA 02110-1301 USA |
| 22 | # |
Anatolij Gustschin | b1e6c4c | 2013-04-30 11:15:33 +0000 | [diff] [blame] | 23 | # Refer doc/README.kwbimage for more details about how-to configure |
Michael Walle | f214a20 | 2012-06-05 11:33:17 +0000 | [diff] [blame] | 24 | # and create kirkwood boot image |
| 25 | # |
| 26 | |
| 27 | # Boot Media configurations |
| 28 | BOOT_FROM spi |
| 29 | |
| 30 | # SOC registers configuration using bootrom header extension |
| 31 | # Maximum KWBIMAGE_MAX_CONFIG configurations allowed |
| 32 | |
| 33 | # Configure RGMII-0/1 interface pad voltage to 1.8V |
| 34 | DATA 0xFFD100E0 0x1B1B9B9B |
| 35 | |
| 36 | # L2 RAM Timing 0 |
| 37 | DATA 0xFFD20134 0xBBBBBBBB |
| 38 | # not further specified in HW manual, timing taken from original vendor port |
| 39 | |
| 40 | # L2 RAM Timing 1 |
| 41 | DATA 0xFFD20138 0x00BBBBBB |
| 42 | # not further specified in HW manual, timing taken from original vendor port |
| 43 | |
| 44 | # DDR Configuration register |
| 45 | DATA 0xFFD01400 0x43000618 |
| 46 | # bit13-0: 0x618, 1560 DDR2 clks refresh rate |
| 47 | # bit23-14: 0 required |
| 48 | # bit24: 1, enable exit self refresh mode on DDR access |
| 49 | # bit25: 1 required |
| 50 | # bit29-26: 0 required |
| 51 | # bit31-30: 0b01 required |
| 52 | |
| 53 | # DDR Controller Control Low |
| 54 | DATA 0xFFD01404 0x39543010 |
| 55 | # bit3-0: 0 required |
| 56 | # bit4: 1, T2 mode, addr/cmd are driven for two cycles |
| 57 | # bit5: 0, clk is driven during self refresh, we don't care for APX |
| 58 | # bit6: 0, use recommended falling edge of clk for addr/cmd |
| 59 | # bit11-7: 0 required |
| 60 | # bit12: 1 required |
| 61 | # bit13: 1 required |
| 62 | # bit14: 0, input buffer always powered up |
| 63 | # bit17-15: 0 required |
| 64 | # bit18: 1, cpu lock transaction enabled |
| 65 | # bit19: 0 required |
| 66 | # bit23-20: 5, recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 |
| 67 | # bit27-24: 9, CL+4, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM |
| 68 | # bit30-28: 3 required |
| 69 | # bit31: 0, no additional STARTBURST delay |
| 70 | |
| 71 | # DDR Timing (Low) |
| 72 | DATA 0xFFD01408 0x22125441 |
| 73 | # bit3-0: 0x1, 18 cycle tRAS (tRAS[3-0]) |
| 74 | # bit7-4: 4, 5 cycle tRCD |
| 75 | # bit11-8: 4, 5 cyle tRP |
| 76 | # bit15-12: 5, 6 cyle tWR |
| 77 | # bit19-16: 2, 3 cyle tWTR |
| 78 | # bit20: 1, 18 cycle tRAS (tRAS[4]) |
| 79 | # bit23-21: 0 required |
| 80 | # bit27-24: 2, 3 cycle tRRD |
| 81 | # bit31-28: 2, 3 cyle tRTP |
| 82 | |
| 83 | # DDR Timing (High) |
| 84 | DATA 0xFFD0140C 0x00000832 |
| 85 | # bit6-0: 0x32, 50 cycle tRFC |
| 86 | # bit8-7: 0, 1 cycle tR2R |
| 87 | # bit10-9: 0, 1 cyle tR2W |
| 88 | # bit12-11: 1, 2 cylce tW2W |
| 89 | # bit31-13: 0 required |
| 90 | |
| 91 | # DDR Address Control |
| 92 | DATA 0xFFD01410 0x0000000C |
| 93 | # bit1-0: 0, Cs0width=x8 |
| 94 | # bit3-2: 3, Cs0size=1Gbit |
| 95 | # bit5-4: 0, Cs1width=nonexistent |
| 96 | # bit7-6: 0, Cs1size=nonexistent |
| 97 | # bit9-8: 0, Cs2width=nonexistent |
| 98 | # bit11-10: 0, Cs2size=nonexistent |
| 99 | # bit13-12: 0, Cs3width=nonexistent |
| 100 | # bit15-14: 0, Cs3size=nonexistent |
| 101 | # bit16: 0, Cs0AddrSel |
| 102 | # bit17: 0, Cs1AddrSel |
| 103 | # bit18: 0, Cs2AddrSel |
| 104 | # bit19: 0, Cs3AddrSel |
| 105 | # bit31-20: 0 required |
| 106 | |
| 107 | # DDR Open Pages Control |
| 108 | DATA 0xFFD01414 0x00000000 |
| 109 | # bit0: 0, OPEn=OpenPage enabled |
| 110 | # bit31-1: 0 required |
| 111 | |
| 112 | # DDR Operation |
| 113 | DATA 0xFFD01418 0x00000000 |
| 114 | # bit3-0: 0, Cmd=Normal SDRAM Mode |
| 115 | # bit31-4: 0 required |
| 116 | |
| 117 | # DDR Mode |
| 118 | DATA 0xFFD0141C 0x00000652 |
| 119 | # bit2-0: 2, Burst Length (2 required) |
| 120 | # bit3: 0, Burst Type (0 required) |
| 121 | # bit6-4: 5, CAS Latency (CL) 5 |
| 122 | # bit7: 0, (Test Mode) Normal operation |
| 123 | # bit8: 0, (Reset DLL) Normal operation |
| 124 | # bit11-9: 3, Write recovery for auto-precharge (3 required) |
| 125 | # bit12: 0, Fast Active power down exit time (0 required) |
| 126 | # bit31-13: 0 required |
| 127 | |
| 128 | # DDR Extended Mode |
| 129 | DATA 0xFFD01420 0x00000006 |
| 130 | # bit0: 0, DRAM DLL enabled |
| 131 | # bit1: 1, DRAM drive strength reduced |
| 132 | # bit2: 1, ODT control Rtt[0] (Rtt=1, 75 ohm termination) |
| 133 | # bit5-3: 0 required |
| 134 | # bit6: 0, ODT control Rtt[1] (Rtt=1, 75 ohm termination) |
| 135 | # bit9-7: 0 required |
| 136 | # bit10: 0, differential DQS enabled |
| 137 | # bit11: 0 required |
| 138 | # bit12: 0, DRAM output buffer enabled |
| 139 | # bit31-13: 0 required |
| 140 | |
| 141 | # DDR Controller Control High |
| 142 | DATA 0xFFD01424 0x0000F17F |
| 143 | # bit2-0: 0x7 required |
| 144 | # bit3: 1, MBUS Burst Chop disabled |
| 145 | # bit6-4: 0x7 required |
| 146 | # bit7: 0 required (???) |
| 147 | # bit8: 1, add writepath sample stage, must be 1 for DDR freq >= 300MHz |
| 148 | # bit9: 0, no half clock cycle addition to dataout |
| 149 | # bit10: 0, 1/4 clock cycle skew enabled for addr/ctl signals |
| 150 | # bit11: 0, 1/4 clock cycle skew disabled for write mesh |
| 151 | # bit15-12: 0xf required |
| 152 | # bit31-16: 0 required |
| 153 | |
| 154 | # DDR2 ODT Read Timing (default values) |
| 155 | DATA 0xFFD01428 0x00085520 |
| 156 | # bit3-0: 0 required |
| 157 | # bit7-4: 2, 2 cycles from read command to assertion of M_ODT signal |
| 158 | # bit11-8: 5, 5 cycles from read command to de-assertion of M_ODT signal |
| 159 | # bit15-12: 5, 5 cycles from read command to assertion of internal ODT signal |
| 160 | # bit19-16: 8, 8 cycles from read command to de-assertion of internal ODT signal |
| 161 | # bit31-20: 0 required |
| 162 | |
| 163 | # DDR2 ODT Write Timing (default values) |
| 164 | DATA 0xFFD0147C 0x00008552 |
| 165 | # bit3-0: 2, 2 cycles from write comand to assertion of M_ODT signal |
| 166 | # bit7-4: 5, 5 cycles from write command to de-assertion of M_ODT signal |
| 167 | # bit15-12: 5, 5 cycles from write command to assertion of internal ODT signal |
| 168 | # bit19-16: 8, 8 cycles from write command to de-assertion of internal ODT signal |
| 169 | # bit31-16: 0 required |
| 170 | |
| 171 | # CS[0]n Base address |
| 172 | DATA 0xFFD01500 0x00000000 |
| 173 | # at 0x0 |
| 174 | |
| 175 | # CS[0]n Size |
| 176 | DATA 0xFFD01504 0x0FFFFFF1 |
| 177 | # bit0: 1, Window enabled |
| 178 | # bit1: 0, Write Protect disabled |
| 179 | # bit3-2: 0x0, CS0 hit selected |
| 180 | # bit23-4: 0xfffff required |
| 181 | # bit31-24: 0x0f, Size (i.e. 256MB) |
| 182 | |
| 183 | # CS[1]n Size |
| 184 | DATA 0xFFD0150C 0x00000000 |
| 185 | # window disabled |
| 186 | |
| 187 | # CS[2]n Size |
| 188 | DATA 0xFFD01514 0x00000000 |
| 189 | # window disabled |
| 190 | |
| 191 | # CS[3]n Size |
| 192 | DATA 0xFFD0151C 0x00000000 |
| 193 | # window disabled |
| 194 | |
| 195 | # DDR ODT Control (Low) |
| 196 | DATA 0xFFD01494 0x00010000 |
| 197 | # bit3-0: 0b0000, (read) M_ODT[0] is not asserted during read from DRAM |
| 198 | # bit7-4: 0b0000, (read) M_ODT[1] is not asserted during read from DRAM |
| 199 | # bit15-8: 0 required |
| 200 | # bit19-16: 0b0001, (write) M_ODT[0] is asserted during write to DRAM CS0 |
| 201 | # bit23-20: 0b0000, (write) M_ODT[1] is not asserted during write to DRAM |
| 202 | # bit31-24: 0 required |
| 203 | |
| 204 | # DDR ODT Control (High) |
| 205 | DATA 0xFFD01498 0x00000000 |
| 206 | # bit1-0: 0, M_ODT[0] assertion is controlled by ODT Control Low register |
| 207 | # bit3-2: 0, M_ODT[1] assertion is controlled by ODT Control Low register |
| 208 | # bit31-4 0 required |
| 209 | |
| 210 | # CPU ODT Control |
| 211 | DATA 0xFFD0149C 0x0000E80F |
| 212 | # bit3-0: 0b1111, internal ODT is asserted during read from DRAM bank 0-3 |
| 213 | # bit7-4: 0b0000, internal ODT is not asserted during write to DRAM bank 0-3 |
| 214 | # bit9-8: 0, Internal ODT assertion is controlled by fiels |
| 215 | # bit11-10: 2, M_DQ, M_DM, and M_DQS I/O buffer ODT 75 ohm |
| 216 | # bit13-12: 2, M_STARTBURST_IN I/O buffer ODT 75 ohm |
| 217 | # bit14: 1, M_STARTBURST_IN ODT enabled |
| 218 | # bit15: 1, DDR IO ODT Unit: Drive ODT calibration values |
| 219 | # bit20-16: 0, Pad N channel driving strength for ODT |
| 220 | # bit25-21: 0, Pad P channel driving strength for ODT |
| 221 | # bit31-26: 0 required |
| 222 | |
| 223 | # DDR Initialization Control |
| 224 | DATA 0xFFD01480 0x00000001 |
| 225 | # bit0: 1, enable DDR init upon this register write |
| 226 | # bit31-1: 0, required |
| 227 | |
| 228 | # End of Header extension |
| 229 | DATA 0x0 0x0 |