8 #ifndef NTV2KONAFLASHPROGRAM_H
9 #define NTV2KONAFLASHPROGRAM_H
15 #include <sys/types.h>
24 #define MAXBITFILE_HEADERSIZE 512
25 #define MAXMCSINFOSIZE 256
26 #define MAXMCSLICENSESIZE 256
53 static std::string FlashBlockIDToString (
const FlashBlockID inID,
const bool inShortDisplay =
false);
56 virtual bool SetBoard (uint32_t index = 0);
58 bool ReadInfoString();
60 bool SetMCSFile (
const std::string & sMCSFileName);
61 std::string Program (
bool fullVerify =
false);
62 bool ProgramFromMCS(
bool verify);
63 bool ProgramSOC(
bool verify =
true);
64 bool ProgramCustom (
const std::string & sCustomFileName,
const uint32_t addr, std::ostream & outMsgs);
65 bool ProgramKonaxMB (
const std::string & sCustomFileName,
const uint32_t addr, std::ostream & outMsgs);
67 bool EraseChip (
UWord chip = 0);
68 bool CreateSRecord (
bool bChangeEndian);
69 bool CreateEDIDIntelRecord ();
71 bool VerifyFlash (
FlashBlockID flashBlockNumber,
bool fullVerify =
false);
75 bool ROMHasBankSelect();
76 uint32_t ReadBankSelect ();
78 bool IsInstalledFWRunning (
bool & outIsRunning, std::ostream & outErrorMsgs);
82 std::string
GetPartName (
void)
const {
return _parser.PartName();}
83 std::string
GetDate (
void)
const {
return _parser.Date();}
84 std::string
GetTime (
void)
const {
return _parser.Time();}
87 const std::string &
GetMCSInfo (
void)
const {
return _mcsInfo;}
88 void ParsePartitionFromFileLines(uint32_t address, uint16_t & partitionOffset);
93 bool ProgramLicenseInfo(
const std::string & licenseString);
94 bool ReadLicenseInfo(std::string & licenseString);
95 void DisplayData(
const uint32_t address,
const uint32_t len);
96 bool ProgramInfoFromString(std::string infoString);
97 bool FullProgram(std::vector<uint8_t> & dataBuffer);
101 bool WaitForFlashNOTBusy();
102 bool ProgramFlashValue(uint32_t address, uint32_t value);
103 bool FastProgramFlash256(uint32_t address, uint32_t* buffer);
104 bool EraseSector(uint32_t sectorAddress);
105 bool CheckFlashErasedWithBlockID(
FlashBlockID flashBlockNumber);
106 uint32_t ReadDeviceID();
107 bool SetDeviceProperties();
108 void DetermineFlashTypeAndBlockNumberFromFileName(
const std::string & bitFileName);
112 return GetBaseAddressForProgramming(flashBlockNumber)+(sectorNumber*_sectorSize);
117 switch ( flashBlockNumber )
133 switch ( flashBlockNumber )
146 bool VerifySOCPartition(
FlashBlockID flashID, uint32_t FlashBlockOffset);
147 bool CheckAndFixMACs();
148 bool MakeMACsFromSerial(
const char *sSerialNumber,
MacAddr *pMac1,
MacAddr *pMac2 );
184 #endif // NTV2KONAFLASHPROGRAM_H