/*
 * Copyright (c) 2001-2006 Opsycon AB  (www.opsycon.se)
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#include <target/xiaohu.h>

#ifndef SBD_DEBUG
#define SBD_DISPLAY(text)		/* No display function */
#else
#define SBD_DISPLAY(text)	tgt_display(text, 0)
#endif

extern void wrstr(char *);	/* Simple string display usable before init */

/*
 *  Name of envvar that has to be set to enable expert mode.
 */
#define EXPERT  "pmcexpert"

/*
 *  Target arch specifics
 */
#define	HAVE_QUAD			/* Native 64 bit integers */

/*
 *  Target dependent CLIENTPC settings
 */
#define CLIENTPC 0x80100000
#define SETCLIENTPC "80100000"

/*
 *  Define the system LED settings
 */
#if defined(TGT_PM74002)
#define	TFTPD_LED_ON	500	/* TFTPD active led on time in ms */
#define	TFTPD_LED_OFF	500	/* TFTPD active led off time in ms */
#define	ERASE_LED_ON	125	/* ERASE active led on time in ms */
#define	ERASE_LED_OFF	125	/* ERASE active led off time in ms */
#define	SYSERR_LED_ON	250	/* SYSERR active led on time in ms */
#define	SYSERR_LED_OFF	250	/* SYSERR active led off time in ms */

#define	ERASE_PIN	114	/* Erase status input. */
#define	ERASE_PIN_TIME	3000	/* Time until activated. */
#define	TFTPD_PIN	114	/* TFTPD status input (may be equal to erase) */
#define	TFTPD_PIN_TIME	5000	/* Time until activated */

#define	SYSTEM_PWR_LED	1	/* Power LED yellow-green */
#define	SYSTEM_ERR_LED	2	/* Error LED yellow-red */

#define	SYSTEM_LEDS \
  { SYSTEM_PWR_LED, 112, -1, 1, 1, { 0x11, 0x00, 0x33, 0x01, 0x31, 0x03 } }, \
  { SYSTEM_ERR_LED, 117, -1, 0, 0, { 0x00, 0x11, 0x22, 0x10, 0x20, 0x12 } },

#endif

#if defined(TGT_PM74101)
#define	ERASE_LED_ON	125	/* ERASE active led on time in ms */
#define	ERASE_LED_OFF	125	/* ERASE active led off time in ms */
#define	SYSERR_LED_ON	250	/* SYSERR active led on time in ms */
#define	SYSERR_LED_OFF	250	/* SYSERR active led off time in ms */

#define	ERASE_PIN	46	/* Erase status input. */
#define	ERASE_PIN_TIME	3000	/* Time until activated. */
#define	DIAGN_PIN	101	/* Diagnostic mode */

#define	SYSTEM_PWR_LED	1	/* Power LED yellow-green */
#define	SYSTEM_ERR_LED	2	/* Error LED yellow-red */

#define	SYSTEM_LEDS \
  { SYSTEM_PWR_LED, 110, 111, 1, 1, { 0x11, 0x00, 0x33, 0x01, 0x31, 0x03 } }, \
  { SYSTEM_ERR_LED, 116, 117, 0, 0, { 0x00, 0x11, 0x22, 0x10, 0x20, 0x12 } },

#endif

