Re: [PATCH/RFC v3 3/4] usb: gadget: udc: renesas_usb3: use usb role switch API

2018-05-15 Thread Simon Horman
On Tue, May 15, 2018 at 08:02:00AM +, Yoshihiro Shimoda wrote:
> Hi Simon-san,
> 
> Thank you for your review!
> 
> > From: Simon Horman, Sent: Tuesday, May 15, 2018 4:54 PM
> > On Mon, May 14, 2018 at 06:15:59PM +0900, Yoshihiro Shimoda wrote:
> 
> > >  static void usb3_set_mode(struct renesas_usb3 *usb3, bool host)
> > >  {
> > > - _usb3_set_mode(usb3, host);
> > > + if (usb3->role_sw)
> > > + usb_role_switch_set_role(usb3->role_sw, host ?
> > > +  USB_ROLE_HOST : USB_ROLE_DEVICE);
> > > + else
> > > + _usb3_set_mode(usb3, host);
> > >  }
> > >
> > >  static void usb3_vbus_out(struct renesas_usb3 *usb3, bool enable)
> > > @@ -672,8 +676,8 @@ static void usb3_mode_config(struct renesas_usb3 
> > > *usb3, bool host, bool a_dev)
> > >  {
> > >   unsigned long flags;
> > >
> > > - spin_lock_irqsave(>lock, flags);
> > >   usb3_set_mode(usb3, host);
> > > + spin_lock_irqsave(>lock, flags);
> > 
> > Hi Shimoda-san,
> > 
> > could you clarify why moving this lock is safe?
> 
> The usb3_set_mode() is possible to call usb_role_switch_set_role() API
> and usb_role_switch_set_role() calls mutex_lock().
> So, this moving this lock (especially avoiding irqsave) needs.

Thanks, that make sense.

But usb3_set_mode() may also call _usb3_set_mode().
It is safe to call _usb3_set_mode() without holding the lock?

> Best regards,
> Yoshihiro Shimoda
> 
> > >   usb3_vbus_out(usb3, a_dev);
> > >   /* for A-Peripheral or forced B-device mode */
> > >   if ((!host && a_dev) ||
> > > --
> > > 1.9.1
> > >
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 6/6] usb: gadget: udc: renesas_usb3: disable the controller's irqs for reconnecting

2018-05-15 Thread Simon Horman
On Tue, May 15, 2018 at 07:49:44AM +, Yoshihiro Shimoda wrote:
> Hi Simon-san,
> 
> Thank you for your review!
> 
> > From: Simon Horman, Sent: Tuesday, May 15, 2018 4:35 PM
> > 
> > On Tue, Apr 10, 2018 at 02:38:54PM +0900, Yoshihiro Shimoda wrote:
> > > This patch fixes an issue that reconnection is possible to fail
> > > because unexpected state handling happens by the irqs. To fix the issue,
> > > the driver disables the controller's irqs when disconnected.
> > >
> > > Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas 
> > > USB3.0 peripheral controller")
> > > Cc: <sta...@vger.kernel.org> # v4.5+
> > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> > > ---
> > >
> > > Remarks:
> > >  - A new file in v2
> > >
> > >  drivers/usb/gadget/udc/renesas_usb3.c | 7 +++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> > > b/drivers/usb/gadget/udc/renesas_usb3.c
> > > index 0e70163..5caf78b 100644
> > > --- a/drivers/usb/gadget/udc/renesas_usb3.c
> > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> > > @@ -623,6 +623,13 @@ static void usb3_disconnect(struct renesas_usb3 
> > > *usb3)
> > >   usb3_usb2_pullup(usb3, 0);
> > >   usb3_clear_bit(usb3, USB30_CON_B3_CONNECT, USB3_USB30_CON);
> > >   usb3_reset_epc(usb3);
> > > + usb3_disable_irq_1(usb3, USB_INT_1_B2_RSUM | USB_INT_1_B3_PLLWKUP |
> > > +USB_INT_1_B3_LUPSUCS | USB_INT_1_B3_DISABLE |
> > > +USB_INT_1_SPEED | USB_INT_1_B3_WRMRST |
> > > +USB_INT_1_B3_HOTRST | USB_INT_1_B2_SPND |
> > > +USB_INT_1_B2_L1SPND | USB_INT_1_B2_USBRST);
> > 
> > Hi Shimoda-san,
> > 
> > is it intentional that USB_INT_1_VBUS_CNG is not disabled above?
> 
> Yes, because the USB_INT_1_VBUS_CNG is enabled in usb3_init_epc_registers() 
> below.

Thanks for the clarification,

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

> 
> > > + usb3_clear_bit(usb3, USB_COM_CON_SPD_MODE, USB3_USB_COM_CON);
> > > + usb3_init_epc_registers(usb3);
> 
> Best regards,
> Yoshihiro Shimoda
> 
> > >   if (usb3->driver)
> > >   usb3->driver->disconnect(>gadget);
> > > --
> > > 1.9.1
> > >
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC v3 3/4] usb: gadget: udc: renesas_usb3: use usb role switch API

2018-05-15 Thread Simon Horman
On Mon, May 14, 2018 at 06:15:59PM +0900, Yoshihiro Shimoda wrote:
> This patch uses usb role switch API if the register suceeeded.
> 
> Signed-off-by: Yoshihiro Shimoda 
> ---
>  drivers/usb/gadget/udc/renesas_usb3.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index c878449..bfb5803 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -657,7 +657,11 @@ static void _usb3_set_mode(struct renesas_usb3 *usb3, 
> bool host)
>  
>  static void usb3_set_mode(struct renesas_usb3 *usb3, bool host)
>  {
> - _usb3_set_mode(usb3, host);
> + if (usb3->role_sw)
> + usb_role_switch_set_role(usb3->role_sw, host ?
> +  USB_ROLE_HOST : USB_ROLE_DEVICE);
> + else
> + _usb3_set_mode(usb3, host);
>  }
>  
>  static void usb3_vbus_out(struct renesas_usb3 *usb3, bool enable)
> @@ -672,8 +676,8 @@ static void usb3_mode_config(struct renesas_usb3 *usb3, 
> bool host, bool a_dev)
>  {
>   unsigned long flags;
>  
> - spin_lock_irqsave(>lock, flags);
>   usb3_set_mode(usb3, host);
> + spin_lock_irqsave(>lock, flags);

Hi Shimoda-san,

could you clarify why moving this lock is safe?

>   usb3_vbus_out(usb3, a_dev);
>   /* for A-Peripheral or forced B-device mode */
>   if ((!host && a_dev) ||
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 6/6] usb: gadget: udc: renesas_usb3: disable the controller's irqs for reconnecting

2018-05-15 Thread Simon Horman
On Tue, Apr 10, 2018 at 02:38:54PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that reconnection is possible to fail
> because unexpected state handling happens by the irqs. To fix the issue,
> the driver disables the controller's irqs when disconnected.
> 
> Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas 
> USB3.0 peripheral controller")
> Cc:  # v4.5+
> Signed-off-by: Yoshihiro Shimoda 
> ---
> 
> Remarks:
>  - A new file in v2
> 
>  drivers/usb/gadget/udc/renesas_usb3.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index 0e70163..5caf78b 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -623,6 +623,13 @@ static void usb3_disconnect(struct renesas_usb3 *usb3)
>   usb3_usb2_pullup(usb3, 0);
>   usb3_clear_bit(usb3, USB30_CON_B3_CONNECT, USB3_USB30_CON);
>   usb3_reset_epc(usb3);
> + usb3_disable_irq_1(usb3, USB_INT_1_B2_RSUM | USB_INT_1_B3_PLLWKUP |
> +USB_INT_1_B3_LUPSUCS | USB_INT_1_B3_DISABLE |
> +USB_INT_1_SPEED | USB_INT_1_B3_WRMRST |
> +USB_INT_1_B3_HOTRST | USB_INT_1_B2_SPND |
> +USB_INT_1_B2_L1SPND | USB_INT_1_B2_USBRST);

Hi Shimoda-san,

is it intentional that USB_INT_1_VBUS_CNG is not disabled above?

> + usb3_clear_bit(usb3, USB_COM_CON_SPD_MODE, USB3_USB_COM_CON);
> + usb3_init_epc_registers(usb3);
>  
>   if (usb3->driver)
>   usb3->driver->disconnect(>gadget);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 5/6] usb: gadget: udc: renesas_usb3: should fail if devm_phy_get() returns error

2018-05-15 Thread Simon Horman
On Tue, Apr 10, 2018 at 02:38:53PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that this driver ignores errors other than
> the non-existence of the device, f.e. a memory allocation failure
> in devm_phy_get(). So, this patch replaces devm_phy_get() with
> devm_phy_optional_get().
> 
> Reported-by: Simon Horman <horms+rene...@verge.net.au>
> Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic 
> phy")
> Cc: <sta...@vger.kernel.org> # v4.15+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

> ---
> Remarks:
>  - A new file in v2
> 
>  drivers/usb/gadget/udc/renesas_usb3.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index 233bc04..0e70163 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -2636,9 +2636,11 @@ static int renesas_usb3_probe(struct platform_device 
> *pdev)
>* This is optional. So, if this driver cannot get a phy,
>* this driver will not handle a phy anymore.
>*/
> - usb3->phy = devm_phy_get(>dev, "usb");
> - if (IS_ERR(usb3->phy))
> - usb3->phy = NULL;
> + usb3->phy = devm_phy_optional_get(>dev, "usb");
> + if (IS_ERR(usb3->phy)) {
> + ret = PTR_ERR(usb3->phy);
> + goto err_add_udc;
> + }
>  
>   pm_runtime_enable(>dev);
>   ret = usb_add_gadget_udc(>dev, >gadget);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: gadget: udc: renesas_usb3: add property "renesas,ignore-id"

2018-04-11 Thread Simon Horman
On Tue, Apr 10, 2018 at 09:13:53PM +0900, Yoshihiro Shimoda wrote:
> This patch adds a new property to ignore the ID signal on a board.
> 
> Signed-off-by: Yoshihiro Shimoda 
> ---
>  Documentation/devicetree/bindings/usb/renesas_usb3.txt |  2 ++
>  drivers/usb/gadget/udc/renesas_usb3.c  | 10 ++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usb3.txt 
> b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> index 2c071bb..53949bd 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usb3.txt
> @@ -19,6 +19,8 @@ Required properties:
>  Optional properties:
>- phys: phandle + phy specifier pair
>- phy-names: must be "usb"
> +  - renesas,ignore-id: when a board doesn't use ID pin, you can add this
> +property to ignore the ID state.
>  
>  Example of R-Car H3 ES1.x:
>   usb3_peri0: usb@ee02 {
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index 409cde4..59e1485 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -350,6 +350,7 @@ struct renesas_usb3 {
>   bool extcon_host;   /* check id and set EXTCON_USB_HOST */
>   bool extcon_usb;/* check vbus and set EXTCON_USB */
>   bool forced_b_device;
> + bool ignore_id;
>  };
>  
>  #define gadget_to_renesas_usb3(_gadget)  \
> @@ -645,6 +646,9 @@ static void usb3_check_vbus(struct renesas_usb3 *usb3)
>  
>  static void usb3_set_mode(struct renesas_usb3 *usb3, bool host)
>  {
> + if (usb3->ignore_id && !usb3->forced_b_device)
> + return;
> +
>   if (host)
>   usb3_clear_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON);
>   else
> @@ -675,6 +679,9 @@ static void usb3_mode_config(struct renesas_usb3 *usb3, 
> bool host, bool a_dev)
>  
>  static bool usb3_is_a_device(struct renesas_usb3 *usb3)
>  {
> + if (usb3->ignore_id)
> + return false;
> +
>   return !(usb3_read(usb3, USB3_USB_OTG_STA) & USB_OTG_IDMON);
>  }
>  
> @@ -2632,6 +2639,9 @@ static int renesas_usb3_probe(struct platform_device 
> *pdev)
>   if (ret < 0)
>   goto err_add_udc;
>  
> + if (of_property_read_bool(pdev->dev.of_node, "renesas,no-id"))
> + usb3->ignore_id = true;

I wonder if this is better expressed as:

usb3->ignore_id = of_property_read_bool(pdev->dev.of_node,
"renesas,no-id"));

> +
>   ret = device_create_file(>dev, _attr_role);
>   if (ret < 0)
>   goto err_dev_create;
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] usb: gadget: udc: renesas_usb3: should call devm_phy_get() before add udc

2018-04-11 Thread Simon Horman
On Tue, Apr 10, 2018 at 09:44:31AM +, Yoshihiro Shimoda wrote:
> Hi Simon-san,
> 
> > From: Simon Horman, Sent: Tuesday, April 10, 2018 6:34 PM
> > 
> > On Tue, Apr 10, 2018 at 01:28:33AM +, Yoshihiro Shimoda wrote:
> > > Hi Simon-san,
> > >
> > > > From: Simon Horman, Sent: Monday, April 9, 2018 8:58 PM
> > > >
> > > > On Mon, Apr 02, 2018 at 09:21:34PM +0900, Yoshihiro Shimoda wrote:
> > > > > This patch fixes an issue that this driver cannot call phy_init()
> > > > > if a gadget driver is alreadly loaded because usb_add_gadget_udc()
> > > > > might call renesas_usb3_start() via .udc_start.
> > > > >
> > > > > Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for 
> > > > > generic phy")
> > > > > Cc: <sta...@vger.kernel.org> # v4.15+
> > > > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> > > > > ---
> > > > >  drivers/usb/gadget/udc/renesas_usb3.c | 16 
> > > > >  1 file changed, 8 insertions(+), 8 deletions(-)
> > > >
> > > > Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
> > > >
> > > >
> > > > Please see some suggestions for follow-up lower-priority patches below.
> > >
> > > Thank you for the review and suggestions!
> > >
> > > > >
> > > > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> > > > > b/drivers/usb/gadget/udc/renesas_usb3.c
> > > > > index 738b734..671bac3 100644
> > > > > --- a/drivers/usb/gadget/udc/renesas_usb3.c
> > > > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> > > > > @@ -2632,6 +2632,14 @@ static int renesas_usb3_probe(struct 
> > > > > platform_device *pdev)
> > > > >   if (ret < 0)
> > > > >   goto err_alloc_prd;
> > > > >
> > > > > + /*
> > > > > +  * This is an optional. So, if this driver cannot get a phy,
> > > > > +  * this driver will not handle a phy anymore.
> > > > > +  */
> > > >
> > > > nit: s/an optional/optional/
> > >
> > > Oops. I will fix and submit v2 patches.
> > >
> > > > > + usb3->phy = devm_phy_get(>dev, "usb");
> > > > > + if (IS_ERR(usb3->phy))
> > > > > + usb3->phy = NULL;
> > > >
> > > > I think this will unintentionally ignore errors other than the
> > > > non-existence of the device, f.e. a memory allocation failure
> > > > in devm_phy_get().
> > > >
> > > > So perhaps something like this, as per phy_optional_get(), would be 
> > > > better?
> > > >
> > > > usb3->phy = devm_phy_get(>dev, "usb");
> > > > if (IS_ERR(usb3->phy) && (PTR_ERR(usb3->phy) == -ENODEV))
> > > > usb3->phy = NULL;
> > >
> > > Thank you for the suggestion. I agree with you.
> > > I think I should use devm_phy_optional_get() instead of dev_phy_get(), as 
> > > you mentioned :)
> > > So, I will fix the code by using devm_phy_optional_get() first, and then 
> > > fix this.
> > 
> > Thanks, I agree that would be a good fix.
> > 
> > But perhaps it is better as a follow-up?
> 
> Oops. Yes, I changed my mind after prepared the patch v2 and submitted v2.
> I should have sent an email about this to you...
> Anyway, thank you very much for reviewing the v2 patches!

v2 looks good to me :)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 5/6] usb: gadget: udc: renesas_usb3: should fail if devm_phy_get() returns error

2018-04-10 Thread Simon Horman
On Tue, Apr 10, 2018 at 02:38:53PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that this driver ignores errors other than
> the non-existence of the device, f.e. a memory allocation failure
> in devm_phy_get(). So, this patch replaces devm_phy_get() with
> devm_phy_optional_get().
> 
> Reported-by: Simon Horman <horms+rene...@verge.net.au>
> Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic 
> phy")
> Cc: <sta...@vger.kernel.org> # v4.15+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

> ---
> Remarks:
>  - A new file in v2
> 
>  drivers/usb/gadget/udc/renesas_usb3.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index 233bc04..0e70163 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -2636,9 +2636,11 @@ static int renesas_usb3_probe(struct platform_device 
> *pdev)
>* This is optional. So, if this driver cannot get a phy,
>* this driver will not handle a phy anymore.
>*/
> - usb3->phy = devm_phy_get(>dev, "usb");
> - if (IS_ERR(usb3->phy))
> - usb3->phy = NULL;
> + usb3->phy = devm_phy_optional_get(>dev, "usb");
> + if (IS_ERR(usb3->phy)) {
> + ret = PTR_ERR(usb3->phy);
> + goto err_add_udc;
> + }
>  
>   pm_runtime_enable(>dev);
>   ret = usb_add_gadget_udc(>dev, >gadget);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 6/6] usb: gadget: udc: renesas_usb3: disable the controller's irqs for reconnecting

2018-04-10 Thread Simon Horman
On Tue, Apr 10, 2018 at 02:38:54PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that reconnection is possible to fail
> because unexpected state handling happens by the irqs. To fix the issue,
> the driver disables the controller's irqs when disconnected.
> 
> Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas 
> USB3.0 peripheral controller")
> Cc: <sta...@vger.kernel.org> # v4.5+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

> ---
> 
> Remarks:
>  - A new file in v2
> 
>  drivers/usb/gadget/udc/renesas_usb3.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index 0e70163..5caf78b 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -623,6 +623,13 @@ static void usb3_disconnect(struct renesas_usb3 *usb3)
>   usb3_usb2_pullup(usb3, 0);
>   usb3_clear_bit(usb3, USB30_CON_B3_CONNECT, USB3_USB30_CON);
>   usb3_reset_epc(usb3);
> + usb3_disable_irq_1(usb3, USB_INT_1_B2_RSUM | USB_INT_1_B3_PLLWKUP |
> +USB_INT_1_B3_LUPSUCS | USB_INT_1_B3_DISABLE |
> +USB_INT_1_SPEED | USB_INT_1_B3_WRMRST |
> +USB_INT_1_B3_HOTRST | USB_INT_1_B2_SPND |
> +USB_INT_1_B2_L1SPND | USB_INT_1_B2_USBRST);
> + usb3_clear_bit(usb3, USB_COM_CON_SPD_MODE, USB3_USB_COM_CON);
> + usb3_init_epc_registers(usb3);
>  
>   if (usb3->driver)
>   usb3->driver->disconnect(>gadget);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] usb: gadget: udc: renesas_usb3: should call devm_phy_get() before add udc

2018-04-10 Thread Simon Horman
On Tue, Apr 10, 2018 at 01:28:33AM +, Yoshihiro Shimoda wrote:
> Hi Simon-san,
> 
> > From: Simon Horman, Sent: Monday, April 9, 2018 8:58 PM
> > 
> > On Mon, Apr 02, 2018 at 09:21:34PM +0900, Yoshihiro Shimoda wrote:
> > > This patch fixes an issue that this driver cannot call phy_init()
> > > if a gadget driver is alreadly loaded because usb_add_gadget_udc()
> > > might call renesas_usb3_start() via .udc_start.
> > >
> > > Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for 
> > > generic phy")
> > > Cc: <sta...@vger.kernel.org> # v4.15+
> > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> > > ---
> > >  drivers/usb/gadget/udc/renesas_usb3.c | 16 
> > >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
> > 
> > 
> > Please see some suggestions for follow-up lower-priority patches below.
> 
> Thank you for the review and suggestions!
> 
> > >
> > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> > > b/drivers/usb/gadget/udc/renesas_usb3.c
> > > index 738b734..671bac3 100644
> > > --- a/drivers/usb/gadget/udc/renesas_usb3.c
> > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> > > @@ -2632,6 +2632,14 @@ static int renesas_usb3_probe(struct 
> > > platform_device *pdev)
> > >   if (ret < 0)
> > >   goto err_alloc_prd;
> > >
> > > + /*
> > > +  * This is an optional. So, if this driver cannot get a phy,
> > > +  * this driver will not handle a phy anymore.
> > > +  */
> > 
> > nit: s/an optional/optional/
> 
> Oops. I will fix and submit v2 patches.
> 
> > > + usb3->phy = devm_phy_get(>dev, "usb");
> > > + if (IS_ERR(usb3->phy))
> > > + usb3->phy = NULL;
> > 
> > I think this will unintentionally ignore errors other than the
> > non-existence of the device, f.e. a memory allocation failure
> > in devm_phy_get().
> > 
> > So perhaps something like this, as per phy_optional_get(), would be better?
> > 
> > usb3->phy = devm_phy_get(>dev, "usb");
> > if (IS_ERR(usb3->phy) && (PTR_ERR(usb3->phy) == -ENODEV))
> > usb3->phy = NULL;
> 
> Thank you for the suggestion. I agree with you.
> I think I should use devm_phy_optional_get() instead of dev_phy_get(), as you 
> mentioned :)
> So, I will fix the code by using devm_phy_optional_get() first, and then fix 
> this.

Thanks, I agree that would be a good fix.

But perhaps it is better as a follow-up?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] usb: gadget: udc: renesas_usb3: should call devm_phy_get() before add udc

2018-04-09 Thread Simon Horman
On Mon, Apr 02, 2018 at 09:21:34PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that this driver cannot call phy_init()
> if a gadget driver is alreadly loaded because usb_add_gadget_udc()
> might call renesas_usb3_start() via .udc_start.
> 
> Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic 
> phy")
> Cc: <sta...@vger.kernel.org> # v4.15+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> ---
>  drivers/usb/gadget/udc/renesas_usb3.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>


Please see some suggestions for follow-up lower-priority patches below.

> 
> diff --git a/drivers/usb/gadget/udc/renesas_usb3.c 
> b/drivers/usb/gadget/udc/renesas_usb3.c
> index 738b734..671bac3 100644
> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c
> @@ -2632,6 +2632,14 @@ static int renesas_usb3_probe(struct platform_device 
> *pdev)
>   if (ret < 0)
>   goto err_alloc_prd;
>  
> + /*
> +  * This is an optional. So, if this driver cannot get a phy,
> +  * this driver will not handle a phy anymore.
> +  */

nit: s/an optional/optional/

> + usb3->phy = devm_phy_get(>dev, "usb");
> + if (IS_ERR(usb3->phy))
> + usb3->phy = NULL;

I think this will unintentionally ignore errors other than the
non-existence of the device, f.e. a memory allocation failure
in devm_phy_get().

So perhaps something like this, as per phy_optional_get(), would be better?

usb3->phy = devm_phy_get(>dev, "usb");
if (IS_ERR(usb3->phy) && (PTR_ERR(usb3->phy) == -ENODEV))
usb3->phy = NULL;

> +
>   pm_runtime_enable(>dev);
>   ret = usb_add_gadget_udc(>dev, >gadget);
>   if (ret < 0)
> @@ -2641,14 +2649,6 @@ static int renesas_usb3_probe(struct platform_device 
> *pdev)
>   if (ret < 0)
>   goto err_dev_create;
>  
> - /*
> -  * This is an optional. So, if this driver cannot get a phy,
> -  * this driver will not handle a phy anymore.
> -  */
> - usb3->phy = devm_phy_get(>dev, "usb");
> - if (IS_ERR(usb3->phy))
> - usb3->phy = NULL;
> -
>   usb3->workaround_for_vbus = priv->workaround_for_vbus;
>  
>   renesas_usb3_debugfs_init(usb3, >dev);
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] usb: gadget: udc: renesas_usb3: should call pm_runtime_enable() before add udc

2018-04-09 Thread Simon Horman
On Mon, Apr 02, 2018 at 09:21:33PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that this driver causes panic if a gadget
> driver is already loaded because usb_add_gadget_udc() might call
> renesas_usb3_start() via .udc_start, and then pm_runtime_get_sync()
> in renesas_usb3_start() doesn't work correctly.
> Note that the usb3_to_dev() macro should not be called at this timing
> because the macro uses the gadget structure.
> 
> Fixes: cf06df3fae28 ("usb: gadget: udc: renesas_usb3: move 
> pm_runtime_{en,dis}able()")
> Cc: <sta...@vger.kernel.org> # v4.15+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] usb: gadget: udc: renesas_usb3: should remove debugfs

2018-04-09 Thread Simon Horman
On Mon, Apr 02, 2018 at 09:21:32PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that this driver doesn't remove its debugfs.
> 
> Fixes: 43ba968b00ea ("usb: gadget: udc: renesas_usb3: add debugfs to set the 
> b-device mode")
> Cc: <sta...@vger.kernel.org> # v4.14+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] usb: gadget: udc: renesas_usb3: fix double phy_put()

2018-04-09 Thread Simon Horman
On Mon, Apr 02, 2018 at 09:21:31PM +0900, Yoshihiro Shimoda wrote:
> This patch fixes an issue that this driver cause double phy_put()
> calling. This driver must not call phy_put() in the remove because
> the driver calls devm_phy_get() in the probe.
> 
> Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic 
> phy")
> Cc: <sta...@vger.kernel.org> # v4.15+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] usb: gadget: udc: renesas_usb3: add binging for r8a77965

2018-03-06 Thread Simon Horman
On Tue, Feb 27, 2018 at 05:16:03PM +0900, Yoshihiro Shimoda wrote:
> This patch adds binding for r8a77965 (R-Car M3-N).
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: renesas_usbhs: add binding for r8a77965

2018-03-06 Thread Simon Horman
On Tue, Feb 27, 2018 at 05:16:02PM +0900, Yoshihiro Shimoda wrote:
> This patch adds binding for r8a77965 (R-Car M3-N).
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: host: xhci-rcar: add support for r8a77965

2018-03-06 Thread Simon Horman
On Tue, Feb 27, 2018 at 05:15:20PM +0900, Yoshihiro Shimoda wrote:
> This patch adds support for r8a77965 (R-Car M3-N).
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 0/3] usb: renesas_usbhs: Add RZ/A1 support

2018-01-09 Thread Simon Horman
On Mon, Jan 08, 2018 at 01:15:08PM +0100, Geert Uytterhoeven wrote:
> Hi Chris,
> 
> On Mon, Jan 8, 2018 at 12:59 PM, Chris Brandt  
> wrote:
> > On Monday, January 08, 2018, Geert Uytterhoeven wrote:
> >> Thanks for the update, but I think there has been a misunderstanding.
> >> I didn't mean to drop "renesas,usbhs-r7s72100" everywhere, only from
> >> the matching in the driver.
> >
> > Opps, I was all kinds of confused then.
> >
> > So, before I submit a V4, here is my understanding:
> >
> > drivers/.../common.c
> >  * contains -only-  '.compatible = "renesas,rza1-usbhs"'
> 
> OK.
> 
> > Documentation/.../renesas_usbhs.txt
> >  * contains both "renesas,usbhs-r7s72100" and "renesas,rza1-usbhs"
> 
> OK.
> 
> > r7s72100.dtsi
> > * usbhs0: usb@e801 {
> > compatible = "renesas,usbhs-r7s72100", "renesas,rza1-usbhs";
> 
> OK.
> 
> > Is this correct?
> 
> Yes.

Ack.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1

2018-01-09 Thread Simon Horman
On Mon, Jan 08, 2018 at 07:30:54AM -0500, Chris Brandt wrote:
> Document support for RZ/A1 SoCs
> 
> Signed-off-by: Chris Brandt <chris.bra...@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+rene...@glider.be>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

> ---
> v4:
>  * Re-added "renesas,usbhs-r7s72100"
> v3:
>  * Removed "renesas,usbhs-r7s72100"
> v2:
>  * Added Reviewed-by
> ---
>  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
> b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> index 47394ab788e3..d060172f1529 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> @@ -13,8 +13,10 @@ Required properties:
>   - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
>   - "renesas,usbhs-r8a7796" for r8a7796 (R-Car M3-W) compatible device
>   - "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
> + - "renesas,usbhs-r7s72100" for r7s72100 (RZ/A1) compatible device
>   - "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
>   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
> + - "renesas,rza1-usbhs" for RZ/A1 compatible device
>  
>   When compatible with the generic version, nodes must list the
>   SoC-specific version corresponding to the platform first followed
> -- 
> 2.15.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1

2018-01-07 Thread Simon Horman
On Fri, Jan 05, 2018 at 05:46:46PM -0500, Chris Brandt wrote:
> Document support for RZ/A1 SoCs
> 
> Signed-off-by: Chris Brandt 
> Reviewed-by: Geert Uytterhoeven 
> ---
> v3:
>  * Removed "renesas,usbhs-r7s72100"

Unless I am mistaken you want both renesas,usbhs-r7s72100, for the SoC
and renesas,rza1-usbhs for the family[*] of SoCs (which currently only has one
member upstream).

Similar to the way there are per-SoC compat strings for R-Car Gen2 and Gen3
SoCs, and per-SoC family fallback compat strings to Gen2 and Gen3.

The motivation for this that empirically SoC families seem to be able to
share the implementation on the driver-side, so only the fallback compat
strings need to be implemented in the driver by defining per-SoC compat
strings we have the flexibility to implement them if differences emerge
between SoCs in the same family.

[*] I used the term family here to group SoCs together. I acknowledge that
Renesas may not refer to them in this way.



> v2:
>  * Added Reviewed-by
> ---
>  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
> b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> index 47394ab788e3..fa16d8d33815 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> @@ -15,6 +15,7 @@ Required properties:
>   - "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
>   - "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
>   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
> + - "renesas,rza1-usbhs" for RZ/A1 compatible device
>  
>   When compatible with the generic version, nodes must list the
>   SoC-specific version corresponding to the platform first followed
> -- 
> 2.15.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/3] ARM: dts: r7s72100: add USB device to device tree

2018-01-07 Thread Simon Horman
On Fri, Jan 05, 2018 at 05:46:47PM -0500, Chris Brandt wrote:
> Add USB device support.
> 
> Signed-off-by: Chris Brandt 
> Reviewed-by: Geert Uytterhoeven 
> ---
> v3:
>  * Changed from "renesas,usbhs-r7s72100" to "renesas,rza1-usbhs"

I think you want both. The SoC-specific compat string followed by a fallback
compat string for something broader:

Like this:

compatible = "renesas,usbhs-r7s72100", "renesas,rza1-usbhs";

> v2:
>  * Node name is now generic 'usb@'
>  * GIC_SPI (73-32) is now just GIC_SPI 41
>  * All hex number are lower case
>  * Added Reviewed-by
> ---
>  arch/arm/boot/dts/r7s72100.dtsi | 20 
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
> index ab9645a42eca..d94431767913 100644
> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -667,4 +667,24 @@
>   power-domains = <_clocks>;
>   status = "disabled";
>   };
> +
> + usbhs0: usb@e801 {
> + compatible = "renesas,rza1-usbhs";
> + reg = <0xe801 0x1a0>;
> + interrupts = ;
> + clocks = <_clks R7S72100_CLK_USB0>;
> + renesas,buswait = <4>;
> + power-domains = <_clocks>;
> + status = "disabled";
> + };
> +
> + usbhs1: usb@e8207000 {
> + compatible = "renesas,rza1-usbhs";
> + reg = <0xe8207000 0x1a0>;
> + interrupts = ;
> + clocks = <_clks R7S72100_CLK_USB1>;
> + renesas,buswait = <4>;
> + power-domains = <_clocks>;
> + status = "disabled";
> + };
>  };
> -- 
> 2.15.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] ARM: dts: r7s72100: add USB device to device tree

2018-01-05 Thread Simon Horman
On Thu, Jan 04, 2018 at 03:01:50PM -0500, Chris Brandt wrote:
> Add USB device support.
> 
> Signed-off-by: Chris Brandt 

Hi Chris,

it looks like there have been some requests for (minor) changes to this
patch. Please consider addressing those and reposting.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ARM: dts: r8a7743: Add xhci support to SoC dtsi

2017-10-17 Thread Simon Horman
On Tue, Oct 17, 2017 at 01:39:33AM +, Yoshihiro Shimoda wrote:
> Hi Biju-san,
> 
> IIUC, when we submitted a patch for dts[i] file,
> we don't need to submit such a patch to usb maintainers.
> 
> > From: Biju Das, Sent: Monday, October 16, 2017 7:13 PM
> > 
> > From: Fabrizio Castro 
> > 
> > Add node for xhci. Boards DT files will enable it if needed.
> > 
> > Signed-off-by: Fabrizio Castro 
> > ---
> >  arch/arm/boot/dts/r8a7743.dtsi | 20 
> >  1 file changed, 20 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
> > index 699c040..386bf07 100644
> > --- a/arch/arm/boot/dts/r8a7743.dtsi
> > +++ b/arch/arm/boot/dts/r8a7743.dtsi
> > @@ -931,6 +931,26 @@
> > status = "disabled";
> > };
> > 
> > +   /*
> > +* pci1 and xhci share the same phy, therefore only one of them
> > +* can be active at any one time. If both of them are enabled,
> > +* a race condition will determine who'll control the phy.
> > +* A firmware file is needed by the xhci driver in order for
> > +* USB 3.0 to work properly.
> > +*/
> > +   xhci: usb@ee00 {
> > +   compatible = "renesas,xhci-r8a7743",
> > +"renesas,rcar-gen2-xhci";
> > +   reg = <0 0xee00 0 0xc00>;
> > +   interrupts = ;
> > +   clocks = < CPG_MOD 328>;
> > +   power-domains = < R8A7743_PD_ALWAYS_ON>;
> > +   resets = < 328>;
> > +   phys = < 1>;
> > +   phy-names = "usb";
> > +   status = "disabled";
> > +   };
> > +
> > sdhi0: sd@ee10 {
> > compatible = "renesas,sdhi-r8a7743";
> > reg = <0 0xee10 0 0x328>;
> 
> It seems good to me. So,
> 
> Reviewed-by: Yoshihiro Shimoda 

Thanks, applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] dt-bindings: usb-xhci: Document r8a7743 support

2017-10-17 Thread Simon Horman
On Mon, Oct 16, 2017 at 11:12:48AM +0100, Biju Das wrote:
> From: Fabrizio Castro <fabrizio.cas...@bp.renesas.com>
> 
> Document r8a7743 xhci support. The driver will use the fallback
> compatible string "renesas,rcar-gen2-xhci", therefore no driver
> change is needed.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.cas...@bp.renesas.com>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] usb: renesas_usbhs: Add compatible string for r8a7743/5

2017-10-09 Thread Simon Horman
On Fri, Oct 06, 2017 at 05:49:34PM +0100, Biju Das wrote:
> This patch adds support for r8a7743/5 SoCs. The Renesas RZ/G1[ME]
> (R8A7743/5) usbhs is identical to the R-Car Gen2 family.
> 
> No driver change is needed due to the fallback compatible value
> "renesas,rcar-gen2-usbhs".
> Adding the SoC-specific compatible values here has two purposes:
>   1. Document which SoCs have this hardware module,
>   2. Allow checkpatch to validate compatible values.

3. Allow the driver to support SoC specific implementations in future
   as necessary.

Acked-by: Simon Horman <horms+rene...@verge.net.au>

> Signed-off-by: Biju Das <biju@bp.renesas.com>
> Signed-off-by: Chris Paterson <chris.paters...@renesas.com>
> Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+rene...@glider.be>
> ---
> v1-->v2
>* Modified the patch description
>* Rebased on the below R-Car D3 patch
>  https://patchwork.kernel.org/patch/9982267/
> 
> This patch is tested against Linux next tag next-20170929 +
>   https://patchwork.kernel.org/patch/9982267/
> 
>  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
> b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> index e79f6e4..47394ab 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> @@ -3,6 +3,8 @@ Renesas Electronics USBHS driver
>  Required properties:
>- compatible: Must contain one or more of the following:
>  
> + - "renesas,usbhs-r8a7743" for r8a7743 (RZ/G1M) compatible device
> + - "renesas,usbhs-r8a7745" for r8a7745 (RZ/G1E) compatible device
>   - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
>   - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
>   - "renesas,usbhs-r8a7792" for r8a7792 (R-Car V2H) compatible device
> @@ -11,7 +13,7 @@ Required properties:
>   - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
>   - "renesas,usbhs-r8a7796" for r8a7796 (R-Car M3-W) compatible device
>   - "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
> - - "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device
> + - "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
>   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
>  
>   When compatible with the generic version, nodes must list the
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: host: xhci-plat: Use of_device_get_match_data() helper

2017-10-06 Thread Simon Horman
On Thu, Oct 05, 2017 at 01:12:01PM +0300, Mathias Nyman wrote:
> On 05.10.2017 12:19, Simon Horman wrote:
> >On Wed, Oct 04, 2017 at 02:25:03PM +0200, Geert Uytterhoeven wrote:
> >>Use the of_device_get_match_data() helper instead of open coding.
> >>
> >>Signed-off-by: Geert Uytterhoeven <geert+rene...@glider.be>
> >
> >Reviewed-by: Simon Horman <horms+rene...@verge.net.au>
> >
> >
> 
> Thanks, I already applied and sent forward before this new reviewed-by tag

Thanks, sorry for not noticing that.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: renesas_usbhs: Use of_device_get_match_data() helper

2017-10-05 Thread Simon Horman
On Wed, Oct 04, 2017 at 02:26:48PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding.
> 
> Signed-off-by: Geert Uytterhoeven <geert+rene...@glider.be>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: host: xhci-plat: Use of_device_get_match_data() helper

2017-10-05 Thread Simon Horman
On Wed, Oct 04, 2017 at 02:25:03PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding.
> 
> Signed-off-by: Geert Uytterhoeven <geert+rene...@glider.be>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: gadget: udc: renesas_usb3: Use of_device_get_match_data() helper

2017-10-05 Thread Simon Horman
On Wed, Oct 04, 2017 at 02:23:31PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding,
> postponing the matching until when it's really needed.
> Note that the renesas_usb3 driver is used with DT only, so there's
> always a valid match.
> 
> Signed-off-by: Geert Uytterhoeven <geert+rene...@glider.be>

Reviewed-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb: gadget: renesas_usb3: Use ARCH_RENESAS

2016-03-01 Thread Simon Horman
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
 drivers/usb/gadget/udc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 Based on usb-gadget/next

diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
index ff4f8a6735d6..7c289416f87d 100644
--- a/drivers/usb/gadget/udc/Kconfig
+++ b/drivers/usb/gadget/udc/Kconfig
@@ -176,7 +176,7 @@ config USB_RENESAS_USBHS_UDC
 
 config USB_RENESAS_USB3
tristate 'Renesas USB3.0 Peripheral controller'
-   depends on ARCH_SHMOBILE || COMPILE_TEST
+   depends on ARCH_RENESAS || COMPILE_TEST
help
   Renesas USB3.0 Peripheral controller is a USB peripheral controller
   that supports super, high, and full speed USB 3.0 data transfers.
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] usb: host: xhci-rcar: Use ARCH_RENESAS

2016-02-18 Thread Simon Horman
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
 drivers/usb/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 438dcf6289b0..ed9a90f601e8 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -64,7 +64,7 @@ config USB_XHCI_MVEBU
 config USB_XHCI_RCAR
tristate "xHCI support for Renesas R-Car SoCs"
select USB_XHCI_PLATFORM
-   depends on ARCH_SHMOBILE || COMPILE_TEST
+   depends on ARCH_RENESAS || COMPILE_TEST
---help---
  Say 'Y' to enable the support for the xHCI host controller
  found in Renesas R-Car ARM SoCs.
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] usb: renesas_usbhs: Use ARCH_RENESAS

2016-02-18 Thread Simon Horman
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
 drivers/usb/renesas_usbhs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/Kconfig 
b/drivers/usb/renesas_usbhs/Kconfig
index ebc99ee076ce..b26d7c339c05 100644
--- a/drivers/usb/renesas_usbhs/Kconfig
+++ b/drivers/usb/renesas_usbhs/Kconfig
@@ -5,7 +5,7 @@
 config USB_RENESAS_USBHS
tristate 'Renesas USBHS controller'
depends on USB_GADGET
-   depends on ARCH_SHMOBILE || SUPERH || COMPILE_TEST
+   depends on ARCH_RENESAS || SUPERH || COMPILE_TEST
depends on EXTCON || !EXTCON # if EXTCON=m, USBHS cannot be built-in
default n
help
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] usb: Use ARCH_RENESAS

2016-02-18 Thread Simon Horman
Hi,

this short series makes use of of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Simon Horman (2):
  usb: renesas_usbhs: Use ARCH_RENESAS
  usb: host: xhci-rcar: Use ARCH_RENESAS

 drivers/usb/host/Kconfig  | 2 +-
 drivers/usb/renesas_usbhs/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/3] usb: renesas_usbhs: More compat strings

2015-12-15 Thread Simon Horman

Hi,

this short series adds generic, and soc-specific r8a7792 and r8a7793 compat
strings to the Renesas USBHS driver. The intention is to provide a complete
set of compat strings for known R-Car SoCs.

Changes since v3:
* State that one or more compat string should be used

Changes since v2:
* Split documentation of SoC names into separate patch
* Use correct fallback compatibility string in example

Changes since v1:
* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
a single compatibility string for all of R-Car.

Simon Horman (3):
  usb: renesas_usbhs: add SoC names to compatibility string
documentation
  usb: renesas_usbhs: add fallback compatibility strings
  usb: renesas_usbhs: add device tree support for r8a779[23]

 .../devicetree/bindings/usb/renesas_usbhs.txt  | 22 --
 drivers/usb/renesas_usbhs/common.c |  9 +
 2 files changed, 25 insertions(+), 6 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 2/3] usb: renesas_usbhs: add fallback compatibility strings

2015-12-15 Thread Simon Horman
Add fallback compatibility strings for R-Car Gen2 and Gen3.
This is in keeping with the fallback scheme being adopted wherever
appropriate for drivers for Renesas SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
Acked-by: Kuninori Morimoto <kuninori.morimoto...@renesas.com>
---
v4
* State that one or more compat string should be used

v3
* Moved documentation of SoC names to a separate patch
* Use correct fallback compatibility string in example

v2
* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
  a single compatibility string for all of R-Car.
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 12 ++--
 drivers/usb/renesas_usbhs/common.c  |  9 +
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index a14c0bb561d5..45d9ae13ffa3 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -1,11 +1,19 @@
 Renesas Electronics USBHS driver
 
 Required properties:
-  - compatible: Must contain one of the following:
+  - compatible: Must contain one or more of the following:
+
- "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
- "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
- "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
+   - "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device
+   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
+
+   When compatible with the generic version, nodes must list the
+   SoC-specific version corresponding to the platform first followed
+   by the generic version.
+
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
@@ -22,7 +30,7 @@ Optional properties:
 
 Example:
usbhs: usb@e659 {
-   compatible = "renesas,usbhs-r8a7790";
+   compatible = "renesas,usbhs-r8a7790", "renesas,rcar-gen2-usbhs";
reg = <0 0xe659 0 0x100>;
interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7790_CLK_HSUSB>;
diff --git a/drivers/usb/renesas_usbhs/common.c 
b/drivers/usb/renesas_usbhs/common.c
index d82fa36c3465..db9a17bd8997 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -481,6 +481,15 @@ static const struct of_device_id usbhs_of_match[] = {
.compatible = "renesas,usbhs-r8a7795",
.data = (void *)USBHS_TYPE_RCAR_GEN2,
},
+   {
+   .compatible = "renesas,rcar-gen2-usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
+   {
+   /* Gen3 is compatible with Gen2 */
+   .compatible = "renesas,rcar-gen3-usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 3/3] usb: renesas_usbhs: add device tree support for r8a779[23]

2015-12-15 Thread Simon Horman
Simply document new compatibility string.
As a previous patch adds a generic R-Car Gen2 compatibility string
there appears to be no need for a driver updates.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
Acked-by: Rob Herring <r...@kernel.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto...@renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 45d9ae13ffa3..b6040563e51a 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -5,6 +5,8 @@ Required properties:
 
- "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
- "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
+   - "renesas,usbhs-r8a7792" for r8a7792 (R-Car V2H) compatible device
+   - "renesas,usbhs-r8a7793" for r8a7793 (R-Car M2-N) compatible device
- "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
- "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/3] usb: renesas_usbhs: add SoC names to compatibility string documentation

2015-12-15 Thread Simon Horman
This extends the documentation of compatibility strings a little to
include the SoC names.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
Acked-by: Kuninori Morimoto <kuninori.morimoto...@renesas.com>

---
v3
* Split into separate patch
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 7d48f63db44e..a14c0bb561d5 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -2,10 +2,10 @@ Renesas Electronics USBHS driver
 
 Required properties:
   - compatible: Must contain one of the following:
-   - "renesas,usbhs-r8a7790"
-   - "renesas,usbhs-r8a7791"
-   - "renesas,usbhs-r8a7794"
-   - "renesas,usbhs-r8a7795"
+   - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
+   - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
+   - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
+   - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/3] usb: renesas_usbhs: add fallback compatibility strings

2015-12-14 Thread Simon Horman
On Fri, Dec 11, 2015 at 03:24:27PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 12/11/2015 5:12 AM, Simon Horman wrote:
> 
> >Add fallback compatibility strings for R-Car Gen2 and Gen3.
> >This is in keeping with the fallback scheme being adopted wherever
> >appropriate for drivers for Renesas SoCs.
> >
> >Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
> >---
> >v3
> >* Moved documentation of SoC names to a separate patch
> >* Use correct fallback compatibility string in example
> >
> >v2
> >* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
> >   a single compatibility string for all of R-Car.
> >---
> >  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 10 +-
> >  drivers/usb/renesas_usbhs/common.c  |  9 +
> >  2 files changed, 18 insertions(+), 1 deletion(-)
> >
> >diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
> >b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> >index a14c0bb561d5..c55cf77006d0 100644
> >--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> >+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> >@@ -2,10 +2,18 @@ Renesas Electronics USBHS driver
> >
> >  Required properties:
> >- compatible: Must contain one of the following:
> 
>Really?

Would "...one or more of the following" help?

> >+
> > - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
> > - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
> > - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
> > - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
> >+- "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device
> >+- "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
> >+
> >+When compatible with the generic version, nodes must list the
> >+SoC-specific version corresponding to the platform first followed
> >+by the generic version.
> >+
> 
>This kinda contradicts the above claim.
> 
> [...]
> 
> MBR, Sergei
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] usb: renesas_usbhs: add fallback compatibility strings

2015-12-10 Thread Simon Horman
On Thu, Dec 10, 2015 at 07:28:06AM +, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> Thank you for your patch
> 
> > Add fallback compatibility strings for R-Car Gen2 and Gen3.
> > This is in keeping with the fallback scheme being adopted wherever
> > appropriate for drivers for Renesas SoCs.
> > 
> > Also add SoC names.
> > 
> > Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
> > ---
> (snip)
> >  Required properties:
> >- compatible: Must contain one of the following:
> > -   - "renesas,usbhs-r8a7790"
> > -   - "renesas,usbhs-r8a7791"
> > -   - "renesas,usbhs-r8a7794"
> > -   - "renesas,usbhs-r8a7795"
> > +
> > +   - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
> > +   - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
> > +   - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
> > +   - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
> > +   - "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatibile device
> > +   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatibile device
> > +
> > +   When compatible with the generic version, nodes must list the
> > +   SoC-specific version corresponding to the platform first followed
> > +   by the generic version.
> 
> I think these can be separated ?
> 
>  1. document update for "renesas,usbhs-r8a77xx"
>  2. add new "rcar-genX" (this patch)

Sure, will do.

> >  Example:
> > usbhs: usb@e659 {
> > -   compatible = "renesas,usbhs-r8a7790";
> > +   compatible = "renesas,usbhs-r8a7790", "renesas,rcar-usbhs";
> 
> I think you want
> 
>  -compatible = "renesas,usbhs-r8a7790", "renesas,rcar-usbhs";
>  +compatible = "renesas,usbhs-r8a7790", "renesas,rcar-gen2-usbhs";

Thanks, I will fix that.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/3] usb: renesas_usbhs: add device tree support for r8a779[23]

2015-12-10 Thread Simon Horman
Simply document new compatibility string.
As a previous patch adds a generic R-Car Gen2 compatibility string
there appears to be no need for a driver updates.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
Acked-by: Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index c55cf77006d0..471a0649e63e 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -5,6 +5,8 @@ Required properties:
 
- "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
- "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
+   - "renesas,usbhs-r8a7792" for r8a7792 (R-Car V2H) compatible device
+   - "renesas,usbhs-r8a7793" for r8a7793 (R-Car M2-N) compatible device
- "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
- "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/3] usb: renesas_usbhs: More compat strings

2015-12-10 Thread Simon Horman
Hi,

this short series adds generic, and soc-specific r8a7792 and r8a7793 compat
strings to the Renesas USBHS driver. The intention is to provide a complete
set of compat strings for known R-Car SoCs.

Changes since v2:
* Split documentation of SoC names into separate patch
* Use correct fallback compatibility string in example

Changes since v1:
* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
  a single compatibility string for all of R-Car.

Simon Horman (3):
  usb: renesas_usbhs: add SoC names to compatibility string
documentation
  usb: renesas_usbhs: add fallback compatibility strings
  usb: renesas_usbhs: add device tree support for r8a779[23]

 .../devicetree/bindings/usb/renesas_usbhs.txt| 20 +++-
 drivers/usb/renesas_usbhs/common.c   |  9 +
 2 files changed, 24 insertions(+), 5 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/3] usb: renesas_usbhs: add fallback compatibility strings

2015-12-10 Thread Simon Horman
Add fallback compatibility strings for R-Car Gen2 and Gen3.
This is in keeping with the fallback scheme being adopted wherever
appropriate for drivers for Renesas SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
v3
* Moved documentation of SoC names to a separate patch
* Use correct fallback compatibility string in example

v2
* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
  a single compatibility string for all of R-Car.
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 10 +-
 drivers/usb/renesas_usbhs/common.c  |  9 +
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index a14c0bb561d5..c55cf77006d0 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -2,10 +2,18 @@ Renesas Electronics USBHS driver
 
 Required properties:
   - compatible: Must contain one of the following:
+
- "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
- "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
- "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
+   - "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device
+   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device
+
+   When compatible with the generic version, nodes must list the
+   SoC-specific version corresponding to the platform first followed
+   by the generic version.
+
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
@@ -22,7 +30,7 @@ Optional properties:
 
 Example:
usbhs: usb@e659 {
-   compatible = "renesas,usbhs-r8a7790";
+   compatible = "renesas,usbhs-r8a7790", "renesas,rcar-gen2-usbhs";
reg = <0 0xe659 0 0x100>;
interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7790_CLK_HSUSB>;
diff --git a/drivers/usb/renesas_usbhs/common.c 
b/drivers/usb/renesas_usbhs/common.c
index d82fa36c3465..db9a17bd8997 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -481,6 +481,15 @@ static const struct of_device_id usbhs_of_match[] = {
.compatible = "renesas,usbhs-r8a7795",
.data = (void *)USBHS_TYPE_RCAR_GEN2,
},
+   {
+   .compatible = "renesas,rcar-gen2-usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
+   {
+   /* Gen3 is compatible with Gen2 */
+   .compatible = "renesas,rcar-gen3-usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/3] usb: renesas_usbhs: add SoC names to compatibility string documentation

2015-12-10 Thread Simon Horman
This extends the documentation of compatibility strings a little to
include the SoC names.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
v3
* Split into separate patch
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 7d48f63db44e..a14c0bb561d5 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -2,10 +2,10 @@ Renesas Electronics USBHS driver
 
 Required properties:
   - compatible: Must contain one of the following:
-   - "renesas,usbhs-r8a7790"
-   - "renesas,usbhs-r8a7791"
-   - "renesas,usbhs-r8a7794"
-   - "renesas,usbhs-r8a7795"
+   - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
+   - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
+   - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
+   - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 2/3] usb: renesas_usbhs: add fallback compatibility strings

2015-12-10 Thread Simon Horman
On Thu, Dec 10, 2015 at 09:56:24PM -0600, Rob Herring wrote:
> On Fri, Dec 11, 2015 at 11:12:26AM +0900, Simon Horman wrote:
> > Add fallback compatibility strings for R-Car Gen2 and Gen3.
> > This is in keeping with the fallback scheme being adopted wherever
> > appropriate for drivers for Renesas SoCs.
> > 
> > Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
> 
> Binding looks okay, but one possible typo.
> 
> Acked-by: Rob Herring <r...@kernel.org>
> 
> > --- a/drivers/usb/renesas_usbhs/common.c
> > +++ b/drivers/usb/renesas_usbhs/common.c
> > @@ -481,6 +481,15 @@ static const struct of_device_id usbhs_of_match[] = {
> > .compatible = "renesas,usbhs-r8a7795",
> > .data = (void *)USBHS_TYPE_RCAR_GEN2,
> > },
> > +   {
> > +   .compatible = "renesas,rcar-gen2-usbhs",
> > +   .data = (void *)USBHS_TYPE_RCAR_GEN2,
> > +   },
> > +   {
> > +   /* Gen3 is compatible with Gen2 */
> > +   .compatible = "renesas,rcar-gen3-usbhs",
> > +   .data = (void *)USBHS_TYPE_RCAR_GEN2,
> 
> This supposed to be GEN3?

Confusingly the symbol is called GEN2 as it was there for Gen 2
before Gen 3 came along and (so far) Gen 3 is compatible with Gen 2.

I'd be happy to change the name but I think that would be best
as an incremental change on top of this one.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/2] usb: renesas_usbhs: More compat strings

2015-12-09 Thread Simon Horman
Hi,

this short series adds generic, and soc-specific r8a7792 and r8a7793 compat
strings to the Renesas USBHS driver. The intention is to provide a complete
set of compat strings for known R-Car SoCs.

Changes since v1:
* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
  a single compatibility string for all of R-Car.

*** BLURB HERE ***

Simon Horman (2):
  usb: renesas_usbhs: add fallback compatibility strings
  usb: renesas_usbhs: add device tree support for r8a779[23]

 .../devicetree/bindings/usb/renesas_usbhs.txt| 20 +++-
 drivers/usb/renesas_usbhs/common.c   |  9 +
 2 files changed, 24 insertions(+), 5 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/2] usb: renesas_usbhs: add device tree support for r8a779[23]

2015-12-09 Thread Simon Horman
Simply document new compatibility string.
As a previous patch adds a generic R-Car Gen2 compatibility string
there appears to be no need for a driver updates.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
Acked-by: Rob Herring <r...@kernel.org>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index b959059826cd..efb3199a2a80 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -5,6 +5,8 @@ Required properties:
 
- "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
- "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
+   - "renesas,usbhs-r8a7792" for r8a7792 (R-Car V2H) compatible device
+   - "renesas,usbhs-r8a7793" for r8a7793 (R-Car M2-N) compatible device
- "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
- "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
- "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatibile device
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] usb: renesas_usbhs: add fallback compatibility strings

2015-12-09 Thread Simon Horman
Add fallback compatibility strings for R-Car Gen2 and Gen3.
This is in keeping with the fallback scheme being adopted wherever
appropriate for drivers for Renesas SoCs.

Also add SoC names.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
v2
* Add R-Car Gen2 and Gen3 fallback compatibility strings rather than
  a single compatibility string for all of R-Car.
---
 .../devicetree/bindings/usb/renesas_usbhs.txt  | 18 +-
 drivers/usb/renesas_usbhs/common.c |  9 +
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 7d48f63db44e..b959059826cd 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -2,10 +2,18 @@ Renesas Electronics USBHS driver
 
 Required properties:
   - compatible: Must contain one of the following:
-   - "renesas,usbhs-r8a7790"
-   - "renesas,usbhs-r8a7791"
-   - "renesas,usbhs-r8a7794"
-   - "renesas,usbhs-r8a7795"
+
+   - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
+   - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device
+   - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
+   - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device
+   - "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatibile device
+   - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatibile device
+
+   When compatible with the generic version, nodes must list the
+   SoC-specific version corresponding to the platform first followed
+   by the generic version.
+
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
@@ -22,7 +30,7 @@ Optional properties:
 
 Example:
usbhs: usb@e659 {
-   compatible = "renesas,usbhs-r8a7790";
+   compatible = "renesas,usbhs-r8a7790", "renesas,rcar-usbhs";
reg = <0 0xe659 0 0x100>;
interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7790_CLK_HSUSB>;
diff --git a/drivers/usb/renesas_usbhs/common.c 
b/drivers/usb/renesas_usbhs/common.c
index d82fa36c3465..db9a17bd8997 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -481,6 +481,15 @@ static const struct of_device_id usbhs_of_match[] = {
.compatible = "renesas,usbhs-r8a7795",
.data = (void *)USBHS_TYPE_RCAR_GEN2,
},
+   {
+   .compatible = "renesas,rcar-gen2-usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
+   {
+   /* Gen3 is compatible with Gen2 */
+   .compatible = "renesas,rcar-gen3-usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: renesas_usbhs: add fallback compatibility string

2015-12-08 Thread Simon Horman
On Tue, Dec 08, 2015 at 05:35:28PM +0300, Sergei Shtylyov wrote:
> On 12/08/2015 08:51 AM, Simon Horman wrote:
> 
> >Add fallback compatibility string.
> >This is in keeping with the fallback scheme being adopted wherever
> >appropriate for drivers for Renesas SoCs.
> >
> >Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
> >---
> >  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 4 ++--
> >  drivers/usb/renesas_usbhs/common.c  | 4 
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> >
> >diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
> >b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> >index 7d48f63db44e..8c50df8441c9 100644
> >--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> >+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> >@@ -1,7 +1,7 @@
> >  Renesas Electronics USBHS driver
> >
> >  Required properties:
> >-  - compatible: Must contain one of the following:
> >+  - compatible: "renesas,usbhs-", "renesas,rcar-usbhs" as fallback.
> > - "renesas,usbhs-r8a7790"
> > - "renesas,usbhs-r8a7791"
> > - "renesas,usbhs-r8a7794"
> [...]
> >diff --git a/drivers/usb/renesas_usbhs/common.c 
> >b/drivers/usb/renesas_usbhs/common.c
> >index d82fa36c3465..2a9d4f405f30 100644
> >--- a/drivers/usb/renesas_usbhs/common.c
> >+++ b/drivers/usb/renesas_usbhs/common.c
> >@@ -481,6 +481,10 @@ static const struct of_device_id usbhs_of_match[] = {
> > .compatible = "renesas,usbhs-r8a7795",
> > .data = (void *)USBHS_TYPE_RCAR_GEN2,
> > },
> >+{
> >+.compatible = "renesas,usbhs",
> 
>You just documented "renesas,rcar-usbhs".

Thanks. I meant to use "renesas,rcar-usbhs" throughout the patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: renesas_usbhs: add fallback compatibility string

2015-12-08 Thread Simon Horman
On Tue, Dec 08, 2015 at 08:32:49AM +, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > > > Add fallback compatibility string.
> > > > This is in keeping with the fallback scheme being adopted wherever
> > > > appropriate for drivers for Renesas SoCs.
> > > > 
> > > > Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
> > > > ---
> > > (snip)
> > > > +   {
> > > > +   .compatible = "renesas,usbhs",
> > > > +   .data = (void *)USBHS_TYPE_RCAR_GEN2,
> > > > +   },
> > > > { },
> > > >  };
> > > 
> > > I think this is too much. This driver is used not only from R-Car Gen2.
> > > It will work as normal mode if .data was 0.
> > > see usbhs_parse_dt()
> > 
> > Are you suggesting that we remove USBHS_TYPE_RCAR_GEN2 from the driver?
> 
> I mean this
> 
> + {
> + .compatible = "renesas,usbhs",
> + },

(As Sergei noted elsewhere, "renesas,rcar-usbhs" is consistent
 with what I documented elsewhere in the patch)

My understanding is that will cause the driver to operate in a different manner
to if USBHS_TYPE_RCAR_GEN2 was set. And thus meaning
of the generic and SoC-specifc compatibility strings will cause
the driver to operate differently.

Currently the only compat strings present are as follows:

* renesas,usbhs-r8a7790
* renesas,usbhs-r8a7791
* renesas,usbhs-r8a7794
* renesas,usbhs-r8a7795

And they all set USBHS_TYPE_RCAR_GEN2 (even though r8a7795 is a Gen3 SoC).

What I am aiming is either:
* A compatibility string for R-Car or;
* Two compatibility strings, one for R-Car Gen2 and one for R-Car Gen3

And for this new compatibility string or strings to operate the same
way as the current compatibility strings.


Looking over the driver its not clear to me why the
non-USBHS_TYPE_RCAR_GEN2 case is handled by the code as
there are no compatibility strings present that trigger that mode of
operation. I feel that I must be missing something.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: renesas_usbhs: add fallback compatibility string

2015-12-08 Thread Simon Horman
On Wed, Dec 09, 2015 at 06:29:07AM +, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > > > (As Sergei noted elsewhere, "renesas,rcar-usbhs" is consistent
> > > >  with what I documented elsewhere in the patch)
> > > 
> > > "renesas,rcar-usbhs" is better,
> > > but I guess you want to have "renesas,rcar-gen2-usbhs" ?
> > > 
> > > My understanding is these
> > > 
> > >  * renesas,usbhs-r8a77xx  # SoC specific
> > >  * renesas,rcar-usbhs # R-Car common
> > >  * renesas,rcar-gen2-usbhs# R-Car Gen2 common
> > >  * renesas,rcar-gen3-usbhs# R-Car Gen3 common
> > >  * renesas,usbhs  # Renesas USBHS common
> > > 
> > 
> > I was intentionally including gen3 as well. So I think we have two options:
> > 
> > 1. renesas,rcar-usbhs
> > 2. renesas,rcar-gen2-usbhs and renesas,rcar-gen3-usbhs
> 
> Renesas USB always have pick feature/settings.
> Thus, generic name (= "renesas,rcar-usbhs") is very risky IMO.
> I think 2 is more safety.

Sure, better safe than sorry.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: renesas_usbhs: add fallback compatibility string

2015-12-08 Thread Simon Horman
On Wed, Dec 09, 2015 at 04:48:47AM +, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > (As Sergei noted elsewhere, "renesas,rcar-usbhs" is consistent
> >  with what I documented elsewhere in the patch)
> 
> "renesas,rcar-usbhs" is better,
> but I guess you want to have "renesas,rcar-gen2-usbhs" ?
> 
> My understanding is these
> 
>  * renesas,usbhs-r8a77xx  # SoC specific
>  * renesas,rcar-usbhs # R-Car common
>  * renesas,rcar-gen2-usbhs# R-Car Gen2 common
>  * renesas,rcar-gen3-usbhs# R-Car Gen3 common
>  * renesas,usbhs  # Renesas USBHS common
> 

I was intentionally including gen3 as well. So I think we have two options:

1. renesas,rcar-usbhs
2. renesas,rcar-gen2-usbhs and renesas,rcar-gen3-usbhs

Which do you prefer?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: renesas_usbhs: add fallback compatibility string

2015-12-07 Thread Simon Horman
On Tue, Dec 08, 2015 at 06:05:51AM +, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > Add fallback compatibility string.
> > This is in keeping with the fallback scheme being adopted wherever
> > appropriate for drivers for Renesas SoCs.
> > 
> > Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
> > ---
> (snip)
> > +   {
> > +   .compatible = "renesas,usbhs",
> > +   .data = (void *)USBHS_TYPE_RCAR_GEN2,
> > +   },
> > { },
> >  };
> 
> I think this is too much. This driver is used not only from R-Car Gen2.
> It will work as normal mode if .data was 0.
> see usbhs_parse_dt()

Are you suggesting that we remove USBHS_TYPE_RCAR_GEN2 from the driver?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] usb: renesas_usbhs: More compat strings

2015-12-07 Thread Simon Horman
Hi,

this short series adds generic, and soc-specific r8a7792 and r8a7793 compat
strings to the Renesas USBHS driver. The intention is to provide a complete
set of compat strings for known R-Car SoCs.

Simon Horman (2):
  usb: renesas_usbhs: add fallback compatibility string
  usb: renesas_usbhs: add device tree support for r8a779[23]

 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 14 --
 drivers/usb/renesas_usbhs/common.c  |  4 
 2 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] usb: renesas_usbhs: add fallback compatibility string

2015-12-07 Thread Simon Horman
Add fallback compatibility string.
This is in keeping with the fallback scheme being adopted wherever
appropriate for drivers for Renesas SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 4 ++--
 drivers/usb/renesas_usbhs/common.c  | 4 
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 7d48f63db44e..8c50df8441c9 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -1,7 +1,7 @@
 Renesas Electronics USBHS driver
 
 Required properties:
-  - compatible: Must contain one of the following:
+  - compatible: "renesas,usbhs-", "renesas,rcar-usbhs" as fallback.
- "renesas,usbhs-r8a7790"
- "renesas,usbhs-r8a7791"
- "renesas,usbhs-r8a7794"
@@ -22,7 +22,7 @@ Optional properties:
 
 Example:
usbhs: usb@e659 {
-   compatible = "renesas,usbhs-r8a7790";
+   compatible = "renesas,usbhs-r8a7790", "renesas,rcar-usbhs";
reg = <0 0xe659 0 0x100>;
interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
clocks = <_clks R8A7790_CLK_HSUSB>;
diff --git a/drivers/usb/renesas_usbhs/common.c 
b/drivers/usb/renesas_usbhs/common.c
index d82fa36c3465..2a9d4f405f30 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -481,6 +481,10 @@ static const struct of_device_id usbhs_of_match[] = {
.compatible = "renesas,usbhs-r8a7795",
.data = (void *)USBHS_TYPE_RCAR_GEN2,
},
+   {
+   .compatible = "renesas,usbhs",
+   .data = (void *)USBHS_TYPE_RCAR_GEN2,
+   },
{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] usb: renesas_usbhs: add device tree support for r8a779[23]

2015-12-07 Thread Simon Horman
Simply document new compatibility string.
As a previous patch adds a generic R-Car Gen2 compatibility string
there appears to be no need for a driver updates.

Also add names for SoCs.

Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index 8c50df8441c9..b31f036d2171 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -2,10 +2,12 @@ Renesas Electronics USBHS driver
 
 Required properties:
   - compatible: "renesas,usbhs-", "renesas,rcar-usbhs" as fallback.
-   - "renesas,usbhs-r8a7790"
-   - "renesas,usbhs-r8a7791"
-   - "renesas,usbhs-r8a7794"
-   - "renesas,usbhs-r8a7795"
+   - "renesas,usbhs-r8a7790" (R-Car H2)
+   - "renesas,usbhs-r8a7791" (R-Car M2-W)
+   - "renesas,usbhs-r8a7792" (R-Car V2H)
+   - "renesas,usbhs-r8a7793" (R-Car M2-N)
+   - "renesas,usbhs-r8a7794" (R-Car E2)
+   - "renesas,usbhs-r8a7795" (R-Car H3)
   - reg: Base address and length of the register for the USBHS
   - interrupts: Interrupt specifier for the USBHS
   - clocks: A list of phandle + clock specifier pairs
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: phy: Remove unused Renesas R-Car (Gen1) USB PHY driveer

2015-12-06 Thread Simon Horman
On Fri, Dec 04, 2015 at 05:04:25PM +0100, Geert Uytterhoeven wrote:
> As of commit 3d7608e4c169af03 ("ARM: shmobile: bockw: remove legacy
> board file and config"), the Renesas R-Car (Gen1) USB PHY driver is no
> longer used.
> In theory it could still be used on R-Car Gen1 SoCs, but that would
> require adding DT support to the driver. Instead, a new driver using the
> generic PHY framework should be written, as was done for R-Car Gen2.
> 
> Remove the driver for good.
> 
> Signed-off-by: Geert Uytterhoeven <geert+rene...@glider.be>

There is a typo in the subject, but that aside:

Acked-by: Simon Horman <horms+rene...@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] arm: koelsch: make USB0 perform Host/Function switching

2015-07-02 Thread Simon Horman
Hi Phil,

when you re-spin this patch could you change the prefix to the following?

ARM: shmobile: koelsch:

Thanks
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: renesas_usbhs: avoid uninitialized variable use

2015-05-24 Thread Simon Horman
On Fri, May 22, 2015 at 11:33:57AM +, Yoshihiro Shimoda wrote:
 Hi Arnd,
 
  Sent: Friday, May 22, 2015 8:07 PM
  
  After the renesas_usbhs driver is enabled in ARM multi_v7_defconfig,
  we now get a new warning:
  
  renesas_usbhs/mod.c: In function 'usbhs_interrupt':
  renesas_usbhs/mod.c:246:7: warning: 'intenb1' may be used uninitialized in 
  this function [-Wmaybe-uninitialized]
  
  gcc correctly points to a problem here, for the case that the
  device is in host mode, we use the intenb1 variable without
  having assigned it first. The state-intsts1 has a similar
  problem, but gcc cannot know that.
  
  This avoids the problem by initializing both sides of the
  comparison to zero when we don't read them from the respective
  registers.
  
  Signed-off-by: Arnd Bergmann a...@arndb.de
  Fixes: 88a25e02f3 (usb: renesas_usbhs: Add access control for INTSTS1 and 
  INTENB1 register)
 
 Thank you very much for the patch!
 
 Acked-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
 
 (I'm not sure why a toolchain I used (Linaro GCC 2014.11) doesn't show this 
 warning...)
 
 Best regards,
 Yoshihiro Shimoda

Reviewed-by: Simon Horman horms+rene...@verge.net.au

 
  diff --git a/drivers/usb/renesas_usbhs/mod.c 
  b/drivers/usb/renesas_usbhs/mod.c
  index e5ce6e6d4f51..d4be5d594896 100644
  --- a/drivers/usb/renesas_usbhs/mod.c
  +++ b/drivers/usb/renesas_usbhs/mod.c
  @@ -223,6 +223,8 @@ static int usbhs_status_get_each_irq(struct usbhs_priv 
  *priv,
  if (usbhs_mod_is_host(priv)) {
  state-intsts1 = usbhs_read(priv, INTSTS1);
  intenb1 = usbhs_read(priv, INTENB1);
  +   } else {
  +   state-intsts1 = intenb1 = 0;
  }
  
  /* mask */
  
  --
  To unsubscribe from this list: send the line unsubscribe linux-usb in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] usb: renesas_usbhs: Change USBHS_TYPE_R8A779x to USBHS_TYPE_RCAR_GEN2

2015-05-18 Thread Simon Horman
On Mon, May 18, 2015 at 08:04:14PM +0900, Yoshihiro Shimoda wrote:
 Since the HSUSB controllers of R-Car Gen2 are the same specification
 (they have 16 pipes and usb-dmac), this patch changes USBHS_TYPE_R8A7790
 and USBHS_TYPE_R8A7791 to USBHS_TYPE_RCAR_GEN2.
 
 Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com

Acked-by: Simon Horman horms+rene...@verge.net.au
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] ARM: shmobile: r8a7790: add for USB-DMAC

2015-02-09 Thread Simon Horman
On Mon, Feb 09, 2015 at 08:41:18AM +, yoshihiro shimoda wrote:
  Subject: [PATCH 0/2] ARM: shmobile: r8a7790: add for USB-DMAC
 
 Oops, I mistook this subject of cover-letter.
 However, actual patches are correct.

Thanks,

I think it would be best if you resubmitted this series, which is for the
r8a7791, and the other similar series for the r8a7790 once the relevant
driver changes have been accepted by their subsystem maintainer.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: renesas_usbhs: fix NULL pointer dereference in dma_release_channel()

2015-01-30 Thread Simon Horman
On Fri, Jan 30, 2015 at 03:58:23PM +0900, Yoshihiro Shimoda wrote:
 This patch fixes an issue that the following commit causes NULL
 pointer dereference in dma_release_channel().
  usb: renesas_usbhs: add support for requesting DT DMA
  (commit id abd2dbf6bb1b5f3a03a8c76b1a8879da1dd30caa)
 
 The usbhsf_dma_init_dt() should set fifo-{t,r}x_chan to NULL if
 dma_request_slave_channel_reason() returns IS_ERR value.
 Otherwise, usbhsf_dma_quit() will call dma_release_channel(), and then
 NULL pointer dereference happens.
 
 Reported-by: Simon Horman ho...@verge.net.au
 Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com

I have tested this on the lager and koelsch boards using
shmobile_defconfig and next-20150129 as a base. The environment
where I originally observed the problem.

Tested-by: Simon Horman horms+rene...@verge.net.au

 ---
 This patch is based on Felipe's usb.git / testing/next branch.
 (commit id =7db3990cb707ff91cd6507d53a0a730afe97)
 
  drivers/usb/renesas_usbhs/fifo.c |4 
  1 file changed, 4 insertions(+)
 
 diff --git a/drivers/usb/renesas_usbhs/fifo.c 
 b/drivers/usb/renesas_usbhs/fifo.c
 index 4c086b1..d891bff 100644
 --- a/drivers/usb/renesas_usbhs/fifo.c
 +++ b/drivers/usb/renesas_usbhs/fifo.c
 @@ -1072,7 +1072,11 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo 
 *fifo)
  static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo)
  {
   fifo-tx_chan = dma_request_slave_channel_reason(dev, tx);
 + if (IS_ERR(fifo-tx_chan))
 + fifo-tx_chan = NULL;
   fifo-rx_chan = dma_request_slave_channel_reason(dev, rx);
 + if (IS_ERR(fifo-rx_chan))
 + fifo-rx_chan = NULL;
  }
  
  static void usbhsf_dma_init(struct usbhs_priv *priv,
 -- 
 1.7.9.5
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] usb: renesas_usbhs: add support for requesting DT DMA

2015-01-29 Thread Simon Horman
Hi Shimoda-san,

On Mon, Jan 19, 2015 at 12:53:17PM +0900, Yoshihiro Shimoda wrote:
 This patch adds dma_request_slave_channel_reason() calling to request
 dma slave channels for multiplatform environment.
 
 Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
 ---
  .../devicetree/bindings/usb/renesas_usbhs.txt  |2 ++
  drivers/usb/renesas_usbhs/fifo.c   |   11 ++-
  2 files changed, 12 insertions(+), 1 deletion(-)

I have observed what appears to be a regression caused by this
patch when booting a kernel built using shmobile_defconfig on the koelsch
and lager boards.

I noticed this problem while testing next-20150129.

I have provided boot logs at the end of this email.

 
 diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt 
 b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
 index b08c903..61b045b 100644
 --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
 +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
 @@ -14,6 +14,8 @@ Optional properties:
function should be enabled
- phys: phandle + phy specifier pair
- phy-names: must be usb
 +  - dmas: Must contain a list of references to DMA specifiers.
 +  - dma-names : Must contain a list of DMA names, tx or rx.
  
  Example:
   usbhs: usb@e659 {
 diff --git a/drivers/usb/renesas_usbhs/fifo.c 
 b/drivers/usb/renesas_usbhs/fifo.c
 index 48e31b9..4c086b1 100644
 --- a/drivers/usb/renesas_usbhs/fifo.c
 +++ b/drivers/usb/renesas_usbhs/fifo.c
 @@ -1069,12 +1069,21 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo 
 *fifo)
   fifo-rx_slave);
  }
  
 +static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo)
 +{
 + fifo-tx_chan = dma_request_slave_channel_reason(dev, tx);
 + fifo-rx_chan = dma_request_slave_channel_reason(dev, rx);
 +}
 +
  static void usbhsf_dma_init(struct usbhs_priv *priv,
   struct usbhs_fifo *fifo)
  {
   struct device *dev = usbhs_priv_to_dev(priv);
  
 - usbhsf_dma_init_pdev(fifo);
 + if (dev-of_node)
 + usbhsf_dma_init_dt(dev, fifo);
 + else
 + usbhsf_dma_init_pdev(fifo);
  
   if (fifo-tx_chan || fifo-rx_chan)
   dev_dbg(dev, enable DMAEngine (%s%s%s)\n,


Koelsch
---

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 3.19.0-rc5-00129-gabd2dbf 
(ho...@ayumi.isobedori.kobe.vergenet.net) (gcc version 4.6.3 (GCC) ) #959 SMP 
Thu Jan 29 20:40:07 JST 2015
CPU: ARMv7 Processor [413fc0f2] revision 2 (ARMv7), cr=10c5307d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Machine model: Koelsch
Ignoring memory block 0x2 - 0x24000
debug: ignoring loglevel setting.
Memory policy: Data cache writealloc
On node 0 totalpages: 262144
free_area_init_node: node 0, pgdat c0612a80, node_mem_map eeff9000
  Normal zone: 1520 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 194560 pages, LIFO batch:31
  HighMem zone: 67584 pages, LIFO batch:15
PERCPU: Embedded 7 pages/cpu @eefca000 s7552 r0 d21120 u32768
pcpu-alloc: s7552 r0 d21120 u32768 alloc=8*4096
pcpu-alloc: [0] 0 [0] 1 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624
Kernel command line: ignore_loglevel rw root=/dev/nfs ip=dhcp
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1032964K/1048576K available (4524K kernel code, 264K rwdata, 1128K 
rodata, 268K init, 191K bss, 15612K reserved, 0K cma-reserved, 270336K highmem)
Virtual kernel memory layout:
vector  : 0x - 0x1000   (   4 kB)
fixmap  : 0xffc0 - 0xfff0   (3072 kB)
vmalloc : 0xf000 - 0xff00   ( 240 MB)
lowmem  : 0xc000 - 0xef80   ( 760 MB)
pkmap   : 0xbfe0 - 0xc000   (   2 MB)
  .text : 0xc0008000 - 0xc058e024   (5657 kB)
  .init : 0xc058f000 - 0xc05d2000   ( 268 kB)
  .data : 0xc05d2000 - 0xc06143a0   ( 265 kB)
   .bss : 0xc06143a0 - 0xc064407c   ( 192 kB)
Hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
Architected cp15 timer(s) running at 10.00MHz (virt).
sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 3435973836800ns
Switching to timer-based delay loop, resolution 100ns
Console: colour dummy device 80x30
console [tty0] enabled
Calibrating delay loop (skipped), value calculated using timer frequency.. 
20.00 BogoMIPS (lpj=10)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: update cpu_capacity 1024
CPU0: thread -1, cpu 0, socket 0, mpidr 8000
Setting 

Re: [PATCH v2 2/2] ARM: shmobile: lager: enable USB3.0

2014-11-03 Thread Simon Horman
On Fri, Oct 31, 2014 at 01:22:22PM +, yoshihiro shimoda wrote:
 Hi Simon-san,
 
  On Fri, Oct 31, 2014 at 02:06:14AM +, yoshihiro shimoda wrote:
   Hi Simon-san,
  
On Wed, Oct 29, 2014 at 08:19:30PM +0900, Yoshihiro Shimoda wrote:
 Hi Magnus-san,

 (2014/10/29 15:53), Magnus Damm wrote:
snip 
 
  Hi Shimoda-san,
 
  Thanks for your patch. I'm fine with this patch as a first step,
  but I'm wondering what the reason is to prioritize USB 2.0 over USB 
  3.0?

 I investigated this reason today, and I found the reason is
 request_firmware().  I checked the following environments:

 Case 1: xHCI and EHCI and OHCI are enabled =y
 Case 2: xHCI and EHCI and OHCI are loadable modules =m
 Case 3: xHCI and EHCI and OHCI are enabled =y,
 and CONFIG_EXTRA_FIRMWARE is enabled

 The results are:
 - In Case 1, EHCI and OHCI are probed first because xHCI didn't 
 find the firmware.
 - In Case 2 and Case 3, xHCI is probed first.

  Is the current order just based on device init order? In my mind
  the expected behavior would be to always use USB 3.0 if it
  happens to be available in the hardware, specified in the DTS,
  enabled by the kernel configuration and firmware is loadable. Or
  does some case exist where it is better to use USB 2.0? I suspect 
  no.

 I agree with you.

  So I wonder if you have any plans how to make USB 3.0 enabled by
  default on Lager?

 It depends on a kernel config. I'm not sure of the
 shmobile_defconfig strategy.  But, in my opinion, one of a
 solution is kernel modules (this means the Case 2.)
   
It sounds like we should enable CONFIG_EXTRA_FIRMWARE in
shmobile_defconfig. I wonder what if any fallout we can foresee 
occurring if we do that.
  
   According to the firmware/README.AddingFirmware, we are unable to add a 
   new firmware image to the firmware directory
  now.
   So, if we enable CONFIG_EXTRA_FIRMWARE with the xHCI firmware, we will 
   not build kernel because the xHCI firmware doesn't
  exist in the linux.git.
  
   === from  firmware/README.AddingFirmware
   =
   This directory is _NOT_ for adding arbitrary new firmware images. The
   place to add those is the separate linux-firmware repository:
  
  
   git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.
   git
   ==
   
  
  Thanks. It seems that EXTRA_FIRMWARE is not an option from a mainline point 
  of view after all.
  
  Is the problem in case 1 that the firmware can't be found because userspace 
  does exist yet and thus can't be loaded from
  there?
 
 That's correct.
 If EXTRA_FIRMWARE is not set, the following error happens:
 
 xhci-hcd ee00.usb: Direct firmware load for r8a779x_usb3_v1.dlmem failed 
 with error -2
 xhci-hcd ee00.usb: can't setup: -2
 xhci-hcd ee00.usb: USB bus 1 deregistered
 xhci-hcd: probe of ee00.usb failed with error -2

At the risk of adding noise to this discussion:
It seems like case 2 with a fallback to case 3 is the way to go.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] ARM: shmobile: lager: enable USB3.0

2014-10-30 Thread Simon Horman
On Fri, Oct 31, 2014 at 02:06:14AM +, yoshihiro shimoda wrote:
 Hi Simon-san,
 
  On Wed, Oct 29, 2014 at 08:19:30PM +0900, Yoshihiro Shimoda wrote:
   Hi Magnus-san,
  
   (2014/10/29 15:53), Magnus Damm wrote:
  snip 
   
Hi Shimoda-san,
   
Thanks for your patch. I'm fine with this patch as a first step, but
I'm wondering what the reason is to prioritize USB 2.0 over USB 3.0?
  
   I investigated this reason today, and I found the reason is
   request_firmware().  I checked the following environments:
  
   Case 1: xHCI and EHCI and OHCI are enabled =y
   Case 2: xHCI and EHCI and OHCI are loadable modules =m
   Case 3: xHCI and EHCI and OHCI are enabled =y,
   and CONFIG_EXTRA_FIRMWARE is enabled
  
   The results are:
   - In Case 1, EHCI and OHCI are probed first because xHCI didn't find 
   the firmware. 
   - In Case 2 and Case 3, xHCI is probed first.
  
Is the current order just based on device init order? In my mind the
expected behavior would be to always use USB 3.0 if it happens to be
available in the hardware, specified in the DTS, enabled by the
kernel configuration and firmware is loadable. Or does some case
exist where it is better to use USB 2.0? I suspect no.
  
   I agree with you.
  
So I wonder if you have any plans how to make USB 3.0 enabled by
default on Lager?
  
   It depends on a kernel config. I'm not sure of the shmobile_defconfig
   strategy.  But, in my opinion, one of a solution is kernel modules
   (this means the Case 2.)
  
  It sounds like we should enable CONFIG_EXTRA_FIRMWARE in 
  shmobile_defconfig. I wonder what if any fallout we can foresee
  occurring if we do that.
 
 According to the firmware/README.AddingFirmware, we are unable to add a new 
 firmware image to the firmware directory now.
 So, if we enable CONFIG_EXTRA_FIRMWARE with the xHCI firmware, we will not 
 build kernel because the xHCI firmware doesn't exist in the linux.git.
 
 === from  firmware/README.AddingFirmware =
 This directory is _NOT_ for adding arbitrary new firmware images. The
 place to add those is the separate linux-firmware repository:
 
 git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
 ==

Thanks. It seems that EXTRA_FIRMWARE is not an option from
a mainline point of view after all.

Is the problem in case 1 that the firmware can't be found because
userspace does exist yet and thus can't be loaded from there?
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/2] ARM: shmobile: lager: enable USB3.0

2014-10-29 Thread Simon Horman
On Wed, Oct 29, 2014 at 08:19:30PM +0900, Yoshihiro Shimoda wrote:
 Hi Magnus-san,
 
 (2014/10/29 15:53), Magnus Damm wrote:
  On Fri, Oct 24, 2014 at 7:41 PM, Yoshihiro Shimoda
  yoshihiro.shimoda...@renesas.com wrote:
  Since the PHY of USB3.0 and EHCI/OHCI ch2 are the same, the USB3.0
  driver cannot use the phy driver when the EHCI/OHCI ch2 already used it:
 
  phy phy-e6590100.usb-phy.3: phy init failed -- -16
  xhci-hcd: probe of ee00.usb failed with error -16
 
  If so, we have to unbind the EHCI/OHCI ch2, and then we have to bind
  the USB3.0 driver as the following:
 
echo :02:02.0  /sys/bus/pci/drivers/ehci-pci/unbind
echo :02:01.0  /sys/bus/pci/drivers/ohci-pci/unbind
echo ee00.usb  /sys/bus/platform/drivers/xhci-hcd/bind
 
  Note that there will be pinctrl-related error messages if both
  internal PCI and USB3.0 are enabled but they should be just ignored:
 
  sh-pfc e606.pfc: pin GP_5_22 already requested by ee0d.pci; cannot 
  claim for ee00.usb
  sh-pfc e606.pfc: pin-182 (ee00.usb) status -22
  ata1: SATA link down (SStatus 0 SControl 300)
  sh-pfc e606.pfc: could not request pin 182 (GP_5_22) from group usb2  
  on device sh-pfc
 
  Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
  ---
   arch/arm/boot/dts/r8a7790-lager.dts |6 ++
   1 file changed, 6 insertions(+)
  
  Hi Shimoda-san,
  
  Thanks for your patch. I'm fine with this patch as a first step, but
  I'm wondering what the reason is to prioritize USB 2.0 over USB 3.0?
 
 I investigated this reason today, and I found the reason is
 request_firmware().  I checked the following environments:
 
  Case 1: xHCI and EHCI and OHCI are enabled =y Case 2: xHCI and EHCI
  and OHCI are loadable modules =m Case 3: xHCI and EHCI and OHCI are
  enabled =y, and CONFIG_EXTRA_FIRMWARE is enabled
 
 The results are: - In Case 1, EHCI and OHCI are probed first because
 xHCI didn't find the firmware.  - In Case 2 and Case 3, xHCI is
 probed first.
 
  Is the current order just based on device init order? In my mind the
  expected behavior would be to always use USB 3.0 if it happens to be
  available in the hardware, specified in the DTS, enabled by the kernel
  configuration and firmware is loadable. Or does some case exist where
  it is better to use USB 2.0? I suspect no.
 
 I agree with you.
 
  So I wonder if you have any plans how to make USB 3.0 enabled by
  default on Lager?
 
 It depends on a kernel config. I'm not sure of the shmobile_defconfig
 strategy.  But, in my opinion, one of a solution is kernel modules (this
 means the Case 2.)

It sounds like we should enable CONFIG_EXTRA_FIRMWARE in
shmobile_defconfig. I wonder what if any fallout we can foresee occurring
if we do that.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/2] ARM: shmobile: add USB3.0 device node on r8a7790

2014-10-26 Thread Simon Horman
On Fri, Oct 24, 2014 at 07:41:45PM +0900, Yoshihiro Shimoda wrote:
  This series is based on Simon's renesas.git branch and
 renesas-devel-20141024-v3.18-rc1 tag. If we use the generic phy
 driver for R-Car Gen2 (drivers/phy/phy-rcar-gen2.c), we can use
 the USB3.0 on lager.

Thanks, I have queued these up.

 
 Changes from v1:
  - rebase the repository.
 
 Yoshihiro Shimoda (2):
   ARM: shmobile: r8a7790: add USB3.0 device node
   ARM: shmobile: lager: enable USB3.0
 
  arch/arm/boot/dts/r8a7790-lager.dts |6 ++
  arch/arm/boot/dts/r8a7790.dtsi  |   10 ++
  2 files changed, 16 insertions(+)
 
 -- 
 1.7.9.5
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 0/2] Add HS-USB device tree support for R8A7790/Lager board

2014-10-26 Thread Simon Horman
On Fri, Oct 24, 2014 at 07:44:32PM +0900, Yoshihiro Shimoda wrote:
 Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
 'renesas-devel-20141024-v3.18-rc1' tag. Here we add the HS-USB device tree
 support on the R8A7790/Lager reference board. The patchset requires the USB 
 PHY
 driver (already merged by Kishon and Greg) and the generic PHY support patches
 for the HS-USB driver posted by Yoshihiro Shimoda in order to work...

Thanks, I have queued these up.

 
 Changes from v4:
  - rebase the repository.
 
 Yoshihiro Shimoda (2):
   ARM: shmobile: r8a7790: add HS-USB device node
   ARM: shmobile: lager: enable HS-USB
 
  arch/arm/boot/dts/r8a7790-lager.dts |   12 
  arch/arm/boot/dts/r8a7790.dtsi  |   11 +++
  2 files changed, 23 insertions(+)
 
 -- 
 1.7.9.5
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/1] ARM: shmobile: add USB3.0 device node on r8a7791

2014-10-26 Thread Simon Horman
On Fri, Oct 24, 2014 at 07:43:01PM +0900, Yoshihiro Shimoda wrote:
  This patch is based on Simon's renesas.git branch and
 renesas-devel-20141024-v3.18-rc1 tag.
 Since koelsch and henninger doesn't have a USB3.0 connector,
 I submit a patch for r8a7791.dtsi only.

Thanks, I have queued this up.

 
 Changes from v1:
  - rebase the repository.
 
 Yoshihiro Shimoda (1):
   ARM: shmobile: r8a7791: add USB3.0 device node
 
  arch/arm/boot/dts/r8a7791.dtsi |   10 ++
  1 file changed, 10 insertions(+)
 
 -- 
 1.7.9.5
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 0/3] HS-USB device tree support for R8A7791/Koelsch/Henninger board

2014-10-26 Thread Simon Horman
On Fri, Oct 24, 2014 at 07:45:05PM +0900, Yoshihiro Shimoda wrote:
Here's the set of 3 patches against Simon Horman's 'renesas.git' repo,
 'renesas-devel-20141024-v3.18-rc1' tag. Here we add the HS-USB device tree
 support on the R8A7791/Koelsch/Henninger reference boards. The patchset
 requires the USB PHY driver (already merged by Kishon and Greg) and the
 generic PHY support patches for the HS-USB driver posted by Yoshihiro Shimoda
 in order to work...
 
 Changes from v3:
  - rebase the repository.

Thanks, I have queued these up.

 
 Yoshihiro Shimoda (3):
   ARM: shmobile: r8a7791: add HS-USB device node
   ARM: shmobile: koelsch: enable HS-USB
   ARM: shmobile: henninger: enable HS-USB
 
  arch/arm/boot/dts/r8a7791-henninger.dts |7 +++
  arch/arm/boot/dts/r8a7791-koelsch.dts   |7 +++
  arch/arm/boot/dts/r8a7791.dtsi  |   11 +++
  3 files changed, 25 insertions(+)
 
 -- 
 1.7.9.5
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: shmobile: add USB3.0 device node on r8a7791

2014-10-23 Thread Simon Horman
On Wed, Oct 08, 2014 at 03:27:55PM +0900, Yoshihiro Shimoda wrote:
 (2014/10/08 15:24), Yoshihiro Shimoda wrote:
   This patch is based on Simon's renesas.git branch and
  renesas-devel-20141007-v3.17 tag.
  Since koelsch and henninger doesn't have a USB3.0 connector,
  I submit a patch for r8a7791.dtsi only.
  
  Yoshihiro Shimoda (1):
ARM: shmobile: r8a7791: add USB3.0 device node
  
   arch/arm/boot/dts/r8a7791.dtsi |   10 ++
   1 file changed, 10 insertions(+)
  
 
 Oops, this patch means [PATCH 0/1]...
 Also the [PATCH] ARM: shmobile: r8a7791: add USB3.0 device node email means
 [PATCH 1/1].

Hi Shimoda-san,

could you update me on the status of this patch.
Should I queue it up?
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] ARM: shmobile: add USB3.0 device node on r8a7790

2014-10-23 Thread Simon Horman
On Wed, Oct 08, 2014 at 03:24:28PM +0900, Yoshihiro Shimoda wrote:
  This series is based on Simon's renesas.git branch and
 renesas-devel-20141007-v3.17 tag. If we use the generic phy
 driver for R-Car Gen2 (drivers/phy/phy-rcar-gen2.c), we can use
 the USB3.0 on lager.
 
 Yoshihiro Shimoda (2):
   ARM: shmobile: r8a7790: add USB3.0 device node
   ARM: shmobile: lager: enable USB3.0
 
  arch/arm/boot/dts/r8a7790-lager.dts |6 ++
  arch/arm/boot/dts/r8a7790.dtsi  |   10 ++
  2 files changed, 16 insertions(+)

Hi Shimoda-san,

could you update me on the status of this patch.
Should I queue it up?
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] ARM: shmobile: add USB3.0 device node on r8a7790

2014-10-23 Thread Simon Horman
On Fri, Oct 24, 2014 at 04:44:28AM +, yoshihiro shimoda wrote:
 Hi Simon-san,
 
  On Wed, Oct 08, 2014 at 03:24:28PM +0900, Yoshihiro Shimoda wrote:
This series is based on Simon's renesas.git branch and
   renesas-devel-20141007-v3.17 tag. If we use the generic phy driver for
   R-Car Gen2 (drivers/phy/phy-rcar-gen2.c), we can use the USB3.0 on
   lager.
  
   Yoshihiro Shimoda (2):
 ARM: shmobile: r8a7790: add USB3.0 device node
 ARM: shmobile: lager: enable USB3.0
  
arch/arm/boot/dts/r8a7790-lager.dts |6 ++
arch/arm/boot/dts/r8a7790.dtsi  |   10 ++
2 files changed, 16 insertions(+)
  
  Hi Shimoda-san,
  
  could you update me on the status of this patch.
  Should I queue it up?
 
 Yes.
 So, should I rebase this patch serias on the current your repository?

Yes, please rebase it on renesas-devel-20141024-v3.18-rc1
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: shmobile: add USB3.0 device node on r8a7791

2014-10-23 Thread Simon Horman
On Fri, Oct 24, 2014 at 04:43:55AM +, yoshihiro shimoda wrote:
 Hi Simon-san,
 
  On Wed, Oct 08, 2014 at 03:27:55PM +0900, Yoshihiro Shimoda wrote:
   (2014/10/08 15:24), Yoshihiro Shimoda wrote:
 This patch is based on Simon's renesas.git branch and
renesas-devel-20141007-v3.17 tag.
Since koelsch and henninger doesn't have a USB3.0 connector, I
submit a patch for r8a7791.dtsi only.
   
Yoshihiro Shimoda (1):
  ARM: shmobile: r8a7791: add USB3.0 device node
   
 arch/arm/boot/dts/r8a7791.dtsi |   10 ++
 1 file changed, 10 insertions(+)
   
  
   Oops, this patch means [PATCH 0/1]...
   Also the [PATCH] ARM: shmobile: r8a7791: add USB3.0 device node
   email means [PATCH 1/1].
  
  Hi Shimoda-san,
  
  could you update me on the status of this patch.
  Should I queue it up?
 
 Yes.
 So, should I rebase this patch on the current your repository?

Yes, please rebase it on renesas-devel-20141024-v3.18-rc1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 0/2] Add HS-USB device tree support for R8A7790/Lager board

2014-10-23 Thread Simon Horman
On Wed, Oct 08, 2014 at 11:53:11PM +0400, Sergei Shtylyov wrote:
 Hello.
 
Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
 'renesas-devel-20141007-v3.17' tag. Here we add the HS-USB device tree support
 on the R8A7790/Lager reference board. The patchset requires the USB PHY
 driver (already merged by Kishon and Greg) and the generic PHY support patches
 for the HS-USB driver posted by Yoshihiro Shimoda in order to work...
 
 [1/2] ARM: shmobile: r8a7790: add HS-USB device node
 [2/2] ARM: shmobile: lager: enable HS-USB

Now that v3.18-rc1 is present in my devel branch should I queue-up
these patches? If so, please rebase them on renesas-devel-20141024-v3.18-rc1
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] arm: shmobile: lager: enable HS-USB

2014-10-05 Thread Simon Horman
On Mon, Oct 06, 2014 at 09:59:48AM +0900, Yoshihiro Shimoda wrote:
 Hello.
 
 (2014/10/04 4:50), Sergei Shtylyov wrote:
  On 10/02/2014 12:04 PM, Yoshihiro Shimoda wrote:
  
  Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
  ---
arch/arm/boot/dts/r8a7790-lager.dts |5 +
1 file changed, 5 insertions(+)
  
  diff --git a/arch/arm/boot/dts/r8a7790-lager.dts 
  b/arch/arm/boot/dts/r8a7790-lager.dts
  index 1698591..4badd0a 100644
  --- a/arch/arm/boot/dts/r8a7790-lager.dts
  +++ b/arch/arm/boot/dts/r8a7790-lager.dts
  @@ -445,3 +445,8 @@
 };
 };
};
  +
  +hsusb {
  +  status = okay;
  +  renesas,enable-gpio = gpio5 18 GPIO_ACTIVE_LOW;
  
  It's certainly active-high.
 
 Since the current code has the following, we have to set the active_low...
 However, the code is unreadable, I think. So, I will modify the code.

It seems to me that would be best.

As far as possible the bindings and their use should
describe the hardware rather than the software.

   /* check GPIO determining if USB function should be enabled */
   if (priv-dparam.enable_gpio) {
   gpio_request_one(priv-dparam.enable_gpio, GPIOF_IN, NULL);
   ret = !gpio_get_value(priv-dparam.enable_gpio);
   gpio_free(priv-dparam.enable_gpio);
   if (ret) {
   dev_warn(pdev-dev,
USB function not selected (GPIO %d)\n,
priv-dparam.enable_gpio);
   ret = -ENOTSUPP;
   goto probe_end_mod_exit;
   }
   }
 
 Best regards,
 Yoshihiro Shimoda
 
  WBR, Sergei
  
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 0/2] Add USB PHY device tree support for R8A7790/Lager board

2014-09-29 Thread Simon Horman
On Fri, Sep 26, 2014 at 01:58:01PM -0700, Sergei Shtylyov wrote:
 Hello.
 
Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
 'renesas-devel-20140924-v3.17-rc6' tag. Here we add the USB PHY device tree
 support on the R8A7790/Lager reference board. The patchset requires the USB 
 PHY
 driver already merged by Kishon and Greg in order to work, so can be applied 
 at
 last...
 
 [1/2] ARM: shmobile: r8a7790: add USB PHY DT support
 [2/2] ARM: shmobile: lager: enable USB PHY

Thanks, I have queued these up.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 0/3] Add USB PHY device tree support for R8A7791/Koelsch/Henninger board

2014-09-29 Thread Simon Horman
On Sat, Sep 27, 2014 at 01:05:41AM +0400, Sergei Shtylyov wrote:
 Hello.
 
Here's the set of 3 patches against Simon Horman's 'renesas.git' repo,
 'renesas-devel-20140924-v3.17-rc6' tag. Here we add the USB PHY device tree
 support on the R8A7791/Koelsch/Henninger boards. The patchset requires the USB
 PHY driver already merged by Kishon and Greg in order to work, so can be
 applied at last...
 
 [1/3] ARM: shmobile: r8a7791: add USB PHY DT support
 [2/3] ARM: shmobile: koelsch: enable USB PHY
 [3/3] ARM: shmobile: henninger: enable USB PHY

Thanks, I have queued these up.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] ARM: shmobile: r8a7790: link PCI USB devices to USB PHY

2014-09-29 Thread Simon Horman
On Mon, Sep 29, 2014 at 10:21:59PM +0400, Sergei Shtylyov wrote:
 Describe the PCI USB devices that are behind the PCI bridges, adding necessary
 links to the USB PHY device.
 
 Based on the original work by Ben Dooks ben.do...@codethink.co.uk.
 
 Signed-off-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com

Thanks, I have queued this up.

 
 ---
 This patch is against 'renesas-devel-20140924-v3.17-rc6' tag of Simon Horman's
 'renesas.git' repo plus R8A7790/Lager USB PHY support patches posted before.
 The patch requires the USB PHY driver and USB HCD generic PHY support (merged
 by Kishon and Greg recently) in order to work.
 
 Changes in version 4:
 - refreshed the patch.
 
 Changes in version 3:
 - adjusted phys properties in the PCI OHCI/EHCI device nodes;
 - resolved rejects.
 
 Changes in version 2:
 - renamed the PCI OHCI/EHCI device nodes to comply with the PCI binding;
 - changed the PHY specifier in the PCI#2 node to reflect that channel #1 
 support
   was dropped;
 - resolved rejects, refreshed the patch.
 
  arch/arm/boot/dts/r8a7790.dtsi |   28 
  1 file changed, 28 insertions(+)
 
 Index: renesas/arch/arm/boot/dts/r8a7790.dtsi
 ===
 --- renesas.orig/arch/arm/boot/dts/r8a7790.dtsi
 +++ renesas/arch/arm/boot/dts/r8a7790.dtsi
 @@ -1107,6 +1107,20 @@
   interrupt-map = 0x 0 0 1 gic 0 108 IRQ_TYPE_LEVEL_HIGH
0x0800 0 0 1 gic 0 108 IRQ_TYPE_LEVEL_HIGH
0x1000 0 0 2 gic 0 108 IRQ_TYPE_LEVEL_HIGH;
 +
 + usb@0,1 {
 + reg = 0x800 0 0 0 0;
 + device_type = pci;
 + phys = usb0 0;
 + phy-names = usb;
 + };
 +
 + usb@0,2 {
 + reg = 0x1000 0 0 0 0;
 + device_type = pci;
 + phys = usb0 0;
 + phy-names = usb;
 + };
   };
  
   pci1: pci@ee0b {
 @@ -1147,6 +1161,20 @@
   interrupt-map = 0x 0 0 1 gic 0 113 IRQ_TYPE_LEVEL_HIGH
0x0800 0 0 1 gic 0 113 IRQ_TYPE_LEVEL_HIGH
0x1000 0 0 2 gic 0 113 IRQ_TYPE_LEVEL_HIGH;
 +
 + usb@0,1 {
 + reg = 0x800 0 0 0 0;
 + device_type = pci;
 + phys = usb2 0;
 + phy-names = usb;
 + };
 +
 + usb@0,2 {
 + reg = 0x1000 0 0 0 0;
 + device_type = pci;
 + phys = usb2 0;
 + phy-names = usb;
 + };
   };
  
   pciec: pcie@fe00 {
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] ARM: shmobile: r8a7791: link PCI USB devices to USB PHY

2014-09-29 Thread Simon Horman
On Mon, Sep 29, 2014 at 10:23:11PM +0400, Sergei Shtylyov wrote:
 Describe the PCI USB devices that are behind the PCI bridges, adding necessary
 links to the USB PHY device.
 
 Signed-off-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com

Thanks, I have queued this up.

 
 ---
 This patch is against 'renesas-devel-20140924-v3.17-rc6' tag of Simon Horman's
 'renesas.git' repo plus R8A7791/Koelsch/Henninger USB PHY support patches 
 posted
 before.  The patch requires the USB PHY driver and USB HCD generic PHY support
 (merged by Kishon and Greg recently) in order to work.
 
 Changes in version 4:
 - refreshed the patch.
 
 Changes in version 3:
 - adjusted phys properties in the PCI OHCI/EHCI device nodes;
 - resolved rejects.
 
 Changes in version 2:
 - renamed the PCI OHCI/EHCI device nodes to comply with the PCI binding;
 - changed the PHY specifier in the PCI#1 node to reflect that channel #1 
 support
   was dropped;
 - resolved rejects.
 
  arch/arm/boot/dts/r8a7791.dtsi |   28 
  1 file changed, 28 insertions(+)
 
 Index: renesas/arch/arm/boot/dts/r8a7791.dtsi
 ===
 --- renesas.orig/arch/arm/boot/dts/r8a7791.dtsi
 +++ renesas/arch/arm/boot/dts/r8a7791.dtsi
 @@ -1125,6 +1125,20 @@
   interrupt-map = 0x 0 0 1 gic 0 108 IRQ_TYPE_LEVEL_HIGH
0x0800 0 0 1 gic 0 108 IRQ_TYPE_LEVEL_HIGH
0x1000 0 0 2 gic 0 108 IRQ_TYPE_LEVEL_HIGH;
 +
 + usb@0,1 {
 + reg = 0x800 0 0 0 0;
 + device_type = pci;
 + phys = usb0 0;
 + phy-names = usb;
 + };
 +
 + usb@0,2 {
 + reg = 0x1000 0 0 0 0;
 + device_type = pci;
 + phys = usb0 0;
 + phy-names = usb;
 + };
   };
  
   pci1: pci@ee0d {
 @@ -1145,6 +1159,20 @@
   interrupt-map = 0x 0 0 1 gic 0 113 IRQ_TYPE_LEVEL_HIGH
0x0800 0 0 1 gic 0 113 IRQ_TYPE_LEVEL_HIGH
0x1000 0 0 2 gic 0 113 IRQ_TYPE_LEVEL_HIGH;
 +
 + usb@0,1 {
 + reg = 0x800 0 0 0 0;
 + device_type = pci;
 + phys = usb2 0;
 + phy-names = usb;
 + };
 +
 + usb@0,2 {
 + reg = 0x1000 0 0 0 0;
 + device_type = pci;
 + phys = usb2 0;
 + phy-names = usb;
 + };
   };
  
   pciec: pcie@fe00 {
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] usb: renesas_usbhs: fix driver dependencies

2014-09-01 Thread Simon Horman
On Mon, Sep 01, 2014 at 06:40:50PM +0200, Geert Uytterhoeven wrote:
 On Mon, Sep 1, 2014 at 4:24 PM, Bartlomiej Zolnierkiewicz
 b.zolnier...@samsung.com wrote:
  Renesas USBHS controller support should be available only on
  Renesas ARM SoCs and SuperH architecture.
 
  Signed-off-by: Bartlomiej Zolnierkiewicz b.zolnier...@samsung.com
  Acked-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Simon Horman ho...@verge.net.au
  Cc: Magnus Damm magnus.d...@gmail.com
  ---
  v2:
  - s/ARCH_SH/SUPERH/ (thanks to Sergei Shtylyov)
 
 Acked-by: Geert Uytterhoeven geert+rene...@glider.be

Acked-by: Simon Horman horms+rene...@verge.net.au

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/2] ARM: shmobile: lager: USBHS callback elimination

2014-07-12 Thread Simon Horman
On Fri, Jul 11, 2014 at 11:23:48AM -0500, Felipe Balbi wrote:
 On Fri, Jul 11, 2014 at 05:41:52PM +0200, Simon Horman wrote:
  On Fri, Jul 11, 2014 at 10:12:37AM -0500, Felipe Balbi wrote:
   On Fri, Jul 11, 2014 at 11:00:07AM +0200, Simon Horman wrote:
[Cc Felipe Balbi]

On Thu, Jul 10, 2014 at 01:20:34AM -0700, Kuninori Morimoto wrote:
 
 Hi
 
  Changes in v2:
  - move phy handle to struct usbhs_priv
  - add new default pipe type to driver
  - remove pipe type from Lager board code
  
  Ulrich Hecht (2):
usb: renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacks
  
   arch/arm/mach-shmobile/board-lager.c | 126 
  ---
   drivers/usb/renesas_usbhs/Makefile   |   2 +-
   drivers/usb/renesas_usbhs/common.c   |  66 --
   drivers/usb/renesas_usbhs/common.h   |   2 +
   drivers/usb/renesas_usbhs/rcar2.c|  76 +
   drivers/usb/renesas_usbhs/rcar2.h|   4 ++
   include/linux/usb/renesas_usbhs.h|   6 ++
   7 files changed, 163 insertions(+), 119 deletions(-)
   create mode 100644 drivers/usb/renesas_usbhs/rcar2.c
   create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
 
 For all patches
 
 Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com

[snip]

 I tested these patches on Lager legacy, and these patches worked 
 correctly.
 
 Tested-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com

Hi,

it seems that the 2nd patch should go through my renesas tree
but it depends on the first patch which should be taken by 
Felipe Balbi (Cced).

Felipe, is there any chance that you could take this for v3.16?
I am quite happy to make a branch for you to pull for renesas_usbhs
if this would make your life easier.
   
   you need to take both patches or just patch 1 ?
  
  Please just take patch 1.
 
 will do.

Thanks.

Ulrich, please repost patch #2 once patch #1 hits an rc release.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/2] ARM: shmobile: lager: USBHS callback elimination

2014-07-11 Thread Simon Horman
[Cc Felipe Balbi]

On Thu, Jul 10, 2014 at 01:20:34AM -0700, Kuninori Morimoto wrote:
 
 Hi
 
  Changes in v2:
  - move phy handle to struct usbhs_priv
  - add new default pipe type to driver
  - remove pipe type from Lager board code
  
  Ulrich Hecht (2):
usb: renesas_usbhs: add R-Car Gen. 2 init and power control
ARM: shmobile: lager: remove USBHS callbacks
  
   arch/arm/mach-shmobile/board-lager.c | 126 
  ---
   drivers/usb/renesas_usbhs/Makefile   |   2 +-
   drivers/usb/renesas_usbhs/common.c   |  66 --
   drivers/usb/renesas_usbhs/common.h   |   2 +
   drivers/usb/renesas_usbhs/rcar2.c|  76 +
   drivers/usb/renesas_usbhs/rcar2.h|   4 ++
   include/linux/usb/renesas_usbhs.h|   6 ++
   7 files changed, 163 insertions(+), 119 deletions(-)
   create mode 100644 drivers/usb/renesas_usbhs/rcar2.c
   create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
 
 For all patches
 
 Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com

[snip]

 I tested these patches on Lager legacy, and these patches worked correctly.
 
 Tested-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com

Hi,

it seems that the 2nd patch should go through my renesas tree
but it depends on the first patch which should be taken by 
Felipe Balbi (Cced).

Felipe, is there any chance that you could take this for v3.16?
I am quite happy to make a branch for you to pull for renesas_usbhs
if this would make your life easier.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/2] ARM: shmobile: lager: USBHS callback elimination

2014-07-11 Thread Simon Horman
On Fri, Jul 11, 2014 at 10:12:37AM -0500, Felipe Balbi wrote:
 On Fri, Jul 11, 2014 at 11:00:07AM +0200, Simon Horman wrote:
  [Cc Felipe Balbi]
  
  On Thu, Jul 10, 2014 at 01:20:34AM -0700, Kuninori Morimoto wrote:
   
   Hi
   
Changes in v2:
- move phy handle to struct usbhs_priv
- add new default pipe type to driver
- remove pipe type from Lager board code

Ulrich Hecht (2):
  usb: renesas_usbhs: add R-Car Gen. 2 init and power control
  ARM: shmobile: lager: remove USBHS callbacks

 arch/arm/mach-shmobile/board-lager.c | 126 
---
 drivers/usb/renesas_usbhs/Makefile   |   2 +-
 drivers/usb/renesas_usbhs/common.c   |  66 --
 drivers/usb/renesas_usbhs/common.h   |   2 +
 drivers/usb/renesas_usbhs/rcar2.c|  76 +
 drivers/usb/renesas_usbhs/rcar2.h|   4 ++
 include/linux/usb/renesas_usbhs.h|   6 ++
 7 files changed, 163 insertions(+), 119 deletions(-)
 create mode 100644 drivers/usb/renesas_usbhs/rcar2.c
 create mode 100644 drivers/usb/renesas_usbhs/rcar2.h
   
   For all patches
   
   Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com
  
  [snip]
  
   I tested these patches on Lager legacy, and these patches worked 
   correctly.
   
   Tested-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
  
  Hi,
  
  it seems that the 2nd patch should go through my renesas tree
  but it depends on the first patch which should be taken by 
  Felipe Balbi (Cced).
  
  Felipe, is there any chance that you could take this for v3.16?
  I am quite happy to make a branch for you to pull for renesas_usbhs
  if this would make your life easier.
 
 you need to take both patches or just patch 1 ?

Please just take patch 1.
Thanks
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] phy-rcar-usb-gen2: add device tree support

2014-01-29 Thread Simon Horman
On Wed, Jan 29, 2014 at 02:41:58PM +0400, Sergei Shtylyov wrote:
 Hello.
 
 On 29-01-2014 10:22, Simon Horman wrote:
 
 [snip]
 
 +static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = {
 +{ .compatible = renesas,usb-phy-r8a7790, },
 +{ .compatible = renesas,rcar-gen2-usb-phy, },
 
 Frankly speaking, I don't understand the need for the clearly
 duplicate entries.
 
 Thanks, will look into remove it.
 Anyone else have any comments on this?
 
 I would like you to leave it there.
 
 As we know the r8a7790 is an R-Car Gen2 SoC.  But there are other R-Car
 Gen2 SoCs, such as the r8a7791, they it could plausibly make use of
 rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
 
Why not just update the driver this way now, may I ask?

Because I don't believe that Ben has access to r8a7791 hardware
to test the change and thus it makes sense to handle it separately.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] phy-rcar-usb-gen2: add device tree support

2014-01-29 Thread Simon Horman
On Wed, Jan 29, 2014 at 04:26:55PM +0400, Sergei Shtylyov wrote:
 Hello.
 
 On 29-01-2014 16:22, Simon Horman wrote:
 
 [snip]
 
 +static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = {
 +{ .compatible = renesas,usb-phy-r8a7790, },
 +{ .compatible = renesas,rcar-gen2-usb-phy, },
 
 Frankly speaking, I don't understand the need for the clearly
 duplicate entries.
 
 Thanks, will look into remove it.
 Anyone else have any comments on this?
 
 I would like you to leave it there.
 
 As we know the r8a7790 is an R-Car Gen2 SoC.  But there are other R-Car
 Gen2 SoCs, such as the r8a7791, they it could plausibly make use of
 rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
 
 Why not just update the driver this way now, may I ask?
 
 Because I don't believe that Ben has access to r8a7791 hardware
 to test the change and thus it makes sense to handle it separately.
 
I believe Valentine has already tested the driver with both SoCs.

Oh, great. Then I guess the compat string for r8a7791 can be added
as you suggest.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] phy-rcar-usb-gen2: add device tree support

2014-01-28 Thread Simon Horman
On Mon, Jan 27, 2014 at 07:06:26PM +, Ben Dooks wrote:
 On 27/01/14 18:23, Sergei Shtylyov wrote:
 Hello.
 
 On 01/26/2014 08:05 PM, Ben Dooks wrote:
 
 [snip]
 
 
 +static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = {
 +{ .compatible = renesas,usb-phy-r8a7790, },
 +{ .compatible = renesas,rcar-gen2-usb-phy, },
 
 Frankly speaking, I don't understand the need for the clearly
 duplicate entries.
 
 Thanks, will look into remove it.
 Anyone else have any comments on this?

I would like you to leave it there.

As we know the r8a7790 is an R-Car Gen2 SoC.  But there are other R-Car
Gen2 SoCs, such as the r8a7791, they it could plausibly make use of
rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 10/12] usb: r8a66597-hcd: Convert to clk_prepare/unprepare

2013-11-28 Thread Simon Horman
On Tue, Nov 26, 2013 at 03:08:27PM +0100, Laurent Pinchart wrote:
 Hi Greg,
 
 On Monday 25 November 2013 18:36:08 Greg Kroah-Hartman wrote:
  On Tue, Nov 26, 2013 at 03:00:30AM +0100, Laurent Pinchart wrote:
   On Saturday 09 November 2013 08:10:59 Greg Kroah-Hartman wrote:
On Sat, Nov 09, 2013 at 03:12:05PM +0100, Laurent Pinchart wrote:
 On Tuesday 29 October 2013 18:47:26 Shimoda, Yoshihiro wrote:
  Hi Laurent-san,
  
  (2013/10/29 7:49), Laurent Pinchart wrote:
   Turn clk_enable() and clk_disable() calls into
   clk_prepare_enable() and clk_disable_unprepare() to get ready for
   the migration to the common clock framework.
   
   Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
   Cc: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
   Cc: linux-usb@vger.kernel.org
   Signed-off-by: Laurent Pinchart
   laurent.pinchart+rene...@ideasonboard.com
  
  Thank you for the patch.
  
  Acked-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com
 
 Could you please pick this patch up ?

I'll pick things up after 3.13-rc1 is out, I can't do anything until
then.
   
   Sure.
   
   As this patch is a dependency for other series that will go through
   different trees, could you please provide a stable branch in your tree
   with this patch included that you will push to v3.14 ?
  
  If you need this for other work, feel free to take it in your tree, I
  have no real need for it to go in mine.
  
  Acked-by: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 Sounds good to me, thanks.
 
 Simon, could you please pick this patch then ?

Sure. I have queued it up.
But I may not push it for a day or two.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/9] usb: hcd: Initialize USB phy if needed

2013-11-20 Thread Simon Horman
On Thu, Nov 21, 2013 at 01:26:19AM +0400, Valentine wrote:
 On 11/20/2013 09:46 PM, Fabio Estevam wrote:
 On Wed, Nov 20, 2013 at 3:38 PM, Ulrich Hecht ulrich.he...@gmail.com wrote:
 From: Valentine Barshak valentine.bars...@cogentembedded.com
 
 This adds external USB phy support to USB HCD driver that
 allows to find and initialize external USB phy, bound to
 the HCD, when the HCD is added.
 The usb_add_hcd function returns -EPROBE_DEFER if the USB
 phy, bound to the HCD, is not ready.
 If no USB phy is bound, the HCD is initialized as usual.
 
 Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
 Acked-by: Alan Stern st...@rowland.harvard.edu
 ---
   drivers/usb/core/hcd.c | 20 
   1 file changed, 20 insertions(+)
 
 diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
 index d939521..fd09ec6 100644
 --- a/drivers/usb/core/hcd.c
 +++ b/drivers/usb/core/hcd.c
 @@ -2597,6 +2597,26 @@ int usb_add_hcd(struct usb_hcd *hcd,
  int retval;
  struct usb_device *rhdev;
 
 +#ifdef CONFIG_USB_PHY
 +   if (!hcd-phy) {
 +   struct usb_phy *phy = usb_get_phy_dev(hcd-self.controller, 
 0);
 
 Wouldn't it be better to use the following instead?
 
if (IS_ENABLED(CONFIG_USB_PHY)  !hcd-(phy) {
 
 Since USB_PHY is a bool I don't see much of a difference.

The difference is that IS_ENABLED() is thought to be less ugly
than #ifdef. For this reason I agree with Fabio's comment.

 
 
 Regards,
 
 Fabio Estevam
 
 Thanks,
 Val.
 
 
 +
 +   if (IS_ERR(phy)) {
 +   retval = PTR_ERR(phy);
 +   if (retval == -EPROBE_DEFER)
 +   return retval;
 +   } else {
 +   retval = usb_phy_init(phy);
 +   if (retval) {
 +   usb_put_phy(phy);
 +   return retval;
 +   }
 +   hcd-phy = phy;
 +   hcd-remove_phy = 1;
 +   }
 +   }
 +#endif
 +
  dev_info(hcd-self.controller, %s\n, hcd-product_desc);
 
  /* Keep old behaviour if authorized_default is not in [0, 1]. */
 --
 1.8.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-usb in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] arm: shmobile: r8a7790: Add USBHS clock support

2013-10-28 Thread Simon Horman
On Thu, Oct 10, 2013 at 02:14:46AM +0400, Valentine Barshak wrote:
 This adds USBHS clock support.
 
 Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
 Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com
 ---
  arch/arm/mach-shmobile/clock-r8a7790.c | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c 
 b/arch/arm/mach-shmobile/clock-r8a7790.c
 index a64f965..161d44e 100644
 --- a/arch/arm/mach-shmobile/clock-r8a7790.c
 +++ b/arch/arm/mach-shmobile/clock-r8a7790.c
 @@ -186,6 +186,7 @@ enum {
   MSTP813,
   MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
   MSTP717, MSTP716,
 + MSTP704,
   MSTP522,
   MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
   MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
 @@ -208,6 +209,7 @@ static struct clk mstp_clks[MSTP_NR] = {
   [MSTP720] = SH_CLK_MSTP32(p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
   [MSTP717] = SH_CLK_MSTP32(zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
   [MSTP716] = SH_CLK_MSTP32(zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
 + [MSTP704] = SH_CLK_MSTP32(mp_clk, SMSTPCR7, 4, 0), /* HSUSB */
   [MSTP522] = SH_CLK_MSTP32(extal_clk, SMSTPCR5, 22, 0), /* Thermal */
   [MSTP315] = SH_CLK_MSTP32(div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* 
 MMC0 */
   [MSTP314] = SH_CLK_MSTP32(div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* 
 SDHI0 */
 @@ -296,6 +298,8 @@ static struct clk_lookup lookups[] = {
   CLKDEV_DEV_ID(ee22.mmcif, mstp_clks[MSTP305]),
   CLKDEV_DEV_ID(sh_mmcif.1, mstp_clks[MSTP305]),
   CLKDEV_DEV_ID(sh_cmt.0, mstp_clks[MSTP124]),
 + CLKDEV_DEV_ID(renesas_usbhs, mstp_clks[MSTP704]),
 + CLKDEV_ICK_ID(usbhs, usb_phy_rcar_gen2, mstp_clks[MSTP704]),
  };
  
  #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)   \

Thanks, I have queued this up.
It should appear in the next push of the devel branch of the renesas tree.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] arm: shmobile: lager: Add USBHS support

2013-10-28 Thread Simon Horman
On Thu, Oct 10, 2013 at 02:14:47AM +0400, Valentine Barshak wrote:
 This adds USBHS PHY and registers USBHS device if the driver is enabled.
 
 Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
 Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com

Thanks,

I notice that Felipe Balbi's has merged the first patch of this series and
that it is present in linux-next though not in v3.12-rc7. My assumption is
that means it will appear in v3.13-rc1 but not v3.12.

With this in mind my current plan is to wait for v3.13-rc1, rebase my
branches, and then queue-up this patch for v3.14.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb: phy: phy-rcar-gen2-usb: Fix phy initialization

2013-10-28 Thread Simon Horman
On Fri, Oct 25, 2013 at 09:07:12PM +0400, Valentine Barshak wrote:
 Add missing USB UGCTRL2 register offset.
 
 Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com

This seems reasonable to me.

Acked-by: Simon Horman horms+rene...@verge.net.au

Felipe, please consider applying this change.

 ---
  drivers/usb/phy/phy-rcar-gen2-usb.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c 
 b/drivers/usb/phy/phy-rcar-gen2-usb.c
 index a99a695..db3ab34 100644
 --- a/drivers/usb/phy/phy-rcar-gen2-usb.c
 +++ b/drivers/usb/phy/phy-rcar-gen2-usb.c
 @@ -107,10 +107,10 @@ static void __rcar_gen2_usb_phy_init(struct 
 rcar_gen2_usb_phy_priv *priv)
   clk_prepare_enable(priv-clk);
  
   /* Set USB channels in the USBHS UGCTRL2 register */
 - val = ioread32(priv-base);
 + val = ioread32(priv-base + USBHS_UGCTRL2_REG);
   val = ~(USBHS_UGCTRL2_USB0_HS | USBHS_UGCTRL2_USB2_SS);
   val |= priv-ugctrl2;
 - iowrite32(val, priv-base);
 + iowrite32(val, priv-base + USBHS_UGCTRL2_REG);
  }
  
  /* Shutdown USB channels */
 -- 
 1.8.3.1
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Add USBHS support to Lager (take 2)

2013-10-08 Thread Simon Horman
On Tue, Oct 08, 2013 at 11:43:24PM +0400, Valentine Barshak wrote:
 This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
 also enables USBHS for the Lager board. It has been updated, based
 on the comments to the previous version.
 
 The patches apply fine to the renesas-devel-20131008 tag of the renesas.git.
 The first patch also applies fine to the usb.git at kernel.org.
 It adds RCAR Gen2 phy driver which is used to configure the shared USB
 channels 0/2 and to control USBHS internal PHY.
 All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
 should acquire the USB phy first to set proper channel configuration.
 
 The other two patches add USBHS support to Lager board, which requires
 RCAR Gen2 phy driver.
 
 Changes from previous version:
 * use-counting and clock handling done in the usb_phy_init/shutdown
   callbacks only;
 * a minor typo in the comments fixed;
 * phy clean up moved to __rcar_gen2_usb_phy_shutdown function;
 * usb_phy_init/shutdown called from usbhs_power_ctrl callback
   to allow renesas_usbhs driver disable USB PHY completely
   when it is not needed.

Hi Morimoto-san,

I could you review this revised series?

My assumption is that in the current form the first patch will
go through the USB tree while the latter patches will subsequently
go through (my) renesas tree.

 Valentine Barshak (3):
   usb: phy: Add RCAR Gen2 USB phy
   arm: shmobile: r8a7790: Add USBHS clock support
   arm: shmobile: lager: Add USBHS support
 
  arch/arm/mach-shmobile/board-lager.c| 106 ++
  arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
  drivers/usb/phy/Kconfig |  13 ++
  drivers/usb/phy/Makefile|   1 +
  drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
 
  include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
  6 files changed, 401 insertions(+)
  create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
  create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h
 
 -- 
 1.8.3.1
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Add USBHS support to Lager (take 2)

2013-10-08 Thread Simon Horman
On Tue, Oct 08, 2013 at 07:09:36PM -0700, Kuninori Morimoto wrote:
 
 Hi
 
  This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
  also enables USBHS for the Lager board. It has been updated, based
  on the comments to the previous version.
  
  The patches apply fine to the renesas-devel-20131008 tag of the renesas.git.
  The first patch also applies fine to the usb.git at kernel.org.
  It adds RCAR Gen2 phy driver which is used to configure the shared USB
  channels 0/2 and to control USBHS internal PHY.
  All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
  should acquire the USB phy first to set proper channel configuration.
  
  The other two patches add USBHS support to Lager board, which requires
  RCAR Gen2 phy driver.
  
  Changes from previous version:
  * use-counting and clock handling done in the usb_phy_init/shutdown
callbacks only;
  * a minor typo in the comments fixed;
  * phy clean up moved to __rcar_gen2_usb_phy_shutdown function;
  * usb_phy_init/shutdown called from usbhs_power_ctrl callback
to allow renesas_usbhs driver disable USB PHY completely
when it is not needed.
  
  Valentine Barshak (3):
usb: phy: Add RCAR Gen2 USB phy
arm: shmobile: r8a7790: Add USBHS clock support
arm: shmobile: lager: Add USBHS support
  
   arch/arm/mach-shmobile/board-lager.c| 106 ++
   arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
   drivers/usb/phy/Kconfig |  13 ++
   drivers/usb/phy/Makefile|   1 +
   drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
  
   include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
   6 files changed, 401 insertions(+)
   create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
   create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h
 
 For all patches
 
 Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com
 
 # I think we can implement usb_phy_xxx() method
 # in renesas_usbhs driver someday.

Hi Felipe,

could you consider taking the first patch of this series?
And if so, could you provide a branch that I can use
as a base for the other changes in the series?

Thanks
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Add USBHS support to Lager

2013-10-07 Thread Simon Horman
On Tue, Oct 08, 2013 at 03:27:00AM +0400, Valentine Barshak wrote:
 This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
 also enables USBHS for the Lager board.
 
 The patches apply fine to the renesas-devel-20131004 tag of the renesas.git.
 
 The first patch also applies fine to the usb.git at kernel.org.
 It adds RCAR Gen2 phy driver, which is used to configure the shared USB
 channels 0/2 and to control USBHS internal PHY.
 All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
 should acquire the USB phy first to set proper channel configuration.
 
 The other two patches add USBHS support to Lager board, which requires
 RCAR Gen2 phy driver.

Hi Morimoto-san,

I could you review this series?

My assumption is that in the current form the first patch will
go through the USB tree while the latter patches will subsequently
go through (my) renesas tree.

 Valentine Barshak (3):
   usb: phy: Add RCAR Gen2 USB phy
   arm: shmobile: r8a7790: Add USBHS clock support
   arm: shmobile: lager: Add USBHS support
 
  arch/arm/mach-shmobile/board-lager.c| 106 +
  arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
  drivers/usb/phy/Kconfig |  14 ++
  drivers/usb/phy/Makefile|   1 +
  drivers/usb/phy/phy-rcar-gen2-usb.c | 271 
 
  include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
  6 files changed, 418 insertions(+)
  create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
  create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h
 
 -- 
 1.8.3.1
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Re: [PATCH-SR9700] Merge USB 1.1 Ethernet Adapter SR9700 DeviceDriver into the Linux Kernel

2013-08-22 Thread Simon Horman
On Wed, Aug 21, 2013 at 06:02:45PM +0800, liujunliang_ljl wrote:
 Dear Ben :
 
   1,  please give me email address of David Miller, and Thanks a 
 lot.

You can find him in the MAINTAINERS file.
He should also show up if you use scripts/get_maintainer.pl
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v9 resend 0/3] Add USB support to R8A7778/BOCK-W

2013-06-11 Thread Simon Horman
On Sun, Jun 09, 2013 at 12:32:34AM +0400, Sergei Shtylyov wrote:
 Hello.
 
Here's the set of 3 patches against the Simon Horman's 'renesas.git' repo,
 'renesas-next-20130607' tag, and the R8A7779/Marzen USB patchset I've posted.
 It was created to add support of R8A7778/BOCK-W USB to the platform code and
 the USB common PHY driver, and so spans both arch/arm/mach-shmobile/ and
 drivers/usb/phy/ subtrees.
 
 [1/3] phy-rcar-usb: add R8A7778 support
 [2/3] ARM: shmobile: r8a7778: add USB support
 [3/3] ARM: shmobile: BOCK-W: add USB support
 
The patchset is completely ready for merging now.

Thanks, I have queued this up in the soc2 phy-rcar-usb.
My current plan is to let that branch sit in next for a few
days and then send a pull-request for it to be included in v3.11.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code

2013-06-11 Thread Simon Horman
On Fri, Jun 07, 2013 at 02:45:45PM +0400, Sergei Shtylyov wrote:
 Hello.
 
 On 07-06-2013 12:06, Simon Horman wrote:
 
 Here's the set of 9 patches against the Simon Horman's 'renesas.git' 
  repo,
 'renesas-next-20130528' tag.  It was created to fix the shortcomings in the
 R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
 spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches 
 have
 to touch both subtrees). The patches were conceived with the complete
 bisectability goal in mind.
 
 [1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to 
 R8A7779 code
 [2/9] ehci-platform: add pre_setup() method to platform data
 [3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
 [4/9] phy-rcar-usb: remove EHCI internal buffer setup
 [5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
 [6/9] phy-rcar-usb: correct base address
 [7/9] phy-rcar-usb: add platform data
 [8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
 [9/9] phy-rcar-usb: handle platform data
 
 The patchset is completely ready to be merged now.
 
 Can I confirm that the plan is for me to merge this code?
 
Yes, that was the plan.
 
 If so, I should be able to do so next week.

Thanks, I have queued this up in the soc2 phy-rcar-usb.
My current plan is to let that branch sit in next for a few
days and then send a pull-request for it to be included in v3.11.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code

2013-06-11 Thread Simon Horman
On Tue, Jun 11, 2013 at 04:49:43PM +0900, Simon Horman wrote:
 On Fri, Jun 07, 2013 at 02:45:45PM +0400, Sergei Shtylyov wrote:
  Hello.
  
  On 07-06-2013 12:06, Simon Horman wrote:
  
  Here's the set of 9 patches against the Simon Horman's 'renesas.git' 
   repo,
  'renesas-next-20130528' tag.  It was created to fix the shortcomings in 
  the
  R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
  spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some 
  patches have
  to touch both subtrees). The patches were conceived with the complete
  bisectability goal in mind.
  
  [1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to 
  R8A7779 code
  [2/9] ehci-platform: add pre_setup() method to platform data
  [3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
  [4/9] phy-rcar-usb: remove EHCI internal buffer setup
  [5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
  [6/9] phy-rcar-usb: correct base address
  [7/9] phy-rcar-usb: add platform data
  [8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
  [9/9] phy-rcar-usb: handle platform data
  
  The patchset is completely ready to be merged now.
  
  Can I confirm that the plan is for me to merge this code?
  
 Yes, that was the plan.
  
  If so, I should be able to do so next week.
 
 Thanks, I have queued this up in the soc2 phy-rcar-usb.

s/soc2 phy-rcar-usb/phy-rcar-usb branch/

 My current plan is to let that branch sit in next for a few
 days and then send a pull-request for it to be included in v3.11.
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v9 resend 0/3] Add USB support to R8A7778/BOCK-W

2013-06-11 Thread Simon Horman
On Tue, Jun 11, 2013 at 04:49:59PM +0900, Simon Horman wrote:
 On Sun, Jun 09, 2013 at 12:32:34AM +0400, Sergei Shtylyov wrote:
  Hello.
  
 Here's the set of 3 patches against the Simon Horman's 'renesas.git' 
  repo,
  'renesas-next-20130607' tag, and the R8A7779/Marzen USB patchset I've 
  posted.
  It was created to add support of R8A7778/BOCK-W USB to the platform code and
  the USB common PHY driver, and so spans both arch/arm/mach-shmobile/ and
  drivers/usb/phy/ subtrees.
  
  [1/3] phy-rcar-usb: add R8A7778 support
  [2/3] ARM: shmobile: r8a7778: add USB support
  [3/3] ARM: shmobile: BOCK-W: add USB support
  
 The patchset is completely ready for merging now.
 
 Thanks, I have queued this up in the soc2 phy-rcar-usb.

s/soc2 phy-rcar-usb/phy-rcar-usb branch/

 My current plan is to let that branch sit in next for a few
 days and then send a pull-request for it to be included in v3.11.
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v9 0/3] Add USB support to R8A7778/BOCK-W

2013-06-09 Thread Simon Horman
On Sun, Jun 09, 2013 at 12:24:04AM +0400, Sergei Shtylyov wrote:
 On 06/09/2013 12:12 AM, Sergei Shtylyov wrote:
 
 Here's the set of 3 patches against the Simon Horman's 'renesas.git' 
  repo,
 'renesas-next-20130607' tag, and the R8A7779/Marzen USB patchset I've posted.
 It was created to add support of R8A7778/BOCK-W USB to the platform code and
 the USB common PHY driver, and so spans both arch/arm/mach-shmobile/ and
 drivers/usb/phy/ subtrees.
 
 [1/3] phy-rcar-usb: add R8A7778 support
 [2/3] ARM: shmobile: r8a7778: add USB support
 [3/3] ARM: shmobile: BOCK-W: add USB support
 
 The patch #4 (ARM: shmobile: BOCK-W: enable USB in defconfig) that has 
  been
 already merged, is not reposted.
 
 The patchset is completely ready for merging now.
 
Argh, scratch that -- I forgot to refresh the patches before sending...

Scratched.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >