diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-10-22 14:46:02 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-10-22 14:46:02 +0000 |
commit | 5edbffe3f64131c582839e0bbd389fda5eeb407c (patch) | |
tree | 81ab7ce00a76f8f8cae955ef5fac8fb4cd9cc7f1 /c/src/lib/libbsp/powerpc/mpc8260ads/clock | |
parent | 2001-10-22 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-5edbffe3f64131c582839e0bbd389fda5eeb407c.tar.bz2 |
01-10-22 Andy Dachs <a.dachs@sstl.co.uk>
* mpc8260ads added as new BSP. tm27 reported not to run
at this time.
* ChangeLog, Makefile.am, README, aclocal.m4, bsp_specs,
clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, configure.in,
console/Makefile.am, console/console.c, include/Makefile.am,
include/bsp.h, include/coverhd.h, irq/.cvsignore, irq/Makefile.am,
irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c,
network/Makefile.am, network/README, network/if_hdlcsubr.c,
network/if_hdlcsubr.h, network/network.c, start/Makefile.am,
start/start.S, startup/Makefile.am, startup/bspstart.c,
startup/cpuinit.c, startup/linkcmds, startup/setvec.c, times,
vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S,
vectors/vectors.h, vectors/vectors_init.c, wrapup/Makefile.am:
New files.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/mpc8260ads/clock')
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc8260ads/clock/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc8260ads/clock/Makefile.am | 26 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc8260ads/clock/p_clock.c | 71 |
3 files changed, 99 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/clock/.cvsignore b/c/src/lib/libbsp/powerpc/mpc8260ads/clock/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/mpc8260ads/clock/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/clock/Makefile.am b/c/src/lib/libbsp/powerpc/mpc8260ads/clock/Makefile.am new file mode 100644 index 0000000000..c41be0decc --- /dev/null +++ b/c/src/lib/libbsp/powerpc/mpc8260ads/clock/Makefile.am @@ -0,0 +1,26 @@ +## +## $Id$ +## + +AUTOMAKE_OPTIONS = foreign 1.4 + +VPATH = @srcdir@:@srcdir@/../../shared/clock + +C_FILES = p_clock.c +C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) + +OBJS = $(C_O_FILES) + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../../../../../../automake/compile.am +include $(top_srcdir)/../../../../../../automake/lib.am + +# +# (OPTIONAL) Add local stuff here using += +# + +# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile + +all-local: $(ARCH) $(OBJS) + +include $(top_srcdir)/../../../../../../automake/local.am diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/clock/p_clock.c b/c/src/lib/libbsp/powerpc/mpc8260ads/clock/p_clock.c new file mode 100644 index 0000000000..5b514cab4b --- /dev/null +++ b/c/src/lib/libbsp/powerpc/mpc8260ads/clock/p_clock.c @@ -0,0 +1,71 @@ +/* + * Clock Tick interrupt conexion code. + * + * COPYRIGHT (c) 1989-1997. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may in + * the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * Modified to support the MPC750. + * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr + * + * $Id$ + */ + +#include <bsp.h> +#include <bspIo.h> +#include <bsp/irq.h> + +extern void clockOn(void*); +extern void clockOff (void*); +extern int clockIsOn(void*); +extern void Clock_isr(); + +static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER, + (rtems_irq_hdl)Clock_isr, + (rtems_irq_enable)clockOn, + (rtems_irq_disable)clockOff, + (rtems_irq_is_enabled)clockIsOn}; + +int BSP_get_clock_irq_level() +{ + /* + * Caution : if you change this, you must change the + * definition of BSP_PERIODIC_TIMER accordingly + */ + return BSP_PERIODIC_TIMER; +} + +int BSP_disconnect_clock_handler (void) +{ + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) { + printk("Unable to stop system clock\n"); + rtems_fatal_error_occurred(1); + } + return BSP_remove_rtems_irq_handler (&clockIrqData); +} + +int BSP_connect_clock_handler (rtems_irq_hdl hdl) +{ + if (!BSP_get_current_rtems_irq_handler(&clockIrqData)) { + printk("Unable to get system clock handler\n"); + rtems_fatal_error_occurred(1); + } + if (!BSP_remove_rtems_irq_handler (&clockIrqData)) { + printk("Unable to remove current system clock handler\n"); + rtems_fatal_error_occurred(1); + } + /* + * Reinit structure + */ + clockIrqData.name = BSP_PERIODIC_TIMER; + clockIrqData.hdl = (rtems_irq_hdl) hdl; + clockIrqData.on = (rtems_irq_enable)clockOn; + clockIrqData.off = (rtems_irq_enable)clockOff; + clockIrqData.isOn = (rtems_irq_is_enabled)clockIsOn; + + return BSP_install_rtems_irq_handler (&clockIrqData); +} |