All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] USB: ohci-at91: support sama5d3x devices
Date: Fri, 08 Mar 2013 09:21:21 +0800	[thread overview]
Message-ID: <51393D11.3080407@atmel.com> (raw)
In-Reply-To: <51385A01.7060206@googlemail.com>

On 3/7/2013 17:12, Andreas Bie?mann wrote:
> Dear Bo Shen,
>
> On 28.02.13 08:00, Bo Shen wrote:
>> Add OHCI support for sama5d3x devices
>>
>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>> ---
>>   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..35a282e 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)
>
> I think these ifdeffery increases alarmingly here and there. Can we find
> a better solution like
>
> #if defined(ATMEL_OHCI_NEEDS_UPLL)
>
> or whatever we can call it. I mean to classify this and enable it in the
> respective SoC headers. Maybe here we can distinguish upon the IP version?
>
>>   	/* 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. */
>> +#if defined(CONFIG_SAMA5D3)
>
> I think this ifdef is Ok instead.
>
>> +	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. */
>> +#if defined(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)
>>
>
> I think the ifdef comment above is no show stopper for this patch but
> should be considered at least for a future patch.

OK.

I will consider this for a future patch, not in this one.

Best Regards,
Bo Shen

> The rest looks sane to me.
>
> Best regards
>
> Andreas Bie?mann
>

  reply	other threads:[~2013-03-08  1:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  7:00 [U-Boot] [PATCH 0/4] ARM: atmel: add sama5d3xek board support Bo Shen
2013-02-28  7:00 ` [U-Boot] [PATCH 1/4] USB: ohci-at91: support sama5d3x devices Bo Shen
2013-03-07  9:12   ` Andreas Bießmann
2013-03-08  1:21     ` Bo Shen [this message]
2013-02-28  7:00 ` [U-Boot] [PATCH 2/4] NET: macb: " Bo Shen
2013-03-07  9:15   ` Andreas Bießmann
2013-02-28  7:00 ` [U-Boot] [PATCH 3/4] SPI: atmel_spi: " Bo Shen
2013-02-28  7:00 ` [U-Boot] [PATCH 4/4] ARM: atmel: add sama5d3xek support Bo Shen
2013-03-04 15:14   ` Tom Rini
2013-03-05  2:03     ` Bo Shen
2013-03-05  2:20       ` Tom Rini
2013-03-05  2:23         ` Bo Shen
2013-03-07 10:58   ` Andreas Bießmann
2013-03-08  3:31     ` Bo Shen
2013-03-08  7:32       ` Andreas Bießmann
2013-03-08  8:37         ` Bo Shen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51393D11.3080407@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.