[PATCH] powerpc/5200: tighten up ac97 reset timing
emillbrandt at dekaresearch.com
Sat Sep 4 02:40:08 EST 2010
On Fri, 3 Sep 2010 at 12:22:24 Wolfram Sang wrote:
>>>> - udelay(2);
>>>> + udelay(1);
>>>> /* Deassert reset */
>>>> setbits8(&wkup_gpio->wkup_dvo, reset);
>>>> + /* wait at least 200ns */
>>>> + __delay(7);
>> Is ndelay defined for powerpc? I was under the impression that it was
>> being redefined to udelay in linux/delay.h.
>> #ifndef ndelay
>> static inline void ndelay(unsigned long x)
>> udelay(DIV_ROUND_UP(x, 1000));
>> #define ndelay(x) ndelay(x)
> Yes, but it is way more readable. Does the extra delay hurt? The value
> of 7 looks a bit magic to me. Are you sure it will do for various
> clock frequencies?
The reset is happening in the gpio spinlock, so I am trying to keep busy
waiting to a minimum. The magic value of 7 calculates to *roughly* 200ns
with a system timebase of 33mhz. This timebase drives the mpc5200(b) at
its max clock speed of 400mhz, so slower frequencies should just extend the
delay, which is acceptable. If you strongly object to the use of __delay
I can change it to ndelay.
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Please consider the environment before printing this email.
More information about the Linuxppc-dev