|
|
 | | From: | manan.kathuria at gmail.com | | Subject: | boot code works when it shudnt (newbie) | | Date: | 11 Jan 2005 01:00:54 -0800 |
|
|
 | hi iv been working on a project involving AT91RM9200 and i got some basic boot code that sets it up etc etc . part of the code sets up the slow clock as the master by first switching from "whatever" mode to PLLB and then from PLLB to slowclock . if u taka a look at the code
ldr r1, = AT91C_BASE_PMC ; Get the PMC Base Address
;------------------------------------------------------------------------------ ;-Write in the MCKR dirty value concerning the clock selection CSS then overwrite it in a second sequence ;------------------------------------------------------------------------------ ; ;-Master Clock Register PMC_MCKR : "dirty CSS" is selected ldr r0, = AT91C_PMC_CSS_PLLB_CLK str r0, [r1, #PMC_MCKR] ;- Reading the PMC Status register to detect when the Master Clock is commuted mov r4, #0x8 MCKR_Loop ldr r3, [r1, #PMC_SR] and r3, r4, r3 cmp r3, #0x8 bne MCKR_Loop
ya , so nowhere here is the pllar register configured . the system starts from reset and so the DIVA bit is set to 0 which means PLL output is 0 . so there shd be no clock once the clock is switchd to PLLB and the system shd stall , but AMAZINGLY , it works! what the hell is going on????
thanks in advance
Mnn!
|
|
 | | From: | Mayank Kaushik | | Subject: | Re: boot code works when it shudnt (newbie) | | Date: | 11 Jan 2005 12:21:02 -0800 |
|
|
 | But as you may see that later in the code, we select the slow clock among the options available in the master clock generator. From the block diagram of the PMC, we can see that the processor wil still get the clock, regardless of whether the plls are revved up or not.
|
|
 | | From: | Mayank Kaushik | | Subject: | Re: boot code works when it shudnt (newbie) | | Date: | 11 Jan 2005 12:34:25 -0800 |
|
|
 | More inportantly, check the waveforms on pg 268. ul see that the processor stays on the same clock till mckrdy is asserted. then it should latch on to the pll, but we load it with a new value in the code...Though i dont think all this has to be done..
|
|
|