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

📄 tboot_1.h

📁 MTK 最新的flashtool工具的源代码
💻 H
字号:
/*****************************************************************************
*  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) 2002
*
*****************************************************************************/

/*******************************************************************************
* Filename:
* ---------
*  tboot_1.h
*
* Project:
* --------
*  Flash tool set
*
* Description:
* ------------
*  header file of Boot ROM communicate thread
*
* Author:
* -------
*  FZ Hsu (mtk00303)
*
*==============================================================================
*           HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* $Revision:   1.9  $
* $Modtime:   Oct 19 2005 11:15:18  $
* $Log:   //mtkvs01/vmdata/flash_tool/archives/TBOOT_1.H-arc  $
 *
 * May 18 2007 mtk01413
 * [STP100001402] FlashTool v3.1.05 release
 * 
 *
 * Mar 12 2007 mtk01413
 * [STP100001329] FlashTool v3.1.04 release
 * Enhancements:
 *  1. [FlashTool] Show Parameter List View automatically when loading secure-on MAUI
 *  2. [FlashTool] Move "Paremeter"/ "File Management"/ "ROM Writer" under "Window" menu item
 *  3. [FlashTool] Show DA version and Build Date in help dialog
 * 
 *
 * Aug 14 2006 mtk00539
 * [STP100001057] FlashTool v3.1.00 release
 * 
 *
 * Mar 22 2006 mtk00539
 * [STP100000703] FlashTool v2.7.1017
 * [FlashTool] Use known BBCHIP_TYPE and EXT_CLOCK to increase start command hit rate in "Reset to Factory Default" procedure.
 * 
 *    Rev 1.9   Oct 19 2005 14:47:26   mtk00539
 *  1. [FlashTool][New] Adapt new BROM_DLL&DA v2.7.1008. 
 * Resolution for 141: [FlashTool v2.7.1008][New] Support NFB download and many new features.
 * 
 *    Rev 1.8   May 24 2005 20:03:42   mtk00539
 *  1. [FlashTool][New] Reset FAT to factory default setting. 
 *  2. [FlashTool][New] Option to enable/disable resource project id comparison. 
 * Resolution for 116: [FlashTool v2.6.1012][New] Reset FAT to factory default setting.
 * 
 *    Rev 1.7   Feb 16 2005 17:27:44   mtk00539
 *  1. [FlashTool][New] Adapt new BROM_DLL&DA v2.4.1009 to support SPANSION S71AL016D and SHARP LRS18C8A flash. 
 *  2. [FlashTool][Enhance] Allow to setup EMI setting in TestMode.
 *  3. [FlashTool][Enhance] Keep TestMode unless you disable it. In order to allow users to do test continuously.
 *  4. [FlashTool][Enhance] Add CTRL+S hot-key to save TestMode log into file.
 * Resolution for 106: [FlashTool v2.6.1009][New] Adapt new BROM_DLL&DA v2.4.1009 to support SPANSION S71AL016D and SHARP LRS18C8A flash.
 * 
 *    Rev 1.6   May 21 2004 15:54:54   mtk00539
 *  1. [FlashTool][BUF FIX] fix incorrect error message of resource detection.
 * Resolution for 71: [FlashTool v2.5.1010][BUF FIX] fix incorrect error message of resource detection.
 * 
 *    Rev 1.5   May 14 2004 17:04:22   mtk00539
 *  1. [FlashTool][New] add CTRL+ALT+O hot-key to toggle Advanced Option Mode.
 *  2. [FlashTool][New] add FAT auto format mechanism.
 *  3. [FlashTool][New] add DA auto selection mechanism.
 *  4. [FlashTool][New] add STOP button.
 *  5. [FlashTool][Enhance] start timer when BootROM start cmd pass.
 *  6. [FlashTool][New] display flash info in status bar hint.
 *  7. [FlashTool][New] display format range info in format progress bar hint.
 *  8. [FlashTool][New] record the DA, Scatter and DL path separately.
 * Resolution for 68: [FlashTool v2.5.1009][New] add FAT auto format, DA auto selection mechanism and lots of enhancements.
 * 
 *    Rev 1.4   Sep 25 2003 14:03:28   mtk00539
 * adapt brom.dll v2.1.1001, please see SCR(29) for more details.
 * Resolution for 29: [FlashTool v2.4.1001][New] See the reasons below.
 * 
 *    Rev 1.3   Jun 30 2003 19:19:36   mtk00539
 *  1. [FlashTool][Add Features] Split flashtool function into brom.dll
 *  2. [FlashTool][Add Features] Format function: users can format any range you want without downloading procedure.
 *  3. [FlashTool][Add Features] Report format percentage.
 *  4. [FlashTool][Add Features] Check format range.
 *  5. [FlashTool][Add Features] Merge FlashTool for Pluto version.
 *  6. [FlashTool][Add Features] Runtime debug log: you can press (CTRL+ALT+T) to enable/disable debug log whenever you want.
 *  7. [FlashTool][Add Features] Forcedly Stop hot-key: you can forcedly stop FlashTool by pressing CTRL+Z.
 *  8. [FlashTool][BUG FIXED] Fix FlashTool MEM_CMD end_addr bug, FlashTool should use (begin_addr+length-1) as end_addr.
 * Resolution for 11: [FlashTool v2.3.1001][New Version] Split flashtool function into brom.dll
 * 
 *    Rev 1.2   Jun 03 2003 22:24:56   mtk00539
 * 1. extend timeout to 10 sec for large image download in boot_2.cpp
 * 2. disable unnecesssary debug hot-key.
 * 3. add shift+ctrl+A for Jensen's DA debug tool kit.
 * 4. enable build number, and start from 1003.
 * 5. save baseband chip type, mcu frequency and auto-memory wait state setup flag to ini file.
 * 6. add DA_SET_REG_CMD command and remove FINISH_CMD, so that release power key could be issued from FlashTool, not hardcoded in DA.
 * 7. add DA_MCU_FREQ_CMD command, so that we don't have to select different DA while switching frequency.
 * 8. add new flash MB84VD23280FA-70 for Chicago project.
 * 9. remove DEVICE_CMD, DA will check flash automatically and report the flash type to PC.
 * 10. add DA_FORMAT_CMD command to support range format.
 * 11. display flash type on FlashTool.
 * 12. merge the DOWNLOAD.H header file, both FlashTool and DA will use the same header file.
 * 13. modify SPEED_CMD handshake by adding a sync mechanism to detect whether if the speed change is done by both sides.
 * Resolution for 7: [FlashTool v2.2.1003][AddFeature] Enhanced for KLM and Chicago project.
 * 
 *    Rev 1.1   Jul 26 2002 11:52:20   admin
 * ver 0726
 * 
 *    Rev 1.0   Jul 20 2002 19:26:16   admin
 * Initial revision.
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
//---------------------------------------------------------------------------

#ifndef tboot_1H
#define tboot_1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
//#include <stdio.h>

#include "mem.h"
#include "flashtool.h"

//---------------------------------------------------------------------------
class tboot_1 : public TThread
{
protected:
        void __fastcall Execute();
        void __fastcall FlashTool();
        void __fastcall DebugDA();
public:
        __fastcall tboot_1(bool CreateSuspended );

		// update progress
        void _fastcall	InitProgress();
        void _fastcall	SyncInitProgress();
        void _fastcall	UpdateProgress();
        void _fastcall	SyncUpdateProgress();
        void _fastcall  ClearStatusBar();

        void _fastcall	DisplayFlashType();
        void _fastcall	SyncDisplayFlashType();

        void _fastcall ShowMsg();
		void _fastcall SyncShowMsg();

		void _fastcall ShowOK_Form();
		void _fastcall StopTimer();

		void _fastcall UpdateDebugDAWindow();

        void _fastcall SyncStartFakeProgress();
		void _fastcall ResetFakeProgress();
		void _fastcall StartFakeProgress();
		void _fastcall StopFakeProgress();
		void _fastcall FinishFakeProgress();
        bool _fastcall EnterMETA(const BBCHIP_TYPE  bbchip, const EXT_CLOCK  ext_clock);

public:
		bool	 		bUpdateFinishBytes;
		unsigned char	progress_percentage;
		unsigned long	progress_finished_bytes;
		unsigned long	progress_total_bytes;
		AnsiString		progress_hint;
		AnsiString		progress_flashtype;
		TColor			progress_forecolor;
        unsigned char   com_port;

		COM_PORT_SETTING			com;
		FLASHTOOL_ARG				arg;
		FLASHTOOL_RESULT			result;
		FLASHTOOL_DOWNLOAD_ARG		dl_arg;
		FLASHTOOL_DOWNLOAD_RESULT	dl_result;
		FLASHTOOL_READBACK_ARG		rb_arg;
		FLASHTOOL_READBACK_RESULT	rb_result;
		FLASHTOOL_FORMAT_ARG		fmt_arg;
		FLASHTOOL_FORMAT_RESULT		fmt_result;
        FLASHTOOL_PARAMETER_ARG     pm_arg;
        FLASHTOOL_PARAMETER_RESULT  pm_result;
        FlashTool_Connect_Arg       cn_arg;
        FlashTool_Connect_Result    cn_result;
        FlashTool_Progress_Arg      pgs_arg;
        FlashTool_ChangeBaudrate_Arg cb_arg;

		char	m_strHWDetectionReport[2048];
		char	m_strNorFlashHint[512];
		char	m_strNandFlashHint[512];

        AnsiString asMsg;
		unsigned char m_RecvChar;
        AnsiString m_RecvString;
};
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

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