168d6963cSValentin Longchamp# 268d6963cSValentin Longchamp# (C) Copyright 2010 368d6963cSValentin Longchamp# Heiko Schocher, DENX Software Engineering, hs@denx.de. 468d6963cSValentin Longchamp# 568d6963cSValentin Longchamp# (C) Copyright 2011 668d6963cSValentin Longchamp# Valentin Longchamp, Keymile AG, valentin.longchamp@keymile.com 768d6963cSValentin Longchamp# 8*1a459660SWolfgang Denk# SPDX-License-Identifier: GPL-2.0+ 968d6963cSValentin Longchamp# 10b1e6c4c3SAnatolij Gustschin# Refer doc/README.kwbimage for more details about how-to configure 1168d6963cSValentin Longchamp# and create kirkwood boot image 1268d6963cSValentin Longchamp# 1368d6963cSValentin Longchamp 1468d6963cSValentin Longchamp# Boot Media configurations 1568d6963cSValentin LongchampBOOT_FROM spi # Boot from SPI flash 1668d6963cSValentin Longchamp 1768d6963cSValentin LongchampDATA 0xFFD10000 0x01112222 # MPP Control 0 Register 1868d6963cSValentin Longchamp# bit 3-0: MPPSel0 2, NF_IO[2] 1968d6963cSValentin Longchamp# bit 7-4: MPPSel1 2, NF_IO[3] 2068d6963cSValentin Longchamp# bit 12-8: MPPSel2 2, NF_IO[4] 2168d6963cSValentin Longchamp# bit 15-12: MPPSel3 2, NF_IO[5] 2268d6963cSValentin Longchamp# bit 19-16: MPPSel4 1, NF_IO[6] 2368d6963cSValentin Longchamp# bit 23-20: MPPSel5 1, NF_IO[7] 2468d6963cSValentin Longchamp# bit 27-24: MPPSel6 1, SYSRST_O 2568d6963cSValentin Longchamp# bit 31-28: MPPSel7 0, GPO[7] 2668d6963cSValentin Longchamp 2768d6963cSValentin LongchampDATA 0xFFD10004 0x03303300 2868d6963cSValentin Longchamp 2968d6963cSValentin LongchampDATA 0xFFD10008 0x00001100 # MPP Control 2 Register 3068d6963cSValentin Longchamp# bit 3-0: MPPSel16 0, GPIO[16] 3168d6963cSValentin Longchamp# bit 7-4: MPPSel17 0, GPIO[17] 3268d6963cSValentin Longchamp# bit 12-8: MPPSel18 1, NF_IO[0] 3368d6963cSValentin Longchamp# bit 15-12: MPPSel19 1, NF_IO[1] 3468d6963cSValentin Longchamp# bit 19-16: MPPSel20 0, GPIO[20] 3568d6963cSValentin Longchamp# bit 23-20: MPPSel21 0, GPIO[21] 3668d6963cSValentin Longchamp# bit 27-24: MPPSel22 0, GPIO[22] 3768d6963cSValentin Longchamp# bit 31-28: MPPSel23 0, GPIO[23] 3868d6963cSValentin Longchamp 3968d6963cSValentin LongchampDATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register 4068d6963cSValentin LongchampDATA 0xFFD20134 0x66666666 # L2 RAM Timing 0 Register 4168d6963cSValentin LongchampDATA 0xFFD20138 0x66666666 # L2 RAM Timing 1 Register 422472216cSHolger Brunck 432472216cSHolger Brunck# NOTE: Don't write on 0x20148 , 0x2014c and 0x20154, leave them untouched! 442472216cSHolger Brunck# If not it could cause KW Exceptions during boot in Fast Corners/High Voltage 4568d6963cSValentin Longchamp 4668d6963cSValentin Longchamp#Dram initalization 4768d6963cSValentin LongchampDATA 0xFFD01400 0x430004E0 # SDRAM Configuration Register 4868d6963cSValentin Longchamp# bit13-0: 0x4E0 (DDR2 clks refresh rate) 4968d6963cSValentin Longchamp# bit23-14: zero 5068d6963cSValentin Longchamp# bit24: 1= enable exit self refresh mode on DDR access 5168d6963cSValentin Longchamp# bit25: 1 required 5268d6963cSValentin Longchamp# bit29-26: zero 5368d6963cSValentin Longchamp# bit31-30: 01 5468d6963cSValentin Longchamp 5568d6963cSValentin LongchampDATA 0xFFD01404 0x38543000 # DDR Controller Control Low 5668d6963cSValentin Longchamp# bit 3-0: 0 reserved 5768d6963cSValentin Longchamp# bit 4: 0=addr/cmd in smame cycle 5868d6963cSValentin Longchamp# bit 5: 0=clk is driven during self refresh, we don't care for APX 5968d6963cSValentin Longchamp# bit 6: 0=use recommended falling edge of clk for addr/cmd 6068d6963cSValentin Longchamp# bit14: 0=input buffer always powered up 6168d6963cSValentin Longchamp# bit18: 1=cpu lock transaction enabled 6268d6963cSValentin Longchamp# bit23-20: 5=recommended value for CL=4 and STARTBURST_DEL disabled bit31=0 6368d6963cSValentin Longchamp# bit27-24: 8= CL+4, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM 6468d6963cSValentin Longchamp# bit30-28: 3 required 6568d6963cSValentin Longchamp# bit31: 0=no additional STARTBURST delay 6668d6963cSValentin Longchamp 6768d6963cSValentin LongchampDATA 0xFFD01408 0x2302433E # DDR Timing (Low) (active cycles value +1) 6868d6963cSValentin Longchamp# bit3-0: TRAS lsbs 6968d6963cSValentin Longchamp# bit7-4: TRCD 7068d6963cSValentin Longchamp# bit11- 8: TRP 7168d6963cSValentin Longchamp# bit15-12: TWR 7268d6963cSValentin Longchamp# bit19-16: TWTR 7368d6963cSValentin Longchamp# bit20: TRAS msb 7468d6963cSValentin Longchamp# bit23-21: 0x0 7568d6963cSValentin Longchamp# bit27-24: TRRD 7668d6963cSValentin Longchamp# bit31-28: TRTP 7768d6963cSValentin Longchamp 7868d6963cSValentin LongchampDATA 0xFFD0140C 0x00000A3E # DDR Timing (High) 7968d6963cSValentin Longchamp# bit6-0: TRFC 8068d6963cSValentin Longchamp# bit8-7: TR2R 8168d6963cSValentin Longchamp# bit10-9: TR2W 8268d6963cSValentin Longchamp# bit12-11: TW2W 8368d6963cSValentin Longchamp# bit31-13: zero required 8468d6963cSValentin Longchamp 8568d6963cSValentin LongchampDATA 0xFFD01410 0x00000001 # DDR Address Control 8668d6963cSValentin Longchamp# bit1-0: 01, Cs0width=x16 8768d6963cSValentin Longchamp# bit3-2: 00, Cs0size=2Gb 8868d6963cSValentin Longchamp# bit5-4: 00, Cs2width=nonexistent 8968d6963cSValentin Longchamp# bit7-6: 00, Cs1size =nonexistent 9068d6963cSValentin Longchamp# bit9-8: 00, Cs2width=nonexistent 9168d6963cSValentin Longchamp# bit11-10: 00, Cs2size =nonexistent 9268d6963cSValentin Longchamp# bit13-12: 00, Cs3width=nonexistent 9368d6963cSValentin Longchamp# bit15-14: 00, Cs3size =nonexistent 9468d6963cSValentin Longchamp# bit16: 0, Cs0AddrSel 9568d6963cSValentin Longchamp# bit17: 0, Cs1AddrSel 9668d6963cSValentin Longchamp# bit18: 0, Cs2AddrSel 9768d6963cSValentin Longchamp# bit19: 0, Cs3AddrSel 9868d6963cSValentin Longchamp# bit31-20: 0 required 9968d6963cSValentin Longchamp 10068d6963cSValentin LongchampDATA 0xFFD01414 0x00000000 # DDR Open Pages Control 10168d6963cSValentin Longchamp# bit0: 0, OpenPage enabled 10268d6963cSValentin Longchamp# bit31-1: 0 required 10368d6963cSValentin Longchamp 10468d6963cSValentin LongchampDATA 0xFFD01418 0x00000000 # DDR Operation 10568d6963cSValentin Longchamp# bit3-0: 0x0, DDR cmd 10668d6963cSValentin Longchamp# bit31-4: 0 required 10768d6963cSValentin Longchamp 10868d6963cSValentin LongchampDATA 0xFFD0141C 0x00000652 # DDR Mode 10968d6963cSValentin LongchampDATA 0xFFD01420 0x00000006 # DDR Extended Mode 11068d6963cSValentin Longchamp# bit0: 0, DDR DLL enabled 11168d6963cSValentin Longchamp# bit1: 1, DDR drive strenght reduced 11268d6963cSValentin Longchamp# bit2: 1, DDR ODT control lsd disabled 11368d6963cSValentin Longchamp# bit5-3: 000, required 11468d6963cSValentin Longchamp# bit6: 0, DDR ODT control msb disabled 11568d6963cSValentin Longchamp# bit9-7: 000, required 11668d6963cSValentin Longchamp# bit10: 0, differential DQS enabled 11768d6963cSValentin Longchamp# bit11: 0, required 11868d6963cSValentin Longchamp# bit12: 0, DDR output buffer enabled 11968d6963cSValentin Longchamp# bit31-13: 0 required 12068d6963cSValentin Longchamp 12168d6963cSValentin LongchampDATA 0xFFD01424 0x0000F17F # DDR Controller Control High 12268d6963cSValentin Longchamp# bit2-0: 111, required 12368d6963cSValentin Longchamp# bit3 : 1 , MBUS Burst Chop disabled 12468d6963cSValentin Longchamp# bit6-4: 111, required 12568d6963cSValentin Longchamp# bit7 : 0 12668d6963cSValentin Longchamp# bit8 : 1 , add a sample stage 12768d6963cSValentin Longchamp# bit9 : 0 , no half clock cycle addition to dataout 12868d6963cSValentin Longchamp# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals 12968d6963cSValentin Longchamp# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh 13068d6963cSValentin Longchamp# bit15-12: 1111 required 13168d6963cSValentin Longchamp# bit31-16: 0 required 13268d6963cSValentin Longchamp 13368d6963cSValentin LongchampDATA 0xFFD01428 0x00084520 # DDR2 SDRAM Timing Low 13468d6963cSValentin Longchamp# bit3-0 : 0000, required 13568d6963cSValentin Longchamp# bit7-4 : 0010, M_ODT assertion 2 cycles after read 136e947cbc9SHolger Brunck# bit11-8 : 0101, M_ODT de-assertion 5 cycles after read 13768d6963cSValentin Longchamp# bit15-12: 0100, internal ODT assertion 4 cycles after read 13868d6963cSValentin Longchamp# bit19-16: 1000, internal ODT de-assertion 8 cycles after read 13968d6963cSValentin Longchamp# bit31-20: 0 , required 14068d6963cSValentin Longchamp 14168d6963cSValentin LongchampDATA 0xFFD0147c 0x00008451 # DDR2 SDRAM Timing High 14268d6963cSValentin Longchamp# bit3-0 : 0001, M_ODT assertion same cycle as write 14368d6963cSValentin Longchamp# bit7-4 : 0101, M_ODT de-assertion x cycles after write 14468d6963cSValentin Longchamp# bit11-8 : 0100, internal ODT assertion x cycles after write 14568d6963cSValentin Longchamp# bit15-12: 1000, internal ODT de-assertion x cycles after write 14668d6963cSValentin Longchamp 14768d6963cSValentin LongchampDATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 14868d6963cSValentin LongchampDATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size 14968d6963cSValentin Longchamp# bit0: 1, Window enabled 15068d6963cSValentin Longchamp# bit1: 0, Write Protect disabled 15168d6963cSValentin Longchamp# bit3-2: 00, CS0 hit selected 15268d6963cSValentin Longchamp# bit23-4: ones, required 15368d6963cSValentin Longchamp# bit31-24: 0x0F, Size (i.e. 256MB) 15468d6963cSValentin Longchamp 15568d6963cSValentin LongchampDATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled 15668d6963cSValentin LongchampDATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled 15768d6963cSValentin LongchampDATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled 15868d6963cSValentin Longchamp 15968d6963cSValentin LongchampDATA 0xFFD01494 0x00010000 # DDR ODT Control (Low) 16068d6963cSValentin Longchamp# bit3-0: 0, ODT0Rd, MODT[0] not asserted during read from DRAM CS0 16168d6963cSValentin Longchamp# bit19-16:1, ODT0Wr, MODT[0] asserted during write to DRAM CS0 16268d6963cSValentin Longchamp 16368d6963cSValentin LongchampDATA 0xFFD01498 0x00000000 # DDR ODT Control (High) 16468d6963cSValentin Longchamp# bit1-0: 00, ODT0 controlled by ODT Control (low) register above 16568d6963cSValentin Longchamp# bit3-2: 00, ODT1 controlled by register 16668d6963cSValentin Longchamp# bit31-4: zero, required 16768d6963cSValentin Longchamp 16868d6963cSValentin LongchampDATA 0xFFD0149C 0x0000F801 # CPU ODT Control 16968d6963cSValentin Longchamp# bit3-0: 1, ODT0Rd, Internal ODT asserted during read from DRAM bank0 17068d6963cSValentin Longchamp# bit7-4: 0, ODT0Wr, Internal ODT not asserted during write to DRAM bank0 17168d6963cSValentin Longchamp# bit9-8: 0, ODTEn, controlled by ODT0Rd and ODT0Wr 17268d6963cSValentin Longchamp# bit11-10:2, DQ_ODTSel. ODT select turned on, 75 ohm 17368d6963cSValentin Longchamp# bit13-12:3, STARTBURST ODT buffer selected, 50 ohm 17468d6963cSValentin Longchamp# bit14 :1, STARTBURST ODT enabled 17568d6963cSValentin Longchamp# bit15 :1, Use ODT Block 17668d6963cSValentin Longchamp 17768d6963cSValentin LongchampDATA 0xFFD01480 0x00000001 # DDR Initialization Control 17868d6963cSValentin Longchamp# bit0=1, enable DDR init upon this register write 17968d6963cSValentin Longchamp 18068d6963cSValentin Longchamp# End of Header extension 18168d6963cSValentin LongchampDATA 0x0 0x0 182