Please pull from 'mpc83xx' branch
Please pull from 'mpc83xx' branch ofgit://git.kernel.org/pub/scm/boot/u-boot/galak/u-boot.git
to receive the following updates:
cpu/mpc83xx/cpu.c | 2 - cpu/mpc83xx/cpu_init.c | 12 +++---- cpu/mpc83xx/speed.c | 12 +++---- include/asm-ppc/global_data.h | 4 +- include/asm-ppc/immap_83xx.h | 66 +++++++++++++++++++++--------------------- include/mpc83xx.h | 10 +++--- 6 files changed, 53 insertions(+), 53 deletions(-)
commit 05bdedd9ecd8819557b111b39309eb1ef9219d16
Author: Kumar Gala <[email protected]> Date: Tue Dec 5 14:35:24 2006 -0600
Fix config of Arbiter, System Priority, and Clock Mode on MPC83xx
The config value for:
* CFG_ACR_PIPE_DEP
* CFG_ACR_RPTCNT
* CFG_SPCR_TSEC1EP
* CFG_SPCR_TSEC2EP
* CFG_SCCR_TSEC1CM
* CFG_SCCR_TSEC2CM
Wasn't not being used when setting the appropriate register
commit 8a764deca0349437b6030e49fba208ec5d11ccff
Author: Kumar Gala <[email protected]> Date: Tue Dec 5 14:34:51 2006 -0600
Remove CONFIG_MPC8349 and use CONFIG_MPC834X instead
CONFIG_MPC8349 is redudant with CONFIG_MPC834X. Additionally CONFIG_MPC834X truly states the class of processors the code is applicable for.
cpu/mpc83xx/cpu.c +1 -1
@@ -97,7 +97,7 @@ int checkcpu(void)return -1 ;/* Not sure what this is */ } -#if defined(CONFIG_MPC8349 ) +#if defined(CONFIG_MPC834X )printf ("Rev: %02x at %s MHz\n" , (spridr &0x0000FFFF )>>4 |(spridr &0x0000000F ),strmhz (buf, clock));#else printf ("Rev: %02x at %s MHz\n" , spridr &0x0000FFFF ,strmhz (buf, clock));
cpu/mpc83xx/cpu_init.c +6 -6
@@ -69,31 +69,31 @@ void cpu_init_f (volatile immap_t * im)#ifdef CFG_ACR_PIPE_DEP /* Arbiter pipeline depth */ - im->arbiter.acr = (im->arbiter.acr & ~ACR_PIPE_DEP ) | (3 <<ACR_PIPE_DEP_SHIFT ); + im->arbiter.acr = (im->arbiter.acr & ~ACR_PIPE_DEP ) | (CFG_ACR_PIPE_DEP <<ACR_PIPE_DEP_SHIFT );#endif #ifdef CFG_SPCR_TSEC1EP /* TSEC1 Emergency priority */ - im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_TSEC1EP ) | (3 <<SPCR_TSEC1EP_SHIFT ); + im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_TSEC1EP ) | (CFG_SPCR_TSEC1EP <<SPCR_TSEC1EP_SHIFT );#endif #ifdef CFG_SPCR_TSEC2EP /* TSEC2 Emergency priority */ - im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_TSEC2EP ) | (3 <<SPCR_TSEC2EP_SHIFT ); + im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_TSEC2EP ) | (CFG_SPCR_TSEC2EP <<SPCR_TSEC2EP_SHIFT );#endif #ifdef CFG_SCCR_TSEC1CM /* TSEC1 clock mode */ - im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM ) | (1 <<SCCR_TSEC1CM_SHIFT ); + im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM ) | (CFG_SCCR_TSEC1CM <<SCCR_TSEC1CM_SHIFT );#endif #ifdef CFG_SCCR_TSEC2CM /* TSEC2 & I2C1 clock mode */ - im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC2CM ) | (1 <<SCCR_TSEC2CM_SHIFT ); + im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC2CM ) | (CFG_SCCR_TSEC2CM <<SCCR_TSEC2CM_SHIFT );#endif #ifdef CFG_ACR_RPTCNT /* Arbiter repeat count */ - im->arbiter.acr = ((im->arbiter.acr & ~(ACR_RPTCNT )) | (3 <<ACR_RPTCNT_SHIFT )); + im->arbiter.acr = ((im->arbiter.acr & ~(ACR_RPTCNT )) | (CFG_ACR_RPTCNT <<ACR_RPTCNT_SHIFT ));#endif /* RSR - Reset Status Register - clear all status (4.6.1.3) */
cpu/mpc83xx/speed.c +6 -6
@@ -99,7 +99,7 @@ int get_clocks(void)u32 lcrr;u32 csb_clk; -#if defined(CONFIG_MPC8349 ) +#if defined(CONFIG_MPC834X )u32 tsec1_clk;u32 tsec2_clk;u32 usbmph_clk;
@@ -144,7 +144,7 @@ #endif sccr = im->clk.sccr; -#if defined(CONFIG_MPC8349 ) +#if defined(CONFIG_MPC834X )switch ((sccr &SCCR_TSEC1CM ) >>SCCR_TSEC1CM_SHIFT ) {case 0 : tsec1_clk =0 ;
@@ -249,7 +249,7 @@ #endif/* unkown SCCR_ENCCM value */ return -6 ; } -#if defined(CONFIG_MPC8349 ) || defined(CONFIG_MPC8360 ) +#if defined(CONFIG_MPC834X ) || defined(CONFIG_MPC8360 ) lbiu_clk = csb_clk * (1 + ((im->reset.rcwl &RCWL_LBIUCM ) >>RCWL_LBIUCM_SHIFT ));#else
@@ -266,7 +266,7 @@ #endif/* unknown lcrr */ return -10 ; } -#if defined(CONFIG_MPC8349 ) || defined(CONFIG_MPC8360 ) +#if defined(CONFIG_MPC834X ) || defined(CONFIG_MPC8360 ) ddr_clk = csb_clk * (1 + ((im->reset.rcwl &RCWL_DDRCM ) >>RCWL_DDRCM_SHIFT )); corepll = (im->reset.rcwl &RCWL_COREPLL ) >>RCWL_COREPLL_SHIFT ;
@@ -314,7 +314,7 @@ #if defined (CONFIG_MPC8360)#endif gd->csb_clk = csb_clk; -#if defined(CONFIG_MPC8349 ) +#if defined(CONFIG_MPC834X ) gd->tsec1_clk = tsec1_clk; gd->tsec2_clk = tsec2_clk; gd->usbmph_clk = usbmph_clk;
@@ -364,7 +364,7 @@ #endifprintf (" SEC: %4d MHz\n" , gd->enc_clk /1000000 );printf (" I2C1: %4d MHz\n" , gd->i2c1_clk /1000000 );printf (" I2C2: %4d MHz\n" , gd->i2c2_clk /1000000 ); -#if defined(CONFIG_MPC8349 ) +#if defined(CONFIG_MPC834X )printf (" TSEC1: %4d MHz\n" , gd->tsec1_clk /1000000 );printf (" TSEC2: %4d MHz\n" , gd->tsec2_clk /1000000 );printf (" USB MPH: %4d MHz\n" , gd->usbmph_clk /1000000 );
include/asm-ppc/global_data.h +2 -2
@@ -52,12 +52,12 @@ #endif#if defined(CONFIG_MPC83XX )/* There are other clocks in the MPC83XX */ u32 csb_clk; -#if defined (CONFIG_MPC8349 ) +#if defined (CONFIG_MPC834X )u32 tsec1_clk;u32 tsec2_clk;u32 usbmph_clk;u32 usbdr_clk; -#endif /* CONFIG_MPC8349 */ +#endif /* CONFIG_MPC834X */ u32 core_clk;u32 i2c1_clk;u32 i2c2_clk;
include/asm-ppc/immap_83xx.h +33 -33
261 lines not on this page · raw message
include/mpc83xx.h +5 -5
@@ -140,7 +140,7 @@ #define BR_ATOM_SHIFT 2#endif #define BR_V 0x00000001#define BR_V_SHIFT 0 -#if defined (CONFIG_MPC8349 ) +#if defined (CONFIG_MPC834X )#define BR_RES ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)#elif defined (CONFIG_MPC8360 )#define BR_RES ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_ATOM|BR_V)
@@ -227,7 +227,7 @@ #define OR_SDRAM_EAD_SHIFT 0#define HRCWH_PCI_AGENT 0x00000000#define HRCWH_PCI_HOST 0x80000000 -#if defined (CONFIG_MPC8349 ) +#if defined (CONFIG_MPC834X )#define HRCWH_32_BIT_PCI 0x00000000#define HRCWH_64_BIT_PCI 0x40000000#endif
@@ -235,7 +235,7 @@ #endif#define HRCWH_PCI1_ARBITER_DISABLE 0x00000000#define HRCWH_PCI1_ARBITER_ENABLE 0x20000000 -#if defined (CONFIG_MPC8349 ) +#if defined (CONFIG_MPC834X )#define HRCWH_PCI2_ARBITER_DISABLE 0x00000000#define HRCWH_PCI2_ARBITER_ENABLE 0x10000000#elif defined (CONFIG_MPC8360 )
@@ -258,14 +258,14 @@ #define HRCWH_SW_WATCHDOG_ENABLE 0x0#define HRCWH_ROM_LOC_DDR_SDRAM 0x00000000#define HRCWH_ROM_LOC_PCI1 0x00100000 -#if defined (CONFIG_MPC8349 ) +#if defined (CONFIG_MPC834X )#define HRCWH_ROM_LOC_PCI2 0x00200000#endif #define HRCWH_ROM_LOC_LOCAL_8BIT 0x00500000#define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000#define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000 -#if defined (CONFIG_MPC8349 ) +#if defined (CONFIG_MPC834X )#define HRCWH_TSEC1M_IN_RGMII 0x00000000#define HRCWH_TSEC1M_IN_RTBI 0x00004000#define HRCWH_TSEC1M_IN_GMII 0x00008000
Quoted 2 lines · Kumar Gala
Please pull from 'mpc83xx' branch of
git://git.kernel.org/pub/scm/boot/u-boot/galak/u-boot.git
Unfortunately, I'm going to have to NACK one of these patches, "Fix config of Arbiter, System Priority, and Clock Mode on MPC83xx".
I just noticed the problem with this patch. It will work for the 8349ITX, but it will break the 8349EMDS and TQM834x.
cpu/mpc83xx/cpu_init.c void cpu_init_f (volatile immap_t * im) · line 88
Quoted 5 lines
#ifdef CFG_SCCR_TSEC1CM /* TSEC1 clock mode */cpu/mpc83xx/cpu_init.c +1
-1- im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM ) | (1 <<SCCR_TSEC1CM_SHIFT ); + im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM ) | (CFG_SCCR_TSEC1CM <<SCCR_TSEC1CM_SHIFT );#endif
This works as long as CFG_SCCR_TSEC1CM is between 0 and 4. But look what the MPC8349EMDS.h has:
#define CFG_SCCR_INIT (SCCR_DEFAULT & (~SCCR_CLK_MASK))
#define CFG_SCCR_TSEC1CM SCCR_TSEC1CM_1 /* TSEC1 clock setting */
#define CFG_SCCR_TSEC2CM SCCR_TSEC2CM_1 /* TSEC2 clock setting */
#define CFG_SCCR_ENCCM SCCR_ENCCM_3 /* ENC clock setting */
#define CFG_SCCR_USBCM SCCR_USBCM_3 /* USB clock setting */
#define CFG_SCCR_VAL ( CFG_SCCR_INIT \ | CFG_SCCR_TSEC1CM \ | CFG_SCCR_TSEC2CM \ | CFG_SCCR_ENCCM \ | CFG_SCCR_USBCM )
SCCR_TSEC1CM_1 is defined in mpc83xx.h:
#define SCCR_TSEC1CM_1 0x40000000
So the patch for mpc83xx/cpu_init.c needs to include changes to MPC8349EMDS.h and TQM834x.h.
But that's not the only problem. cpu_init_f() does not have any code that uses these two defines in MPC8349EMDS.h and TQM834x.h:
#define CFG_SCCR_ENCCM SCCR_ENCCM_3 /* ENC clock setting */
#define CFG_SCCR_USBCM SCCR_USBCM_3 /* USB clock setting */
Which means that currently, these bitfields aren't being set at all! If you try to load the Linux USB driver on an 8349EMDS, the driver will hang at boot time.
I'm working on follow-up patches to fix this.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
Quoted 32 lines · Timur Tabi
Quoted 2 lines · Kumar Gala
Please pull from 'mpc83xx' branch of
git://git.kernel.org/pub/scm/boot/u-boot/galak/u-boot.gitUnfortunately, I'm going to have to NACK one of these patches, "Fix config of Arbiter, System Priority, and Clock Mode on MPC83xx".
I just noticed the problem with this patch. It will work for the 8349ITX, but it will break the 8349EMDS and TQM834x.
Quoted 7 lines
#ifdef CFG_SCCR_TSEC1CM /* TSEC1 clock mode */(quoted diff) +0
-1- im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM) | (1 <<
SCCR_TSEC1CM_SHIFT);(quoted diff) +1
-0+ im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM) |(
CFG_SCCR_TSEC1CM<<SCCR_TSEC1CM_SHIFT);
#endifThis works as long as
CFG_SCCR_TSEC1CMis between 0 and 4. But look what theMPC8349EMDS.hhas:#define
CFG_SCCR_INIT(SCCR_DEFAULT& (~SCCR_CLK_MASK))
#defineCFG_SCCR_TSEC1CMSCCR_TSEC1CM_1/* TSEC1 clock setting */
#defineCFG_SCCR_TSEC2CMSCCR_TSEC2CM_1/* TSEC2 clock setting */
#defineCFG_SCCR_ENCCMSCCR_ENCCM_3/* ENC clock setting */
#defineCFG_SCCR_USBCMSCCR_USBCM_3/* USB clock setting */#define CFG_SCCR_VAL ( CFG_SCCR_INIT \ | CFG_SCCR_TSEC1CM \ | CFG_SCCR_TSEC2CM \ | CFG_SCCR_ENCCM \ | CFG_SCCR_USBCM )
Quoted 3 lines
SCCR_TSEC1CM_1is defined inmpc83xx.h:#define
SCCR_TSEC1CM_10x40000000
Ok so we need to fixup the defines of CFG_SCCR_TSEC1M/ CFG_SCCR_TSEC2CM to be set to 1 for the boards
Quoted 6 lines
So the patch for
mpc83xx/cpu_init.cneeds to include changes toMPC8349EMDS.handTQM834x.h.But that's not the only problem.
cpu_init_f()does not have any code that uses these two defines inMPC8349EMDS.handTQM834x.h:
Quoted 8 lines
#define
CFG_SCCR_ENCCMSCCR_ENCCM_3/* ENC clock setting */
#defineCFG_SCCR_USBCMSCCR_USBCM_3/* USB clock setting */Which means that currently, these bitfields aren't being set at all! If you try to load the Linux USB driver on an 8349EMDS, the driver will hang at boot time.
I'm working on follow-up patches to fix this.
Ok, I'll fix up the usage of CFG_SCCR_TSEC1M in my tree and leave the other SCCR settings to you.
- kumar
Quoted 2 lines · Kumar Gala
Ok, I'll fix up the usage of
CFG_SCCR_TSEC1Min my tree and leave the other SCCR settings to you.
Ok.
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale