/*
 * (C) Copyright 2001
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#ifndef _CMD_BSP_H_
#define _CMD_BSP_H_

#include <ppcboot.h>
#include <command.h>

#if (CONFIG_COMMANDS & CFG_CMD_BSP)

/* ----- LWMON -----------------------------------------------------------------
 */
#if defined(CONFIG_LWMON)

#define	CMD_TBL_BSP	MK_CMD_TBL_ENTRY(					\
	"pic",	3,	4,	1,	do_pic,					\
	"pic     - read and write PIC registers\n",				\
	"read  reg      - read PIC register `reg'\n"				\
	"pic write reg val  - write value `val' to PIC register `reg'\n"	\
),

void do_pic (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);

#endif	/* CONFIG_LWMON */
/* ----------------------------------------------------------------------------*/

/* ----- PCU E -----------------------------------------------------------------
 */
#if defined(CONFIG_PCU_E) || defined(CONFIG_CCM)

#define CMD_TBL_BSP	MK_CMD_TBL_ENTRY(					\
	"puma",	4,	4,	1,	do_puma,				\
	"puma    - access PUMA FPGA\n",						\
	"status - print PUMA status\n"						\
	"puma load addr len - load PUMA configuration data\n"			\
),

void do_puma (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);

#endif	/* CONFIG_PCU_E, CONFIG_CCM */
/* ----------------------------------------------------------------------------*/

/* ----- PIP405 -----------------------------------------------------------------
 */
#if defined(CONFIG_PIP405)

#define	CMD_TBL_BSP MK_CMD_TBL_ENTRY(				\
	"pip405",	4,	6,	1,	do_pip405,			\
	"pip405  - PIP405 specific Cmds\n",					\
	"flash mem [SrcAddr] - updates PPCBOOT with image in memory\n"					\
	"pip405 flash floppy [SrcAddr] - updates PPCBOOT with image from floppy\n"					\
	"pip405 flash mps - updates PPCBOOT with image from MPS\n"					\
),

void do_pip405 (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);

#endif /* CONFIG_PIP405 */
/* ----------------------------------------------------------------------------*/

/* ----- DASA_SIM ---------------------------------------------------------------
 */
#if defined(CONFIG_DASA_SIM)

#define	CMD_TBL_BSP MK_CMD_TBL_ENTRY(				                \
	"pci9054",	7,	3,	1,	do_pci9054,			\
	"pci9054 - PLX PCI9054 EEPROM access\n",				\
	"pci9054 info - print EEPROM values\n"		                        \
	"pci9054 update - updates EEPROM with default values\n"			\
),

void do_pci9054 (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);

#endif /* CONFIG_DASA_SIM */
/* ----------------------------------------------------------------------------*/

/* ----- HYMOD -----------------------------------------------------------------
 */
#if defined(CONFIG_HYMOD)

#define	CMD_TBL_BSP	MK_CMD_TBL_ENTRY(				\
	"fpga",	4,	6,	1,	do_fpga,			\
	"fpga    - FPGA sub-system\n",					\
	"load [type] addr size\n"					\
	"  - write the configuration data at memory address `addr',\n"	\
	"    size `size' bytes, into the FPGA of type `type' (either\n"	\
	"    `main' or `mezz', default `main'). e.g.\n"			\
	"        `fpga load 100000 7d8f'\n"				\
	"    loads the main FPGA with config data at address 100000\n"	\
	"    HEX, size 7d8f HEX (32143 DEC) bytes\n"			\
	"fpga tftp file addr\n"						\
	"  - transfers `file' from the tftp server into memory at\n"	\
	"    address `addr', then writes the entire file contents\n"	\
	"    into the main FPGA\n"					\
	"fpga store addr\n"						\
	"  - read configuration data from the main FPGA (the mezz\n"	\
	"    FPGA is write-only), into address `addr'. There must be\n"	\
	"    enough memory available at `addr' to hold all the config\n"\
	"    data - the size of which is determined by VC:???\n"	\
	"fpga info\n"							\
	"  - print information about the Hymod FPGA, namely the\n"	\
	"    memory addresses at which the four FPGA local bus\n"	\
	"    address spaces appear in the physical address space\n"	\
), MK_CMD_TBL_ENTRY(							\
	"eeclear", 4,	1,	0,	do_eecl,			\
	"eeclear - Clear the eeprom on a Hymod board \n",		\
	"[type]\n"							\
	"  - write zeroes into the EEPROM on the board of type `type'\n"\
	"    (`type' is either `main' or `mezz' - default `main')\n"	\
	"    Note: the EEPROM write enable jumper must be installed\n"	\
),

void do_fpga (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);
void do_eecl (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);

#endif	/* CONFIG_HYMOD */
/* ----------------------------------------------------------------------------*/
/* CRAY405 (L1) */
#if defined (CONFIG_CRAYL1)
#define	CMD_TBL_BSP MK_CMD_TBL_ENTRY(						\
	"L1cmd",	5,	4,	1,	do_crayL1,			\
	"L1cmd  - L1 update, setup, commands \n",				\
	"L1cmd update - update flash images from host\n"			\
	"L1cmd boot - nfs or ramboot L1\n"					\
),
void do_crayL1 (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);
#endif /* CONFIG_CRAY405 */
/* ----------------------------------------------------------------------------*/

#else
#define CMD_TBL_BSP
#endif	/* CFG_CMD_BSP */

#endif	/* _CMD_BSP_H_ */
