Hello Georg,
i'm using the following code during setup of the fsys and check the D3 of the SYNSR if the PLL is locked. the system will boot if i set the fsys to 100MHz, 125MHz or 150MHz while it hanged (at the point when the system tried to load the data from the NOR Flash to the DDR SDRAM) if i set it to 50MHz or 25MHz. and, indeed, i tried this in the M5275EVB.
void cpu_init_f (void)
{
unsigned long *aux = (unsigned long *) (MCFSIM_SYNSR);
/* Disable Software Watchdog Timer */
mbar_writeShort(MCFSIM_WDT_WCR, 0x0000);
/* Set PLL */
// mbar_writeLong(MCFSIM_SYNCR, 0x01000000); /* 150 MHz clock */
// mbar_writeLong(MCFSIM_SYNCR, 0x03080000); /* 125 MHz clock */
// mbar_writeLong(MCFSIM_SYNCR, 0x00000000); /* 100 MHz clock */
mbar_writeLong(MCFSIM_SYNCR, 0x00080000); /* 50 MHz clock */
// mbar_writeLong(MCFSIM_SYNCR, 0x00100000); /* 25 MHz clock */
while (! ((*aux) & 0x00000008) ); /* wait for PLL lock */
/* set SCM RAMBAR */
mbar_writeLong(MCFSIM_SCM_RAMBAR, 0x20000200);
/* Set up GPIO pins for use UART 0 & 1 */
mbar_writeShort(MCFSIM_GPIO_PAR_UART, 0x3FFF);
/* Enable Ethernet pins */
mbar_writeByte(MCF_GPIO_PAR_FECI2C, CFG_FECI2C);
mbar_writeByte(MCF_GPIO_PAR_FEC0, CFG_FEC0);
/* CS0 - AMD Flash */
mbar_writeShort(MCFSIM_CSAR0,0xffe0); /* start at first MB of 2. */
mbar_writeShort(MCFSIM_CSCR0, 0x1980); /* WS=0110 (6 wait states), AA=1, PS=10 (16bit port) */
// mbar_writeLong(MCFSIM_CSMR0, 0x001f0001); /* 2MB of flash, WP=0, V=1 */
mbar_writeLong(MCFSIM_CSMR0, 0x003f000f); /* 4MB of flash, WP=0, V=1 */
/* 16-31 bits for mem size. set 8 bit for write protect. set bit 0 for valid CS */
/* Not used CSs */
mbar_writeLong(MCFSIM_CSMR1, 0x00000000);
mbar_writeLong(MCFSIM_CSMR2, 0x00000000);
mbar_writeLong(MCFSIM_CSMR3, 0x00000000);
mbar_writeLong(MCFSIM_CSMR4, 0x00000000);
mbar_writeLong(MCFSIM_CSMR5, 0x00000000);
mbar_writeLong(MCFSIM_CSMR6, 0x00000000);
mbar_writeLong(MCFSIM_CSMR7, 0x00000000);
}
Message Edited by Inky on
2007-09-28 03:08 AMMessage Edited by Inky on
2007-09-28 03:10 AM