Modify MPC85xx CPU files for MPC8544DS board port.
PATCH 3/4 Modify MPC85xx CPU files for MPC8544DS board port.
Recognize new SVR values, add a few register definitions, and add a few new sysclk cases.
Make some DDR biasing configurations apply only to 8548. Allow for skipping DDR initialization if it is already done.
Signed-off-by Ed Swarthout <[email protected]>
Signed-off-by Jon Loeliger <[email protected]>
--- cpu/mpc85xx/cpu.c | 33 ++++++++++++++++------ cpu/mpc85xx/spd_sdram.c | 68 +++++++++++++++++++++++++++++++++++++++++----- cpu/mpc85xx/speed.c | 27 +++++++++++++++--- 3 files changed, 106 insertions(+), 22 deletions(-)
cpu/mpc85xx/cpu.c +24 -9
@@ -1,5 +1,5 @@/* -* Copyright 2004 Freescale Semiconductor. +* Copyright 2004,2007 Freescale Semiconductor, Inc. * (C) Copyright 2002, 2003 Motorola Inc. * Xianghua Xiao (X.Xiao at motorola.com) *
@@ -70,6 +70,12 @@ int checkcpu (void)case SVR_8548_E :puts ("8548_E" );break ; +case SVR_8544 : +puts ("8544" ); +break ; +case SVR_8544_E : +puts ("8544_E" ); +break ;default :puts ("Unknown" );break ;
@@ -112,7 +118,7 @@ int checkcpu (void)#endif clkdiv = lcrr &0x0f ;if (clkdiv ==2 || clkdiv ==4 || clkdiv ==8 ) { -#ifdef CONFIG_MPC8548 +#if defined(CONFIG_MPC8548 ) || defined(CONFIG_MPC8544 )/* * Yes, the entire PQ38 family use the same * bit-representation for twice the clock divider values.
@@ -183,9 +189,9 @@ reset_85xx_watchdog(void)* Clear TSR(WIS) bit by writing 1 */ unsigned long val; - val =mfspr (tsr); - val |=0x40000000 ; - mtspr(tsr, val); + val =mfspr (SPRN_TSR ); + val |=TSR_WIS ; + mtspr(SPRN_TSR, val); }#endif /* CONFIG_WATCHDOG */
@@ -196,6 +202,7 @@ void dma_init(void) { dma->satr0 =0x02c40000 ; dma->datr0 =0x02c40000 ; + dma->sr0 =0xfffffff ;/* clear any errors */ asm("sync; isync; msync" );return ; }
@@ -210,6 +217,10 @@ uint dma_check(void) { status = dma->sr0; } +/* clear MR0[CS] channel start bit */ + dma->mr0 &=0x00000001 ; + asm("sync;isync;msync" ); +if (status !=0 ) {printf ("DMA Error: status = %x\n" , status); }
@@ -254,22 +265,26 @@ ft_cpu_setup(void *blob, bd_t *bd) *p =cpu_to_be32 (clock);#if defined(CONFIG_MPC85XX_TSEC1 ) - p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 24000/mac-address" , &len); + p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 24000/local-mac-address" , &len); +if (p !=NULL )memcpy (p, bd->bi_enetaddr,6 );#endif #if defined(CONFIG_HAS_ETH1 ) - p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 25000/mac-address" , &len); + p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 25000/local-mac-address" , &len); +if (p !=NULL )memcpy (p, bd->bi_enet1addr,6 );#endif #if defined(CONFIG_HAS_ETH2 ) - p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 26000/mac-address" , &len); + p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 26000/local-mac-address" , &len); +if (p !=NULL )memcpy (p, bd->bi_enet2addr,6 );#endif #if defined(CONFIG_HAS_ETH3 ) - p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 27000/mac-address" , &len); + p =ft_get_prop (blob,"/" OF_SOC "/ethernet at 27000/local-mac-address" , &len); +if (p !=NULL )memcpy (p, bd->bi_enet3addr,6 );#endif
cpu/mpc85xx/spd_sdram.c +60 -8
126 lines not on this page · raw message
cpu/mpc85xx/speed.c +22 -5
@@ -1,5 +1,5 @@/* -* Copyright 2004 Freescale Semiconductor. +* Copyright 2004, 2007 Freescale Semiconductor, Inc. * (C) Copyright 2003 Motorola Inc. * Xianghua Xiao, (X.Xiao at motorola.com) *
@@ -31,27 +31,32 @@DECLARE_GLOBAL_DATA_PTR ; -/* --------------------------------------------------------------- */ -void get_sys_info (sys_info_t * sysInfo) +void get_sys_info (sys_info_t *sysInfo) { -volatile immap_t *immap = (immap_t *)CFG_IMMR ; +volatile immap_t *immap = (immap_t *)CFG_IMMR ;volatile ccsr_gur_t *gur = &immap->im_gur;uint plat_ratio,e500_ratio; plat_ratio = (gur->porpllsr) &0x0000003e ; plat_ratio >>=1 ; -switch (plat_ratio) { + +switch (plat_ratio) {case 0x02 :case 0x03 :case 0x04 :case 0x05 :case 0x06 : +case 0x07 :case 0x08 :case 0x09 :case 0x0a : +case 0x0b :case 0x0c : +case 0x0e : +case 0x0f :case 0x10 : +case 0x14 : sysInfo->freqSystemBus = plat_ratio *CONFIG_SYS_CLK_FREQ ;break ;default :
@@ -62,6 +67,12 @@ void get_sys_info (sys_info_t * sysInfo) e500_ratio = (gur->porpllsr) &0x003f0000 ; e500_ratio >>=16 ;switch (e500_ratio) { +case 0x02 : + sysInfo->freqProcessor = sysInfo->freqSystemBus; +break ; +case 0x03 : + sysInfo->freqProcessor =3 *sysInfo->freqSystemBus/2 ; +break ;case 0x04 : sysInfo->freqProcessor =2 *sysInfo->freqSystemBus;break ;
@@ -74,6 +85,12 @@ void get_sys_info (sys_info_t * sysInfo)case 0x07 : sysInfo->freqProcessor =7 *sysInfo->freqSystemBus/2 ;break ; +case 0x08 : + sysInfo->freqProcessor =4 *sysInfo->freqSystemBus; +break ; +case 0x09 : + sysInfo->freqProcessor =9 *sysInfo->freqSystemBus/2 ; +break ;default : sysInfo->freqProcessor =0 ;break ;
Signature · 1 line
1.5.0.3