/******************************************************************************/ /* DNA PROPRIETARY INFORMATION */ /* (C) Copyright 1997,1998 by DNA Enterprises, Inc. */ /* All rights reserved */ /******************************************************************************/ /* BOARD.H - EVM and McEVM board initialization, configuration and control */ /* */ /* This module provides routines which initialize, configure */ /* and control options on the EVM and McEVM boards. */ /* */ /* FUNCTIONS: */ /* evm_init - Initialize EVM for use */ /* evm_codec_enable - Connect codec to McBSP0 serial port and power up */ /* evm_codec_disable- Disconnect codec from McBSP0 serial port / power dn */ /* evm_led_enable - Illuminate user LED on EVM board */ /* evm_led_disable - Extinguish user LED on EVM board */ /* evm_default_emif_init - Initialize EVM with default EMIF control */ /* evm_emif_init - Initialize EVM with clock rate adjusted EMIF control */ /* cpu_freq - Returns frequency of internal CPU clock in MHz */ /* delay_usec - Delay specified number of microseconds */ /* delay_msec - Delay specified number of milliseconds */ /* evm_nmi_sel - Select Host or Codec for connection to NMI */ /* evm_nmi_enable - Enable NMI in EVM CPLD */ /* evm_nmi_disable - Disable NMI in EVM CPLD */ /* evm_db_reset - Hold daughterboard in reset */ /* evm_db_unreset - Remove daughterboard reset */ /* evm_board_type - Return board type */ /* */ /* MACRO FUNCTIONS: */ /* NOPS - Two NOP instructions */ /* */ /* GLOBAL VARIABLES */ /* boardInitFlag - Set TRUE when EVM board initialization performed */ /* sbsramBaseAddr - Base address of SBSRAM in the CE0 memory space */ /* sdram0BaseAddr - Base address of bank 0 SDRAM in the CE2 memory space */ /* sdram1BaseAddr - Base address of bank 1 SDRAM in the CE3 memory space */ /* cpldBaseAddr - Base address of memory-mapped CPLD registers in CE1 */ /* cpuFreq - CPU clock frequency (integer number in MHz) */ /* mapMode - Memory map mode of DSP (0 or 1) */ /* littleEndian - Endian mode (0=big, 1=little) */ /* override160 - Set TRUE when 200 MHz is used instead of 160 MHz */ /* */ /* REVISION HISTORY: */ /* */ /* DATE DESCRIPTION */ /* ------- ---------------------------------------------------------- */ /* 1JUL98 Changed DEFAULT_EMIF_CE1_CTRL value from 0x30F30323 to */ /* 0x40F40323. */ /* */ /* 16JUL98 Added evm_board_type function. Added BOARD_TYPE enumuration.*/ /* */ /******************************************************************************/ #ifndef _BOARD_H_ #define _BOARD_H_ /*----------------------------------------------------------------------------*/ /* INCLUDES */ /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ /* DEFINES AND MACROS */ /*----------------------------------------------------------------------------*/ #define EVM_SBSRAM_SIZE 0x10000 /* 64k 32 bit words */ #define EVM_SDRAM_SIZE 0x100000 /* 1024k 32 bit words each bank */ #define MCEVM_SBSRAM_SIZE 0x20000 /* 128k 32 bit words */ #define MCEVM_SDRAM_SIZE 0x400000 /* 4096k 32 bit words each bank */ #define EVM_DEVICEID 0x1002 /* 16 bit EVM device ID */ #define MCEVM_DEVICEID 0x1003 /* 16 bit McEVM device ID */ typedef enum { TYPE_UNKNOWN = 0, TYPE_EVM, TYPE_MCEVM } BOARD_TYPE; /******************************************************************************/ /* CPLD Register Offsets */ /******************************************************************************/ #define CPLD_CNTL_OFFSET 0x00 #define CPLD_STAT_OFFSET 0x04 #define CPLD_DIPOPT_OFFSET 0x08 #define CPLD_DIPBOOT_OFFSET 0x0C #define CPLD_DSPOPT_OFFSET 0x10 #define CPLD_DSPBOOT_OFFSET 0x14 #define CPLD_FIFOSTAT_OFFSET 0x18 #define CPLD_SDCNTL_OFFSET 0x1C #define CPLD_OSCB_OFFSET 0x20 #define CPLD_RSEM1_OFFSET 0x24 #define CPLD_RSEM2_OFFSET 0x28 #define CPLD_FALC_CNTL_OFFSET 0x2C /* McEVM only */ #define CPLD_INT_CNTL_OFFSET 0x30 /* McEVM only */ #define CPLD_MISC_CNTL_OFFSET 0x34 /* McEVM only */ /******************************************************************************/ /* CPLD Bit and Bit Fields */ /******************************************************************************/ /* CNTL register */ #define LED0 0 #define LED1 1 #define SP0SEL 2 #define NMISEL 3 #define NMIEN 4 #define XRESET 5 #define XCNTL0 6 #define XCNTL1 7 /* STAT register */ #define PCIDET 0 #define PCIINT 1 #define CODECIRQ 2 /* EVM only */ #define CODECPD 3 /* EVM only */ #define DSPNMI 4 #define DBINT 5 #define XSTAT0 6 #define XSTAT1 7 /* DIPOPT register */ #define S_USER0 0 #define S_USER1 1 #define S_USER2 2 #define S_USER_SZ 3 #define S_JTAGSEL 3 #define S_ENDIAN 4 #define S_CLKSEL 5 #define S_CLKMODE 6 /* DIPBOOT register */ #define S_BMODE0 0 #define S_BMODE1 1 #define S_BMODE2 2 #define S_BMODE3 3 #define S_BMODE4 4 /* DSPOPT register */ #define USER0 0 #define USER1 1 #define USER2 2 #define JTAGSEL 3 #define LENDIAN 4 #define CLKSEL 5 #define CLKMODE 6 /* DSPBOOT register */ #define BMODE0 0 #define BMODE1 1 #define BMODE2 2 #define BMODE3 3 #define BMODE4 4 #define SWSEL 7 /* FIFOSTAT register */ #define PCIMWEN 0 #define PCIMREN 1 #define WRFULL 2 #define RDEMPTY 3 #define PCIMWINT 4 #define PCIMRINT 5 /* SDCNTL register */ #define CE2SDEN 0 #define CE3SDEN 1 /* FALC_CNTL register (McEVM only) */ #define FALC_RESET 0 #define FMIC_RESET_B 1 #define FMIC_SWP_2_0 2 #define FMIC_SWP_3_1 3 #define FALC_MODE_SEL 4 /* INT_CNTL register (McEVM only) */ #define FALC_INT_CLR_MSK 0 #define DB_INT_CLR_MSK 1 #define FALC_INT_RAW 4 #define DB_INT_RAW 5 #define FALC_INT_LTCHD 6 /* read only */ #define DB_INT_LTCHD 7 /* read only */ /* MISC_CNTL register (McEVM only) */ #define FMIC_ERROR 1 #define VBAP_ENA 2 #define VBAP_SEL 3 /* a-law or u-law */ #define LED_YEL_ALARM 4 #define LED_RED_ALARM 5 #define LED_SYNC_B 6 #define LED_LOOP_B 7 /******************************************************************************/ /* Default EMIF settings for EVM */ /******************************************************************************/ /* RBTR8 preemtion, SBSRAM at 1/2, clk1&2 disable, hold enabled, no clock inv */ #define DEFAULT_EMIF_GCTRL 0x00003060 /* CE0 space SBSRAM, all other field are dont cares */ #define DEFAULT_EMIF_CE0_CTRL 0x00000040 /* CE1 space async expansion and CODEC, holds setups and strobes maximum val */ #define DEFAULT_EMIF_CE1_CTRL 0x40F40323 /* CE2,CE3 space SDRAM, all other fields are dont cares */ #define DEFAULT_EMIF_CE2_CTRL 0x00000030 #define DEFAULT_EMIF_CE3_CTRL 0x00000030 /* SDRAM, default TRC TRP TRCD, init SDRAM, refresh enable, 16 bit devices */ #define DEFAULT_EMIF_SDRAM_CTRL 0x07229000 /* SDRAM default refresh period */ #define DEFAULT_EMIF_SDRAM_REF 0x00000619 /******************************************************************************/ /* Miscellaneous Definitions */ /******************************************************************************/ #define NOPS asm(" NOP 2") #define NMI_HOST 0 #define NMI_CODEC 1 /*----------------------------------------------------------------------------*/ /* GLOBAL VARIABLES */ /*----------------------------------------------------------------------------*/ extern int boardInitFlag; extern unsigned int sbsramBaseAddr; extern unsigned int sdram0BaseAddr; extern unsigned int sdram1BaseAddr; extern unsigned int cpldBaseAddr; extern unsigned int cpuFreq; extern int mapMode; extern int littleEndian; extern int override160; /*----------------------------------------------------------------------------*/ /* FUNCTIONS */ /*----------------------------------------------------------------------------*/ /******************************************************************************/ /* evm_init() - Initialize EVM for use */ /* */ /* This function will initialize the EVM for use by determining the C6x map */ /* mode, setting the EMIF to default EVM configuration */ /* and setting external peripheral base addresses which are dependent upon */ /* the map mode. */ /******************************************************************************/ int evm_init(void); /******************************************************************************/ /* evm_codec_enable - Connect CODEC to C62xx serial port and power up */ /******************************************************************************/ int evm_codec_enable(void); /******************************************************************************/ /* evm_codec_disable - Disconnect CODEC from C62xx serial port and power down */ /******************************************************************************/ int evm_codec_disable(void); /******************************************************************************/ /* evm_led_enable - Illuminate LED on EVM board */ /******************************************************************************/ int evm_led_enable(int ledNumber); /******************************************************************************/ /* evm_led_disable - Extinguish LED on EVM board */ /******************************************************************************/ int evm_led_disable(int ledNumber); /******************************************************************************/ /* evm_default_emif_init - Initialize EVM with default EMIF parameters */ /* */ /* This function initializes the EMIF registers with default parameters */ /* for the EVM board. */ /* */ /******************************************************************************/ void evm_default_emif_init(void); /******************************************************************************/ /* evm_emif_init - Initialize EVM with clock rate adjusted EMIF parameters */ /* */ /* This function initializes the EMIF registers with clock rate specific */ /* parameters for the EVM board. */ /* */ /******************************************************************************/ void evm_emif_init(void); /******************************************************************************/ /* cpu_freq - Returns frequency of internal CPU clock in MHz */ /******************************************************************************/ int cpu_freq(); /******************************************************************************/ /* delay_usec - Delay specified number of microseconds */ /******************************************************************************/ int delay_usec(unsigned short numUsec); /******************************************************************************/ /* delay_msec - Delay specified number of milliseconds */ /******************************************************************************/ int delay_msec(unsigned short numMsec); /******************************************************************************/ /* evm_nmi_sel() - Select Host or Codec for connection to NMI */ /******************************************************************************/ void evm_nmi_sel( int sel ); /* IN: sel= 0 host, 1 codec */ /******************************************************************************/ /* evm_nmi_enable - Enable NMI in CPLD */ /******************************************************************************/ void evm_nmi_enable(void); /******************************************************************************/ /* evm_nmi_disable - Disable NMI in CPLD */ /******************************************************************************/ void evm_nmi_disable(void); /******************************************************************************/ /* evm_db_reset - Hold daughterboard in reset */ /******************************************************************************/ void evm_db_reset(void); /******************************************************************************/ /* evm_db_unreset - Remove daughterboard from reset */ /******************************************************************************/ void evm_db_unreset(void); /******************************************************************************/ /* evm_board_type - return board type */ /******************************************************************************/ unsigned short evm_board_type(void); #endif