diff options
Diffstat (limited to 'c/src/lib/libbsp/powerpc/dmv177/include')
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in | 38 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/bsp.h | 178 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/chain.h | 353 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h | 134 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h | 215 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/tod.h | 38 |
6 files changed, 956 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in new file mode 100644 index 0000000000..54f072893c --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in @@ -0,0 +1,38 @@ +# +# $Id$ +# + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +RTEMS_ROOT = @RTEMS_ROOT@ +PROJECT_ROOT = @PROJECT_ROOT@ +RTEMS_CUSTOM = $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg + +H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h \ + $(srcdir)/dmv170.h $(srcdir)/chain.h $(srcdir)/tod.h + +# +# Equate files are for including from assembly preprocessed by +# gm4 or gasp. No examples are provided except for those for +# other CPUs. The best way to generate them would be to +# provide a program which generates the constants used based +# on the C equivalents. +# +# If you add equate files, don't forget to uncomment the install line +# below. +# + +EQ_FILES = + +SRCS=$(H_FILES) $(EQ_FILES) + +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +CLEAN_ADDITIONS += +CLOBBER_ADDITIONS += + +all: $(SRCS) + $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE) diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h b/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h new file mode 100644 index 0000000000..aa4f4df348 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h @@ -0,0 +1,178 @@ +/* bsp.h + * + * This include file contains all DY-4 DMV170 board IO definitions. + * + * COPYRIGHT (c) 1989-1997. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __DMV170_BSP_h +#define __DMV170_BSP_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef ASM +/* Definition of where to store registers in alignment handler */ +#define ALIGN_REGS 0x0140 + +#else +#include <rtems.h> +#include <console.h> +#include <clockdrv.h> +#include <console.h> +#include <iosupp.h> + +#include <dmv170.h> + +#define Enable_Debug() \ + DMV170_WRITE( 0xffffbd0c, 0 ) + +#define Debug_Entry( num ) \ + DMV170_WRITE( 0xffffbd06, num ) + +/* + * The following macro calculates the Baud constant. For the Z8530 chip. + */ +#define Z8530_Baud( _frequency, _clock_by, _baud_rate ) \ + ( (_frequency /( _clock_by * 2 * _baud_rate)) - 2) + + +/* + * Define the time limits for RTEMS Test Suite test durations. + * Long test and short test duration limits are provided. These + * values are in seconds and need to be converted to ticks for the + * application. + * + */ + +#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ +#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ + + +/* + * Stuff for Time Test 27 + */ + +#define MUST_WAIT_FOR_INTERRUPT 1 + +#define Install_tm27_vector( _handler ) \ + set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 ) + +#define Cause_tm27_intr() \ + do { \ + unsigned32 _clicks = 1; \ + asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ + } while (0) + + +#define Clear_tm27_intr() \ + do { \ + unsigned32 _clicks = 0xffffffff; \ + asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ + } while (0) + +#define Lower_tm27_intr() \ + do { \ + unsigned32 _msr = 0; \ + _ISR_Set_level( 0 ); \ + asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ + _msr |= 0x8002; \ + asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ + } while (0) + +/* Constants */ + +/* + * Device Driver Table Entries + */ + +/* + * NOTE: Use the standard Console driver entry + */ + +/* + * NOTE: Use the standard Clock driver entry + */ + + +/* + * Information placed in the linkcmds file. + */ + +extern int RAM_START; +extern int RAM_END; +extern int RAM_SIZE; + +extern int PROM_START; +extern int PROM_END; +extern int PROM_SIZE; + +extern int CLOCK_SPEED; + +extern int end; /* last address in the program */ + +/* + * How many libio files we want + */ + +#define BSP_LIBIO_MAX_FDS 20 + +/* functions */ + +/* + * genvec.c + */ +rtems_isr_entry set_EE_vector( + rtems_isr_entry handler, /* isr routine */ + rtems_vector_number vector /* vector number */ +); +void initialize_external_exception_vector (); + +/* + * console.c + */ +void DEBUG_puts( char *string ); + +void BSP_fatal_return( void ); + + + +void bsp_start( void ); + +void bsp_cleanup( void ); + +rtems_isr_entry set_vector( /* returns old vector */ + rtems_isr_entry handler, /* isr routine */ + rtems_vector_number vector, /* vector number */ + int type /* RTEMS or RAW intr */ +); + +void BSP_fatal_return( void ); + +void bsp_spurious_initialize( void ); + +extern rtems_configuration_table BSP_Configuration; /* owned by BSP */ + +extern rtems_cpu_table Cpu_table; /* owned by BSP */ + +extern rtems_unsigned32 bsp_isr_level; + +extern int CPU_PPC_CLICKS_PER_MS; + +#endif /* ASM */ + +#ifdef __cplusplus +} +#endif + +#endif +/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/chain.h b/c/src/lib/libbsp/powerpc/dmv177/include/chain.h new file mode 100644 index 0000000000..c54df2b4e7 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/include/chain.h @@ -0,0 +1,353 @@ +/* chain.h + * + * This include file contains all the constants and structures associated + * with doubly linked chains. This file actually just provides an + * interface to the chain object in rtems. + * + */ + +#ifndef __CHAIN_h +#define __CHAIN_h + +#include <rtems.h> + +/* + * Chain_Initialize + * + * This routine initializes the_chain structure to manage the + * contiguous array of number_nodes nodes which starts at + * starting_address. Each node is of node_size bytes. + * + * Chain_Control *the_chain, * IN * + * void *starting_address, * IN * + * rtems_unsigned32 number_nodes, * IN * + * rtems_unsigned32 node_size * IN * + */ + +#define Chain_Initialize( the_chain, starting_address, \ + number_nodes, node_size ) \ + _Chain_Initialize( the_chain, starting_address, \ + number_nodes, node_size ) \ + + +/* + * Chain_Initialize_empty + * + * This routine initializes the specified chain to contain zero nodes. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Initialize_empty( the_chain ) \ + _Chain_Initialize_empty( the_chain ) + + +/* + * Chain_Are_nodes_equal + * + * This function returns TRUE if LEFT and RIGHT are equal, + * and FALSE otherwise. + * + * Chain_Node *left, * IN * + * Chain_Node *right * IN * + */ + +#define Chain_Are_nodes_equal( left, right ) \ + _Chain_Are_nodes_equal( left, right ) + + +/* + * Chain_Extract_unprotected + * + * This routine extracts the_node from the chain on which it resides. + * It does NOT disable interrupts to insure the atomicity of the + * extract operation. + * + * Chain_Node *the_node * IN * + */ + +#define Chain_Extract_unprotected( the_node ) \ + _Chain_Extract_unprotected( the_node ) + + +/* + * Chain_Extract + * + * This routine extracts the_node from the chain on which it resides. + * It disables interrupts to insure the atomicity of the + * extract operation. + * + * Chain_Node *the_node * IN * + */ + +#define Chain_Extract( the_node ) \ + _Chain_Extract( the_node ) + + +/* + * Chain_Get_unprotected + * + * This function removes the first node from the_chain and returns + * a pointer to that node. If the_chain is empty, then NULL is returned. + * It does NOT disable interrupts to insure the atomicity of the + * get operation. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Get_unprotected( the_chain ) \ + _Chain_Get_unprotected( the_chain ) + + +/* + * Chain_Get + * + * This function removes the first node from the_chain and returns + * a pointer to that node. If the_chain is empty, then NULL is returned. + * It disables interrupts to insure the atomicity of the + * get operation. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Get( the_chain ) \ + _Chain_Get( the_chain ) + + +/* + * Chain_Get_first_unprotected + * + * This function removes the first node from the_chain and returns + * a pointer to that node. It does NOT disable interrupts to insure + * the atomicity of the get operation. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Get_first_unprotected( the_chain ) \ + _Chain_Get_first_unprotected( the_chain ) + + +/* + * Chain_Insert_unprotected + * + * This routine inserts the_node on a chain immediately following + * after_node. It does NOT disable interrupts to insure the atomicity + * of the extract operation. + * + * Chain_Node *after_node, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Insert_unprotected( after_node, the_node ) \ + _Chain_Insert_unprotected( after_node, the_node ) + + +/* + * Chain_Insert + * + * This routine inserts the_node on a chain immediately following + * after_node. It disables interrupts to insure the atomicity + * of the extract operation. + * + * Chain_Node *after_node, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Insert( after_node, the_node ) \ + _Chain_Insert( after_node, the_node ) + + +/* + * Chain_Append_unprotected + * + * This routine appends the_node onto the end of the_chain. + * It does NOT disable interrupts to insure the atomicity of the + * append operation. + * + * Chain_Control *the_chain, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Append_unprotected( the_chain, the_node ) \ + _Chain_Append_unprotected( the_chain, the_node ) + + +/* + * Chain_Append + * + * This routine appends the_node onto the end of the_chain. + * It disables interrupts to insure the atomicity of the + * append operation. + * + * Chain_Control *the_chain, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Append( the_chain, the_node ) \ + _Chain_Append( the_chain, the_node ) + + +/* + * Chain_Prepend_unprotected + * + * This routine prepends the_node onto the front of the_chain. + * It does NOT disable interrupts to insure the atomicity of the + * prepend operation. + * + * Chain_Control *the_chain, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Prepend_unprotected( the_chain, the_node ) \ + _Chain_Prepend_unprotected( the_chain, the_node ) + + +/* + * Chain_Prepend + * + * This routine prepends the_node onto the front of the_chain. + * It disables interrupts to insure the atomicity of the + * prepend operation. + * + * Chain_Control *the_chain, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Prepend( the_chain, the_node ) \ + _Chain_Prepend( the_chain, the_node ) + + +/* + * Chain_Head + * + * This function returns a pointer to the first node on the chain. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Head( the_chain ) \ + _Chain_Head( the_chain ) + + +/* + * Chain_Tail + * + * This function returns a pointer to the last node on the chain. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Tail( the_chain ) \ + _Chain_Tail( the_chain ) + + +/* + * Chain_Is_head + * + * This function returns TRUE if the_node is the head of the_chain and + * FALSE otherwise. + * + * Chain_Control *the_chain, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Is_head( the_chain, the_node ) \ + _Chain_Is_head( the_chain, the_node ) + + +/* + * Chain_Is_tail + * + * This function returns TRUE if the_node is the tail of the_chain and + * FALSE otherwise. + * + * Chain_Control *the_chain, * IN * + * Chain_Node *the_node * IN * + */ + +#define Chain_Is_tail( the_chain, the_node ) \ + _Chain_Is_tail( the_chain, the_node ) + + +/* + * Chain_Is_first + * + * This function returns TRUE if the_node is the first node on a chain and + * FALSE otherwise. + * + * Chain_Node *the_node * IN * + */ + +#define Chain_Is_first( the_node ) \ + _Chain_Is_first( the_node ) + + +/* + * Chain_Is_last + * + * This function returns TRUE if the_node is the last node on a chain and + * FALSE otherwise. + * + * Chain_Node *the_node * IN * + */ + +#define Chain_Is_last( the_node ) \ + _Chain_Is_last( the_node ) + + +/* + * Chain_Is_empty + * + * This function returns TRUE if there are no nodes on the_chain and + * FALSE otherwise. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Is_empty( the_chain ) \ + _Chain_Is_empty( the_chain ) + + +/* + * Chain_Has_only_one_node + * + * This function returns TRUE if there is only one node on the_chain and + * FALSE otherwise. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Has_only_one_node( the_chain ) \ + _Chain_Has_only_one_node( the_chain ) + + +/* + * Chain_Is_null + * + * This function returns TRUE if the_chain is NULL and FALSE otherwise. + * + * Chain_Control *the_chain * IN * + */ + +#define Chain_Is_null( the_chain ) \ + _Chain_Is_null( the_chain ) + + +/* + * Chain_Is_null_node + * + * This function returns TRUE if the_node is NULL and FALSE otherwise. + * + * Chain_Node *the_node * IN * + */ + +#define Chain_Is_null_node( the_node ) \ + _Chain_Is_null_node( the_node ) + + +#undef __RTEMS_APPLICATION__ +#include <rtems/score/chain.inl> +#define __RTEMS_APPLICATION__ +#endif +/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h b/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h new file mode 100644 index 0000000000..451d13b706 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h @@ -0,0 +1,134 @@ +/* coverhd.h + * + * This include file has defines to represent the overhead associated + * with calling a particular directive from C. These are used in the + * Timing Test Suite to ignore the overhead required to pass arguments + * to directives. On some CPUs and/or target boards, this overhead + * is significant and makes it difficult to distinguish internal + * RTEMS execution time from that used to call the directive. + * This file should be updated after running the C overhead timing + * test. Once this update has been performed, the RTEMS Time Test + * Suite should be rebuilt to account for these overhead times in the + * timing results. + * + * NOTE: If these are all zero, then the times reported include + * calling overhead including passing of arguments. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +/* + * + * Units are 100ns. + * + * These numbers are of questionable use, as they are developed by calling + * the routine many times, thus getting its entry veneer into the (small) + * cache on the 403GA. This in general is not true of the RTEMS timing + * tests, which usually call a routine only once, thus having no cache loaded + * advantage. + * + * Whether the directive times are useful after deducting the function call + * overhead is also questionable. The user is more interested generally + * in the total cost of a directive, not the cost if the procedure call + * is inlined! (In general this is not true). + * + * Andrew Bray 18/08/1995 + * + */ + +#ifndef __COVERHD_h +#define __COVERHD_h + +#ifdef __cplusplus +extern "C" { +#endif + +#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0 +#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0 +#define CALLING_OVERHEAD_TASK_CREATE 0 +#define CALLING_OVERHEAD_TASK_IDENT 0 +#define CALLING_OVERHEAD_TASK_START 0 +#define CALLING_OVERHEAD_TASK_RESTART 0 +#define CALLING_OVERHEAD_TASK_DELETE 0 +#define CALLING_OVERHEAD_TASK_SUSPEND 0 +#define CALLING_OVERHEAD_TASK_RESUME 0 +#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0 +#define CALLING_OVERHEAD_TASK_MODE 0 +#define CALLING_OVERHEAD_TASK_GET_NOTE 0 +#define CALLING_OVERHEAD_TASK_SET_NOTE 0 +#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0 +#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0 +#define CALLING_OVERHEAD_INTERRUPT_CATCH 0 +#define CALLING_OVERHEAD_CLOCK_GET 0 +#define CALLING_OVERHEAD_CLOCK_SET 0 +#define CALLING_OVERHEAD_CLOCK_TICK 0 + +#define CALLING_OVERHEAD_TIMER_CREATE 0 +#define CALLING_OVERHEAD_TIMER_IDENT 0 +#define CALLING_OVERHEAD_TIMER_DELETE 0 +#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0 +#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0 +#define CALLING_OVERHEAD_TIMER_RESET 0 +#define CALLING_OVERHEAD_TIMER_CANCEL 0 +#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0 +#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0 +#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0 +#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0 +#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0 +#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0 + +#define CALLING_OVERHEAD_EVENT_SEND 0 +#define CALLING_OVERHEAD_EVENT_RECEIVE 0 +#define CALLING_OVERHEAD_SIGNAL_CATCH 0 +#define CALLING_OVERHEAD_SIGNAL_SEND 0 +#define CALLING_OVERHEAD_PARTITION_CREATE 0 +#define CALLING_OVERHEAD_PARTITION_IDENT 0 +#define CALLING_OVERHEAD_PARTITION_DELETE 0 +#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0 +#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0 +#define CALLING_OVERHEAD_REGION_CREATE 0 +#define CALLING_OVERHEAD_REGION_IDENT 0 +#define CALLING_OVERHEAD_REGION_DELETE 0 +#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0 +#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0 +#define CALLING_OVERHEAD_PORT_CREATE 0 +#define CALLING_OVERHEAD_PORT_IDENT 0 +#define CALLING_OVERHEAD_PORT_DELETE 0 +#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0 +#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0 + +#define CALLING_OVERHEAD_IO_INITIALIZE 0 +#define CALLING_OVERHEAD_IO_OPEN 0 +#define CALLING_OVERHEAD_IO_CLOSE 0 +#define CALLING_OVERHEAD_IO_READ 0 +#define CALLING_OVERHEAD_IO_WRITE 0 +#define CALLING_OVERHEAD_IO_CONTROL 0 +#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0 +#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0 +#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0 +#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0 +#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0 +#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0 + +#ifdef __cplusplus +} +#endif + +#endif +/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h new file mode 100644 index 0000000000..2c0d8a0b00 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h @@ -0,0 +1,215 @@ +/* dmv170.h + * + * This include file contains information pertaining to the DMV170. + * + * NOTE: Other than where absolutely required, this version currently + * supports only the peripherals and bits used by the basic board + * support package. This includes at least significant pieces of + * the following items: + * + * + UART Channels A and B + * + * 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. + * + * $Id$ + */ + +#ifndef _INCLUDE_DMV170_h +#define _INCLUDE_DMV170_h + + +/* + * DY-4 is out of their mind and uses a non-standard clock. + */ + +#undef MC68681_BAUD_RATE_MASK_9600 +#define MC68681_BAUD_RATE_MASK_9600 + +#define DMV17x_MC68681_BAUD_RATE_MASK_9600 + +#if 0 +#define MC68681_OFFSET_MULTIPLIER 8 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Note: Move address defs to the linker files. */ +#define DMV170_RTC_ADDRESS 0xf2c00000 /* Real Time clock Base Address*/ +#define DUART_ADDR 0xf2800000 /* base address of the DUART(68681) */ +#define SCC_ADDR 0xfb000000 /* base address for the SCC (85C30) */ + +#define DMV170_LOCAL_CONTROL_STATUS_REG 0xf2400000 +#define DMV170_TIMER0_COUNT_INTERVAL_REG 0xf2400008 +#define DMV170_TIMER1_COUNT_INTERVAL_REG 0xf2400010 +#define DMV170_TIMER2_COUNT_INTERVAL_REG 0xf2400018 +#define DMV170_TIMER_CONTROL_REG 0xf2400020 +#define DMV170_CARD_RESORCE_REG 0xf2400040 + + +#define DMV170_WRITE( reg,data) \ + *((volatile rtems_unsigned16 *)(reg)) = (data) + +#define DMV170_READ( reg, data ) \ + (data) = *((volatile rtems_unsigned16 *)(reg)) + +/* + * The following defines the bits in the Local Control and Status Register. + */ +#define DMV170_IPLx_MASK 0x0007 +#define DMV170_MAXPACK_SENSE_MASK 0x0008 +#define DMV170_MAXPACK_NOT_INSTALLED 0x0008 +#define DMV170_MAXPACK_INSTALLED 0x0000 + +#define DMV170_MAXPACK_RESET_MASK 0x0010 +#define DMV170_MAXPACK_RESET_NEGATE 0x0010 +#define DMV170_MAXPACK_RESET_ASSERT 0x0000 +#define DMV170_EEPROM_READ_WRITE_MASK 0x0020 +#define DMV170_EEPROM_READ 0x0020 +#define DMV170_EEPROM_WRITE 0x0000 +#define DMV170_EEPROM_CLOCK_CTRL_MASK 0x0040 +#define DMV170_EEPROM_CLOCK_ASSERT 0x0040 +#define DMV170_EEPROM_CLOCK_NEGATE 0x0000 +#define DMV170_EEPROM_DATA_MASK 0x0080 +#define DMV170_EEPROM_DATA_HIGH 0x0080 +#define DMV170_EEPROM_DATA_LOW 0x0000 + +/* Bits 8:10 68040 Transfer Modifer Codes represent the Transfer Modifier to be used on MAXPack Accesses. */ +/* Bit 11 68040 Transfer Type (TT) 0:TT are both low 1:TT are both high */ + +#define DMV170_USER_LINK0_STATUS_MASK 0x1000 +#define DMV170_USER_LINK0_OPEN 0x1000 +#define DMV170_USER_LINK0_INSTALLED 0x0000 +#define DMV170_LOWER_STATUS_LED_CONTROL_MASK 0x2000 +#define DMV170_LOWER_STATUS_LED_IS_OFF 0x2000 +#define DMV170_LOWER_STATUS_LED_IS_ON 0x0000 +#ifdef DMV176 + /* The following are not available for the DMV171 */ +#define DMV170_RAM_TYPE_MASK 0x4000 +#define DMV170_RAM_TYPE_IS_DRAM 0x4000 +#define DMV170_RAM_TYPE_IS_SRAM 0x0000 +#define DMV170_IACK_VECTOR_AUTOVECTOR_MASK 0x8000 +#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_VECTOR 0x8000 +#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_NOT_VECTOR 0x0000 +#endif + +/* + * The following defines the bits in the Timer Control Register. + */ +#define DMV170_TIMER0_ENABLE_MASK 0x0001 +#define DMV170_TIMER0_IS_ENABLED 0x0001 +#define DMV170_TIMER0_IS_DISABLED 0x0000 +#define DMV170_TIMER1_ENABLE_MASK 0x0002 +#define DMV170_TIMER1_IS_ENABLED 0x0002 +#define DMV170_TIMER1_IS_DISABLED 0x0000 +#define DMV170_TIMER2_ENABLE_MASK 0x0004 +#define DMV170_TIMER2_IS_ENABLED 0x0004 +#define DMV170_TIMER2_IS_DISABLED 0x0000 +#define DMV170_TIMER1_CLOCK_MASK 0x0008 +#define DMV170_TIMER1_CLOCK_AT_TIMER0 0x0008 +#define DMV170_TIMER1_CLOCK_AT_1MHZ 0x0000 + +#define DMV170_TIMER2_CLOCK_MASK 0x0010 +#define DMV170_TIMER2_CLOCK_AT_TIMER0 0x0010 +#define DMV170_TIMER2_CLOCK_AT_1MHZ 0x0000 +#define DMV170_TIMER0_INTERRUPT_MASK 0x0020 +#define DMV170_TIMER0_INTERRUPT_ENABLE 0x0020 +#define DMV170_TIMER0_INTERRUPT_CLEAR 0x0000 +#define DMV170_TIMER1_INTERRUPT_MASK 0x0040 +#define DMV170_TIMER1_INTERRUPT_ENABLE 0x0040 +#define DMV170_TIMER1_INTERRUPT_CLEAR 0x0000 +#define DMV170_TIMER2_INTERRUPT_MASK 0x0080 +#define DMV170_TIMER2_INTERRUPT_ENABLE 0x0080 +#define DMV170_TIMER2_INTERRUPT_CLEAR 0x0000 + + + +/* The Following definethe bits for the Card Resource Register */ +#define DMV170_DUART_INTERRUPT_MASK 0x0001 /* DUART Interrupt Sense Bit */ +#define DMV170_DUART_INTERRUPT_NEGATE 0x0001 +#define DMV170_DUART_INTERRUPT_ASSERT 0x0000 +#define DMV170_SONIC_INTERRUPT_MASK 0x0002 /* SONIC Interrupt Sense Bit */ +#define DMV170_SONIC_INTERRUPT_NEGATE 0x0002 +#define DMV170_SONIC_INTERRUPT_ASSERT 0x0000 +#define DMV170_SCSI_INTERRUPT_MASK 0x0004 /* SCSI Interrupt Sense Bit */ +#define DMV170_SCSI_INTERRUPT_NEGATE 0x0004 +#define DMV170_SCSI_INTERRUPT_ASSERT 0x0000 +#define DMV170_SCC_INTERRUPT_MASK 0x0008 /* SCC Interrupt Sense Bit */ +#define DMV170_SCC_INTERRUPT_NEGATE 0x0008 +#define DMV170_SCC_INTERRUPT_ASSERT 0x0000 +#define DMV170_SNOOP_ENABLE_MASK 0x0010 /* CPU Snoop Enable Bit */ +#define DMV170_SNOOP_DISABLE 0x0010 +#define DMV170_SNOOP_ENABLE 0x0000 +#define DMV170_SONIC_RESET_MASK 0x0020 /* SONIC RESET Control */ +#define DMV170_SONIC_RESET_CLEAR 0x0020 +#define DMV170_SONIC_RESET_HOLD 0x0000 +#define DMV170_NV64_WE_MASK 0x0040 /* 64-bit Non-Volital Memory */ +#define DMV170_NV64_WRITE_ENABLE 0x0040 /* Write Enable */ +#define DMV170_NV64_WRITE_DISABLE 0x0000 +#define DMV170_BOOT_NV16_MASK 0x0080 /* BOOT Device Type */ +#define DMV170_BOOT_64_BIT 0x0080 +#define DMV170_BOOT_16_BIT 0x0000 +#define DMV170_DUART_INST_MASK 0x0100 /* DUART Sense Bit */ +#define DMV170_DUART_INSTALLED 0x0100 +#define DMV170_DUART_NOT_INSTALLED 0x0000 +#define DMV170_SONIC_INST_MASK 0x0200 /* SONIC Sense Bit */ +#define DMV170_SONIC_INSTALLED 0x0200 +#define DMV170_SONIC_NOT_INSTALLED 0x0000 +#define DMV170_16M_NV64_MASK 0x0400 /* 16 Mb of 64bit Flash Sense */ +#define DMV170_16Mb_FLASH_INSTALLED 0x0400 +#define DMV170_8Mb_FLASH_INSTALLED 0x0000 +#define DMV170_SCC_INST_MASK 0x0800 /* SCC Sense Bit */ +#define DMV170_SCC_INSTALLED 0x0800 +#define DMV170_SCC_NOT_INSTALLED 0x0000 +#define DMV170_RTC_INST_MASK 0x1000 /* RTC Sense Bit */ +#define DMV170_RTC_INSTALLED 0x1000 +#define DMV170_RTC_NOT_INSTALLED 0x0000 +#define DMV170_NV64_INST_MASK 0x2000 /* 64bit Non-Volital Mem Sense*/ + +#define DMV170_64_BIT_NON_VOLITAL_MEM_INSTALLED 0x2000 +#define DMV170_64_BIT_NON_VOLITAL_MEM_NOT_INSTALLED 0x0000 + + +/* + * DUART Baud Rate Definations. + */ +#define DMV170_DUART_9621 MC68681_BAUD_RATE_MASK_600 /* close to 9600 */ + +#define DMV170_RTC_FREQUENCY 0x0000 + + +/* + * CPU General Purpose Interrupt definations (PPC_IRQ_EXTERNAL). + * Note: For the interrupt level read the lower 3 bits of the + * Local Control and Status Register. + */ +#define DMV170_IRQ_FIRST ( PPC_IRQ_LAST + 1 ) + +#define DMV170_LIRQ0 ( DMV170_IRQ_FIRST + 0 ) +#define DMV170_LIRQ1 ( DMV170_IRQ_FIRST + 1 ) +#define DMV170_LIRQ2 ( DMV170_IRQ_FIRST + 2 ) +#define DMV170_LIRQ3 ( DMV170_IRQ_FIRST + 3 ) +#define DMV170_LIRQ4 ( DMV170_IRQ_FIRST + 4 ) +#define DMV170_LIRQ5 ( DMV170_IRQ_FIRST + 5 ) + +#define MAX_BOARD_IRQS DMV170_LIRQ5 +#ifdef __cplusplus +} +#endif + +#endif /* !_INCLUDE_DMV170_h */ +/* end of include file */ + + + + + + + diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/tod.h b/c/src/lib/libbsp/powerpc/dmv177/include/tod.h new file mode 100644 index 0000000000..d51ceb23b9 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/dmv177/include/tod.h @@ -0,0 +1,38 @@ +/* + * Real Time Clock (MK48T08) for RTEMS on Score603e + * + * Based on MVME162 TOD by: + * COPYRIGHT (C) 1997 + * by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN + * ALL RIGHTS RESERVED + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + + +#ifndef TOD_H +#define TOD_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern void setRealTimeToRTEMS(); +/* Read real time from RTC and set it to RTEMS' clock manager */ + +extern void setRealTimeFromRTEMS(); +/* Read time from RTEMS' clock manager and set it to RTC */ + +extern int checkRealTime(); +/* Return the difference between RTC and RTEMS' clock manager time in minutes. + If the difference is greater than 1 day, this returns 9999. */ + +#ifdef __cplusplus +} +#endif + +#endif |