diff mbox

[U-Boot,RFC,2/2] driver/usb/fsl: Make FSL USB driver common

Message ID 1416432285-14934-2-git-send-email-yorksun@freescale.com
State Not Applicable
Delegated to: York Sun
Headers show

Commit Message

York Sun Nov. 19, 2014, 9:24 p.m. UTC
Add ifdef for powerpc specific code. This driver can be used by arm SoCs.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Alison Wang <alison.wang@freescale.com>
CC: Nikhil Badola <nikhil.badola@freescale.com>
---
This patch is needed if fsl USB driver is enabled for ARM SoCs, like LS1021.

 drivers/usb/host/ehci-fsl.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Nikhil Badola Nov. 22, 2014, 4:27 a.m. UTC | #1
> -----Original Message-----
> From: York Sun [mailto:yorksun@freescale.com]
> Sent: Thursday, November 20, 2014 2:55 AM
> To: u-boot@lists.denx.de
> Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
> Subject: [RFC Patch 2/2] driver/usb/fsl: Make FSL USB driver common
> 
> Add ifdef for powerpc specific code. This driver can be used by arm SoCs.
> 
> Signed-off-by: York Sun <yorksun@freescale.com>
> CC: Alison Wang <alison.wang@freescale.com>
> CC: Nikhil Badola <nikhil.badola@freescale.com>
> ---
> This patch is needed if fsl USB driver is enabled for ARM SoCs, like LS1021.
> 
>  drivers/usb/host/ehci-fsl.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index
> 79fb6b4..994bfd7 100644
> --- a/drivers/usb/host/ehci-fsl.c
> +++ b/drivers/usb/host/ehci-fsl.c
> @@ -130,9 +130,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
> 
>  	in_le32(&ehci->usbmode);
> 
> +#ifdef CONFIG_PPC
>  	if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
>  	    IS_SVR_REV(get_svr(), 2, 0))
>  		set_txfifothresh(ehci, TXFIFOTHRESH);
> +#endif

This patch can be replaced by 
http://patchwork.ozlabs.org/patch/400407/ 
> 
>  	return 0;
>  }
> @@ -151,7 +153,8 @@ int ehci_hcd_stop(int index)
>   * to counter DDR latencies in writing data into Tx buffer.
>   * This prevents Tx buffer from getting underrun
>   */
> -static void set_txfifothresh(struct usb_ehci *ehci, u32 txfifo_thresh)
> +static void __maybe_unused set_txfifothresh(struct usb_ehci *ehci,
> +					    u32 txfifo_thresh)
>  {
>  	u32 cmd;
>  	cmd = ehci_readl(&ehci->txfilltuning);
> --
> 1.7.9.5
York Sun Nov. 24, 2014, 5:51 p.m. UTC | #2
On 11/21/2014 08:27 PM, Badola Nikhil-B46172 wrote:
>> -----Original Message-----
>> From: York Sun [mailto:yorksun@freescale.com]
>> Sent: Thursday, November 20, 2014 2:55 AM
>> To: u-boot@lists.denx.de
>> Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
>> Subject: [RFC Patch 2/2] driver/usb/fsl: Make FSL USB driver common
>>
>> Add ifdef for powerpc specific code. This driver can be used by arm SoCs.
>>
>> Signed-off-by: York Sun <yorksun@freescale.com>
>> CC: Alison Wang <alison.wang@freescale.com>
>> CC: Nikhil Badola <nikhil.badola@freescale.com>
>> ---
>> This patch is needed if fsl USB driver is enabled for ARM SoCs, like LS1021.
>>
>>  drivers/usb/host/ehci-fsl.c |    5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index
>> 79fb6b4..994bfd7 100644
>> --- a/drivers/usb/host/ehci-fsl.c
>> +++ b/drivers/usb/host/ehci-fsl.c
>> @@ -130,9 +130,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
>>
>>  	in_le32(&ehci->usbmode);
>>
>> +#ifdef CONFIG_PPC
>>  	if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
>>  	    IS_SVR_REV(get_svr(), 2, 0))
>>  		set_txfifothresh(ehci, TXFIFOTHRESH);
>> +#endif
> 
> This patch can be replaced by 
> http://patchwork.ozlabs.org/patch/400407/ 

Great! I will drop this patch.

York
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 79fb6b4..994bfd7 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -130,9 +130,11 @@  int ehci_hcd_init(int index, enum usb_init_type init,
 
 	in_le32(&ehci->usbmode);
 
+#ifdef CONFIG_PPC
 	if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
 	    IS_SVR_REV(get_svr(), 2, 0))
 		set_txfifothresh(ehci, TXFIFOTHRESH);
+#endif
 
 	return 0;
 }
@@ -151,7 +153,8 @@  int ehci_hcd_stop(int index)
  * to counter DDR latencies in writing data into Tx buffer.
  * This prevents Tx buffer from getting underrun
  */
-static void set_txfifothresh(struct usb_ehci *ehci, u32 txfifo_thresh)
+static void __maybe_unused set_txfifothresh(struct usb_ehci *ehci,
+					    u32 txfifo_thresh)
 {
 	u32 cmd;
 	cmd = ehci_readl(&ehci->txfilltuning);