blob: 588a99a2e65a4947ceb05b18cb1bac0fb2fc6471 [file] [log] [blame]
! dram init
!Data.Set 0xD0001400 %LONG 0x7301D453 ; DDR SDRAM Configuration Register
SET VAL /SIZE=LONG 0xD0001400 = 0x7301D453
!Data.Set 0xD0001404 %LONG 0x3630B840 ; Dunit Control Low Register
SET VAL /SIZE=LONG 0xD0001404 = 0x3630B840
!Data.Set 0xD0001408 %LONG 0x5415A998 ; DDR SDRAM Timing (Low) Register
SET VAL /SIZE=LONG 0xD0001408 = 0x5415A998
!Data.Set 0xD000140C %LONG 0x36000C6A ; DDR SDRAM Timing (High) Register
SET VAL /SIZE=LONG 0xD000140C = 0x36000C6A
!Data.Set 0xD0001410 %LONG 0x04000000 ; DDR SDRAM Address Control Register
SET VAL /SIZE=LONG 0xD0001410 = 0x04000000
!Data.Set 0xD0001414 %LONG 0x00000000 ; DDR SDRAM Open Pages Control Register
SET VAL /SIZE=LONG 0xD0001414 = 0x00000000
!Data.Set 0xD0001418 %LONG 0x00000E00 ; DDR SDRAM Operation Register
SET VAL /SIZE=LONG 0xD0001418 = 0x00000E00
!Data.Set 0xD000141C %LONG 0x00000672 ; DDR SDRAM Mode Register
SET VAL /SIZE=LONG 0xD000141C = 0x00000672
!Data.Set 0xD0001420 %LONG 0x00000004 ; DDR SDRAM Extended Mode Register
SET VAL /SIZE=LONG 0xD0001420 = 0x00000004
!Data.Set 0xD0001424 %LONG 0x0100D1FF ; Dunit Control High Register ( 2 :1 - bits 15:12 = 0xD )
SET VAL /SIZE=LONG 0xD0001424 = 0x0100D1FF
!Data.Set 0xD0001428 %LONG 0x000F8830 ; Dunit Control High Register
SET VAL /SIZE=LONG 0xD0001428 = 0x000F8830
!Data.Set 0xD000142C %LONG 0x214C2F38 ; Dunit Control High Register ( 2:1 - bit 29 = '1' )
SET VAL /SIZE=LONG 0xD000142C = 0x214C2F38
!Data.Set 0xD000147C %LONG 0x0000C871 ;
SET VAL /SIZE=LONG 0xD000147C = 0x0000C871
! 2:1
!Data.Set 0xD00014A8 %LONG 0x00000100 ; DSMP "101"
SET VAL /SIZE=LONG 0xD00014A8 = 0x00000100
!Data.Set 0xD0020220 %LONG 0x00000006 ; DSMP 7
SET VAL /SIZE=LONG 0xD0020220 = 0x00000006
!Data.Set 0xD0001494 %LONG 0x00010000 ; DDR SDRAM ODT Control (Low) Register
SET VAL /SIZE=LONG 0xD0001494 = 0x00010000
!Data.Set 0xD0001498 %LONG 0x00000000 ; DDR SDRAM ODT Control (High) Register
SET VAL /SIZE=LONG 0xD0001498 = 0x00000000
!Data.Set 0xD000149C %LONG 0x00000001 ; DDR Dunit ODT Control Register
SET VAL /SIZE=LONG 0xD000149C = 0x00000001
! First work with Mbus DRAM window at DRAM Init - 256MB in default
!Data.Set 0xD00200EC %LONG 0x00000000
SET VAL /SIZE=LONG 0xD00200EC = 0x00000000
!Data.Set 0xD00200E8 %LONG 0x1FFF0E00
SET VAL /SIZE=LONG 0xD00200E8 = 0x1FFF0E00
!Data.Set 0xD0020184 %LONG 0x1FFFFFE1
SET VAL /SIZE=LONG 0xD0020184 = 0x1FFFFFE1
! Those registers should not be connected in this device, so just to be sure we will Zero them
!Data.Set 0xD0001504 %LONG 0x1FFFFFF1 ;
SET VAL /SIZE=LONG 0xD0001504 = 0x1FFFFFF1
!Data.Set 0xD000150C %LONG 0x00000000 ; CS[1]n Size Register
SET VAL /SIZE=LONG 0xD000150C = 0x00000000
!Data.Set 0xD0001514 %LONG 0x00000000 ; CS[2]n Size Register
SET VAL /SIZE=LONG 0xD0001514 = 0x00000000
!Data.Set 0xD000151C %LONG 0x00000000 ; CS[3]n Size Register
SET VAL /SIZE=LONG 0xD000151C = 0x00000000
!Data.Set 0xD0001524 %LONG 0x0000C800 ; DDR I/O register
SET VAL /SIZE=LONG 0xD0001524 = 0x0000C800
!Data.Set 0xD0001538 %LONG 0x0000000B ; Read Data Sample Delays Register
SET VAL /SIZE=LONG 0xD0001538 = 0x0000000B
!Data.Set 0xD000153C %LONG 0x0000000D ; Read Data Ready Delay Register
SET VAL /SIZE=LONG 0xD000153C = 0x0000000D
!Data.Set 0xD00015D0 %LONG 0x00000A50 ; MR0
SET VAL /SIZE=LONG 0xD00015D0 = 0x00000A50
!Data.Set 0xD00015D4 %LONG 0x00008044 ; MR1
SET VAL /SIZE=LONG 0xD00015D4 = 0x00008044
!Data.Set 0xD00015D8 %LONG 0x00010210 ; MR2
SET VAL /SIZE=LONG 0xD00015D8 = 0x00010210
!Data.Set 0xD00015DC %LONG 0x00018000 ; MR3
SET VAL /SIZE=LONG 0xD00015DC = 0x00018000
!Data.Set 0xD00015E4 %LONG 0x00203C18; ZQC Configuration Register
SET VAL /SIZE=LONG 0xD00015E4 = 0x00203C18
!Data.Set 0xD00015EC %LONG 0xF800AA25; DDR PHY
SET VAL /SIZE=LONG 0xD00015EC = 0xF800AA25
DEFINE SYMBOL /TYPE="unsigned int" /ADDRESS=0xD00016A0 PrfaReq
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!;read leveling values
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!;PUP RdSampleDly (+CL) Phase RL ADLL value
!;0 2 1 3
!Data.Set 0xD00016A0 %LONG 0xC0020103
SET VAL /SIZE=LONG 0xD00016A0 = 0xC0020103
!&status=Data.Long(SD:0xD00016A0)
!&status=&status&(1<<31)
!WHILE (&status>0)
!(
! &status=Data.Long(SD:0xD00016A0)
! &status=&status&(1<<31)
!)
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;1 2 0 18
!Data.Set 0xD00016A0 %LONG 0xC0420012
SET VAL /SIZE=LONG 0xD00016A0 = 0xC0420012
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;2 2 1 19
!Data.Set 0xD00016A0 %LONG 0xC0820113
SET VAL /SIZE=LONG 0xD00016A0 = 0xC0820113
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;3 2 0 18
!Data.Set 0xD00016A0 %LONG 0xC0C20012
SET VAL /SIZE=LONG 0xD00016A0 = 0xC0C20012
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;4 2 1 0
!Data.Set 0xD00016A0 %LONG 0xC1020100
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1020100
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;5 2 0 22
!Data.Set 0xD00016A0 %LONG 0xC1420016
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1420016
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;6 2 1 9
!Data.Set 0xD00016A0 %LONG 0xC1820109
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1820109
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;7 2 0 16
!Data.Set 0xD00016A0 %LONG 0xC1C20010
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1C20010
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;8 2 0 28
!Data.Set 0xD00016A0 %LONG 0xC2020112
SET VAL /SIZE=LONG 0xD00016A0 = 0xC2020112
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!;write leveling values
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!;PUP
!;0
!Data.Set 0xD00016A0 %LONG 0xC000B11F
SET VAL /SIZE=LONG 0xD00016A0 = 0xC000B11F
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;1
!Data.Set 0xD00016A0 %LONG 0xC040690D
SET VAL /SIZE=LONG 0xD00016A0 = 0xC040690D
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;2
!Data.Set 0xD00016A0 %LONG 0xC0803600
SET VAL /SIZE=LONG 0xD00016A0 = 0xC0803600
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;3
!Data.Set 0xD00016A0 %LONG 0xC0C0A81D
SET VAL /SIZE=LONG 0xD00016A0 = 0xC0C0A81D
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;4
!Data.Set 0xD00016A0 %LONG 0xC1009919
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1009919
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;5
!Data.Set 0xD00016A0 %LONG 0xC1407911
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1407911
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;6
!Data.Set 0xD00016A0 %LONG 0xC180AD1E
SET VAL /SIZE=LONG 0xD00016A0 = 0xC180AD1E
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;7
!Data.Set 0xD00016A0 %LONG 0xC1C04D06
SET VAL /SIZE=LONG 0xD00016A0 = 0xC1C04D06
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;8
!Data.Set 0xD00016A0 %LONG 0xC2008514
SET VAL /SIZE=LONG 0xD00016A0 = 0xC2008514
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!; center DQS on read cycle
!Data.Set 0xD00016A0 %LONG 0xC803000F
SET VAL /SIZE=LONG 0xD00016A0 = 0xC803000F
WHILE PrfaReq & 0x80000000 THEN
TCI DELAY 1
END
!Data.Set 0xD0001480 %LONG 0x00000001 ; DDR SDRAM Initialization Control Register
SET VAL /SIZE=LONG 0xD0001480 = 0x00000001
!WAIT 1.s
TCI DELAY 1000
PRINT "DDR3 Init Done!\n"