diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-19 06:35:52 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 09:57:01 +0200 |
commit | 7632906fc290b652416ab59eb5fb49356c064ed6 (patch) | |
tree | ac036b1f95637e044e10138ceea8d2b56d80ec97 /c/src/lib/libbsp/arm/gumstix | |
parent | bsps: Move bspsmpgetcurrentprocessor.c to bsps (diff) | |
download | rtems-7632906fc290b652416ab59eb5fb49356c064ed6.tar.bz2 |
bsps: Move clock drivers to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/arm/gumstix')
-rw-r--r-- | c/src/lib/libbsp/arm/gumstix/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/gumstix/clock/clock.c | 118 |
2 files changed, 1 insertions, 119 deletions
diff --git a/c/src/lib/libbsp/arm/gumstix/Makefile.am b/c/src/lib/libbsp/arm/gumstix/Makefile.am index 8f9b9c8d97..ec5d8c910e 100644 --- a/c/src/lib/libbsp/arm/gumstix/Makefile.am +++ b/c/src/lib/libbsp/arm/gumstix/Makefile.am @@ -26,7 +26,7 @@ librtemsbsp_a_SOURCES += startup/bspreset.c librtemsbsp_a_SOURCES += startup/memmap.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c -librtemsbsp_a_SOURCES += clock/clock.c +librtemsbsp_a_SOURCES +=../../../../../../bsps/arm/gumstix/clock/clock.c librtemsbsp_a_SOURCES += timer/timer.c #console diff --git a/c/src/lib/libbsp/arm/gumstix/clock/clock.c b/c/src/lib/libbsp/arm/gumstix/clock/clock.c deleted file mode 100644 index d8e8afb9dd..0000000000 --- a/c/src/lib/libbsp/arm/gumstix/clock/clock.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * PXA255 clock specific using the System Timer - * - * RTEMS uses IRQ 26 as Clock Source - */ - -/* - * 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.org/license/LICENSE. - */ - -#include <rtems.h> -#include <rtems/clockdrv.h> -#include <rtems/libio.h> - -#include <stdlib.h> -#include <bsp.h> -#include <bspopts.h> -#include <bsp/irq.h> -#include <pxa255.h> - -#if ON_SKYEYE==1 - #define CLOCK_DRIVER_USE_FAST_IDLE 1 -#endif - -static unsigned long period_num; - -/** - * Enables clock interrupt. - * - * If the interrupt is always on, this can be a NOP. - */ -static void clock_isr_on(const rtems_irq_connect_data *unused) -{ - /*Clear the interrupt bit */ - XSCALE_OS_TIMER_TSR = 0x1; - - /* enable timer interrupt */ - XSCALE_OS_TIMER_IER |= 0x1; - -#if ON_SKYEYE==1 - period_num = (TIMER_RATE* rtems_configuration_get_microseconds_per_tick())/100000; -#else - period_num = (TIMER_RATE* rtems_configuration_get_microseconds_per_tick())/10000; -#endif - - XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num; -} - -/** - * Disables clock interrupts - * - * If the interrupt is always on, this can be a NOP. - */ -static void clock_isr_off(const rtems_irq_connect_data *unused) -{ - /*Clear the interrupt bit */ - XSCALE_OS_TIMER_TSR = 0x1; - /* disable timer interrupt*/ - XSCALE_OS_TIMER_IER &= ~0x1; -} - -/** - * Tests to see if clock interrupt is enabled, and returns 1 if so. - * If interrupt is not enabled, returns 0. - * - * If the interrupt is always on, this always returns 1. - */ -static int clock_isr_is_on(const rtems_irq_connect_data *irq) -{ - /* check timer interrupt */ - return XSCALE_OS_TIMER_IER & 0x1; -} - -void Clock_isr(rtems_irq_hdl_param arg); - -rtems_irq_connect_data clock_isr_data = { - .name = XSCALE_IRQ_OS_TIMER, - .hdl = Clock_isr, - .handle = NULL, - .on = clock_isr_on, - .off = clock_isr_off, - .isOn = clock_isr_is_on, -}; - -#define Clock_driver_support_install_isr( _new ) \ - BSP_install_rtems_irq_handler(&clock_isr_data) - -static void Clock_driver_support_initialize_hardware(void) -{ - period_num = TIMER_RATE* rtems_configuration_get_microseconds_per_tick(); -#if ON_SKYEYE==1 - period_num /= 100000; -#else - period_num /= 10000; -#endif -} - -#define Clock_driver_support_at_tick() \ - do { \ - /* read the status to clear the int */ \ - XSCALE_OS_TIMER_TSR = 0x1; \ - \ - /*Add the match register*/ \ - XSCALE_OS_TIMER_MR0 = XSCALE_OS_TIMER_TCR + period_num; \ - } while (0) - -#define Clock_driver_support_shutdown_hardware() \ - do { \ - BSP_remove_rtems_irq_handler(&clock_isr_data); \ - } while (0) - -#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER - -#include "../../../../libbsp/shared/clockdrv_shell.h" |