There is a bug in the PXA270 AC97 driver.

If 'expireTime' get set to 0xFFFFFFFF the last while will hang forever
in the last while loop


//
// XllpOstDelayTicks
//
// Delay the number of ticks specified using the OST OSCR0 clock.
//
// Inputs:
// pOstRegs - handle to structure containing the OST a base
register
// addresses.
// ticks - the unsigned 32-bit value containing the number
of
// ticks to delay
//
static void XllpOstDelayTicks
(P_XLLP_OST_T pOstRegs, XLLP_UINT32_T ticks)
{
XLLP_UINT32_T expireTime,
time;

time = pOstRegs->oscr0;
expireTime = time + ticks;

//
// Check if we wrapped on the expireTime
// and delay first part until wrap
//
if (expireTime < time)
{
while (time < pOstRegs->oscr0);
}
while (pOstRegs->oscr0 <= expireTime);
return;
}

Re: AC97 Win CE 5.0, PXA270 by SP

SP
Tue Mar 18 00:51:42 PDT 2008

interesting.....

May I know if you meet problem with that?
Just curious !!

Cheers,
SP


"Arne Varholm" <arne@varholm.com>
???????:4317376c-a131-4581-8f5d-2d83538825ab@n75g2000hsh.googlegroups.com...
> There is a bug in the PXA270 AC97 driver.
>
> If 'expireTime' get set to 0xFFFFFFFF the last while will hang forever
> in the last while loop
>
>
> //
> // XllpOstDelayTicks
> //
> // Delay the number of ticks specified using the OST OSCR0 clock.
> //
> // Inputs:
> // pOstRegs - handle to structure containing the OST a base
> register
> // addresses.
> // ticks - the unsigned 32-bit value containing the number
> of
> // ticks to delay
> //
> static void XllpOstDelayTicks
> (P_XLLP_OST_T pOstRegs, XLLP_UINT32_T ticks)
> {
> XLLP_UINT32_T expireTime,
> time;
>
> time = pOstRegs->oscr0;
> expireTime = time + ticks;
>
> //
> // Check if we wrapped on the expireTime
> // and delay first part until wrap
> //
> if (expireTime < time)
> {
> while (time < pOstRegs->oscr0);
> }
> while (pOstRegs->oscr0 <= expireTime);
> return;
> }