From 7632906fc290b652416ab59eb5fb49356c064ed6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 19 Apr 2018 06:35:52 +0200 Subject: bsps: Move clock drivers to bsps This patch is a part of the BSP source reorganization. Update #3285. --- c/src/lib/libbsp/arm/csb337/Makefile.am | 2 +- c/src/lib/libbsp/arm/csb337/clock/clock.c | 113 ------------------------------ 2 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 c/src/lib/libbsp/arm/csb337/clock/clock.c (limited to 'c/src/lib/libbsp/arm/csb337') diff --git a/c/src/lib/libbsp/arm/csb337/Makefile.am b/c/src/lib/libbsp/arm/csb337/Makefile.am index fcf4774221..23a87975bb 100644 --- a/c/src/lib/libbsp/arm/csb337/Makefile.am +++ b/c/src/lib/libbsp/arm/csb337/Makefile.am @@ -37,7 +37,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c librtemsbsp_a_SOURCES += startup/pmc.c -librtemsbsp_a_SOURCES += clock/clock.c +librtemsbsp_a_SOURCES +=../../../../../../bsps/arm/csb337/clock/clock.c librtemsbsp_a_SOURCES += timer/timer.c # console librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/legacy-console.c diff --git a/c/src/lib/libbsp/arm/csb337/clock/clock.c b/c/src/lib/libbsp/arm/csb337/clock/clock.c deleted file mode 100644 index f231a04697..0000000000 --- a/c/src/lib/libbsp/arm/csb337/clock/clock.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * AT91RM9200 clock specific using the System Timer - */ - -/* - * Copyright (c) 2003 by Cogent Computer Systems - * Written by Mike Kelly - * and Jay Monkman - * - * 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 -#include -#include - -#include -#include -#include -#include -#include - -/** - * 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) -{ - /* enable timer interrupt */ - ST_REG(ST_IER) = ST_SR_PITS; -} - -/** - * 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) -{ - /* disable timer interrupt */ - ST_REG(ST_IDR) = ST_SR_PITS; -} - -/** - * 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 ST_REG(ST_IMR) & ST_SR_PITS; -} - -void Clock_isr(rtems_irq_hdl_param arg); - -/* Replace the first value with the clock's interrupt name. */ -rtems_irq_connect_data clock_isr_data = { - .name = AT91RM9200_INT_SYSIRQ, - .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) -{ - uint32_t st_str; - int slck; - unsigned long value; - - /* the system timer is driven from SLCK */ - slck = at91rm9200_get_slck(); - value = (((rtems_configuration_get_microseconds_per_tick() * slck) + - (1000000/2))/ 1000000); - - /* read the status to clear the int */ - st_str = ST_REG(ST_SR); - (void) st_str; /* avoid set but not used warning */ \ - - /* set priority */ - AIC_SMR_REG(AIC_SMR_SYSIRQ) = AIC_SMR_PRIOR(0x7); - - /* set the timer value */ - ST_REG(ST_PIMR) = value; -} - -#define Clock_driver_support_at_tick() \ - do { \ - uint32_t st_str; \ - \ - /* read the status to clear the int */ \ - st_str = ST_REG(ST_SR); \ - (void) st_str; /* avoid set but not used warning */ \ - } 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" -- cgit v1.2.3