1*83d290c5STom Rini# SPDX-License-Identifier: GPL-2.0+ 27809fbb9SPrafulla Wadaskar# 37809fbb9SPrafulla Wadaskar# (C) Copyright 2009 47809fbb9SPrafulla Wadaskar# Marvell Semiconductor <www.marvell.com> 57809fbb9SPrafulla Wadaskar# Written-by: Prafulla Wadaskar <prafulla@marvell.com> 632324b7fSKarl O. Pinc# Refer to doc/README.kwbimage for more details about how-to 732324b7fSKarl O. Pinc# configure and create kirkwood boot images. 87809fbb9SPrafulla Wadaskar# 97809fbb9SPrafulla Wadaskar 107809fbb9SPrafulla Wadaskar# Boot Media configurations 117809fbb9SPrafulla WadaskarBOOT_FROM nand 127809fbb9SPrafulla WadaskarNAND_ECC_MODE default 137809fbb9SPrafulla WadaskarNAND_PAGE_SIZE 0x0800 147809fbb9SPrafulla Wadaskar 157809fbb9SPrafulla Wadaskar# SOC registers configuration using bootrom header extension 167809fbb9SPrafulla Wadaskar# Maximum KWBIMAGE_MAX_CONFIG configurations allowed 177809fbb9SPrafulla Wadaskar 187809fbb9SPrafulla Wadaskar# Configure RGMII-0 interface pad voltage to 1.8V 197809fbb9SPrafulla WadaskarDATA 0xFFD100e0 0x1b1b1b9b 207809fbb9SPrafulla Wadaskar 217809fbb9SPrafulla Wadaskar#Dram initalization for SINGLE x16 CL=5 @ 400MHz 227809fbb9SPrafulla WadaskarDATA 0xFFD01400 0x43000c30 # DDR Configuration register 237809fbb9SPrafulla Wadaskar# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) 247809fbb9SPrafulla Wadaskar# bit23-14: zero 257809fbb9SPrafulla Wadaskar# bit24: 1= enable exit self refresh mode on DDR access 267809fbb9SPrafulla Wadaskar# bit25: 1 required 277809fbb9SPrafulla Wadaskar# bit29-26: zero 287809fbb9SPrafulla Wadaskar# bit31-30: 01 297809fbb9SPrafulla Wadaskar 307809fbb9SPrafulla WadaskarDATA 0xFFD01404 0x37543000 # DDR Controller Control Low 317809fbb9SPrafulla Wadaskar# bit 4: 0=addr/cmd in smame cycle 327809fbb9SPrafulla Wadaskar# bit 5: 0=clk is driven during self refresh, we don't care for APX 337809fbb9SPrafulla Wadaskar# bit 6: 0=use recommended falling edge of clk for addr/cmd 347809fbb9SPrafulla Wadaskar# bit14: 0=input buffer always powered up 357809fbb9SPrafulla Wadaskar# bit18: 1=cpu lock transaction enabled 367809fbb9SPrafulla Wadaskar# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 377809fbb9SPrafulla Wadaskar# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM 387809fbb9SPrafulla Wadaskar# bit30-28: 3 required 397809fbb9SPrafulla Wadaskar# bit31: 0=no additional STARTBURST delay 407809fbb9SPrafulla Wadaskar 417809fbb9SPrafulla WadaskarDATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) 427809fbb9SPrafulla Wadaskar# bit3-0: TRAS lsbs 437809fbb9SPrafulla Wadaskar# bit7-4: TRCD 447809fbb9SPrafulla Wadaskar# bit11- 8: TRP 457809fbb9SPrafulla Wadaskar# bit15-12: TWR 467809fbb9SPrafulla Wadaskar# bit19-16: TWTR 477809fbb9SPrafulla Wadaskar# bit20: TRAS msb 487809fbb9SPrafulla Wadaskar# bit23-21: 0x0 497809fbb9SPrafulla Wadaskar# bit27-24: TRRD 507809fbb9SPrafulla Wadaskar# bit31-28: TRTP 517809fbb9SPrafulla Wadaskar 527809fbb9SPrafulla WadaskarDATA 0xFFD0140C 0x00000a33 # DDR Timing (High) 537809fbb9SPrafulla Wadaskar# bit6-0: TRFC 547809fbb9SPrafulla Wadaskar# bit8-7: TR2R 557809fbb9SPrafulla Wadaskar# bit10-9: TR2W 567809fbb9SPrafulla Wadaskar# bit12-11: TW2W 577809fbb9SPrafulla Wadaskar# bit31-13: zero required 587809fbb9SPrafulla Wadaskar 59c88ed4cbSMark AsselstineDATA 0xFFD01410 0x000000cc # DDR Address Control 60c88ed4cbSMark Asselstine# bit1-0: 00, Cs0width=x8 61c88ed4cbSMark Asselstine# bit3-2: 11, Cs0size=1Gb 62c88ed4cbSMark Asselstine# bit5-4: 00, Cs1width=x8 63c88ed4cbSMark Asselstine# bit7-6: 11, Cs1size=1Gb 647809fbb9SPrafulla Wadaskar# bit9-8: 00, Cs2width=nonexistent 657809fbb9SPrafulla Wadaskar# bit11-10: 00, Cs2size =nonexistent 667809fbb9SPrafulla Wadaskar# bit13-12: 00, Cs3width=nonexistent 677809fbb9SPrafulla Wadaskar# bit15-14: 00, Cs3size =nonexistent 687809fbb9SPrafulla Wadaskar# bit16: 0, Cs0AddrSel 697809fbb9SPrafulla Wadaskar# bit17: 0, Cs1AddrSel 707809fbb9SPrafulla Wadaskar# bit18: 0, Cs2AddrSel 717809fbb9SPrafulla Wadaskar# bit19: 0, Cs3AddrSel 727809fbb9SPrafulla Wadaskar# bit31-20: 0 required 737809fbb9SPrafulla Wadaskar 747809fbb9SPrafulla WadaskarDATA 0xFFD01414 0x00000000 # DDR Open Pages Control 757809fbb9SPrafulla Wadaskar# bit0: 0, OpenPage enabled 767809fbb9SPrafulla Wadaskar# bit31-1: 0 required 777809fbb9SPrafulla Wadaskar 787809fbb9SPrafulla WadaskarDATA 0xFFD01418 0x00000000 # DDR Operation 797809fbb9SPrafulla Wadaskar# bit3-0: 0x0, DDR cmd 807809fbb9SPrafulla Wadaskar# bit31-4: 0 required 817809fbb9SPrafulla Wadaskar 827809fbb9SPrafulla WadaskarDATA 0xFFD0141C 0x00000C52 # DDR Mode 837809fbb9SPrafulla Wadaskar# bit2-0: 2, BurstLen=2 required 847809fbb9SPrafulla Wadaskar# bit3: 0, BurstType=0 required 857809fbb9SPrafulla Wadaskar# bit6-4: 4, CL=5 867809fbb9SPrafulla Wadaskar# bit7: 0, TestMode=0 normal 877809fbb9SPrafulla Wadaskar# bit8: 0, DLL reset=0 normal 887809fbb9SPrafulla Wadaskar# bit11-9: 6, auto-precharge write recovery ???????????? 897809fbb9SPrafulla Wadaskar# bit12: 0, PD must be zero 907809fbb9SPrafulla Wadaskar# bit31-13: 0 required 917809fbb9SPrafulla Wadaskar 927809fbb9SPrafulla WadaskarDATA 0xFFD01420 0x00000040 # DDR Extended Mode 937809fbb9SPrafulla Wadaskar# bit0: 0, DDR DLL enabled 947809fbb9SPrafulla Wadaskar# bit1: 0, DDR drive strenght normal 957809fbb9SPrafulla Wadaskar# bit2: 0, DDR ODT control lsd (disabled) 967809fbb9SPrafulla Wadaskar# bit5-3: 000, required 977809fbb9SPrafulla Wadaskar# bit6: 1, DDR ODT control msb, (disabled) 987809fbb9SPrafulla Wadaskar# bit9-7: 000, required 997809fbb9SPrafulla Wadaskar# bit10: 0, differential DQS enabled 1007809fbb9SPrafulla Wadaskar# bit11: 0, required 1017809fbb9SPrafulla Wadaskar# bit12: 0, DDR output buffer enabled 1027809fbb9SPrafulla Wadaskar# bit31-13: 0 required 1037809fbb9SPrafulla Wadaskar 1047809fbb9SPrafulla WadaskarDATA 0xFFD01424 0x0000F17F # DDR Controller Control High 1057809fbb9SPrafulla Wadaskar# bit2-0: 111, required 1067809fbb9SPrafulla Wadaskar# bit3 : 1 , MBUS Burst Chop disabled 1077809fbb9SPrafulla Wadaskar# bit6-4: 111, required 1087809fbb9SPrafulla Wadaskar# bit7 : 0 1097809fbb9SPrafulla Wadaskar# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz 1107809fbb9SPrafulla Wadaskar# bit9 : 0 , no half clock cycle addition to dataout 1117809fbb9SPrafulla Wadaskar# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals 1127809fbb9SPrafulla Wadaskar# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh 1137809fbb9SPrafulla Wadaskar# bit15-12: 1111 required 1147809fbb9SPrafulla Wadaskar# bit31-16: 0 required 1157809fbb9SPrafulla Wadaskar 1167809fbb9SPrafulla WadaskarDATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) 1177809fbb9SPrafulla WadaskarDATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) 1187809fbb9SPrafulla Wadaskar 1197809fbb9SPrafulla WadaskarDATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 1207809fbb9SPrafulla WadaskarDATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size 1217809fbb9SPrafulla Wadaskar# bit0: 1, Window enabled 1227809fbb9SPrafulla Wadaskar# bit1: 0, Write Protect disabled 1237809fbb9SPrafulla Wadaskar# bit3-2: 00, CS0 hit selected 1247809fbb9SPrafulla Wadaskar# bit23-4: ones, required 1257809fbb9SPrafulla Wadaskar# bit31-24: 0x0F, Size (i.e. 256MB) 1267809fbb9SPrafulla Wadaskar 1277809fbb9SPrafulla WadaskarDATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb 1287809fbb9SPrafulla WadaskarDATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 1297809fbb9SPrafulla Wadaskar 1307809fbb9SPrafulla WadaskarDATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled 1317809fbb9SPrafulla WadaskarDATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled 1327809fbb9SPrafulla Wadaskar 1337809fbb9SPrafulla WadaskarDATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) 1347809fbb9SPrafulla WadaskarDATA 0xFFD01498 0x00000000 # DDR ODT Control (High) 1357809fbb9SPrafulla Wadaskar# bit1-0: 00, ODT0 controlled by ODT Control (low) register above 1367809fbb9SPrafulla Wadaskar# bit3-2: 01, ODT1 active NEVER! 1377809fbb9SPrafulla Wadaskar# bit31-4: zero, required 1387809fbb9SPrafulla Wadaskar 1397809fbb9SPrafulla WadaskarDATA 0xFFD0149C 0x0000E803 # CPU ODT Control 1407809fbb9SPrafulla WadaskarDATA 0xFFD01480 0x00000001 # DDR Initialization Control 1417809fbb9SPrafulla Wadaskar#bit0=1, enable DDR init upon this register write 1427809fbb9SPrafulla Wadaskar 1437809fbb9SPrafulla Wadaskar# End of Header extension 1447809fbb9SPrafulla WadaskarDATA 0x0 0x0 145