AMSSansa: Corrects bug introduced with r21577 causing random lockups on AMSSansas.

The input to the ADC is now set to CVDD inside the while loop.  If the input gets changed while waiting for the voltage to be read it will now be reset to CVDD before the next read is attempted.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21584 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jack Halpin 2009-07-01 04:47:36 +00:00
parent 4093874f80
commit c929310e55

View file

@ -330,9 +330,10 @@ void set_cpu_frequency(long frequency)
{
/* Increasing frequency so boost voltage before change */
ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20));
/* Confirm voltage is at least 1.20v before making fclk > 200 MHz */
ascodec_write(AS3514_ADC_0, 4<<4); /* ADC Source = CVDD */
while (ascodec_read(AS3514_ADC_1) < 0xe0); /* 0x1e0 *.0025 = 1.20 */
/* Wait for voltage to be at least 1.20v before making fclk > 200 MHz */
do
ascodec_write(AS3514_ADC_0, 4<<4); /* ADC Input = CVDD */
while (ascodec_read(AS3514_ADC_1) < 0xe0); /* 0x1e0 *.0025 = 1.20v */
/* e0 = 8LSB's of 0x1e0 */
asm volatile(
"mrc p15, 0, r0, c1, c0 \n"