|
|
|
@ -43,13 +43,11 @@ static void sdram_start (int hi_addr) |
|
|
|
|
long hi_addr_bit = hi_addr ? 0x01000000 : 0; |
|
|
|
|
|
|
|
|
|
/* unlock mode register */ |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | |
|
|
|
|
hi_addr_bit; |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit; |
|
|
|
|
__asm__ volatile ("sync"); |
|
|
|
|
|
|
|
|
|
/* precharge all banks */ |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | |
|
|
|
|
hi_addr_bit; |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit; |
|
|
|
|
__asm__ volatile ("sync"); |
|
|
|
|
|
|
|
|
|
#if SDRAM_DDR |
|
|
|
@ -63,13 +61,11 @@ static void sdram_start (int hi_addr) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* precharge all banks */ |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | |
|
|
|
|
hi_addr_bit; |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit; |
|
|
|
|
__asm__ volatile ("sync"); |
|
|
|
|
|
|
|
|
|
/* auto refresh */ |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | |
|
|
|
|
hi_addr_bit; |
|
|
|
|
*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_addr_bit; |
|
|
|
|
__asm__ volatile ("sync"); |
|
|
|
|
|
|
|
|
|
/* set mode register */ |
|
|
|
@ -181,6 +177,30 @@ void flash_preinit(void) |
|
|
|
|
|
|
|
|
|
int misc_init_f (void) |
|
|
|
|
{ |
|
|
|
|
/* Initialize GPIO output pins.
|
|
|
|
|
*/ |
|
|
|
|
/* Configure GPT as GPIO output */ |
|
|
|
|
*(vu_long *)MPC5XXX_GPT0_ENABLE = |
|
|
|
|
*(vu_long *)MPC5XXX_GPT1_ENABLE = |
|
|
|
|
*(vu_long *)MPC5XXX_GPT2_ENABLE = |
|
|
|
|
*(vu_long *)MPC5XXX_GPT3_ENABLE = |
|
|
|
|
*(vu_long *)MPC5XXX_GPT4_ENABLE = |
|
|
|
|
*(vu_long *)MPC5XXX_GPT5_ENABLE = 0x24; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Configure PSC3_6,7 as GPIO output */ |
|
|
|
|
*(vu_long *)MPC5XXX_GPIO_ENABLE |= 0x00003000; |
|
|
|
|
*(vu_long *)MPC5XXX_GPIO_DIR |= 0x00003000; |
|
|
|
|
|
|
|
|
|
/* Configure PSC3_8 as GPIO output, no interrupt */ |
|
|
|
|
*(vu_long *)MPC5XXX_GPIO_SI_ENABLE |= 0x04000000; |
|
|
|
|
*(vu_long *)MPC5XXX_GPIO_SI_DIR |= 0x04000000; |
|
|
|
|
*(vu_long *)MPC5XXX_GPIO_SI_IEN &= ~0x04000000; |
|
|
|
|
|
|
|
|
|
/* Configure PSC3_9 and GPIO_WKUP6,7 as GPIO output */ |
|
|
|
|
*(vu_long *)MPC5XXX_WU_GPIO_ENABLE |= 0xc4000000; |
|
|
|
|
*(vu_long *)MPC5XXX_WU_GPIO_DIR |= 0xc4000000; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Reset Coral-P graphics controller |
|
|
|
|
*/ |
|
|
|
|