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

📄 download.h

📁 MTK 最新的flashtool工具的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*******************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2001
*
*******************************************************************************/

/*******************************************************************************
 * Filename:
 * ---------
 *	   download.h
 *
 * Project:
 * --------
 *   MTK6208 DOWNLOAD AGENT
 *
 * Description:
 * ------------
 *   This file is intends for download agent specific definition
 *
 * Author:
 * -------
 *	Jensen Hu
 *
 *------------------------------------------------------------------------------
 * $Revision:   1.36  $ 
 * $Modtime:   Jan 13 2006 20:33:06  $
 * $Log:   //mtkvs01/vmdata/flash_tool/archives/DA/INC/DOWNLOAD.H-arc  $
 *
 * May 18 2007 mtk01413
 * [STP100001402] FlashTool v3.1.05 release
 *  1. [DA] Supports new NOR Flash device
 * 		[SPANSION] S29WS128P
 * 		[SPANSION] S29WS256P
 * 		[TOSHIBA] TV00560002DDGB
 *
 * Mar 12 2007 mtk01413
 * [STP100001329] FlashTool v3.1.04 release
 * New features:
 *  1. [DA] Supports new NOR Flash device
 * 		[SAMSUNG] K5L2731CAM
 * 		[SAMSUNG] K5L2931CAM
 * 		[SPANSION] S71PL127J
 * 		[TOSHIBA] TY00689002APGN
 * 		[SPANSION] S29GL064A_T
 * 		[SPANSION] S29GL064A_B
 * 
 *  2. [DA] Supports OTP driver for below NOR Flash device
 * 		[SPANSION] NOR_S71WS256N
 * 		[SPANSION] S71WS128NB0BFWAN3
 * Enhancements:
 *  1. [DA] Rename old NOR Flash device
 * 		[SPANSION] S71WS128NB0BFWAN3	-->	S29WS128N
 * 		[SPANSION] S71WS256N		-->	S29WS256N
 * 		[SPANSION] S71WS512PD0HF3HR	-->	S29WS512P
 * 		[SPANSION] S29GL128NH		-->	S29GL128N_T
 * 		[SPANSION] S29GL128NL		-->	S29GL128N_B
 * 		[SPANSION] S29GL256NH		-->	S29GL256N_T
 * 		[SPANSION] S29GL256NL		-->	S29GL256N_B
 * 		[SPANSION] S29GL512NH		-->	S29GL512N_T
 * 		[SPANSION] S29GL512NL		-->	S29GL512N_B
 * 	
 *
 * Jan 2 2007 mtk01413
 * [STP100001195] FlashTool v3.1.02 release
 * New features:
 *  1. [BROM_DLL/DA] Support FOTA(Firmware update Over The Air) download.
 *  2. [BROM_DLL/DA] Support MT6223  download.
 *  3. [BROM_DLL/DA] Support MT6268T download.
 *  4. [DA] Supports new NOR Flash device
 * 		[SPANSION] S29GL128NH
 * 		[SPANSION] S29GL128NL
 * 		[SPANSION] S29GL256NH
 * 		[SPANSION] S29GL256NL
 * 		[SPANSION] S29GL512NH
 * 		[SPANSION] S29GL512NL
 * 
 *
 * Nov 2 2006 mtk01413
 * [STP100001195] FlashTool v3.1.02 release
 * New features:
 *  1. [DA] Supports new NOR Flash device (AD-Mux)
 * 		[SPANSION] S29NS064N
 * 		[SPANSION] S29NS128N
 * 		[SPANSION] S29NS256N
 * 
 *  2. [DA] Supports new NOR flash device.
 * 		[ST] M58PPR256J
 * 		[ST] M58PPR512J	
 * 		[SST] SST32HF3241C
 * 		[SPANSION] S71WS128NB0BFWAN3
 * 		[SPANSION] S71WS256N
 * 		[SPANSION] S71WS512PD0HF3HR
 * 
 *
 * Aug 16 2006 mtk00539
 * [STP100001057] FlashTool v3.1.00 release
 * Add DA_GET_PROJECT_ID_CMD and DA_GET_FAT_INFO_CMD command.
 *
 * Aug 13 2006 mtk01413
 * [STP100001057] FlashTool v3.1.00 release
 * 
 *
 * Jun 12 2006 mtk01413
 * [STP100000922] FlashTool v2.9.1001 release
 * New features:
 *  1. [FlashTool/BROM_DLL] Support Multi-Load Autodetection Download.
 *
 * May 24 2006 mtk01413
 * [STP100000877] FlashTool v2.7.1018 release
 *  1. [DA] Supports new NOR flash device.
 * 	[SHARP] LRS18BK
 * 	[INTEL] 28F3204C3TD70, [MemoCom] KS03204
 *  2. [DA] Supports new NAND flash device.
 * 	[TOSHIBA] TC58NWM9S3B 
 *
 * Mar 18 2006 mtk01413
 * [STP100000694] [DA] 1. Support SST driver. 2. Bug Fix: WriteCmd  3. Bug Fix: DetectExtSRAM
 * [SST]  SST34HF16x1
 * [SST]  SST34HF32x4
 *
 * Mar 8 2006 mtk00539
 * [STP100000625] FlashTool v2.7.1016
 *  1. [DA] Supports new NOR flash device.
 * 		[INTEL] PF48F50xxM0x1xx
 * 		[INTEL] PF48F40xxM0x0xx
 * 		[INTEL] PF48F40xxM0x1xx
 *  2. [DA] Supports new NAND flash device.
 * 		[MICRON] MT29F2G08AAC
 * 		[MICRON] MT29F4G08BAB
 * 		[RENESAS] superAND 512Mb/8bits
 * 		[RENESAS] superAND 512Mb/16bits
 * 		[Infineon] HYF33DS51280
 * 		[Infineon] HYF33DS1G80
 * 		[Infineon] HYF33DS1G16
 * 
 *
 * Mar 8 2006 mtk00539
 * [STP100000669] [DA] Support RENESAS superAND flash read back and format operation.
 * 
 *
 * Feb 26 2006 mtk00539
 * [STP100000633] [BROM_DLL] Using local DA_REPORT_T variable to avoid multithread unsafe problem.
 * 
 *
 * Feb 23 2006 mtk00539
 * [STP100000625] FlashTool v2.7.1016
 * 
 * 
 *    Rev 1.36   Jan 14 2006 00:09:52   mtk00539
 * Bug fixes:
 *  1. [DA] Workaround reading DSP version failure issue in some production lines, rollback to the old method for reading DSP version. 
 * 
 * New features:
 *  1. [DA] Supports INTEL Sibley family flash.
 *  2. [DA] Supports new NOR flash device.
 * 		[INTEL] PF38F5050M0XXXX
 * Resolution for 159: [FlashTool v2.7.1015]
 * 
 *    Rev 1.35   Jan 04 2006 14:35:48   mtk00539
 * Bug fixes:
 *  1. [DA] Fix Spansion S71PLXXXN detection problem by reading CFI info.
 * 
 * New features:
 *  1. [DA] Supports Spansion MirrorBit Buffer-Program method.
 *  2. [DA] Supports new NOR flash device.
 * 		[SPANSION] S71PL129N
 * 
 * Enhancements:
 *  1. [DA] Halt program when external RAM is less than 128KB.
 * Resolution for 158: [FlashTool v2.7.1014][New] Support Spansion MirrorBit Buffer-Program method.
 * 
 *    Rev 1.34   Jan 02 2006 13:16:22   mtk00539
 * Add new flash [SPANSION] S71PL256NC0HAW5B
 * Resolution for 156: [FlashTool v2.7.1013][BUG FIX] Fix BootROM start command failure while manually selecting NMT6226 or MT6227 baseband chip.
 * 
 *    Rev 1.33   Dec 29 2005 10:42:58   mtk00539
 *  1. [DA] Supports new NOR flash device.
 * 		[SPANSION] S71PL127N
 * 		[SILICON7] SV6D2832UTA
 * 		[SILICON7] SV6D2832UBA
 * 		[SILICON7] SV6C2832UTA
 * 		[SILICON7] SV6C2832UBA
 * 		[SHARP] LH28F16
 * 		[TOSHIBA] TV00578002DABD
 * 		[TOSHIBA] TV00578003DABD
 *  2. [DA] Supports new NAND flash device.
 * 		[TOSHIBA] TH58NVG1S8BFT
 * Resolution for 156: [FlashTool v2.7.1013][BUG FIX] Fix BootROM start command failure while manually selecting NMT6226 or MT6227 baseband chip.
 * 
 *    Rev 1.32   Nov 27 2005 16:35:56   mtk00539
 * 1. [DA][BUG FIX] Add NUTL_VERIFY_AFTER_PROGRAM flash to perform read back verification after program operation. 
 * Resolution for 151: [BROM_DLL v2.7.1012][BUG FIX] Cannot recognize 05B ROM_INFO header.
 * 
 *    Rev 1.31   Nov 19 2005 00:40:30   mtk00539
 *  1. [BROM_DLL&DA][New] Add UID Secure Booting feature.
 *  2. [BROM_DLL&DA][BUG FIX] Fix RTC date-time value could not be initialized problem. 
 *  3. [DA][New] Supports new NOR flash device.
 * 				[INTEL] 38F1010C0ZBL0
 * 				[INTEL] 28F1602C3BD70
 * 				[TOSHIBA] TY0068B012APGG
 * 				[TOSHIBA] TY0068B013APGG
 *  4. [DA][New] Supports new NAND flash device.
 * 				[HYNIX] HY27XG082G2M
 * Resolution for 149: [BROM_DLL v2.7.1011][New] Add UID Secure Booting feature and Bug Fix.
 * 
 *    Rev 1.30   Oct 26 2005 09:43:42   mtk00539
 *  1. [BROM_DLL][Enhance] Always fix BootROM start command read timeout to 20ms to bypass start command failure problem.
 *  2. [DA][BUG FIX] Fix wrong start block address of 2nd binary for new NFB architecture.
 * Resolution for 144: [BROM_DLL v2.7.1010][BUG FIX] Fix wrong start block address of 2nd binary for new NFB architecture.
 * 
 *    Rev 1.29   Oct 19 2005 14:45:02   mtk00539
 *  1. [BROM_DLL&DA][New] New H/W devices detection architecture including NOR, NAND, SRAM and DRAM detection. 
 *  2. [BROM_DLL&DA][New] DA partial download technic, that overcomes DA size exceeds MT6205B internal SRAM (32KB).
 *  3. [BROM_DLL&DA][New] Format verification option, each byte should be 0xFF after erasure. 
 *  4. [BROM_DLL&DA][New] DA validation to ensure invalid binary could not be loaded.
 *  5. [BROM_DLL&DA][New] Support NFB download. 
 *  6. [BROM_DLL&DA][New] Support NAND flash format with 3 method, NORMAL, FORCEDLY ERASE and MARK AS BAD BLOCK. 
 *  7. [BROM_DLL&DA][New] Support NAND flash read back with 4 methods, PAGE+ECC, PAGE ONLY, SPARE ONLY and PAGE+SPARE. 
 * Resolution for 140: [BROM_DLL v2.7.1008][New] Support NFB download and many new features.
 * 
 *    Rev 1.28   Oct 18 2005 13:36:40   mtk00539
 *  1. [DA][New] New NOR flash device support
 * 		[SILICON7] S7_SV7E160XT,
 * 		[SILICON7] S7_SV7E160XB,
 * 		[SILICON7] S7_SV7E320XT,
 * 		[SILICON7] S7_SV7E320XB,
 * 		[SPANSION] S71GL032R3_T,
 * 		[SPANSION] S71GL032R4_B,
 * 		[SPANSION] S71GL032R1R2,
 * 		[TOSHIBA] TV00569002BABD,
 * 		[TOSHIBA] TV00569003BABD,
 * 		[TOSHIBA] TV00569002AABD,
 * 		[TOSHIBA] TV00569003AABD,
 * Resolution for 137: [BROM_DLL v2.4.1017][New] Enable SID feature and add new flash device supoprt.
 * 
 *    Rev 1.27   Sep 13 2005 13:23:52   mtk00539
 *  1. [DA][New] New NOR flash device support [Winbond] W19B320ATB, W19B320ATT.
 *  2. [DA][BUG FIX] Fix MT6229 read DSP version failure problem.
 * Resolution for 130: [BROM_DLL v2.4.1016][Enhance] Workaround the 1st time power up failure issue when RTC is empty.
 * 
 *    Rev 1.26   Jun 15 2005 12:21:42   mtk00539
 *  1. [DA][New] Support new flash devices TV0057A002AABD and TV0057A002AABD.
 *  2. [DA][New] Support RENESAS flash with F-WP#(LOW).
 * Resolution for 118: [BROM_DLL v2.4.1013][New] Support RENESAS flash with F-WP#(LOW).
 * 
 *    Rev 1.25   May 24 2005 19:54:22   mtk00539
 *  1. [BROM_DLL][New] Add DA_cmd::CMD_EnableWatchDog() to enable watchdog after download process. 
 *  2. [BROM_DLL][New] Add DL_ResourceProjectIdComparisonSetting() API to enable/disable resource project id comparison. 
 *  3. [BROM_DLL][New] Add callback function in Boot_META() series API to do extra process after BootROM start command passed.
 *  4. [BROM_DLL][BUG FIX] Fix com port error after using HyperTerminal.
 *  5. [BROM_DLL][BUG FIX] Fix m_boot_timeout takes no effect in BRom_AutoBoot::BRom_StartCmd().
 *  6. [BROM_DLL][Change Behavior] Stop download process while CALLBACK_DA_REPORT return non-zero value. 
 *  7. [BROM_DLL][Change Behavior] Skip resource table size and content size checking for CustPack project.
 * Resolution for 115: [BROM_DLL v2.4.1012][New] Support new flash devices and bug fix.
 * 
 *    Rev 1.24   Mar 29 2005 11:14:38   mtk00539
 *  1. [BROM_DLL][BUG FIX] ROM_ID_Class::LoadID() should dump only the last 256 bytes data. 
 *  2. [BROM_DLL][New] Add detail H/W error debug log. 
 *  3. [DA][Enhance] Enhance bus test in FlashTest_DA.
 *  4. [DA][New] Add H/W error detail detection, thus we can distinguish INT_SRAM or EXT_SRAM error.
 *  5. [DA][New] Add all INTEL W18/W30, L18/L30 non-SCSP flashes support. 
 * Resolution for 107: [BROM_DLL v2.4.1010][New] Enhance bus test in FlashTest_DA, new INTEL flash support and bug fix.
 * 
 *    Rev 1.23   Feb 16 2005 17:23:56   mtk00539
 *  1. [DA][BUG FIX] Fix INTEL W18/W30 series flash program fail. this series don't support Buffered-Program method, we can only use WORD program.
 *  2. [DA][BUG FIX] Fix format %x bug in UART_Printf().
 *  3. [DA][BUG FIX] Fix small size EXT_SRAM detection error. Shrink the EXT_SRAM detection unit from 512KB to 128KB in Board_Schematic().
 *  4. [DA][New] Extend max sector region to 4 for SPANSION S71AL016D flash.
 *  5. [DA][New] Add SPANSION S71AL016D T/B and SHARP LRS18C8A flash support. 
 * Resolution for 105: [BROM_DLL v2.4.1009][New] Fix INTEL W18/W30 series bug and add SPANSION S71AL016D and SHARP LRS18C8A flash support.
 * 
 *    Rev 1.22   Nov 29 2004 15:49:36   mtk00539
 * [DA][New] Support new flashes [SHARP]LRS18B0 and LRS1863.
 * Resolution for 99: [BROM_DLL v2.4.1008][New] Support INTEL family flash Buffered-Program method.
 * 
 *    Rev 1.21   Nov 22 2004 12:23:48   mtk00539
 *  1. [DA][BUG FIX] Add data verification in status polling during erase or program operation.
 *  2. [DA][BUG FIX] Fix two dies flash detection fail in INTEL_CheckDevID(). 
 *  3. [DA][Change Behavior] When S_DA_UART_RX_BUF_FULL occurs, flush data queued in UART ring buffer til data is less than 512KB.
 *  4. [DA][New] Support Buffered-Program method for INTEL family flashes.
 *  5. [DA][New] Support new flashes [SHARP]LRS1828C and [RENESAS]M6MGB64BM34CDG.
 * Resolution for 99: [BROM_DLL v2.4.1008][New] Support INTEL family flash Buffered-Program method.
 * 
 *    Rev 1.20   Oct 29 2004 11:42:58   mtk00539
 *  1. [BROM_DLL][New] Implement auto bbchip and ext_clock detection mechanism.
 *  2. [BROM_DLL][New] Increase BootROM baudrate as twice times by setup UART_HIGHSPEED_RATE_STEP register.
 *  3. [BROM_DLL][New] Add new bbchip MT6205_EN and MT6218B_GN.
 *  4. [BROM_DLL][Enhance] Increase MT6217 and MT6219 EMI driving strength.
 * Resolution for 92: [BROM_DLL v2.4.1006][BUG FIX] Fix AM49DL3208GT & S71PL032J download fail problem and some enhancement.
 * 
 *    Rev 1.19   Sep 17 2004 17:01:22   mtk00539
 * add error code to indicate Board_Schematic() error
 * Resolution for 90: [BROM_DLL v2.4.1005][BUG FIX] Fix MT6217 download fail problem and some enhancement.
 * 
 *    Rev 1.18   Sep 14 2004 20:47:38   mtk00539
 * [SAMSUNG] KAD060300B
 * Resolution for 90: [BROM_DLL v2.4.1005][BUG FIX] Fix MT6217 download fail problem and some enhancement.
 * 
 *    Rev 1.17   Sep 14 2004 16:38:26   mtk00539
 *  1. [BROM_DLL][BUG FIX] Change MT6217 EMI general control register to default value since it's different with MT6218B.
 *  2. [BROM_DLL][Enhance] Modify serial port enumeration to support FTDI USB-Serial cable.
 * Resolution for 90: [BROM_DLL v2.4.1005][BUG FIX] Fix MT6217 download fail problem and some enhancement.
 * 
 *    Rev 1.16   Aug 03 2004 10:42:42   mtk00539
 *  1. [DA][BUG FIX] Invoke Board_Schematic()(old name is HW_Init()) before FUTL_CheckDevice(). Because FUTL_CheckDevice() must know the absolute address for each bank.
 *  2. [DA][New] Add 12 new flash devices support 
 * 				[SAMSUNG]K5A3280YT,
 * 				[TOSHIBA]TH50VPF6782AASB,
 * 				[TOSHIBA]TH50VPF6783AASB,
 * 				[TOSHIBA]TV00578002AABD,
 * 				[TOSHIBA]TV00578003AABD,
 * 				[Fujitsu]MB84VP24581HK,
 * 				[INTEL]INTEL_28F640W30_B,
 * 				[SPANSION]AM49PDL127BH,
 * 				[SPANSION]AM49PDL129BH,
 * 				[RENESAS]M6MGD13BW66CDG,
 * 				[Winbond]W19B322TM,
 * 				[Winbond]W19B323TM,
 *  3. [DA][New] Readback check after WORD program is done, so that DA won't have to keep the chksum.
 *  4. [DA][New] Auto-detect baseband chip type.
 *  5. [DA][New] Auto-detect external SRAM size.
 *  6. [DA][New] Merge MT6205B, MT6218B and MT6219 to an all-in-one DA.
 *  7. [DA][New] Merge flash stress test module.
 *  8. [DA][New] Modify makefile to build ARM or THUMB code.
 *  9. [DA][New] Construct a customization kit for customers to add new flash or SOC checking algorithm by themselves.
 * 10. [DA][Enhance] Split out AM29PDL128G function to improve the performance of general AMD callback functions.
 * 11. [DA][Enhance] Enhance RX_BUFF_FULL behavior to prevent always retry two times.
 * Resolution for 83: [BROM_DLL v2.4.1002] Merge all the DAs into all-in-one DA and fix many bugs and enhancement.
 * 
 *    Rev 1.15   Jul 19 2004 01:39:34   mtk00539
 *  1. [DA][New] New flash table structure to support AMD and Intel family flash.
 *  2. [DA][New] New flash ID detection method to tell from single stack flash and daul stack flash with the same id.
 *  3. [DA][BUG FIX] Fix MB84VD23280FA id detection error.
 *  4. [DA][BUG FIX] Fix baudrate 921600 download fail under 13MHz external clock, shift SAMPLE_POINT to 0x01 under 13MHz.
 * Resolution for 81: [BROM_DLL v2.4.1001] Support Intel flash and fix many bugs.
 * 
 *    Rev 1.14   Jun 16 2004 16:30:08   mtk00539
 * 1. [DA][New] Replace two expired Toshiba flash with AMD AM29DL322GT and ST M29DW640D in flash device table.
 * 2. [DA][Enhance] Check MEM_BLOCK range to prevent it exceeds that flash size.
 * Resolution for 77: [BROM_DLL v2.3.1007][New] Support AMD AM29DL322GT and ST M29DW640D flash.
 * 
 *    Rev 1.13   May 14 2004 16:59:22   mtk00539
 * 1. [DA][New] add DA auto selection mechanism, append custom_name at the end of DA.
 * 2. [DA][New] add FAT auto format mechanism, report flash manufacture id and device code to PC side.
 * Resolution for 67: [BootRom v2.3.1001][New] add FAT auto format, DA auto selection mechanism and bug fix.
 * 
 *    Rev 1.12   Mar 02 2004 00:14:42   mtk00539
 * 1. [DA][Enhance] re-assign DA command id.
 * 2. [DA][Enhance] add DSP firmware version command.
 * 3. [DA][BUG FIX] fix unsigned var in while loop that causes infinite loop.
 * Resolution for 53: [BootRom v2.2.1007][Enhance] resource layout error detection.
 * 
 *    Rev 1.11   Feb 05 2004 14:13:52   mtk00539
 * supposupport multiple concatanated bin files download.
 * Resolution for 46: [BootRom v2.2.1001][New] support multiple concatanated bin files download.
 * 
 *    Rev 1.10   Feb 04 2004 10:04:36   mtk00539
 * support AMD AM50DL128CG flash
 * Resolution for 45: [BootRom v2.1.1011][New] support AMD AM50DL128CG flash.
 * 
 *    Rev 1.9   Jan 13 2004 10:14:54   mtk00539
 * [DA][New] support Fujitsu MB84VP24491HK-70 flash.
 * Resolution for 43: [BootRom v2.1.1010][New] support Fujitsu MB84VP24491HK-70 flash
 * 
 *    Rev 1.8   Dec 12 2003 14:31:34   mtk00539
 * support Fujitsu MB84VD22280FE flash by Chicago's request.
 * Resolution for 40: [BootRom v2.1.1007][New] support Fujitsu MB84VD22280FE flash and etc.
 * 
 *    Rev 1.7   Nov 12 2003 14:14:44   mtk00539
 * Add SOC feature
 * Resolution for 35: [BootRom v2.1.1005][New] Add SOC feature.
 * 
 *    Rev 1.6   Oct 01 2003 23:34:06   mtk00539
 * Add packet length in DA_WRITE_CMD and DA_READ_CMD.
 * Resolution for 28: [BootRom v2.1.1001][New] See the reasons below.
 * 
 *    Rev 1.5   Sep 25 2003 13:57:52   mtk00539
 * brom.dll v2.1.1001, please see SCR(28) for more details.
 * Resolution for 28: [BootRom v2.1.1001][New] See the reasons below.
 * 
 *    Rev 1.4   Jun 30 2003 19:30:26   mtk00539
 *  1. [brom.dll][BUG FIXED] Fix DA_MEM_CMD end_addr bug, FlashTool should use (begin_addr+length-1) as end_addr.
 *  2. [brom.dll][Add Features] Split flashtool function into brom.dll
 *  3. [brom.dll][Add Features] Add a fake MT6208 bootrom for FlashTool for Pluto version.
 *  4. [DA][Add Features] Check format range.
 *  5. [DA][Add Features] Report format percentage.
 *  6. [DA][Add Features] Support 6208 EVB/CEVB for double flash devices access.
 *  7. [DA][BUG FIXED] Fix DA pre-format sector bug, it shouldn't format beyond the max size of flash.

⌨️ 快捷键说明

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