⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global_variables.h

📁 老外的一个开源项目
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************************************
**
**  COPYRIGHT (C) 2000, 2001, 2002 Intel Corporation.
**
**  The information in this file is furnished for informational use 
**  only, is subject to change without notice, and should not be construed as 
**  a commitment by Intel Corporation. Intel Corporation assumes no 
**  responsibility or liability for any errors or inaccuracies that may appear 
**  in this document or any software that may be provided in association with 
**  this document. 
**
**  FILENAME:       Global_Variables.h
**
**  PURPOSE:        declares all global varibales used by the Jflash software
**
**  LAST MODIFIED:  $Modtime: 2/18/04 3:22p $
******************************************************************************/


/*
*******************************************************************************
Globals
*******************************************************************************
*/

int lpt_address;									// Global variable assigned to parallel port address
int lpt_ECR;										// global for LPT extended control register
int lpt_CTL;										// global for the LPT control port
int lpt_STAT;										// global for LPT status register
DWORD MILLISECOND_COUNT = 0;						// global to keep an approx loop count for a ms
int block_number = 0;								// Global variable for determining the block number
char filename[MAX_IN_LENGTH] = "download.bin";		// Global variable for storing the file name
char data_filename[MAX_IN_LENGTH] = "DBPXA250";     // Global variable for the platform data file
char flash_data_filename[MAX_IN_LENGTH] = "Flash_18_2_32.dat";     // Global variable for the flash data file
char int_data_filename[MAX_IN_LENGTH] = "DBPXA250_INTEGRITY.DAT"; // global integrity data file

char VERSION_LOCK[11] =       "VL00000001";
char FLASH_VERSION_LOCK[11] = "VLF0000001";

CABLE_TYPES CableType = Parallel_Jtag;				// Global variable for specifying the Cable type
DWORD ChipSelect0		= 0;						// Global variable for chip select 0
DWORD ChipSelect1		= 0;						// Global variable for chip select 1
DWORD ChipSelect2		= 0;						// Global variable for chip select 2
DWORD ChipSelect3		= 0;						// Global variable for chip select 3
DWORD ChipSelect4		= 0;						// Global variable for chip select 4
DWORD ChipSelect5		= 0;						// Global variable for chip select 5

DWORD OutputEnable		= 0;    // Global variable for output enable
DWORD WriteEnable		= 0;    // Global variable for write enable
DWORD MdUpperControl	= 0;    // Global variable for MD upper control
DWORD MdLowerControl	= 0;    // Global variable for MD lower control
DWORD ReadWriteMode		= 0;    // Global variable for Read Write access mode

DWORD IR_Idcode		= 0;	    // Global variable for the IDCODE instruction of the IR
DWORD IR_Bypass		= 0;	    // Global variable for the BYPASS instruction of the IR
DWORD IR_Extest		= 0;	    // Global variable for the EXTEST instruction of the IR
DWORD ChainLength	= 0;		// Global variable for the chain length of the selected platform
DWORD UnlockFlashCtrl1 = 0;		// unlock flash control pin 1
DWORD UnlockFlashCtrl1Lev = 0;	// unlock flash control pin 1 level for unlock
DWORD LockFlashCtrl1Lev = 0;	// lock1 flash level
DWORD UnlockFlashCtrl2 = 0;		// unlock flash control pin 2
DWORD UnlockFlashCtrl2Lev = 0;	// unlock flash control pin 2 level for unlock
DWORD LockFlashCtrl2Lev = 0;	// lock2 flash level
DWORD UnlockFlashCtrl3 = 0;		// unlock flash control pin 3
DWORD UnlockFlashCtrl3Lev = 0;	// unlock flash control pin 3 level for unlock
DWORD LockFlashCtrl3Lev = 0;	// lock3 flash level
DWORD UnlockFlashCtrl4 = 0;		// unlock flash control pin 4
DWORD UnlockFlashCtrl4Lev = 0;	// unlock flash control pin 4 level for unlock
DWORD LockFlashCtrl4Lev = 0;	// lock4 flash level

DWORD CSR_LADDR[6];				// array of chip select region low addresses 
DWORD CSR_HADDR[6];				// array of chip select regions high addresses

DWORD CSR1 = 6;	// the chip select for region 1. 6 is illegal and is here to flag an error if not defined.
DWORD CSR2 = 6;	// the chip select for region 2
DWORD CSR3 = 6;	// the chip select for region 3
DWORD CSR4 = 6;	// the chip select for region 4
DWORD CSR5 = 6;	// the chip select for region 5
DWORD CSR6 = 6;	// the chip select for region 6

// some flash related globals

DWORD BlockEraseTime = 10;
DWORD FlashBufferSize = 32;
DWORD FlashDeviceSize = 0;
bool  REGION_STATUS[10];		// array of region status
DWORD REGION_NUM_BLOCKS[10];	// number of blocks in the  region
DWORD REGION_BLOCKSIZE[10];		// The size of the blocks in that  region
DWORD REGION_START_ADDR[10];	// The start address of the region
DWORD REGION_END_ADDR[10];		// the end address of the region
DWORD BLOCK_ADDRESS[512];		// up to 512 unique block addresses
int ADDR_MULT = 4;				// addressing multiplier or divider for flash

int WorkBufSize	= 0;		    // Global variable for setting the work buffer size
int IrLength   	= 0;			// Global variable for setting the correct IR length

// Chain device data
bool  DEVICESTATUS[5];	  // enabled or disabled
DWORD DEVICEIRLENGTH[5];  // length of IR to set bypass
bool  DEVICETYPE[5];	  // true if controller
bool  DEVICEISLAST[5];
int DEVICE_CONTROLLER = 0; // which device is the controller 
int DEVICES_BEFORE = 0;
int DEVICES_AFTER = 0;
int DEVICES_IN_CHAIN = 0;

#define MAX_HANDLER_SIZE 0x200

bool PlatformIs16bit = false;						// Global variable for diferentiating between 16bit and 32bit platforms
bool PlatformIsBulverdeOrDimebox = true;			// Global variable to determine if the selected platform is bulverde or dimebox
bool PlatformIsBulverdeDimeboxShortChain = false;	// Global variable for determining whether it's a short chain or not
bool PlatformIsBulverdeDimeboxLongChain = true;		// Global variable for determining whether it's a long chain or not
bool Debug_Mode = false;
bool UsageShown = false;
bool AskQuestions = true;
bool K3_STABILITY_FIX_ENABLE = false;


// Globals for flash commands and query codes. Assumes 32 bit as default

DWORD F_READ_ARRAY = 		0x00FF00FFL;
DWORD F_READ_IDCODES =   	0x00900090L;
DWORD F_READ_QUERY =     	0x00980098L;
DWORD F_READ_STATUS =    	0x00700070L;
DWORD F_CLEAR_STATUS =   	0x00500050L;
DWORD F_WRITE_BUFFER =   	0x00E800E8L;
DWORD F_WORDBYTE_PROG =  	0x00400040L;

DWORD F_BLOCK_ERASE =    	0x00200020L;
DWORD F_BLOCK_ERASE_2ND =	0x00D000D0L; 

DWORD F_BLK_ERASE_PS =       0x00B000B0L;
DWORD F_BLK_ERASE_PR =       0x00D000D0L;
DWORD F_CONFIGURATION =      0x00B800B8L;

DWORD F_SET_READ_CFG_REG =   0x00600060L;
DWORD F_SET_READ_CFG_REG_2ND = 0x00030003L;

DWORD F_SET_BLOCK_LOCK =      0x00600060L;
DWORD F_SET_BLOCK_LOCK_2ND =  0x00010001L;

DWORD F_CLEAR_BLOCK_LOCK =    0x00600060L;
DWORD F_CLEAR_BLOCK_LOCK_2ND =0x00D000D0L;

DWORD F_PROTECTION =          0x00C000C0L;

DWORD F_ATTR_Q =              0x00510051L;
DWORD F_ATTR_R =              0x00520052L;
DWORD F_ATTR_Y =              0x00590059L;

DWORD F_BLOCK_LOCKED =        0x00010001L;
DWORD F_STATUS_READY =        0x00800080L;
DWORD F_STATUS_READY_MASK =   0x00FF00FFL;

FILE *in_file;
FILE *data_file_pointer;
FILE *flash_file_pointer;
FILE *intercom_file_pointer;
FILE *int_data_file_pointer;

int out_dat[MAX_DR_SIZE];
bool UNLOCKBLOCK = false;
bool HASLOCKCONTROLS = false;	// Is there external locking for the flash?
unsigned long MAX_DATA = 230;
unsigned long MAX_FLASH_DATA = 60;

char WORDARRAY[230][132];  // the capture of all strings from the data file
char FLASHWORDARRAY[60][132];  // the capture of all strings from the data file
DWORD addr_order[27];
DWORD input_dat_order[33];
DWORD dat_order[33];
DWORD pin[1000]; // max JTAG boundary length of 1000 bits

//Integrity check arrays 
char  INT_DATA_ARRAY[1200][132]; // the full data array from the parsed data file
DWORD INT_OUT_ARRAY[300]; // the output pin offsets for the integrity check
DWORD INT_IN_ARRAY[300];  // the input pin offsets for the integrity check
char  INT_NAME_ARRAY[300][132]; // the names of the pins that will be integrity checked
DWORD INT_CONTROL_ARRAY[300]; // control lines required to set the pins

DWORD DebugProgress 	=	0x0; // bits indicate progress markers to assist in debugging problems
// define data points for progress
#define foundFlashID 		0x1
#define foundProcID 		0x2
#define unlockedFlash		0x4
#define firstWordVerified 	0x8
#define eraseSuccess		0x10
#define lastWordVerified	0x20




// Position of data in the platform data file

#define p_processor 	0
#define p_devsys		1
#define p_dataver		2
#define p_verlock		3
#define p_blength		4
#define p_irlength		5
#define p_extest		6
#define p_idcode		7
#define p_bypass		8
#define p_cs0			9
#define p_cs1			10
#define p_cs2			11
#define p_cs3			12
#define p_cs4			13
#define p_cs5			14
#define p_nOE_OUT		15
#define p_nWE_OUT	   	16
#define p_mdupper_ctrl	17
#define p_mdlower_ctrl	18
#define p_RD_nWR_OUT	19
#define	p_cp1			20
#define	p_a0			21
#define	p_a1			22
#define	p_a2			23
#define	p_a3			24
#define	p_a4			25
#define	p_a5			26
#define	p_a6			27
#define	p_a7			28
#define	p_a8			29
#define	p_a9			30
#define	p_a10			31
#define	p_a11			32
#define	p_a12			33
#define	p_a13			34
#define	p_a14			35
#define	p_a15			36
#define	p_a16			37
#define	p_a17			38
#define	p_a18			39
#define	p_a19			40
#define	p_a20			41
#define	p_a21			42
#define	p_a22			43
#define	p_a23			44
#define	p_a24			45
#define	p_a25			46
#define	p_d0in			47
#define	p_d1in			48
#define	p_d2in			49
#define	p_d3in			50
#define	p_d4in			51
#define	p_d5in			52
#define	p_d6in			53
#define	p_d7in			54
#define	p_d8in			55
#define	p_d9in			56

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -