/*      $Id: diag_target.h,v 1.12 2008/02/22 01:25:20 zoran Exp $ */
/*
 * Copyright (c) 2006 PMC-Sierra
 *
 * 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.
 *
 */
#ifndef _DIAG_TARGET_H_
#define _DIAG_TARGET_H_

#include <dev/pci/pcidevs.h>
#include <pmon/dev/it8712.h>

/* Maximum number of pci buses connected with the target */
#define MAX_PCI_BUS    1	
/* Maximum number of pci slots available with the target */
#define MAX_PCI_DEVICE 31	

/*
 *  Name and number of ethernet interface to be initialized.
 */
#define	DIAG_NIF	2
#define	DIAG_IFNAME	"sk"

/* Product code of the Target XiaoHu */
#define PRODUCT_CODES		{"PI", "Q9", "TA"}

#define USB_CONTROLLER_NAME	"NEC uPD720101 USB"
#define SATA_CONTROLLER_NAME	"Promise PDC40518 SATA"
#define GE_CONTROLLER_NAME	"Marvell 88E8001 GE"
#define ENCRYPT_ENGINE_NAME	"SafeNet SafeXcel 1141 Encryptor"
#define	DIAG_PCIDEVS \
        /*VID                   PID                             product                 vendor          {PCI Tag}       test function */    \
        {PCI_VENDOR_NEC,	PCI_PRODUCT_NEC_USB2,		USB_CONTROLLER_NAME,	"NEC",		{0, 17, 2},	nas_pci_check_usb}, \
        {PCI_VENDOR_PROMISE,	PCI_PRODUCT_PROMISE_PDC40518,	SATA_CONTROLLER_NAME,	"Promise",	{0, 19, 0},	nas_pci_check_pdc405xx}, \
	{PCI_VENDOR_MARVELL,	PCI_PRODUCT_MARVELL_YUKON,	GE_CONTROLLER_NAME"1",	"Marvell",	{0, 18, 0},	nas_pci_check_ether}, \
	{PCI_VENDOR_MARVELL,	PCI_PRODUCT_MARVELL_YUKON,	GE_CONTROLLER_NAME"2",	"Marvell",	{0, 20, 0},	nas_pci_check_ether}, \
	{PCI_VENDOR_SAFENET,	PCI_PRODUCT_SAFENET_SAFEXCEL,	ENCRYPT_ENGINE_NAME,	"Safenet",	{0, 16, 0},	nas_pci_check_safenet}

#define DIAG_TESTS \
    {    "", "Memory Test",                           0,  NULL },          \
    { "PCI", "PCI Device",                            1,  diag_test_pci }, \
    {    "", USB_CONTROLLER_NAME,                     1,  NULL },          \
    {    "", SATA_CONTROLLER_NAME,                    1,  NULL },          \
    {    "", GE_CONTROLLER_NAME"1",                   1,  NULL },          \
    {    "", GE_CONTROLLER_NAME"2",                   1,  NULL },          \
    {    "", ENCRYPT_ENGINE_NAME,                     1,  NULL },          \
    { "USB", "USB OnBoard FLASH",                     1,  diag_test_usb }, \
    { "LPC", "LPC Device",                            1,  diag_test_lpc }, \
    {    "", "LPC: Environment Controller",           1,  NULL},           \
    {    "", "LPC: GPIO Controller",                  1,  NULL},           \
    { "RTC", "RTC setting",                           1,  diag_test_rtc }, \
    {  NULL, "UDI Programming",                       1,  diag_udi_program, 0 },

#define	DIAG_TEST_PCI
#define	DIAG_TEST_USB
#define	DIAG_TEST_LPC
#define	DIAG_TEST_RTC

#endif /* _DIAG_TARGET_H */
