On 08/19/13 10:40 PM, Eugeniy Meshcheryakov wrote:
Hi,
uint32_t rcc = syscon->rcc;
+ uint32_t rcc2 = syscon->rcc2;
rcc = (rcc& ~SYSCONRCC_USESYSDIV) | SYSCONRCC_BYPASS;
+ rcc2 |= SYSCONRCC2_BYPASS2;
+
+ syscon->rcc = rcc;
+ syscon->rcc2 = rcc2;
+
+ rcc&= SYSCONRCC_MOSCDIS;
syscon->rcc = rcc;
+ lm3s69xx_syscon_delay_3x_clocks(524288);
rcc = (rcc& ~(SYSCONRCC_PWRDN | SYSCONRCC_XTAL_MSK | SYSCONRCC_OSCSRC_MSK))
| SYSCONRCC_XTAL(LM3S69XX_XTAL_CONFIG) | SYSCONRCC_OSCSRC_MOSC;
- syscon->rcc = rcc;
+ rcc2 = (rcc2& ~(SYSCONRCC2_PWRDN2 | SYSCONRCC2_USERCC2 |
SYSCONRCC2_OSCSRC2_MSK))
+ | SYSCONRCC2_USERCC2 | SYSCONRCC2_OSCSRC2_MSK;
^^^^^^^^^^^^^^^^^^
Here is one more problem. You are using RCC2 unconditionally, so I think
you do not need most of the code that uses RCC here.
This was intentional since I've not been sure if your MCUs support RCC2.
Now I see, they should... (i.e. being Fure and DustDevil classes)
I think the problem
you saw was because you were overwritting settings made to RCC by
writing to RCC2 or other way around. Please use only RCC2 here, except
maybe for bits that are in RCC but not in RCC2. But then be careful with
cached values of registers. Especially you do not have to set clock
divisor value in RCC.
OK, I'll try to rewrite this part.
Thanks for the review!
Karel
_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel