/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/

/*****************************************************************************
 *** 
 *** @(#) $Id: dbconfig.h,v 1.1 1997/09/15 21:10:37 gary Exp $
 *** 
 *****************************************************************************/

/*
 *  If DB_STARTRUN is set on startup, DBX does not halt the program
 *  after db_start is called, but continues the user program
 *  unimpaired.
 */

#define DB_STARTRUN 0

/*
 *  Whenever DB_FAKESTOP is set, the debugger reports to DBX that
 *  it has immediately stopped each time it is started.  After this,
 *  since DBX thinks the program is stopped, its possible to look
 *  step, it will halt immediately, and report proper status.
 */

#define DB_FAKESTOP 0

/*
 *  Whenever DB_REALTIME is set, the debugger does not wait for messages
 *  to be transmitted, or acknowledges to be received before returning
 *  to the user program.  The disadvantage is that there are no
 *  automatic retries on transmit, so on error-prone lines, DBX can
 *  hang up.  Should this happen, the user can manually halt the
 *  program so the timeout will resume, and DBX will heal itself.
 */

#define DB_REALTIME 1

/*
 * DB_DOCHECK determines whether a text/data area checksum is done
 * whenever the program stops, and the debugger is entered.  If
 * DB_CHECK is 1 or greater, the text area is checked; if 2 or
 * greater, the data area is also checked.  When a text checksum error
 * is detected, the debugger generates a USER 1 exception.  If a data
 * checksum error is detected, the debugger generates a USER 2
 * exception.
 */

#define DB_DOCHECK 0

/*
 *  Configuration for different DigiBoard device environments.
 */

#if 0
#  if SMART
#    define DB_UART	0xa10102e0	/* UART address */
#    if INTKLUDGE
#      define DB_IMASK	0x0000		/* No dedicated interrupt */
#      define DB_IADDR	0xa1010010	/* Interrupt address for UART #16 */
#      define DB_IBIT	0x80		/* Interrupt bit for UART #16 */
#    else
#      define DB_IMASK	0x1000		/* Interrupt mask for UART */
#    endif
#    define EBICONF 	*(volatile char *)0xa101000c = 0x02;
#    define WATCHDOG
#  endif
#else
#  if SMART
#    define DB_UART	0		/* Use memory interface */
#    define DB_IMASK	0x0800		/* Host interrupt mask */
#    define HOSTACK	(*(volatile uchar *)0xa1008000);
#    define WATCHDOG
#  endif
#endif

#if CONC
#  define DB_UART	0xa20102e0	/* UART address */
#  if IUSC
#    define DB_IADDR	0xa2010010	/* Interrupt address for UART #16 */
#    define DB_IBIT	0x80		/* Interrupt bit for UART #16 */
#  endif
#  if SCA
#    define DB_IADDR	0xa2010008	/* Interrupt address for UART #16 */
#    define DB_IBIT	0x80		/* Interrupt bit for UART #16 */
#  endif
#  if INTKLUDGE
#    define DB_IMASK	0x0000		/* No dedicated interrupt */
#  else
#    define DB_IMASK	0x1000		/* Interrupt mask for UART */
#  endif
#  define EBICONF
#  define WATCHDOG 	(*(volatile uchar *)0xa2010000) = 0;
#endif

#if RTS
#  define DB_UART	0xa20002e3	/* UART address */
#  define DB_IADDR	0xa200000a	/* Interrupt address for UART #16 */
#  define DB_IBIT	0x80		/* Interrupt bit for UART #16 */
#  if INTKLUDGE
#    define DB_IMASK	0x0000		/* No dedicated interrupt */
#  else
#    define DB_IMASK	0x2000		/* Interrupt mask for UART */
#  endif
#  define EBICONF 	(*(volatile char  *)0xa200000f) = 0x02;
#  define WATCHDOG 	(*(volatile ulong *)0xa1000000) = 0;
#endif

#if PRI
#define	DB_UART		0xa2060000	/* UART Address */
#if BIOS
#define	WATCHDOG
#define	EBICONF
#else
#define	WATCHDOG	{ \
				extern volatile unsigned char *board_counter ; \
				extern volatile unsigned char *host_counter ; \
									\
				if (*board_counter != *host_counter) { \
					*board_counter = *board_counter + 1; \
				} \
			}
#define	EBICONF
#endif
#else
#define WATCHDOG 
#define DB_UART 1
#endif

/*
 *  Other options.
 */

#define DB_MAIN_SIZE	0x1000		/* dbmain() stack size */
#define DB_TRAN_SIZE	0x1000		/* transmit() stack size */
#define DB_RECV_SIZE	0x1000		/* receive() stack size */

#define DB_BAUD		9600		/* Fixed Uart baud rate */
