diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-04 16:33:31 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-06-04 16:33:31 +0000 |
commit | d7a915dadec627b1906fcc22f45f573cd73914a3 (patch) | |
tree | 44f7096debd2aeb14a339c1c6aad4f562303b4a5 /c/src/lib/libcpu/arm/pxa255/pmc/pmc.c | |
parent | 2009-06-04 Xi Yang <hiyangxi@gmail.com> (diff) | |
download | rtems-d7a915dadec627b1906fcc22f45f573cd73914a3.tar.bz2 |
2009-06-04 Xi Yang <hiyangxi@gmail.com>
* Makefile.am, configure.ac, preinstall.am: New Gumstix BSP and PXA255
support.
* pxa255/clock/clock.c, pxa255/ffuart/ffuart.c, pxa255/include/bits.h,
pxa255/include/ffuart.h, pxa255/include/pxa255.h,
pxa255/irq/bsp_irq_asm.S, pxa255/irq/bsp_irq_init.c,
pxa255/irq/irq.c, pxa255/irq/irq.h, pxa255/pmc/pmc.c,
pxa255/timer/timer.c: New files.
Diffstat (limited to 'c/src/lib/libcpu/arm/pxa255/pmc/pmc.c')
-rwxr-xr-x | c/src/lib/libcpu/arm/pxa255/pmc/pmc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/c/src/lib/libcpu/arm/pxa255/pmc/pmc.c b/c/src/lib/libcpu/arm/pxa255/pmc/pmc.c new file mode 100755 index 0000000000..dc784be5ad --- /dev/null +++ b/c/src/lib/libcpu/arm/pxa255/pmc/pmc.c @@ -0,0 +1,45 @@ +/* + * By Yang Xi <hiyangxi@gmail.com>. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <rtems.h> +#include <bsp.h> +#include <pxa255.h> + +unsigned int int_latency; + +static void pmc_isr_on(const rtems_irq_connect_data *unused) +{ + unsigned int operand; + /*clean CC*/ + operand = 0x0; + asm volatile("mcr p14,0,%0,c1,c0,0 \n"::"r"(operand)); + /*clean the Clock counter flag and enable the interrupt of CC*/ + operand = 0x0|RESET_CCOF|ENABLE_CC_INT|RESET_CC|ENABLE_PMC_CC; + asm volatile("mcr p14,0,%0,c0,c0,0 \n"::"r"(operand)); + /*Set to the 4kHZ*/ + operand = (unsigned int)0xffffffff-(unsigned int)100000; + asm volatile("mcr p14,0,%0,c1,c0,0 \n"::"r"(operand)); +} + +static void pmc_isr_off(const rtems_irq_connect_data *unused) +{ + unsigned int operand; + operand = 0x0|RESET_CCOF; + asm volatile("mcr p14,0,%0,c0,c0,0 \n"::"r"(operand)); +} + +static int pmc_isr_is_on(const rtems_irq_connect_data *unused) +{ + unsigned int operand; + asm volatile("mrc p14,0,%0,c0,c0,0 \n":"=r"(operand):); + if((operand & ENABLE_PMC_CC ) && (operand & ENABLE_CC_INT)) + return 1; + return 0; +} |