Re: [linux-usb-devel] [PATCH] ehci_fsl update for MPC831x support

2007-05-11 Thread David Brownell
On Wednesday 09 May 2007, Li Yang wrote:
 For MPC831x support, change the ehci-fsl driver to preserve
 bits set in platform code.  Add a common CONFIG_USB_EHCI_FSL
 to indicate presence of Freescale EHCI SOC.  Add FSL_USB2_DR_OTG
 operating mode support, thus both host and device can work for the
 mini-ab receptacle.  Note: this doesn't enable OTG protocol
 support.
 
 Signed-off-by: Li Yang [EMAIL PROTECTED]

Looks pretty much OK, but see below.


 ---
  drivers/usb/host/Kconfig|6 ++
  drivers/usb/host/ehci-fsl.c |   10 +++---
  drivers/usb/host/ehci-hcd.c |2 +-
  3 files changed, 14 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
 index 6271187..8da3185 100644
 --- a/drivers/usb/host/Kconfig
 +++ b/drivers/usb/host/Kconfig
 @@ -72,6 +72,12 @@ config USB_EHCI_BIG_ENDIAN_MMIO
   depends on USB_EHCI_HCD
   default n
  
 +config USB_EHCI_FSL
 + bool
 + default n
 + ---help---
 +   Variation of ARC USB block used in some Freescale chips.

So does that mean a select USB_EHCI_ROOT_HUB_TT is missing?
Or is that part of the variation?

And:  who sets USB_EHCI_FSL?  Shouldn't there be a
default y if MPC831x || MPC834x etc?


 +
  config USB_ISP116X_HCD
   tristate ISP116X HCD support
   depends on USB
 diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
 index a524805..e802a13 100644
 --- a/drivers/usb/host/ehci-fsl.c
 +++ b/drivers/usb/host/ehci-fsl.c
 @@ -67,7 +67,8 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
* in host mode.
*/
   if (!((pdata-operating_mode == FSL_USB2_DR_HOST) ||
 -   (pdata-operating_mode == FSL_USB2_MPH_HOST))) {
 +   (pdata-operating_mode == FSL_USB2_MPH_HOST) ||
 +   (pdata-operating_mode == FSL_USB2_DR_OTG))) {
   dev_err(pdev-dev,
   Non Host Mode configured for %s. Wrong driver 
 linked.\n,
   pdev-dev.bus_id);
 @@ -185,15 +186,18 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd)
   struct ehci_hcd *ehci = hcd_to_ehci(hcd);
   struct fsl_usb2_platform_data *pdata;
   void __iomem *non_ehci = hcd-regs;
 + u32 temp;
  
   pdata =
   (struct fsl_usb2_platform_data *)hcd-self.controller-
   platform_data;
   /* Enable PHY interface in the control reg. */
 - out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x0004);
 + temp = in_be32(non_ehci + FSL_SOC_USB_CTRL);
 + out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x0004);
   out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x001b);
  
 - if (pdata-operating_mode == FSL_USB2_DR_HOST)
 + if ((pdata-operating_mode == FSL_USB2_DR_HOST) ||
 + (pdata-operating_mode == FSL_USB2_DR_OTG))
   mpc83xx_setup_phy(ehci, pdata-phy_mode, 0);
  
   if (pdata-operating_mode == FSL_USB2_MPH_HOST) {
 diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
 index c7458f7..cc27a87 100644
 --- a/drivers/usb/host/ehci-hcd.c
 +++ b/drivers/usb/host/ehci-hcd.c
 @@ -926,7 +926,7 @@ MODULE_LICENSE (GPL);
  #define  PCI_DRIVER  ehci_pci_driver
  #endif
  
 -#ifdef CONFIG_MPC834x
 +#ifdef CONFIG_USB_EHCI_FSL
  #include ehci-fsl.c
  #define  PLATFORM_DRIVER ehci_fsl_driver
  #endif
 



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] ehci_fsl update for MPC831x support

2007-05-11 Thread Li Yang-r58472
 -Original Message-
 From: David Brownell [mailto:[EMAIL PROTECTED]
 Sent: Friday, May 11, 2007 4:03 PM
 To: Li Yang-r58472
 Cc: [EMAIL PROTECTED]; linux-usb-devel@lists.sourceforge.net
 Subject: Re: [PATCH] ehci_fsl update for MPC831x support
 
 On Wednesday 09 May 2007, Li Yang wrote:
  For MPC831x support, change the ehci-fsl driver to preserve
  bits set in platform code.  Add a common CONFIG_USB_EHCI_FSL
  to indicate presence of Freescale EHCI SOC.  Add FSL_USB2_DR_OTG
  operating mode support, thus both host and device can work for the
  mini-ab receptacle.  Note: this doesn't enable OTG protocol
  support.
 
  Signed-off-by: Li Yang [EMAIL PROTECTED]
 
 Looks pretty much OK, but see below.
 
 
  ---
   drivers/usb/host/Kconfig|6 ++
   drivers/usb/host/ehci-fsl.c |   10 +++---
   drivers/usb/host/ehci-hcd.c |2 +-
   3 files changed, 14 insertions(+), 4 deletions(-)
 
  diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
  index 6271187..8da3185 100644
  --- a/drivers/usb/host/Kconfig
  +++ b/drivers/usb/host/Kconfig
  @@ -72,6 +72,12 @@ config USB_EHCI_BIG_ENDIAN_MMIO
  depends on USB_EHCI_HCD
  default n
 
  +config USB_EHCI_FSL
  +   bool
  +   default n
  +   ---help---
  + Variation of ARC USB block used in some Freescale chips.
 
 So does that mean a select USB_EHCI_ROOT_HUB_TT is missing?
 Or is that part of the variation?

No, we still need USB_EHCI_ROOT_HUB_TT.  This option is used to indicate
the presence of Freescale EHCI SoC which is a variation of ARC USB.
EHCI_ROOT_HUB_TT is part of the variation; maybe we can make it
automatically select EHCI_ROOT_HUB_TT.

 
 And:  who sets USB_EHCI_FSL?  Shouldn't there be a
 default y if MPC831x || MPC834x etc?

It is set in platform Kconfig.  Like:

config PPC_MPC831x
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
select USB_EHCI_FSL
default y if MPC8313_RDB

- Leo

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] ehci_fsl update for MPC831x support

2007-05-11 Thread Li Yang-r58472
   diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
   index 6271187..8da3185 100644
   --- a/drivers/usb/host/Kconfig
   +++ b/drivers/usb/host/Kconfig
   @@ -72,6 +72,12 @@ config USB_EHCI_BIG_ENDIAN_MMIO
 depends on USB_EHCI_HCD
 default n
  
   +config USB_EHCI_FSL
   + bool
   + default n
   + ---help---
   +   Variation of ARC USB block used in some Freescale chips.
 
  So does that mean a select USB_EHCI_ROOT_HUB_TT is missing?
  Or is that part of the variation?

I misunderstood your comment just now.  I agree that select
USB_EHCI_ROOT_HUB_TT should be added.

- Leo

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel