Intel
®
81341 and 81342—DDR SDRAM Memory Controller
Intel
®
81341 and 81342 I/O Processors
Developer’s Manual
December 2007
670
Order Number: 315037-002US
/* Compute Optimum DLLRCVER Value by moving DLLRCVEREN delay back
by MCLK/4 to be in the pre-ample window */
dllrcver_value -= 16;
/* Make sure we don't go below zero */
if(dllrcver_value < 0)
dllrcver_value = 0;
/* Write new DLLRCVER value */
treg = *MCU_DLLRCVER & (1<<16);
fine = (dllrcver_value & 0x1f);
coarse = ((dllrcver_value >> 5) & 0x7);
*MCU_DLLRCVER = ( treg | (coarse << 8) | fine );
/* Reset the MCU FIFOs */
sdcr0_val = *(MCU_SDCR0);
*(MCU_SDCR0) = sdcr0_val &~ (1<<7); /* Clear Reset FIFO bit */
*(MCU_SDCR0) = sdcr0_val | (1<<7); /* Set Reset FIFO bit */
return 0;
} // End Algorithm
/* Sample DQS Procedure */
sample_dqs(dllval)
{
unsigned int treg, fine, coarse, val;
volatile unsigned int *ddr_mem_addr = 0; /* Pick a DDR addr */
treg = *MCU_DLLRCVER & (1<<16);
fine = (dllval & 0x1f);
coarse = ((dllval >> 5) & 0x7);