diff options
Diffstat (limited to 'c/src/lib/libbsp/m68k/sim68000/console')
-rw-r--r-- | c/src/lib/libbsp/m68k/sim68000/console/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/sim68000/console/Makefile.am | 37 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/sim68000/console/conscfg.c | 74 |
3 files changed, 113 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/m68k/sim68000/console/.cvsignore b/c/src/lib/libbsp/m68k/sim68000/console/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/c/src/lib/libbsp/m68k/sim68000/console/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/c/src/lib/libbsp/m68k/sim68000/console/Makefile.am b/c/src/lib/libbsp/m68k/sim68000/console/Makefile.am new file mode 100644 index 0000000000..2ee7fd276e --- /dev/null +++ b/c/src/lib/libbsp/m68k/sim68000/console/Makefile.am @@ -0,0 +1,37 @@ +## +## $Id$ +## + +AUTOMAKE_OPTIONS = foreign 1.4 + +VPATH = @srcdir@:@srcdir@/../../../shared + +PGM = $(ARCH)/console.rel + +C_FILES = conscfg.c console.c +C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) + +S_FILES = +S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o) + +OBJS = $(C_O_FILES) $(S_O_FILES) + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../../../../../../automake/lib.am + +# +# (OPTIONAL) Add local stuff here using += +# + +$(PGM): $(OBJS) + $(make-rel) + +# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile + +all-local: $(ARCH) $(OBJS) $(PGM) + +.PRECIOUS: $(PGM) + +EXTRA_DIST = conscfg.c + +include $(top_srcdir)/../../../../../../automake/local.am diff --git a/c/src/lib/libbsp/m68k/sim68000/console/conscfg.c b/c/src/lib/libbsp/m68k/sim68000/console/conscfg.c new file mode 100644 index 0000000000..0817233834 --- /dev/null +++ b/c/src/lib/libbsp/m68k/sim68000/console/conscfg.c @@ -0,0 +1,74 @@ +/* + * This file contains the TTY driver table. + * + * COPYRIGHT (c) 1989-2000. + * On-Line Applications Research Corporation (OAR). + * + * 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$ + */ + +#include <bsp.h> + +#include <libchip/serial.h> +#include <libchip/mc68681.h> + +/* + * Fix these for the simulator + */ + +#define MC68681_PORT_CONFIG MC68681_XBRG_IGNORED +#define MC68681_PROBE libchip_serial_default_probe +#define MC68681_VECTOR 0 +#define MC68681_BASE_ADDRESS 0x71001 +#define MC68681_BASE_ADDRESS 0x71007 + +/* + * Based on BSP configuration information decide whether to do polling IO + * or interrupt driven IO. + */ + +#if (CONSOLE_USE_INTERRUPTS) +#define MC68681_FUNCTIONS &mc68681_fns +#else +#define MC68681_FUNCTIONS &mc68681_fns_polled +#endif + + + +console_tbl Console_Port_Tbl[] = { + { + "/dev/com0", /* sDeviceName */ + SERIAL_MC68681, /* deviceType */ + MC68681_FUNCTIONS, /* pDeviceFns */ + NULL, /* deviceProbe */ + NULL, /* pDeviceFlow */ + 16, /* ulMargin */ + 8, /* ulHysteresis */ + (void *)9600, /* baud rate */ /* pDeviceParams */ + MC68681_BASE_ADDRESS, /* ulCtrlPort1 */ + MC68681_BASE_ADDRESS, /* ulCtrlPort2 */ + MC68681_DATA_ADDRESS, /* ulDataPort */ + mc68681_get_register_2, /* getRegister */ + mc68681_set_register_2, /* setRegister */ + NULL, /* unused */ /* getData */ + NULL, /* unused */ /* setData */ + mc68681_baud_rate_table, /* ulClock */ + MC68681_VECTOR /* ulIntVector */ + } +}; + +/* + * Declare some information used by the console driver + */ + +#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) + +unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; + +console_data Console_Port_Data[NUM_CONSOLE_PORTS]; + +rtems_device_minor_number Console_Port_Minor; |