1. 程式人生 > 其它 >41. DDR2記憶體初始化程式碼分析-4

41. DDR2記憶體初始化程式碼分析-4

技術標籤:U-boot

	//step 2: PhyControl0 DLL on      //開啟PhyControl0的總開關
	ldr	r1, =0x00101002					
	str	r1, [r0, #DMC_PHYCONTROL0]

開啟待機開關

	//step 4: PhyControl0 DLL start   //代開待機開關
	ldr	r1, =0x00101003					
	str	r1, [r0, #DMC_PHYCONTROL0]

DLL此時開始啟動/全部開啟.真正可用,要等到DLL完全穩定才可以。下面就是等待DLL鎖定,等待同步完成的程式碼

find_lock_val:
	//Loop until DLL is locked
	ldr	r1, [r0, #DMC_PHYSTATUS]			
	and	r2, r1, #0x7
	cmp	r2, #0x7					
	bne	find_lock_val

	//Force Value locking
	and	r1, #0x3fc0
	mov	r2, r1, LSL #18
	orr	r2, r2, #0x100000
	orr	r2 ,r2, #0x1000
	orr	r1, r2, #0x3					
	str	r1, [r0, #DMC_PHYCONTROL0]

該程式碼的執行並沒有完全follow手冊裡面的步驟,而是把第12步提到第5步之前去執行。