138041db7SEric Cooper# 238041db7SEric Cooper# Copyright (C) 2010 Eric C. Cooper <ecc@cmu.edu> 338041db7SEric Cooper# 438041db7SEric Cooper# Based on sheevaplug/kwbimage.cfg originally written by 538041db7SEric Cooper# Prafulla Wadaskar <prafulla@marvell.com> 638041db7SEric Cooper# (C) Copyright 2009 738041db7SEric Cooper# Marvell Semiconductor <www.marvell.com> 838041db7SEric Cooper# 9*1a459660SWolfgang Denk# SPDX-License-Identifier: GPL-2.0+ 1038041db7SEric Cooper# 11b1e6c4c3SAnatolij Gustschin# Refer doc/README.kwbimage for more details about how-to configure 1238041db7SEric Cooper# and create kirkwood boot image 1338041db7SEric Cooper# 1438041db7SEric Cooper 1538041db7SEric Cooper# Boot Media configurations 1638041db7SEric CooperBOOT_FROM nand 1738041db7SEric CooperNAND_ECC_MODE default 1838041db7SEric CooperNAND_PAGE_SIZE 0x0800 1938041db7SEric Cooper 2038041db7SEric Cooper# SOC registers configuration using bootrom header extension 2138041db7SEric Cooper# Maximum KWBIMAGE_MAX_CONFIG configurations allowed 2238041db7SEric Cooper 2338041db7SEric Cooper# Configure RGMII-0 interface pad voltage to 1.8V 2438041db7SEric CooperDATA 0xFFD100e0 0x1b1b1b9b 2538041db7SEric Cooper 2638041db7SEric Cooper#Dram initalization for SINGLE x16 CL=5 @ 400MHz 2738041db7SEric CooperDATA 0xFFD01400 0x43000c30 # DDR Configuration register 2838041db7SEric Cooper# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) 2938041db7SEric Cooper# bit23-14: zero 3038041db7SEric Cooper# bit24: 1= enable exit self refresh mode on DDR access 3138041db7SEric Cooper# bit25: 1 required 3238041db7SEric Cooper# bit29-26: zero 3338041db7SEric Cooper# bit31-30: 01 3438041db7SEric Cooper 3538041db7SEric CooperDATA 0xFFD01404 0x37543000 # DDR Controller Control Low 3638041db7SEric Cooper# bit 4: 0=addr/cmd in smame cycle 3738041db7SEric Cooper# bit 5: 0=clk is driven during self refresh, we don't care for APX 3838041db7SEric Cooper# bit 6: 0=use recommended falling edge of clk for addr/cmd 3938041db7SEric Cooper# bit14: 0=input buffer always powered up 4038041db7SEric Cooper# bit18: 1=cpu lock transaction enabled 4138041db7SEric Cooper# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 4238041db7SEric Cooper# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM 4338041db7SEric Cooper# bit30-28: 3 required 4438041db7SEric Cooper# bit31: 0=no additional STARTBURST delay 4538041db7SEric Cooper 4638041db7SEric CooperDATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) 4738041db7SEric Cooper# bit3-0: TRAS lsbs 4838041db7SEric Cooper# bit7-4: TRCD 4938041db7SEric Cooper# bit11- 8: TRP 5038041db7SEric Cooper# bit15-12: TWR 5138041db7SEric Cooper# bit19-16: TWTR 5238041db7SEric Cooper# bit20: TRAS msb 5338041db7SEric Cooper# bit23-21: 0x0 5438041db7SEric Cooper# bit27-24: TRRD 5538041db7SEric Cooper# bit31-28: TRTP 5638041db7SEric Cooper 5738041db7SEric CooperDATA 0xFFD0140C 0x00000a33 # DDR Timing (High) 5838041db7SEric Cooper# bit6-0: TRFC 5938041db7SEric Cooper# bit8-7: TR2R 6038041db7SEric Cooper# bit10-9: TR2W 6138041db7SEric Cooper# bit12-11: TW2W 6238041db7SEric Cooper# bit31-13: zero required 6338041db7SEric Cooper 6438041db7SEric CooperDATA 0xFFD01410 0x0000000d # DDR Address Control 6538041db7SEric Cooper# bit1-0: 00, Cs0width=x8 6638041db7SEric Cooper# bit3-2: 11, Cs0size=1Gb 6738041db7SEric Cooper# bit5-4: 00, Cs1width=nonexistent 6838041db7SEric Cooper# bit7-6: 00, Cs1size =nonexistent 6938041db7SEric Cooper# bit9-8: 00, Cs2width=nonexistent 7038041db7SEric Cooper# bit11-10: 00, Cs2size =nonexistent 7138041db7SEric Cooper# bit13-12: 00, Cs3width=nonexistent 7238041db7SEric Cooper# bit15-14: 00, Cs3size =nonexistent 7338041db7SEric Cooper# bit16: 0, Cs0AddrSel 7438041db7SEric Cooper# bit17: 0, Cs1AddrSel 7538041db7SEric Cooper# bit18: 0, Cs2AddrSel 7638041db7SEric Cooper# bit19: 0, Cs3AddrSel 7738041db7SEric Cooper# bit31-20: 0 required 7838041db7SEric Cooper 7938041db7SEric CooperDATA 0xFFD01414 0x00000000 # DDR Open Pages Control 8038041db7SEric Cooper# bit0: 0, OpenPage enabled 8138041db7SEric Cooper# bit31-1: 0 required 8238041db7SEric Cooper 8338041db7SEric CooperDATA 0xFFD01418 0x00000000 # DDR Operation 8438041db7SEric Cooper# bit3-0: 0x0, DDR cmd 8538041db7SEric Cooper# bit31-4: 0 required 8638041db7SEric Cooper 8738041db7SEric CooperDATA 0xFFD0141C 0x00000C52 # DDR Mode 8838041db7SEric Cooper# bit2-0: 2, BurstLen=2 required 8938041db7SEric Cooper# bit3: 0, BurstType=0 required 9038041db7SEric Cooper# bit6-4: 4, CL=5 9138041db7SEric Cooper# bit7: 0, TestMode=0 normal 9238041db7SEric Cooper# bit8: 0, DLL reset=0 normal 9338041db7SEric Cooper# bit11-9: 6, auto-precharge write recovery ???????????? 9438041db7SEric Cooper# bit12: 0, PD must be zero 9538041db7SEric Cooper# bit31-13: 0 required 9638041db7SEric Cooper 9738041db7SEric CooperDATA 0xFFD01420 0x00000040 # DDR Extended Mode 9838041db7SEric Cooper# bit0: 0, DDR DLL enabled 9938041db7SEric Cooper# bit1: 0, DDR drive strenght normal 10038041db7SEric Cooper# bit2: 0, DDR ODT control lsd (disabled) 10138041db7SEric Cooper# bit5-3: 000, required 10238041db7SEric Cooper# bit6: 1, DDR ODT control msb, (disabled) 10338041db7SEric Cooper# bit9-7: 000, required 10438041db7SEric Cooper# bit10: 0, differential DQS enabled 10538041db7SEric Cooper# bit11: 0, required 10638041db7SEric Cooper# bit12: 0, DDR output buffer enabled 10738041db7SEric Cooper# bit31-13: 0 required 10838041db7SEric Cooper 10938041db7SEric CooperDATA 0xFFD01424 0x0000F17F # DDR Controller Control High 11038041db7SEric Cooper# bit2-0: 111, required 11138041db7SEric Cooper# bit3 : 1 , MBUS Burst Chop disabled 11238041db7SEric Cooper# bit6-4: 111, required 11338041db7SEric Cooper# bit7 : 0 11438041db7SEric Cooper# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz 11538041db7SEric Cooper# bit9 : 0 , no half clock cycle addition to dataout 11638041db7SEric Cooper# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals 11738041db7SEric Cooper# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh 11838041db7SEric Cooper# bit15-12: 1111 required 11938041db7SEric Cooper# bit31-16: 0 required 12038041db7SEric Cooper 12138041db7SEric CooperDATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) 12238041db7SEric CooperDATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) 12338041db7SEric Cooper 12438041db7SEric CooperDATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 12538041db7SEric CooperDATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size 12638041db7SEric Cooper# bit0: 1, Window enabled 12738041db7SEric Cooper# bit1: 0, Write Protect disabled 12838041db7SEric Cooper# bit3-2: 00, CS0 hit selected 12938041db7SEric Cooper# bit23-4: ones, required 13038041db7SEric Cooper# bit31-24: 0x07, Size (i.e. 128MB) 13138041db7SEric Cooper 13238041db7SEric CooperDATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb 13338041db7SEric CooperDATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled 13438041db7SEric Cooper 13538041db7SEric CooperDATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled 13638041db7SEric CooperDATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled 13738041db7SEric Cooper 13838041db7SEric CooperDATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) 13938041db7SEric CooperDATA 0xFFD01498 0x00000000 # DDR ODT Control (High) 14038041db7SEric Cooper# bit1-0: 00, ODT0 controlled by ODT Control (low) register above 14138041db7SEric Cooper# bit3-2: 01, ODT1 active NEVER! 14238041db7SEric Cooper# bit31-4: zero, required 14338041db7SEric Cooper 14438041db7SEric CooperDATA 0xFFD0149C 0x0000E803 # CPU ODT Control 14538041db7SEric CooperDATA 0xFFD01480 0x00000001 # DDR Initialization Control 14638041db7SEric Cooper#bit0=1, enable DDR init upon this register write 14738041db7SEric Cooper 14838041db7SEric Cooper# End of Header extension 14938041db7SEric CooperDATA 0x0 0x0 150