void set_cpu_frequency(long frequency)
{ if (frequency == CPUFREQ_MAX)
{
asm volatile("mov r0, #0\n"
"mrc p15, 0, r0, c1, c0, 0\n"
"bic r0, r0, #0xC0000000 \n" /* clear bus bits */
"orr r0, r0, #0x40000000 \n" /* synchronous bus */
"mcr p15, 0, r0, c1, c0, 0" : : : "r0");

cpu_frequency = CPUFREQ_MAX;
}
else
{
asm volatile("mov r0, #0\n"
"mrc p15, 0, r0, c1, c0, 0\n"
"bic r0, r0, #0xC0000000 \n" /* clear bus bits */
"bic r0, r0, #3<<30\n" /* set to FastBus mode*/
"mcr p15, 0, r0, c1, c0, 0" : : : "r0");

cpu_frequency = CPUFREQ_NORMAL;
}
}