Compare commits
5 Commits
first-pack
...
master
Author | SHA1 | Date |
---|---|---|
Henrik Grimler | 02b577ec77 | |
Henrik Grimler | 14f3521a6b | |
Henrik Grimler | 0cf817a591 | |
Henrik Grimler | c3516307d2 | |
Henrik Grimler | f6c4698c8b |
|
@ -114,7 +114,7 @@
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Heimdall Frontend</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Heimdall Frontend</span></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Version 2.0.1</p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Version 2.0.2</p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright © 2010-2017 Benjamin Dobell, Glass Echidna</p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright © 2010-2017 Benjamin Dobell, Glass Echidna</p>
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Heimdall (command line)</span></p>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Heimdall (command line)</span></p>
|
||||||
|
|
|
@ -116,16 +116,16 @@ static bool openFiles(Arguments& arguments, vector<PartitionFile>& partitionFile
|
||||||
{
|
{
|
||||||
const StringArgument *stringArgument = static_cast<const StringArgument *>(*it);
|
const StringArgument *stringArgument = static_cast<const StringArgument *>(*it);
|
||||||
FILE *file = FileOpen(stringArgument->GetValue().c_str(), "rb");
|
FILE *file = FileOpen(stringArgument->GetValue().c_str(), "rb");
|
||||||
FileSeek(file, 0, SEEK_END);
|
|
||||||
unsigned long fileSize = (unsigned long)FileTell(file);
|
|
||||||
FileRewind(file);
|
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
Interface::PrintError("Failed to open file \"%s\"\n", stringArgument->GetValue().c_str());
|
Interface::PrintError("Failed to open file \"%s\"\n", stringArgument->GetValue().c_str());
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileSeek(file, 0, SEEK_END);
|
||||||
|
unsigned long fileSize = (unsigned long)FileTell(file);
|
||||||
|
FileRewind(file);
|
||||||
|
|
||||||
partitionFiles.push_back(PartitionFile(argumentName.c_str(), file, fileSize));
|
partitionFiles.push_back(PartitionFile(argumentName.c_str(), file, fileSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,11 +303,11 @@ static bool flashPartitions(BridgeManager *bridgeManager, const vector<Partition
|
||||||
{
|
{
|
||||||
const PitEntry *part = pitData->FindEntry(it->argumentName);
|
const PitEntry *part = pitData->FindEntry(it->argumentName);
|
||||||
if (part->GetDeviceType() != PitEntry::kDeviceTypeMMC &&
|
if (part->GetDeviceType() != PitEntry::kDeviceTypeMMC &&
|
||||||
part->GetDeviceType() != PitEntry::kDeviceTypeMMC4096)
|
part->GetDeviceType() != PitEntry::kDeviceTypeUFS)
|
||||||
continue;
|
continue;
|
||||||
unsigned long partitionSize = part->GetBlockCount();
|
unsigned long partitionSize = part->GetBlockCount();
|
||||||
unsigned int blockSize = 512;
|
unsigned int blockSize = 512;
|
||||||
if (part->GetDeviceType() == PitEntry::kDeviceTypeMMC4096)
|
if (part->GetDeviceType() == PitEntry::kDeviceTypeUFS)
|
||||||
blockSize = 4096;
|
blockSize = 4096;
|
||||||
if (partitionSize > 0 && it->fileSize > partitionSize*blockSize)
|
if (partitionSize > 0 && it->fileSize > partitionSize*blockSize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,7 +42,7 @@ using namespace Heimdall;
|
||||||
map<string, Interface::ActionInfo> actionMap;
|
map<string, Interface::ActionInfo> actionMap;
|
||||||
bool stdoutErrors = false;
|
bool stdoutErrors = false;
|
||||||
|
|
||||||
const char *version = "v2.0.1";
|
const char *version = "v2.0.2";
|
||||||
const char *actionUsage = "Usage: heimdall <action> <action arguments>\n";
|
const char *actionUsage = "Usage: heimdall <action> <action arguments>\n";
|
||||||
|
|
||||||
const char *releaseInfo = "Heimdall %s\n\n\
|
const char *releaseInfo = "Heimdall %s\n\n\
|
||||||
|
@ -211,7 +211,7 @@ void Interface::PrintPit(const PitData *pitData)
|
||||||
Interface::Print("Entry Count: %d\n", pitData->GetEntryCount());
|
Interface::Print("Entry Count: %d\n", pitData->GetEntryCount());
|
||||||
Interface::Print("Unknown string: %s\n", pitData->GetComTar2());
|
Interface::Print("Unknown string: %s\n", pitData->GetComTar2());
|
||||||
Interface::Print("CPU/bootloader tag: %s\n", pitData->GetCpuBlId());
|
Interface::Print("CPU/bootloader tag: %s\n", pitData->GetCpuBlId());
|
||||||
Interface::Print("Protocol version: 0x%04x\n", pitData->GetProtocolVersion());
|
Interface::Print("Logic unit count: %d\n", pitData->GetLUCount());
|
||||||
|
|
||||||
for (unsigned int i = 0; i < pitData->GetEntryCount(); i++)
|
for (unsigned int i = 0; i < pitData->GetEntryCount(); i++)
|
||||||
{
|
{
|
||||||
|
@ -257,8 +257,8 @@ void Interface::PrintPit(const PitData *pitData)
|
||||||
Interface::Print("All (?)");
|
Interface::Print("All (?)");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PitEntry::kDeviceTypeMMC4096:
|
case PitEntry::kDeviceTypeUFS:
|
||||||
Interface::Print("MMC 4096");
|
Interface::Print("UFS");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -69,7 +69,7 @@ PitData::PitData()
|
||||||
com_tar2[0] = '\0';
|
com_tar2[0] = '\0';
|
||||||
cpu_bl_id[0] = '\0';
|
cpu_bl_id[0] = '\0';
|
||||||
|
|
||||||
protocol_version = 0;
|
luCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PitData::~PitData()
|
PitData::~PitData()
|
||||||
|
@ -98,7 +98,7 @@ bool PitData::Unpack(const unsigned char *data)
|
||||||
return (false);
|
return (false);
|
||||||
cpu_bl_id[8]='\0';
|
cpu_bl_id[8]='\0';
|
||||||
|
|
||||||
protocol_version = PitData::UnpackShort(data, 24);
|
luCount = PitData::UnpackShort(data, 24);
|
||||||
|
|
||||||
unsigned int integerValue;
|
unsigned int integerValue;
|
||||||
unsigned int entryOffset;
|
unsigned int entryOffset;
|
||||||
|
@ -153,7 +153,7 @@ void PitData::Pack(unsigned char *data) const
|
||||||
memcpy(&data[8], com_tar2, 8);
|
memcpy(&data[8], com_tar2, 8);
|
||||||
memcpy(&data[16], cpu_bl_id, 8);
|
memcpy(&data[16], cpu_bl_id, 8);
|
||||||
|
|
||||||
PitData::PackShort(data, 24, protocol_version);
|
PitData::PackShort(data, 24, luCount);
|
||||||
|
|
||||||
int entryOffset;
|
int entryOffset;
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ bool PitData::Matches(const PitData *otherPitData) const
|
||||||
if (entryCount == otherPitData->entryCount &&
|
if (entryCount == otherPitData->entryCount &&
|
||||||
(strncmp(com_tar2, otherPitData->com_tar2, 8) == 0) &&
|
(strncmp(com_tar2, otherPitData->com_tar2, 8) == 0) &&
|
||||||
(strncmp(cpu_bl_id, otherPitData->cpu_bl_id, 8) == 0) &&
|
(strncmp(cpu_bl_id, otherPitData->cpu_bl_id, 8) == 0) &&
|
||||||
protocol_version == otherPitData->protocol_version)
|
luCount == otherPitData->luCount)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < entryCount; i++)
|
for (unsigned int i = 0; i < entryCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -211,7 +211,7 @@ void PitData::Clear(void)
|
||||||
|
|
||||||
cpu_bl_id[0] = '\0';
|
cpu_bl_id[0] = '\0';
|
||||||
|
|
||||||
protocol_version = 0;
|
luCount = 0;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < entries.size(); i++)
|
for (unsigned int i = 0; i < entries.size(); i++)
|
||||||
delete entries[i];
|
delete entries[i];
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace libpit
|
||||||
kDeviceTypeFile, // FAT
|
kDeviceTypeFile, // FAT
|
||||||
kDeviceTypeMMC,
|
kDeviceTypeMMC,
|
||||||
kDeviceTypeAll, // ?
|
kDeviceTypeAll, // ?
|
||||||
kDeviceTypeMMC4096 = 8 // block size 4096
|
kDeviceTypeUFS = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
@ -261,12 +261,12 @@ namespace libpit
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
unsigned int entryCount; // 0x04
|
unsigned int entryCount; // 0x04
|
||||||
char com_tar2[8+1]; // 0x08
|
char com_tar2[8+1]; // 0x08
|
||||||
|
|
||||||
char cpu_bl_id[8+1]; // 0x10
|
char cpu_bl_id[8+1]; // 0x10
|
||||||
|
|
||||||
unsigned short protocol_version; // 0x18
|
unsigned short luCount; // 0x18
|
||||||
|
|
||||||
// Entries start at 0x1C
|
// Entries start at 0x1C
|
||||||
std::vector<PitEntry *> entries;
|
std::vector<PitEntry *> entries;
|
||||||
|
@ -375,9 +375,9 @@ namespace libpit
|
||||||
return cpu_bl_id;
|
return cpu_bl_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int GetProtocolVersion(void) const
|
unsigned int GetLUCount(void) const
|
||||||
{
|
{
|
||||||
return protocol_version;
|
return luCount;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue