#ifndef __CONFIG_H
#define __CONFIG_H

/*#define DEBUG 1*/

#define CONFIG_STB22X		1
#define CONFIG_STB225		1
#define CONFIG_STB225v1		1
#define CONFIG_SOC_PNX833X	1
#define CONFIG_SERIAL_IP3106	1
#define PNX833X_UART0		1

#ifndef GENERATED_CONFIG
#define GENERATED_CONFIG	8335_config
#endif

/*
   CFG_CMD_FLASH, CFG_CMD_NAND and CFG_CMD_NET are missing from
   CONFIG_COMMANDS_MINIMAL_NONET. They will be added to final CONFIG_COMMANDS
   based on boot mode / platform selection.
*/
#define CONFIG_COMMANDS_MINIMAL_NONET (0 \
                | CFG_CMD_BDI           /* bdinfo                        */ \
        /*      | CFG_CMD_LOADS            loads                         */ \
                | CFG_CMD_LOADB         /* loadb                         */ \
                | CFG_CMD_IMI           /* iminfo                        */ \
        /*      | CFG_CMD_CACHE            icache, dcache                */ \
        /*      | CFG_CMD_FLASH            flinfo, erase, protect        */ \
                | CFG_CMD_MEMORY        /* md, mm, nm, mw, cp, cmp,      */ \
                                        /* ... crc, base, loop, mtest    */ \
        /*      | CFG_CMD_NET              bootp, tftpboot, rarpboot     */ \
                | CFG_CMD_ENV           /* saveenv                       */ \
        /*      | CFG_CMD_KGDB             kgdb                          */ \
        /*      | CFG_CMD_PCMCIA           PCMCIA support                */ \
        /*      | CFG_CMD_IDE              IDE harddisk support          */ \
        /*      | CFG_CMD_PCI              pciinfo                       */ \
        /*      | CFG_CMD_IRQ              irqinfo                       */ \
                | CFG_CMD_BOOTD         /* bootd                         */ \
        /*      | CFG_CMD_CONSOLE          coninfo                       */ \
        /*      | CFG_CMD_EEPROM           EEPROM read/write support     */ \
                | CFG_CMD_ASKENV        /* ask for env variable          */ \
                | CFG_CMD_RUN           /* run command in env variable   */ \
                | CFG_CMD_ECHO          /* echo arguments                */ \
        /*      | CFG_CMD_I2C              I2C serial bus support        */ \
        /*      | CFG_CMD_REGINFO          Register dump                 */ \
        /*      | CFG_CMD_IMMAP            IMMR dump support             */ \
        /*      | CFG_CMD_DATE             support for RTC, date/time... */ \
        /*      | CFG_CMD_DHCP             DHCP Support                  */ \
        /*      | CFG_CMD_BEDBUG           Include BedBug Debugger       */ \
        /*      | CFG_CMD_FDC              Floppy Disk Support           */ \
        /*      | CFG_CMD_SCSI             SCSI Support                  */ \
        /*      | CFG_CMD_AUTOSCRIPT       Autoscript Support            */ \
                | CFG_CMD_MII           /* MII support                   */ \
        /*      | CFG_CMD_SETGETDCR        DCR support on 4xx            */ \
        /*      | CFG_CMD_BSP              Board Specific functions      */ \
        /*      | CFG_CMD_ELF              ELF (VxWorks) load/boot cmd   */ \
                | CFG_CMD_MISC          /* Misc functions like sleep etc */ \
        /*      | CFG_CMD_USB              USB Support                   */ \
        /*      | CFG_CMD_DOC              Disk-On-Chip Support          */ \
                | CFG_CMD_JFFS2         /* JFFS2 Support                 */ \
        /*      | CFG_CMD_DTT              Digital Therm and Thermostat  */ \
        /*      | CFG_CMD_SDRAM            SDRAM DIMM SPD info printout  */ \
        /*      | CFG_CMD_DIAG             Diagnostics                   */ \
        /*      | CFG_CMD_FPGA             FPGA configuration Support    */ \
        /*      | CFG_CMD_HWFLOW           RTS/CTS hw flow control       */ \
        /*      | CFG_CMD_SAVES            save S record dump            */ \
        /*      | CFG_CMD_SPI              SPI utility                   */ \
        /*      | CFG_CMD_FDOS             Floppy DOS support            */ \
        /*      | CFG_CMD_VFD              VFD support (TRAB)            */ \
        /*      | CFG_CMD_NAND             NAND support                  */ \
        /*      | CFG_CMD_BMP              BMP support                   */ \
        /*      | CFG_CMD_PORTIO           Port I/O                      */ \
        /*      | CFG_CMD_PING             ping support                  */ \
        /*      | CFG_CMD_MMC              MMC support                   */ \
        /*      | CFG_CMD_FAT              FAT support                   */ \
        /*      | CFG_CMD_IMLS             List all found images         */ \
                | CFG_CMD_ITEST         /* Integer (and string) test     */ \
        /*      | CFG_CMD_NFS              NFS support                   */ \
        /*      | CFG_CMD_REISER           Reiserfs support              */ \
        /*      | CFG_CMD_CDP              Cisco Discovery Protocol      */ \
        /*      | CFG_CMD_XIMG             Load part of Multi Image      */ \
        /*      | CFG_CMD_UNIVERSE         Tundra Universe Support       */ \
        /*      | CFG_CMD_EXT2             EXT2 Support                  */ \
        /*      | CFG_CMD_SNTP             SNTP support                  */ \
        /*      | CFG_CMD_DISPLAY          Display support               */ \
                | 0)

#if defined (ETHERNET_PRESENT)
  #define CONFIG_COMMANDS_MINIMAL	(CONFIG_COMMANDS_MINIMAL_NONET | CFG_CMD_NET)
#else
  #define CONFIG_COMMANDS_MINIMAL	(CONFIG_COMMANDS_MINIMAL_NONET)
#endif


/*******************************************************************************
*******************************************************************************/

#define MTDIDS_NAND_DEFAULT		"nand0=gen_nand"
#define MTDPARTS_NAND_DEFAULT		"gen_nand:128k(Boot0),1M(Boot1),512k(Env),4M(Kernel),16M(Filesystem),128k(User)"
#define ENV_OFFSET_NAND_DEFAULT 	((128 * 1024) + (1024 * 1024))
#define ENV_SIZE_NAND_DEFAULT		(128 * 1024)

#define MTDIDS_NOR_DEFAULT		"nor0=physmap-flash.0"
#define MTDPARTS_NOR_DEFAULT		"physmap-flash.0:512k(Boot),128k(Env),1664k(Kernel),11M(Filesystem),640k(User)"
#define ENV_OFFSET_NOR_DEFAULT		(512 * 1024)
#define ENV_SECT_SIZE_NOR_DEFAULT	(128 * 1024)

/*
   Uniboot == aboot + u-boot concatenated together
*/
#define MTDIDS_CINDYKATE		"nor0=physmap-flash.0,nand0=gen_nand"
#define MTDPARTS_CINDYKATE		"physmap-flash.0:384k(Uniboot),128k(Env),1536k(Kernel0);gen_nand:3M(Kernel1),32M(Filesystem0),32M(Filesystem1),-(Metadata)"
#define ENV_OFFSET_CINDYKATE		(384 * 1024)
#define ENV_SECT_SIZE_CINDYKATE 	(128 * 1024)


/*******************************************************************************
*******************************************************************************/

#if defined (SPLASH)
  #define CONFIG_SPLASH_SCREEN
  #define CONFIG_CFB_CONSOLE
  #define VIDEO_KBD_INIT_FCT		-1
  #define VIDEO_TSTC_FCT		serial_tstc
  #define VIDEO_GETC_FCT		serial_getc
  #define CONFIG_VIDEO_BMP_GZIP
  #define CFG_VIDEO_LOGO_MAX_SIZE	(1 << 21)
  #define DISPLAY_MODE_NTSC		(0)
  #define DISPLAY_MODE_PAL		(1)
  #define DISPLAY_MODE_480P		(2)
  #define DISPLAY_MODE_576P		(3)
  #if defined (MODE_NTSC)
    #define STB225_DISPLAY_MODE 	DISPLAY_MODE_NTSC
  #elif defined (MODE_PAL)
    #define STB225_DISPLAY_MODE 	DISPLAY_MODE_PAL
  #elif defined (MODE_480P)
    #define STB225_DISPLAY_MODE 	DISPLAY_MODE_480P
  #elif defined (MODE_576P)
    #define STB225_DISPLAY_MODE 	DISPLAY_MODE_576P
  #endif
  #if defined (SCART_OUTPUT)
    #define STB225_SCART_OUTPUT_MODE
  #endif
  #if defined (HDMI_OUTPUT)
    #define STB225_HDMI_OUTPUT_MODE
  #endif
#else
  #undef CONFIG_SPLASH_SCREEN
#endif

#if defined (ETHERNET_OSCILLATOR)
  #define STB225_ETHERNET_OSCILLATOR
#endif

#if defined (NAND_SUPPORTS_READY_SIGNAL)
  #define STB225_NAND_SUPPORTS_READY_SIGNAL
#endif

#if ! defined (IPADDR_DEFAULT)
  #define IPADDR_DEFAULT		"192.168.0.2"
#endif
#if ! defined (SERVERIP_DEFAULT)
  #define SERVERIP_DEFAULT		"192.168.0.1"
#endif
#if ! defined (GATEWAYIP_DEFAULT)
  #define GATEWAYIP_DEFAULT		"192.168.0.1"
#endif


/*******************************************************************************
*******************************************************************************/

#if defined (BOOT_TARGET_GENERIC_NAND_RESCUE)

  #define CFG_PROMPT			"\nSTB225v1 rescue# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_NAND)
  #define CONFIG_BOOTDELAY		-1
  #undef  CONFIG_SPLASH_SCREEN
  #undef  STB225_ETHERNET_OSCILLATOR
  #define CFG_ENV_IS_IN_NAND		1
  #define CFG_ENV_OFFSET		ENV_OFFSET_NAND_DEFAULT
  #define CFG_ENV_SIZE			ENV_SIZE_NAND_DEFAULT
  #define MTDIDS_DEFAULT		MTDIDS_NAND_DEFAULT
  #define MTDPARTS_DEFAULT		"mtdparts=" MTDPARTS_NAND_DEFAULT
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT	"\0" \
	"mtdparts=" MTDPARTS_DEFAULT	"\0"


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_GENERIC_NOR_RESCUE)

  #define CFG_PROMPT			"\nSTB225v1 rescue# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_FLASH)
  #define CONFIG_BOOTDELAY		-1
  #undef  CONFIG_SPLASH_SCREEN
  #undef  STB225_ETHERNET_OSCILLATOR
  #define CFG_ENV_IS_IN_FLASH		1
  #define CFG_ENV_OFFSET		ENV_OFFSET_NOR_DEFAULT
  #define CFG_ENV_SECT_SIZE		ENV_SECT_SIZE_NOR_DEFAULT
  #define MTDIDS_DEFAULT		MTDIDS_NOR_DEFAULT
  #define MTDPARTS_DEFAULT		"mtdparts=" MTDPARTS_NOR_DEFAULT
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT	"\0" \
	"mtdparts=" MTDPARTS_DEFAULT	"\0"

  /*
     There's no standard GPIO assignment for NOR write-protect, so
     defining GPIO_NOR_WP unconditionally is a little dangerous...
  */
  #define GPIO_NOR_WP			GPIO_7		/* output : low == NOR device writes are disabled */


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_GENERIC_NAND)

  #define CFG_PROMPT			"\nSTB225v1 nand# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_NAND)
  #define CONFIG_BOOTDELAY		1
  #define CFG_ENV_IS_IN_NAND		1
  #define CFG_ENV_OFFSET		ENV_OFFSET_NAND_DEFAULT
  #define CFG_ENV_SIZE			ENV_SIZE_NAND_DEFAULT
  #define MTDIDS_DEFAULT		MTDIDS_NAND_DEFAULT
  #define MTDPARTS_DEFAULT		"mtdparts=" MTDPARTS_NAND_DEFAULT
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT										"\0" \
	"mtdparts=" MTDPARTS_DEFAULT										"\0" \
	"fspart=4"												"\0" \
	"autostart=yes" 											"\0" \
	"bootnand=nboot.jffs2 Kernel"										"\0" \
	"boottftp=tftpboot"											"\0" \
	"setargs=set bootargs ${mtdparts} ${xargs} ip3902.mac_address=${ethaddr}"				"\0" \
	"adddhcp=set bootargs ${bootargs} ip=dhcp"								"\0" \
	"addip=set bootargs ${bootargs} ip=${ipaddr}:${serverip}::::${ethport}"					"\0" \
	"addjffs=set bootargs ${bootargs} root=/dev/mtdblock${fspart} ro rootfstype=jffs2"			"\0" \
	"addcramfs=set bootargs ${bootargs} root=/dev/mtdblock_robbs${fspart} ro rootfstype=cramfs"		"\0" \
	"addsquashfs=set bootargs ${bootargs} root=/dev/mtdblock_robbs${fspart} ro rootfstype=squashfs"		"\0" \
	"addnfs=set bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath},tcp,nfsvers=3"	"\0" \
	"hostname=stb"												"\0" \
	"loadaddr=80800000"											"\0" \
	"bootfile=uImage_stb225"										"\0" \
	"rootpath=/rootfs"											"\0" \
	"ethport=eth0"												"\0" \
	"ipaddr=" IPADDR_DEFAULT										"\0" \
	"serverip=" SERVERIP_DEFAULT										"\0" \
	"gatewayip=" GATEWAYIP_DEFAULT 										"\0" \
	"netmask=255.255.255.0" 										"\0" \
	"bootcmd=run setargs; run addip; run addjffs; run bootnand"						"\0"


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_GENERIC_NOR)

  #define CFG_PROMPT			"\nSTB225v1 nor# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_FLASH)
  #define CONFIG_BOOTDELAY		1
  #define CFG_ENV_IS_IN_FLASH		1
  #define CFG_ENV_OFFSET		ENV_OFFSET_NOR_DEFAULT
  #define CFG_ENV_SECT_SIZE		ENV_SECT_SIZE_NOR_DEFAULT
  #define MTDIDS_DEFAULT		MTDIDS_NOR_DEFAULT
  #define MTDPARTS_DEFAULT		"mtdparts=" MTDPARTS_NOR_DEFAULT
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT										"\0" \
	"mtdparts=" MTDPARTS_DEFAULT										"\0" \
	"fspart=3"												"\0" \
	"autostart=yes" 											"\0" \
	"bootnor=bootm b80a0000"										"\0" \
	"boottftp=tftpboot"											"\0" \
	"setargs=set bootargs ${mtdparts} ${xargs} ip3902.mac_address=${ethaddr}"				"\0" \
	"adddhcp=set bootargs ${bootargs} ip=dhcp"								"\0" \
	"addip=set bootargs ${bootargs} ip=${ipaddr}:${serverip}::::${ethport}"					"\0" \
	"addjffs=set bootargs ${bootargs} root=/dev/mtdblock${fspart} ro rootfstype=jffs2"			"\0" \
	"addcramfs=set bootargs ${bootargs} root=/dev/mtdblock${fspart} ro rootfstype=cramfs"			"\0" \
	"addsquashfs=set bootargs ${bootargs} root=/dev/mtdblock_robbs${fspart} ro rootfstype=squashfs"		"\0" \
	"addnfs=set bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath},tcp,nfsvers=3"	"\0" \
	"hostname=stb"												"\0" \
	"loadaddr=80800000"											"\0" \
	"bootfile=uImage_stb225"										"\0" \
	"rootpath=/rootfs"											"\0" \
	"ethport=eth0"												"\0" \
	"ipaddr=" IPADDR_DEFAULT										"\0" \
	"serverip=" SERVERIP_DEFAULT										"\0" \
	"gatewayip=" GATEWAYIP_DEFAULT 										"\0" \
	"netmask=255.255.255.0" 										"\0" \
	"bootcmd=run setargs; run addip; run addjffs; run bootnor"						"\0"

  /*
     There's no standard GPIO assignment for NOR write-protect, so
     defining GPIO_NOR_WP unconditionally is a little dangerous...
  */
  #define GPIO_NOR_WP			GPIO_7		/* output : low == NOR device writes are disabled */


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_GRIFFIN_RESCUE)

  #error "BOOT_TARGET_GRIFFIN_RESCUE not yet supported"


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_GRIFFIN)

  /*
     Fixme: Won't build due to lack of Env partition in Flash (CFG_ENV_IS_NOWHERE
            doesn't seem to work). Previous solution was to define dummy CFG_ENV_SIZE
	    and CFG_ENV_OFFSET and then hope CRC check always failed, but that seems
	    a little dubious... should be fixed properly.
  */
  #define CFG_PROMPT			"\nSTB225v1 nand# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_NAND)
  #define CONFIG_BOOTDELAY		1
  #define CFG_ENV_IS_NOWHERE		1
  #define MTDIDS_DEFAULT		"nand0=Nand"
  #define MTDPARTS_DEFAULT		"mtdparts=Nand:2M(Boot),24M(FS1),24M(FS2),14M(RW)"
  #define CONFIG_BOOTCOMMAND		"run setargs; run add${bootfs}; bootn"
  #define CFG_NAND_BB_REMAP		1
  #define CFG_BOOTN_ENABLE		1
  #define CFG_BOOTN_BOOT_SIZE		( 2 * 1024 * 1024)
  #define CFG_BOOTN_ID_SIZE		( 2 *   16 * 1024)
  #define CFG_BOOTN_FS_SIZE		(24 * 1024 * 1024)
  #define CFG_BOOTN_MAC_OFFSET		((CFG_BOOTN_BOOT_SIZE - CFG_BOOTN_ID_SIZE) + 351)	/* temporary: will disappear when MAC moves into polyfuses */
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT "\0" \
	"mtdparts=" MTDPARTS_DEFAULT "\0" \
	"addcramfs=set bootargs ${bootargs} root=/dev/mtdblock_robbs1 ro" "\0" \
	"addnfs=set bootargs ${bootargs} ip=${ipaddr}:${serverip}::::${ethport} root=/dev/nfs rw nfsroot=${serverip}:${rootpath},tcp,nfsvers=3" "\0" \
	"setargs=set bootargs console=ttyS0,115200" "\0" \
	"autostart=yes" "\0" \
	"ethport=eth0" "\0" \
	"rootpath=/rootfs" "\0" \
	"ipaddr=" IPADDR_DEFAULT "\0" \
	"serverip=" SERVERIP_DEFAULT "\0" \
	"bootfs=cramfs" "\0"

  #define CONFIG_DEFAULT_ENV_IS_SECURE		/* If not, undef this and populate default_environment_secure with desired secure environment */


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_MONACO)

  #define CFG_PROMPT			"\nMonaco# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_NAND | CFG_CMD_DHCP | CFG_CMD_NET)
  #define CONFIG_BOOTDELAY		3
  #undef  CONFIG_SPLASH_SCREEN
  #define CFG_ENV_IS_IN_NAND		1
  #define CFG_ENV_OFFSET		0xfc000
  #define CFG_ENV_SIZE		0x4000
  #define MTDIDS_DEFAULT		"nand0=gen_nand"
  #define MTDPARTS_DEFAULT		"mtdparts=gen_nand:128k(Boot0),880k(Boot1),16k(Env1),10M(Recovery),5M(Kernel),512k(Settings),48640k(Filesystem)"
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT "\0" \
	"mtdparts=" MTDPARTS_DEFAULT "\0" \
	"setargs=setenv bootargs ${mtdparts} ${xargs} ip3902.mac_address=${ethaddr} loglevel=${loglevel} boot_version=${extraver}" "\0" \
	"addnfs=dhcp;setenv bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${nfs_rootpath},tcp,nfsvers=3" "\0" \
	"adddhcp=setenv bootargs ${bootargs} ip=dhcp" "\0" \
	"addjffs=setenv bootargs ${bootargs} root=/dev/mtdblock${fspart} ro rootfstype=jffs2" "\0" \
	"addled=setenv bootargs ${bootargs} roku_monaco_io.initial_outputs=0x400" "\0" \
	"addrunargs=setenv bootargs ${bootargs} panic_on_oops=1 panic=1" "\0" \
	"adddbgargs=setenv bootargs ${bootargs} reboot_on_userfault=0" "\0" \
	"bootsafe=run setargs; run addrunargs; run addled; setenv autoload y; nboot.jffs2 Recovery" "\0" \
	"bootflash=run setargs; run addrunargs; run addjffs; setenv autoload y; nboot.jffs2 Kernel" "\0" \
	"bootnfs=run setargs; run adddbgargs; run adddhcp; run addnfs; nboot.jffs2 Kernel" "\0" \
	"boottftp=run setargs; run adddbgargs; run adddhcp; setenv autoload y; dhcp" "\0" \
	"bootcmd=run bootflash; run bootsafe" "\0" \
	"altbootcmd=run bootsafe" "\0" \
	"autoload=n" "\0" \
	"autostart=yes" "\0" \
	"fspart=6" "\0"

/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_CINDYKATE_RESCUE)

  #define CFG_PROMPT			"\nSTB225v1 rescue# "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_FLASH | CFG_CMD_NAND)
  #define CONFIG_BOOTDELAY		-1
  #undef  CONFIG_SPLASH_SCREEN
  #undef  STB225_ETHERNET_OSCILLATOR
  #define CFG_ENV_IS_IN_FLASH		1
  #define CFG_ENV_ACTIVE_COUNT		1
  #define CFG_ENV_OFFSET		ENV_OFFSET_CINDYKATE
  #define CFG_ENV_SECT_SIZE		ENV_SECT_SIZE_CINDYKATE
  #define MTDIDS_DEFAULT		MTDIDS_CINDYKATE
  #define MTDPARTS_DEFAULT		"mtdparts=" MTDPARTS_CINDYKATE
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT	"\0" \
	"mtdparts=" MTDPARTS_DEFAULT	"\0"


/*******************************************************************************
*******************************************************************************/

#elif defined (BOOT_TARGET_CINDYKATE)

  #define CFG_PROMPT			"\nSTB225v1 # "
  #define CONFIG_COMMANDS		(CONFIG_COMMANDS_MINIMAL | CFG_CMD_FLASH | CFG_CMD_NAND)
  #define CONFIG_BOOTDELAY		1
  #define CFG_ENV_IS_IN_FLASH		1
  #define CFG_ENV_ACTIVE_COUNT		1
  #define CFG_ENV_OFFSET		ENV_OFFSET_CINDYKATE
  #define CFG_ENV_SECT_SIZE		ENV_SECT_SIZE_CINDYKATE
  #define MTDIDS_DEFAULT		MTDIDS_CINDYKATE
  #define MTDPARTS_DEFAULT		"mtdparts=" MTDPARTS_CINDYKATE
  #define CONFIG_EXTRA_ENV_SETTINGS \
	"mtdids=" MTDIDS_DEFAULT										"\0" \
	"mtdparts=" MTDPARTS_DEFAULT										"\0" \
	"fspart=4"												"\0" \
	"fspart0=4"												"\0" \
	"fspart1=5"												"\0" \
	"autostart=yes" 											"\0" \
	"bootnor=bootm b8080000"										"\0" \
	"bootnand=nboot.jffs2 Kernel1"										"\0" \
	"boottftp=tftpboot"											"\0" \
	"bootbootp=bootp"											"\0" \
	"setargs=set bootargs ${mtdparts} ${xargs} ip3902.mac_address=${ethaddr}"				"\0" \
	"adddhcp=set bootargs ${bootargs} ip=dhcp"								"\0" \
	"addip=set bootargs ${bootargs} ip=${ipaddr}:${serverip}::::${ethport}"					"\0" \
	"addjffs=set bootargs ${bootargs} root=/dev/mtdblock${fspart} ro rootfstype=jffs2"			"\0" \
	"addcramfs=set bootargs ${bootargs} root=/dev/mtdblock_robbs${fspart} ro rootfstype=cramfs"		"\0" \
	"addsquashfs=set bootargs ${bootargs} root=/dev/mtdblock_robbs${fspart} ro rootfstype=squashfs"		"\0" \
	"addnfs=set bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath},tcp,nfsvers=3"	"\0" \
	"hostname=stb"												"\0" \
	"loadaddr=80800000"											"\0" \
	"bootfile=uImage_stb225"										"\0" \
	"rootpath=/rootfs"											"\0" \
	"ethport=eth0"												"\0" \
	"ipaddr=" IPADDR_DEFAULT										"\0" \
	"serverip=" SERVERIP_DEFAULT										"\0" \
	"gatewayip=" GATEWAYIP_DEFAULT										"\0" \
	"netmask=255.255.255.0" 										"\0" \
	"bootcmd=run setargs; run addip; run addjffs; run bootnor"						"\0"


/*******************************************************************************
*******************************************************************************/

#else
#if ! defined (CFG_ENV_SIZE)
  #define CFG_ENV_SIZE			(8 * 1024)
#endif
#endif

/*******************************************************************************
*******************************************************************************/

#include <cmd_confdefs.h>

/*******************************************************************************
*******************************************************************************/

#if ! defined (CONFIG_ETHADDR)
  #define CONFIG_ETHADDR		00:60:37:03:00:00
#endif

/*
   For debug / test purposes, allow a GPIO pin to force u-boot to
   behave as if the secure boot polyfuse has been set.
   Warning: GPIO_41 is connected to a push switch on STB225 boards,
            but maybe undefined on other platforms. Therefore don't
            enable for builds which may run on boards other than STB225 !!
*/
#if 0
  #define CFG_FORCE_SECURE_GPIO		1
  #define GPIO_FORCE_SECURE		GPIO_41		/* input : high when idle, low when switch is pressed (1027 on STB225 PCB) */
#endif

#define CFG_BAUDRATE_TABLE		{ 9600, 19200, 38400, 57600, 115200 }
#define CONFIG_BAUDRATE			115200

#define CONFIG_MEMSIZE_IN_BYTES 	1

#define CFG_AUTO_COMPLETE		1
#define CFG_HUSH_PARSER			1
#define CFG_LONGHELP			1

#if 0
  #define CONFIG_MTD_DEBUG		1
  #define CONFIG_MTD_DEBUG_VERBOSE	2		/* 1: less verbose, 3: more verbose */
#endif

#define CFG_SHA_ASSEMBLER		1
#define CFG_CONSOLE_INFO_QUIET		1

#define CONFIG_CMDLINE_EDITING		1
#define CFG_PROMPT_HUSH_PS2		"> "
#define CFG_CBSIZE			512
#define CFG_PBSIZE			512
#define CFG_MAXARGS			32

#define CONFIG_JFFS2_CMDLINE		1

#define MALLOC_SIZE_DEFAULT		(4 * 1024 * 1024)	/* */
#define MALLOC_SIZE_BZIP		(1 * 1024 * 1024)	/* Is bzip support still required ? If so, when and why ? */
#define KERNEL_SIZE_MAX 		(4 * 1024 * 1024)	/* worst case size of an auImage (ie a compressed kernel) */

#define CFG_MALLOC_LEN			(MALLOC_SIZE_DEFAULT + MALLOC_SIZE_BZIP + (2 * KERNEL_SIZE_MAX))

#define CFG_MONITOR_BASE		(TEXT_BASE)		/* */
#define CFG_MONITOR_LEN			(512 * 1024)		/* */

#define CFG_BOOTPARAMS_LEN		( 16 * 1024)		/* making this small causes problems even with 150-character command lines (?!?) */

#define CONFIG_BOOTCOMMAND_SECURE	"boota"

#define CONFIG_ENV_OVERWRITE		1

#if 0
#define CFG_FLASH_QUIET_TEST		1
#endif

#define CFG_NO_FS_ACCESS

#define CFG_SGDX_REGS_BASE		0xB7E1C000

#define MIU_CS0_BASE_UNCACHED		0xB8000000
#define MIU_CS1_BASE_UNCACHED		0xBA000000
#define MIU_CS2_BASE_UNCACHED		0xBC000000
#define MIU_CS3_BASE_UNCACHED		0xBE000000

#define MIU_CS0_BASE_CACHED		0x98000000
#define MIU_CS1_BASE_CACHED		0x9A000000
#define MIU_CS2_BASE_CACHED		0x9C000000
#define MIU_CS3_BASE_CACHED		0x9E000000

/* Platform specific GPIO definitions */

#if defined (BOOT_TARGET_CINDYKATE) || defined (BOOT_TARGET_CINDYKATE_RESCUE)
  #define GPIO_ID0			GPIO_44
  #define GPIO_ID1			GPIO_45
  #define GPIO_ID2			GPIO_46
  #define GPIO_ID3			GPIO_47
  #define GPIO_ID4			GPIO_48
  #define GPIO_ID5			GPIO_49
#endif

#if defined (ETHERNET_NETPHY_RESET_PIO_29)
  #define GPIO_EXT_PHY_RESET		GPIO_ETH_TXER
#endif

/* NOR flash settings */

#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
  #define CFG_FLASH_CFI			1
  #define CFG_FLASH_CFI_DRIVER		1
  #define CFG_FLASH_BASE		MIU_CS0_BASE_UNCACHED
  #define CFG_MAX_FLASH_BANKS		1
  #define CFG_MAX_FLASH_SECT		512		/* 512 sectors * 128k per sector == 64MBytes */
  #define CFG_FLASH_PROTECTION		1
  #define CFG_FLASH_USE_BUFFER_WRITE
#else
  #define CFG_NO_FLASH					/* no NOR Flash... NAND may still be enabled... */
#endif

/* NAND flash settings */

#if (CONFIG_COMMANDS & CFG_CMD_NAND)
  #define CFG_NAND_BASE			0		/* dummy value (actual NAND base detected at run time from boot mode) */
  #define GPIO_NAND_RDY 		GPIO_4		/* input : low == NAND device is busy, high == NAND device is ready */
  #define GPIO_NAND_WP			GPIO_5		/* output : low == NAND device writes are disabled */
  #define CFG_MAX_NAND_DEVICE		1
  #define NAND_MAX_CHIPS		1
  #define CONFIG_JFFS2_NAND		1
  #if 0
    #define CONFIG_NAND_DBG_CONTROL	1
  #endif
#endif

#if defined (ETHERNET_PRESENT)
  #define CONFIG_NET_MULTI
  #define CONFIG_MII
  #define CFG_TFTP_TIMEOUT		1
  #if defined (ETHERNET_IP3902)
    #define CONFIG_IP3902
    #define CFG_IP3902_IOBASE		0xB7E2F000
  #endif
  #if defined (ETHERNET_SMSC911X)
    #define CONFIG_SMSC911X
    #define CFG_SMSC911X_IOBASE 	MIU_CS3_BASE_UNCACHED
  #endif
#endif

#if 0
#define CONFIG_SATA_NHP
#define CONFIG_DOS_PARTITION
#define CONFIG_IDE_RESET
#define CFG_IDE_MAXBUS			1
#define CFG_IDE_MAXDEVICE		1
#define CFG_ATA_BASE_ADDR		0xB7F50000
#define CFG_ATA_IDE0_OFFSET		0
#endif

#define BOOTMODE_EXTERNAL		0
#define BOOTMODE_SPINOR 		1
#define BOOTMODE_NOR_8			2
#define BOOTMODE_NOR_16 		3
#define BOOTMODE_NAND_8 		4
#define BOOTMODE_NAND_16		5
#define BOOTMODE_6			6
#define BOOTMODE_OMNIBOOT		7

#ifndef __ASSEMBLY__
extern unsigned int stb225_get_cpu_clock_mhz (void);
extern unsigned int stb225_get_cpu_clock_hz (void);
/*
   Note: MIPS 4Kec internal timer tick rate is half the CPU core clock speed... !!
*/
#define CFG_SYSCLK_MHZ			(stb225_get_cpu_clock_mhz() / 2)
#define CFG_SYSCLK_HZ			(stb225_get_cpu_clock_hz() / 2)
#define CFG_MS_HZ			(CFG_SYSCLK_HZ / 1000)
#define CFG_HZ				(CFG_SYSCLK_HZ)
#endif

#define CFG_SDRAM_BASE			0x80000000	/* in KSEG0 */
#define CFG_INIT_SP			0x80001000	/* temp stack (used only for _very_ early init in start.S) */
#define CFG_LOAD_ADDR			0x80800000	/* Default load addr */

#define CFG_ICACHE_SIZE			16384
#define CFG_DCACHE_SIZE			8192
#define CFG_CACHELINE_SIZE		16

#ifndef __ASSEMBLY__
extern unsigned long sdram_size (void);
#define CFG_MEMTEST_START		(CFG_SDRAM_BASE)
#define CFG_MEMTEST_END			(CFG_SDRAM_BASE + sdram_size() - CFG_MALLOC_LEN - (1 * 1024 * 1024))
#endif

/* sanity check here */
#if defined( CFG_MIU_SPI_FLASH ) && defined( CFG_FLASH_CFI )
#error Cannot support both MIU SPI Data Flash and Parallel CFI flash at the same time
#endif

#endif

