diff mbox

[U-Boot,v2,1/4] USB: ohci-at91: support sama5d3x devices

Message ID 1363068932-2485-2-git-send-email-voice.shen@atmel.com
State Changes Requested, archived
Delegated to: Andreas Bießmann
Headers show

Commit Message

Bo Shen March 12, 2013, 6:15 a.m. UTC
Add OHCI support for sama5d3x devices

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
change in v2:
  - change #if defined to #ifdef for sama5d3
---
 drivers/usb/host/ohci-at91.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Andreas Bießmann May 12, 2013, 11:28 a.m. UTC | #1
Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:
> Add OHCI support for sama5d3x devices

can you please rebase this patch and send again?

>
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
> ---
> change in v2:
>    - change #if defined to #ifdef for sama5d3
> ---
>   drivers/usb/host/ohci-at91.c |   14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index efd711d..086cd0f 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -42,7 +42,7 @@ int usb_cpu_init(void)
>   	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
>   		;
>   #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
> -	defined(CONFIG_AT91SAM9X5)
> +	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
>   	/* Enable UPLL */
>   	writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
>   		&pmc->uckr);
> @@ -54,7 +54,12 @@ int usb_cpu_init(void)
>   #endif
>
>   	/* Enable USB host clock. */
> +#ifdef CONFIG_SAMA5D3
> +	writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);

Please reorder the patches so that pmc->pcer1 is declared before used.

Best regards

Andreas Bießmann
Bo Shen May 13, 2013, 6:30 a.m. UTC | #2
Hi Andreas,

On 5/12/2013 19:28, Andreas Bießmann wrote:
> Dear Bo Shen,
>
> On 12.03.2013 07:15, Bo Shen wrote:
>> Add OHCI support for sama5d3x devices
>
> can you please rebase this patch and send again?

OK, I will do it at next version.

>>
>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>> ---
>> change in v2:
>>    - change #if defined to #ifdef for sama5d3
>> ---
>>   drivers/usb/host/ohci-at91.c |   14 ++++++++++++--
>>   1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
>> index efd711d..086cd0f 100644
>> --- a/drivers/usb/host/ohci-at91.c
>> +++ b/drivers/usb/host/ohci-at91.c
>> @@ -42,7 +42,7 @@ int usb_cpu_init(void)
>>       while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
>>           ;
>>   #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
>> || \
>> -    defined(CONFIG_AT91SAM9X5)
>> +    defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
>>       /* Enable UPLL */
>>       writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
>>           &pmc->uckr);
>> @@ -54,7 +54,12 @@ int usb_cpu_init(void)
>>   #endif
>>
>>       /* Enable USB host clock. */
>> +#ifdef CONFIG_SAMA5D3
>> +    writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);
>
> Please reorder the patches so that pmc->pcer1 is declared before used.

Ok, thanks for figure out this. I will do it at next version.

> Best regards
>
> Andreas Bießmann

Best Regards,
Bo Shen
diff mbox

Patch

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index efd711d..086cd0f 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -42,7 +42,7 @@  int usb_cpu_init(void)
 	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
 		;
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-	defined(CONFIG_AT91SAM9X5)
+	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
 	/* Enable UPLL */
 	writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
 		&pmc->uckr);
@@ -54,7 +54,12 @@  int usb_cpu_init(void)
 #endif
 
 	/* Enable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+	writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);
+#else
 	writel(1 << ATMEL_ID_UHP, &pmc->pcer);
+#endif
+
 #ifdef CONFIG_AT91SAM9261
 	writel(ATMEL_PMC_UHP | AT91_PMC_HCK0, &pmc->scer);
 #else
@@ -69,7 +74,12 @@  int usb_cpu_stop(void)
 	at91_pmc_t *pmc	= (at91_pmc_t *)ATMEL_BASE_PMC;
 
 	/* Disable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+	writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcdr1);
+#else
 	writel(1 << ATMEL_ID_UHP, &pmc->pcdr);
+#endif
+
 #ifdef CONFIG_AT91SAM9261
 	writel(ATMEL_PMC_UHP | AT91_PMC_HCK0, &pmc->scdr);
 #else
@@ -83,7 +93,7 @@  int usb_cpu_stop(void)
 	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != 0)
 		;
 #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-	defined(CONFIG_AT91SAM9X5)
+	defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
 	/* Disable UPLL */
 	writel(readl(&pmc->uckr) & (~AT91_PMC_UPLLEN), &pmc->uckr);
 	while ((readl(&pmc->sr) & AT91_PMC_LOCKU) == AT91_PMC_LOCKU)