mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected
@ 2013-12-04  1:56 Chris Ruehl
  2013-12-04  1:56 ` [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag Chris Ruehl
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Ruehl @ 2013-12-04  1:56 UTC (permalink / raw)
  To: peter.chen; +Cc: gregkh, linux-usb, linux-kernel, Chris Ruehl

usb: chipidea: Reallocate regmap only if lpm is detected

The regmap only needs to reallocate if the hw_read on the CAP register shows
lpm is used. Therefore the if() statement check the change.

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Acked-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/chipidea/core.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 5d8981c..9a5ef20 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -208,7 +208,8 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base)
 	reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >>
 		__ffs(HCCPARAMS_LEN);
 	ci->hw_bank.lpm  = reg;
-	hw_alloc_regmap(ci, !!reg);
+	if (reg)
+		hw_alloc_regmap(ci, !!reg);
 	ci->hw_bank.size = ci->hw_bank.op - ci->hw_bank.abs;
 	ci->hw_bank.size += OP_LAST;
 	ci->hw_bank.size /= sizeof(u32);
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag
  2013-12-04  1:56 [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Chris Ruehl
@ 2013-12-04  1:56 ` Chris Ruehl
  2013-12-06  7:08   ` Peter Chen
  2013-12-04  1:56 ` [PATCH 3/3 v5] usb: chipidea: put hw_phymode_configure before ci_usb_phy_init Chris Ruehl
  2013-12-04  7:34 ` [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Peter Chen
  2 siblings, 1 reply; 6+ messages in thread
From: Chris Ruehl @ 2013-12-04  1:56 UTC (permalink / raw)
  To: peter.chen; +Cc: gregkh, linux-usb, linux-kernel, Chris Ruehl

Fix Internal error: : 808 [#1] ARM related to STS flag

* init the sts flag to 0 (missed)
* fix write the real bit not sts value
* Set PORTCS_STS and DEVLC_STS only if sts = 1
 (prefered solution by Mr. Peter Chen, Maintainer of ChipIdea subsystem)

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
---
 drivers/usb/chipidea/core.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 9a5ef20..2834801 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -243,7 +243,7 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base)
 
 static void hw_phymode_configure(struct ci_hdrc *ci)
 {
-	u32 portsc, lpm, sts;
+	u32 portsc, lpm, sts = 0;
 
 	switch (ci->platdata->phy_mode) {
 	case USBPHY_INTERFACE_MODE_UTMI:
@@ -273,10 +273,12 @@ static void hw_phymode_configure(struct ci_hdrc *ci)
 
 	if (ci->hw_bank.lpm) {
 		hw_write(ci, OP_DEVLC, DEVLC_PTS(7) | DEVLC_PTW, lpm);
-		hw_write(ci, OP_DEVLC, DEVLC_STS, sts);
+		if (sts)
+			hw_write(ci, OP_DEVLC, DEVLC_STS, DEVLC_STS);
 	} else {
 		hw_write(ci, OP_PORTSC, PORTSC_PTS(7) | PORTSC_PTW, portsc);
-		hw_write(ci, OP_PORTSC, PORTSC_STS, sts);
+		if (sts)
+			hw_write(ci, OP_PORTSC, PORTSC_STS, PORTSC_STS);
 	}
 }
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3 v5] usb: chipidea: put hw_phymode_configure before  ci_usb_phy_init
  2013-12-04  1:56 [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Chris Ruehl
  2013-12-04  1:56 ` [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag Chris Ruehl
@ 2013-12-04  1:56 ` Chris Ruehl
  2013-12-06  7:42   ` Peter Chen
  2013-12-04  7:34 ` [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Peter Chen
  2 siblings, 1 reply; 6+ messages in thread
From: Chris Ruehl @ 2013-12-04  1:56 UTC (permalink / raw)
  To: peter.chen; +Cc: gregkh, linux-usb, linux-kernel, Chris Ruehl

usb: chipidea: put hw_phymode_configure before ci_usb_phy_init

hw_phymode_configure configures the PORTSC registers and allow the
following phy_inits to operate on the right parameters. This fix a problem
where the UPLI (ISP1504) could not be detected, because the Viewport was not
available and read the viewport return 0's only.

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Acked-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/chipidea/core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 2834801..43897dd 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -564,6 +564,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	hw_phymode_configure(ci);
+
 	ret = ci_usb_phy_init(ci);
 	if (ret) {
 		dev_err(dev, "unable to init phy: %d\n", ret);
@@ -581,8 +583,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
 
 	ci_get_otg_capable(ci);
 
-	hw_phymode_configure(ci);
-
 	dr_mode = ci->platdata->dr_mode;
 	/* initialize role(s) before the interrupt is requested */
 	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_HOST) {
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected
  2013-12-04  1:56 [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Chris Ruehl
  2013-12-04  1:56 ` [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag Chris Ruehl
  2013-12-04  1:56 ` [PATCH 3/3 v5] usb: chipidea: put hw_phymode_configure before ci_usb_phy_init Chris Ruehl
@ 2013-12-04  7:34 ` Peter Chen
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Chen @ 2013-12-04  7:34 UTC (permalink / raw)
  To: Chris Ruehl; +Cc: gregkh, linux-usb, linux-kernel



 
> usb: chipidea: Reallocate regmap only if lpm is detected
> 
> The regmap only needs to reallocate if the hw_read on the CAP register
> shows
> lpm is used. Therefore the if() statement check the change.
> 
> Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
> Acked-by: Peter Chen <peter.chen@freescale.com>
> ---
>  drivers/usb/chipidea/core.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 5d8981c..9a5ef20 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -208,7 +208,8 @@ static int hw_device_init(struct ci_hdrc *ci, void
> __iomem *base)
>  	reg = hw_read(ci, CAP_HCCPARAMS, HCCPARAMS_LEN) >>
>  		__ffs(HCCPARAMS_LEN);
>  	ci->hw_bank.lpm  = reg;
> -	hw_alloc_regmap(ci, !!reg);
> +	if (reg)
> +		hw_alloc_regmap(ci, !!reg);
>  	ci->hw_bank.size = ci->hw_bank.op - ci->hw_bank.abs;
>  	ci->hw_bank.size += OP_LAST;
>  	ci->hw_bank.size /= sizeof(u32);
> --
> 1.7.10.4
> 

Applied, Thanks.
Please do not add subject to commit log next time :)

Peter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag
  2013-12-04  1:56 ` [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag Chris Ruehl
@ 2013-12-06  7:08   ` Peter Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Chen @ 2013-12-06  7:08 UTC (permalink / raw)
  To: Chris Ruehl; +Cc: gregkh, linux-usb, linux-kernel

On Wed, Dec 04, 2013 at 09:56:18AM +0800, Chris Ruehl wrote:
> Fix Internal error: : 808 [#1] ARM related to STS flag
> 
> * init the sts flag to 0 (missed)
> * fix write the real bit not sts value
> * Set PORTCS_STS and DEVLC_STS only if sts = 1
>  (prefered solution by Mr. Peter Chen, Maintainer of ChipIdea subsystem)
> 
> Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
> ---
>  drivers/usb/chipidea/core.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 9a5ef20..2834801 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -243,7 +243,7 @@ static int hw_device_init(struct ci_hdrc *ci, void __iomem *base)
>  
>  static void hw_phymode_configure(struct ci_hdrc *ci)
>  {
> -	u32 portsc, lpm, sts;
> +	u32 portsc, lpm, sts = 0;
>  
>  	switch (ci->platdata->phy_mode) {
>  	case USBPHY_INTERFACE_MODE_UTMI:
> @@ -273,10 +273,12 @@ static void hw_phymode_configure(struct ci_hdrc *ci)
>  
>  	if (ci->hw_bank.lpm) {
>  		hw_write(ci, OP_DEVLC, DEVLC_PTS(7) | DEVLC_PTW, lpm);
> -		hw_write(ci, OP_DEVLC, DEVLC_STS, sts);
> +		if (sts)
> +			hw_write(ci, OP_DEVLC, DEVLC_STS, DEVLC_STS);
>  	} else {
>  		hw_write(ci, OP_PORTSC, PORTSC_PTS(7) | PORTSC_PTW, portsc);
> -		hw_write(ci, OP_PORTSC, PORTSC_STS, sts);
> +		if (sts)
> +			hw_write(ci, OP_PORTSC, PORTSC_STS, PORTSC_STS);
>  	}
>  }
>  
> -- 
> 1.7.10.4
> 
> 

Applied, Thanks.

-- 

Best Regards,
Peter Chen


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 3/3 v5] usb: chipidea: put hw_phymode_configure before ci_usb_phy_init
  2013-12-04  1:56 ` [PATCH 3/3 v5] usb: chipidea: put hw_phymode_configure before ci_usb_phy_init Chris Ruehl
@ 2013-12-06  7:42   ` Peter Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Chen @ 2013-12-06  7:42 UTC (permalink / raw)
  To: Chris Ruehl; +Cc: gregkh, linux-usb, linux-kernel

 
> 
> usb: chipidea: put hw_phymode_configure before ci_usb_phy_init
> 
> hw_phymode_configure configures the PORTSC registers and allow the
> following phy_inits to operate on the right parameters. This fix a
> problem
> where the UPLI (ISP1504) could not be detected, because the Viewport was
> not
> available and read the viewport return 0's only.
> 
> Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
> Acked-by: Peter Chen <peter.chen@freescale.com>
> ---
>  drivers/usb/chipidea/core.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 2834801..43897dd 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -564,6 +564,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  	}
> 
> +	hw_phymode_configure(ci);
> +
>  	ret = ci_usb_phy_init(ci);
>  	if (ret) {
>  		dev_err(dev, "unable to init phy: %d\n", ret);
> @@ -581,8 +583,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
> 
>  	ci_get_otg_capable(ci);
> 
> -	hw_phymode_configure(ci);
> -
>  	dr_mode = ci->platdata->dr_mode;
>  	/* initialize role(s) before the interrupt is requested */
>  	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_HOST) {
> --
> 1.7.10.4
> 

Applied, Thanks.

Peter



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-06  7:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-04  1:56 [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Chris Ruehl
2013-12-04  1:56 ` [PATCH 2/3 v5] Fix Internal error: : 808 [#1] ARM related to STS flag Chris Ruehl
2013-12-06  7:08   ` Peter Chen
2013-12-04  1:56 ` [PATCH 3/3 v5] usb: chipidea: put hw_phymode_configure before ci_usb_phy_init Chris Ruehl
2013-12-06  7:42   ` Peter Chen
2013-12-04  7:34 ` [PATCH 1/3 v5] usb: chipidea: Reallocate regmap only if lpm is detected Peter Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®