Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-02-01 Thread Scott Wood
On Mon, 31 Jan 2011 22:14:45 -0500
Haiying Wang haiying.w...@freescale.com wrote:

 On Mon, 2011-01-31 at 15:28 -0600, Kumar Gala wrote:
  On Jan 31, 2011, at 2:50 PM, Haiying Wang wrote:
  
   On Mon, 2011-01-31 at 21:11 +0100, Wolfgang Denk wrote:
   
   +#ifdef CONFIG_P1021
   +   ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
   +
   +   /* QE9 and QE12 need to be set for enabling QE MII managment 
   signals */
   +   setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE9);
   +   setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE12);
   +#endif
   ...
   
   Can we please avoid having board specific code in common files?
   I wish I could, but only P1021 has such pin mux problems.
   
   If this is really necessary, it shoud be a feature-specific #define,
   not a board specific one.
   I don't know whether this *feature* will show up on other SoC. But if
   you insist, I can use CONFIG_QE_PIN_MUX.
   
   Thanks.
   
   Haiying
  
  I think pin muxing is a board level decision so it seems like board code is 
  the right place for it.
  
 If it is a one time setting, there should be no problem to put it into
 board code. But these pin settings need to be done before any usage of
 phy read/write (accessing MDIO/MDC), and need to be released after the
 usage of phy, thus the devices connected to eLBC like NAND flash/BCSR
 can be accessed. If we use board code to set/release the pin, we don't
 know when the phy access and nand flash access will happen.

Is this actually a board issue or an SoC issue?

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-02-01 Thread Haiying Wang
On Tue, 2011-02-01 at 10:50 -0600, Scott Wood wrote:
   
  If it is a one time setting, there should be no problem to put it into
  board code. But these pin settings need to be done before any usage of
  phy read/write (accessing MDIO/MDC), and need to be released after the
  usage of phy, thus the devices connected to eLBC like NAND flash/BCSR
  can be accessed. If we use board code to set/release the pin, we don't
  know when the phy access and nand flash access will happen.
 
 Is this actually a board issue or an SoC issue?
 
It is not a board issue. It is a SoC *feature*. Too many pins are muxed
on P1021. For this case, LBCTL of eLBC is muxed with QE's CE_PB[20]
which is used for MDIO signal. 

Haiying


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-02-01 Thread Kumar Gala

On Feb 1, 2011, at 11:01 AM, Haiying Wang wrote:

 On Tue, 2011-02-01 at 10:50 -0600, Scott Wood wrote:
 
 If it is a one time setting, there should be no problem to put it into
 board code. But these pin settings need to be done before any usage of
 phy read/write (accessing MDIO/MDC), and need to be released after the
 usage of phy, thus the devices connected to eLBC like NAND flash/BCSR
 can be accessed. If we use board code to set/release the pin, we don't
 know when the phy access and nand flash access will happen.
 
 Is this actually a board issue or an SoC issue?
 
 It is not a board issue. It is a SoC *feature*. Too many pins are muxed
 on P1021. For this case, LBCTL of eLBC is muxed with QE's CE_PB[20]
 which is used for MDIO signal. 
 
 Haiying
 

But its a board decision on how they want to utilize those pins and for what 
feature.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-02-01 Thread Haiying Wang
On Tue, 2011-02-01 at 13:15 -0600, Kumar Gala wrote:
 On Feb 1, 2011, at 11:01 AM, Haiying Wang wrote:
 
  On Tue, 2011-02-01 at 10:50 -0600, Scott Wood wrote:
  
  If it is a one time setting, there should be no problem to put it into
  board code. But these pin settings need to be done before any usage of
  phy read/write (accessing MDIO/MDC), and need to be released after the
  usage of phy, thus the devices connected to eLBC like NAND flash/BCSR
  can be accessed. If we use board code to set/release the pin, we don't
  know when the phy access and nand flash access will happen.
  
  Is this actually a board issue or an SoC issue?
  
  It is not a board issue. It is a SoC *feature*. Too many pins are muxed
  on P1021. For this case, LBCTL of eLBC is muxed with QE's CE_PB[20]
  which is used for MDIO signal. 
  
  Haiying
  
 
 But its a board decision on how they want to utilize those pins and for what 
 feature.

Yes, you can say that. If the board doesn't have QE UCC ETH support at
all, we won't have to add such code in QE driver. But if there is QE UCC
ETH on board, we have no choice to decide which pins to use. We
definitely need to use CE_PB[20] for MDIO signal, there is no other GPIO
pins to use for QE's MDIO.  

Haiying



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-02-01 Thread Kumar Gala

On Feb 1, 2011, at 1:46 PM, Haiying Wang wrote:

 On Tue, 2011-02-01 at 13:15 -0600, Kumar Gala wrote:
 On Feb 1, 2011, at 11:01 AM, Haiying Wang wrote:
 
 On Tue, 2011-02-01 at 10:50 -0600, Scott Wood wrote:
 
 If it is a one time setting, there should be no problem to put it into
 board code. But these pin settings need to be done before any usage of
 phy read/write (accessing MDIO/MDC), and need to be released after the
 usage of phy, thus the devices connected to eLBC like NAND flash/BCSR
 can be accessed. If we use board code to set/release the pin, we don't
 know when the phy access and nand flash access will happen.
 
 Is this actually a board issue or an SoC issue?
 
 It is not a board issue. It is a SoC *feature*. Too many pins are muxed
 on P1021. For this case, LBCTL of eLBC is muxed with QE's CE_PB[20]
 which is used for MDIO signal. 
 
 Haiying
 
 
 But its a board decision on how they want to utilize those pins and for what 
 feature.
 
 Yes, you can say that. If the board doesn't have QE UCC ETH support at
 all, we won't have to add such code in QE driver. But if there is QE UCC
 ETH on board, we have no choice to decide which pins to use. We
 definitely need to use CE_PB[20] for MDIO signal, there is no other GPIO
 pins to use for QE's MDIO.  
 
 Haiying

If that case and controlled by some CONFIG_QE_* define than we clearly can make 
the choice in non-board specific code.

- k

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-01-31 Thread Wolfgang Denk
Dear haiying.w...@freescale.com,

In message 1296499317-26616-7-git-send-email-haiying.w...@freescale.com you 
wrote:
 From: Haiying Wang haiying.w...@freescale.com
 
 P1021 has some QE pins which need to be set in pmuxcr register before using QE
 functions. In this patch, pin QE0 and QE3 are set for UCC1 and UCC5 in Eth 
 mode.
 QE9 and QE12 are set for MII management. QE12 needs to be released after MII
 access because QE12 pin is muxed with LBCTL signal.
 
 P1021MDS has to load the microcode from NAND flash, this patch defines
 misc_init_r() for loading ucode and initializing qe.
...
 diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
 index 282ab23..04d7987 100644
 --- a/drivers/qe/uec.c
 +++ b/drivers/qe/uec.c
...
 +#ifdef CONFIG_P1021
 +#define BCSR11_ENET_MICRST   0x20
 +#endif
  
  /* Default UTBIPAR SMI address */
  #ifndef CONFIG_UTBIPAR_INIT_TBIPA
 @@ -588,9 +591,25 @@ static void phy_change(struct eth_device *dev)
  {
   uec_private_t   *uec = (uec_private_t *)dev-priv;
  
 +#ifdef CONFIG_P1021
 + ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 +
 + /* QE9 and QE12 need to be set for enabling QE MII managment signals */
 + setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE9);
 + setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE12);
 +#endif
...

Can we please avoid having board specific code in common files?

If this is really necessary, it shoud be a feature-specific #define,
not a board specific one.


 @@ -425,6 +469,8 @@
  #define CONFIG_PCI_PNP /* do pci plug-and-play */
  #endif
  
 +#define CONFIG_E1000

In which way is this change related to this commit?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It is better to marry than to burn.
- Bible ``I Corinthians'' ch. 7, v. 9
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-01-31 Thread Haiying Wang
On Mon, 2011-01-31 at 21:11 +0100, Wolfgang Denk wrote:
   
  +#ifdef CONFIG_P1021
  +   ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  +
  +   /* QE9 and QE12 need to be set for enabling QE MII managment signals */
  +   setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE9);
  +   setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE12);
  +#endif
 ...
 
 Can we please avoid having board specific code in common files?
I wish I could, but only P1021 has such pin mux problems.

 If this is really necessary, it shoud be a feature-specific #define,
 not a board specific one.
I don't know whether this *feature* will show up on other SoC. But if
you insist, I can use CONFIG_QE_PIN_MUX.

Thanks.

Haiying



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-01-31 Thread Kumar Gala

On Jan 31, 2011, at 2:50 PM, Haiying Wang wrote:

 On Mon, 2011-01-31 at 21:11 +0100, Wolfgang Denk wrote:
 
 +#ifdef CONFIG_P1021
 +   ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 +
 +   /* QE9 and QE12 need to be set for enabling QE MII managment signals */
 +   setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE9);
 +   setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE12);
 +#endif
 ...
 
 Can we please avoid having board specific code in common files?
 I wish I could, but only P1021 has such pin mux problems.
 
 If this is really necessary, it shoud be a feature-specific #define,
 not a board specific one.
 I don't know whether this *feature* will show up on other SoC. But if
 you insist, I can use CONFIG_QE_PIN_MUX.
 
 Thanks.
 
 Haiying

I think pin muxing is a board level decision so it seems like board code is the 
right place for it.

- k
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] p1021mds: add QE and UEC support

2011-01-31 Thread Haiying Wang
On Mon, 2011-01-31 at 15:28 -0600, Kumar Gala wrote:
 On Jan 31, 2011, at 2:50 PM, Haiying Wang wrote:
 
  On Mon, 2011-01-31 at 21:11 +0100, Wolfgang Denk wrote:
  
  +#ifdef CONFIG_P1021
  + ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  +
  + /* QE9 and QE12 need to be set for enabling QE MII managment signals */
  + setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE9);
  + setbits_be32(gur-pmuxcr, MPC85xx_PMUXCR_QE12);
  +#endif
  ...
  
  Can we please avoid having board specific code in common files?
  I wish I could, but only P1021 has such pin mux problems.
  
  If this is really necessary, it shoud be a feature-specific #define,
  not a board specific one.
  I don't know whether this *feature* will show up on other SoC. But if
  you insist, I can use CONFIG_QE_PIN_MUX.
  
  Thanks.
  
  Haiying
 
 I think pin muxing is a board level decision so it seems like board code is 
 the right place for it.
 
If it is a one time setting, there should be no problem to put it into
board code. But these pin settings need to be done before any usage of
phy read/write (accessing MDIO/MDC), and need to be released after the
usage of phy, thus the devices connected to eLBC like NAND flash/BCSR
can be accessed. If we use board code to set/release the pin, we don't
know when the phy access and nand flash access will happen.

Haiying



___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot