7 #if !defined(_EncoreBootImage_h_) 8 #define _EncoreBootImage_h_ 16 #include "BootImage.h" 18 #include "smart_ptr.h" 20 #include "StExecutableImage.h" 25 typedef uint8_t cipher_block_t[16];
28 typedef uint8_t sha1_digest_t[20];
31 typedef uint32_t section_id_t;
34 inline size_t sizeOfCipherBlocks(
unsigned count)
36 return sizeof(cipher_block_t) * count;
41 inline size_t numberOfCipherBlocks(
size_t s)
43 return (s +
sizeof(cipher_block_t) - 1) /
sizeof(cipher_block_t);
48 inline size_t sizeInCipherBlocks(
size_t s)
50 return (
unsigned)sizeOfCipherBlocks(numberOfCipherBlocks(s));
57 inline size_t sizeOfPaddingForCipherBlocks(
size_t s)
59 return sizeInCipherBlocks(s) - s;
154 sha1_digest_t m_digest;
355 virtual unsigned getBlockCount()
const {
return 0; }
376 virtual unsigned getBlocks(
unsigned offset,
unsigned maxCount, cipher_block_t *data) {
return 0; }
390 static BootCommand *createFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
413 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed) = 0;
417 virtual uint8_t getTag()
const = 0;
429 virtual unsigned getBlockCount()
const;
433 virtual unsigned getBlocks(
unsigned offset,
unsigned maxCount, cipher_block_t *data);
438 virtual unsigned getDataBlockCount()
const {
return 0; }
459 virtual unsigned getDataBlocks(
unsigned offset,
unsigned maxCount, cipher_block_t *data) {
return 0; }
468 CMD_ADDRESS_FIELD = 4,
490 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
494 virtual uint8_t getTag()
const {
return ROM_NOP_CMD; }
520 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
524 virtual uint8_t getTag()
const {
return ROM_TAG_CMD; }
532 inline void setSectionIdentifier(uint32_t identifier) { m_sectionIdentifier = identifier; }
533 inline void setSectionLength(uint32_t length) { m_sectionLength = length; }
534 inline void setSectionFlags(uint32_t flags) { m_sectionFlags = flags; }
535 inline void setLast(
bool isLast) { m_isLast = isLast; }
558 LoadCommand(uint32_t address,
const uint8_t *data, uint32_t length);
561 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
571 inline void setDCD(
bool isDCD) { m_loadDCD = isDCD; }
576 inline void setLoadAddress(uint32_t address) { m_address = address; }
577 inline uint32_t getLoadAddress()
const {
return m_address; }
582 void setData(
const uint8_t *data, uint32_t length);
585 inline uint8_t *getData() {
return m_data; }
586 inline const uint8_t *getData()
const {
return m_data; }
587 inline uint32_t getLength()
const {
return m_length; }
592 virtual unsigned getDataBlockCount()
const;
596 virtual unsigned getDataBlocks(
unsigned offset,
unsigned maxCount, cipher_block_t *data);
604 uint8_t m_padding[15];
611 uint32_t calculateCRC()
const;
624 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
636 inline void setAddress(uint32_t address) { m_address = address; };
637 inline uint32_t getAddress()
const {
return m_address; }
638 inline void setFillCount(uint32_t count) { m_count = count; }
639 inline uint32_t getFillCount()
const {
return m_count; }
644 void setPattern(uint8_t pattern);
645 void setPattern(uint16_t pattern);
646 void setPattern(uint32_t pattern);
648 inline uint32_t getPattern()
const {
return m_pattern; }
674 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
686 inline void setBootMode(uint32_t mode) { m_mode = mode; }
687 inline uint32_t getBootMode()
const {
return m_mode; }
706 , m_doEraseAll(false)
707 , m_doEraseAllUnsecure(false)
715 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
727 void setEraseAll(
bool doEraseAll) { m_doEraseAll = doEraseAll; }
728 bool getEraseAll()
const {
return m_doEraseAll; }
733 void setEraseAllUnsecure(
bool doEraseAllUnsecure) { m_doEraseAllUnsecure = doEraseAllUnsecure; }
734 bool getEraseAllUnsecure()
const {
return m_doEraseAllUnsecure; }
739 void setAddressRange(uint32_t startAddress, uint32_t count);
740 void getAddressRange(uint32_t *startAddress, uint32_t *count)
const;
745 void setMemoryId(uint32_t memId) { m_memoryId = memId; }
746 uint32_t getMemoryId()
const {
return m_memoryId; }
754 bool m_doEraseAllUnsecure;
755 uint32_t m_startAddress;
756 uint32_t m_byteCount;
769 , m_isEightByte(false)
778 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
790 void setIsEightByte(
bool doIt) { m_isEightByte = doIt; }
791 bool isEightByte()
const {
return m_isEightByte; }
796 void setMemSpace(uint32_t
id) { m_memSpace = id; }
797 uint32_t getMemSpace()
const {
return m_memSpace; }
802 void setIndex(uint32_t index) { m_index = index; }
803 uint32_t getIndex()
const {
return m_index; }
808 void setDataWord1(uint32_t dataWord) { m_dataWord1 = dataWord; }
809 uint32_t getDataWord1()
const {
return m_dataWord1; }
814 void setDataWord2(uint32_t dataWord) { m_dataWord2 = dataWord; }
815 uint32_t getDataWord2()
const {
return m_dataWord2; }
843 , m_isStackPointerSet(false)
848 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
860 inline void setAddress(uint32_t address) { m_address = address; }
861 inline uint32_t getAddress()
const {
return m_address; }
862 inline void setArgument(uint32_t argument) { m_argument = argument; }
863 inline uint32_t getArgument()
const {
return m_argument; }
864 inline void setIsHAB(
bool isHAB) { m_isHAB = isHAB; }
865 inline bool isHAB()
const {
return m_isHAB; }
866 inline void setIVTSize(uint32_t ivtSize) { m_ivtSize = ivtSize; }
867 inline uint32_t getIVTSize()
const {
return m_ivtSize; }
868 inline void setStackPointer(uint32_t sp) { m_stackPointer = sp; }
869 inline uint32_t getStackPointer() {
return m_stackPointer; }
870 inline void setIsStackPointerSet(
bool isSP) { m_isStackPointerSet = isSP; }
871 inline bool IsStackPointerSet()
const {
return m_isStackPointerSet; }
882 bool m_isStackPointerSet;
918 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
945 , m_memControllerId(0)
950 virtual void initFromData(
const cipher_block_t *blocks,
unsigned count,
unsigned *consumed);
962 void setAddressRange(uint32_t startAddress, uint32_t count);
963 void getAddressRange(uint32_t *startAddress, uint32_t *count)
const;
968 void setMemControllerId(uint32_t memControllerId) { m_memControllerId = memControllerId; }
969 uint32_t getMemControllerId()
const {
return m_memControllerId; }
976 uint32_t m_startAddress;
977 uint32_t m_byteCount;
978 uint32_t m_memControllerId;
999 , m_leaveUnencrypted(false)
1006 , m_identifier(identifier)
1010 , m_leaveUnencrypted(false)
1016 inline void setIdentifier(uint32_t identifier) { m_identifier = identifier; }
1017 inline uint32_t getIdentifier()
const {
return m_identifier; }
1022 virtual void setFlags(uint32_t flags) {
m_flags = flags; }
1044 void setAlignment(
unsigned alignment);
1050 unsigned getPadBlockCountForOffset(
unsigned offset);
1055 void setLeaveUnencrypted(
unsigned flag) { m_leaveUnencrypted = flag; }
1075 typedef std::list<BootCommand *> command_list_t;
1076 typedef command_list_t::iterator iterator_t;
1077 typedef command_list_t::const_iterator const_iterator_t;
1096 virtual void fillFromData(
const cipher_block_t *blocks,
unsigned count);
1106 void addCommand(
BootCommand *command) { m_commands.push_back(command); }
1113 iterator_t begin() {
return m_commands.begin(); }
1114 iterator_t end() {
return m_commands.end(); }
1115 const_iterator_t begin()
const {
return m_commands.begin(); }
1116 const_iterator_t end()
const {
return m_commands.end(); }
1121 virtual unsigned getBlockCount()
const;
1125 virtual unsigned getBlocks(
unsigned offset,
unsigned maxCount, cipher_block_t *data);
1136 void deleteCommands();
1162 void setData(
const uint8_t *data,
unsigned length);
1165 void setDataNoCopy(
const uint8_t *data,
unsigned length);
1169 virtual unsigned getBlockCount()
const;
1173 virtual unsigned getBlocks(
unsigned offset,
unsigned maxCount, cipher_block_t *data);
1203 inline unsigned sectionCount()
const {
return (
unsigned)
m_sections.size(); }
1204 inline section_iterator_t beginSection() {
return m_sections.begin(); }
1205 inline section_iterator_t endSection() {
return m_sections.end(); }
1206 inline const_section_iterator_t beginSection()
const {
return m_sections.begin(); }
1207 inline const_section_iterator_t endSection()
const {
return m_sections.end(); }
1208 section_iterator_t findSection(
Section *section);
1216 inline void addKey(
const AES128Key &newKey) {
m_keys.push_back(newKey); }
1217 inline unsigned keyCount()
const {
return (
unsigned)
m_keys.size(); }
1218 inline key_iterator_t beginKeys() {
return m_keys.begin(); }
1219 inline key_iterator_t endKeys() {
return m_keys.end(); }
1220 inline const_key_iterator_t beginKeys()
const {
return m_keys.begin(); }
1221 inline const_key_iterator_t endKeys()
const {
return m_keys.end(); }
1228 virtual void setProductVersion(
const version_t &version);
1229 virtual void setComponentVersion(
const version_t &version);
1234 inline void setFlags(uint16_t flags) {
m_headerFlags = flags; }
1271 #endif // _EncoreBootImage_h_ virtual ~EncoreBootImage()
Destructor.
Definition: EncoreBootImage.cpp:31
Jump to address command.
Definition: EncoreBootImage.h:268
Value for elftosb::EncoreBootImage::boot_image_header_t::m_signature2;.
Definition: EncoreBootImage.h:115
AES128Key m_sessionKey
Session key we're using.
Definition: EncoreBootImage.h:1261
The DEK dictionary always follows the image header, in the next cipher block.
Definition: EncoreBootImage.h:194
uint32_t m_sectionLength
Number of cipher blocks this section occupies.
Definition: EncoreBootImage.h:543
Pattern fill command.
Definition: EncoreBootImage.h:267
section_id_t m_firstBootableSectionID
ID of section to start booting from.
Definition: EncoreBootImage.h:167
void setDCD(bool isDCD)
Sets the load-dcd flag.
Definition: EncoreBootImage.h:571
uint16_t m_headerFlags
Flags field in the boot image header.
Definition: EncoreBootImage.h:1255
Section tag bootloader command.
Definition: EncoreBootImage.h:507
Call function command.
Definition: EncoreBootImage.h:269
MemEnableCommand()
Default constructor.
Definition: EncoreBootImage.h:941
Base class for a section of an Encore boot image.
Definition: EncoreBootImage.h:989
uint32_t m_firstBootTagBlock
Offset from start of file to the first boot tag, in blocks.
Definition: EncoreBootImage.h:166
DataSection(uint32_t identifier)
Constructor taking the unique identifier for this section.
Definition: EncoreBootImage.h:1154
EncoreBootImage()
Default constructor.
Definition: EncoreBootImage.cpp:23
unsigned m_alignment
Alignment requirement for the start of this section.
Definition: EncoreBootImage.h:1064
Current boot image major version.
Definition: EncoreBootImage.h:117
uint32_t m_stackPointer
Stack pointer for "jump sp" command.
Definition: EncoreBootImage.h:880
Change boot mode bootloader command.
Definition: EncoreBootImage.h:663
BootCommand()
Default constructor.
Definition: EncoreBootImage.h:394
Load data command.
Definition: EncoreBootImage.h:266
uint8_t m_majorVersion
Major version for the image format, see ROM_BOOT_IMAGE_MAJOR_VERSION.
Definition: EncoreBootImage.h:162
key_list_t m_keys
List of key encryption keys. If empty, the image is unencrypted.
Definition: EncoreBootImage.h:1260
A bootable section of an Encore boot image.
Definition: EncoreBootImage.h:1072
Signature in elftosb::EncoreBootImage::boot_image_header_t::m_signature.
Definition: EncoreBootImage.h:113
IFR memory.
Definition: EncoreBootImage.h:340
std::list< Section * > section_list_t
List of image sections.
Definition: EncoreBootImage.h:1185
Bit position of mem space ID.
Definition: EncoreBootImage.h:315
Reset command.
Definition: EncoreBootImage.h:272
Fill with word sized pattern.
Definition: EncoreBootImage.h:294
uint32_t m_tag
Unique identifier for this section. High bit must be zero.
Definition: EncoreBootImage.h:211
Call function bootloader command.
Definition: EncoreBootImage.h:890
uint32_t m_count
Number of bytes to fill.
Definition: EncoreBootImage.h:656
Section tag command.
Definition: EncoreBootImage.h:265
TagCommand()
Default constructor.
Definition: EncoreBootImage.h:511
uint16_t m_sectionCount
Number of section headers in this table.
Definition: EncoreBootImage.h:171
EncoreBootImage * m_image
The image to which this section belongs.
Definition: EncoreBootImage.h:1063
uint32_t m_length
Number of bytes to load.
Definition: EncoreBootImage.h:606
Erase all flash instead of just a range.
Definition: EncoreBootImage.h:321
section_list_t m_sections
Sections contained in this image.
Definition: EncoreBootImage.h:1259
uint16_t m_keyDictionaryBlock
Starting block number for the key dictionary.
Definition: EncoreBootImage.h:169
uint32_t m_dataWord2
Second 4 bytes to write, valid if m_doEightByte is true.
Definition: EncoreBootImage.h:825
Section(uint32_t identifier)
Constructor taking the unique identifier for this section.
Definition: EncoreBootImage.h:1004
uint8_t m_padding1[6]
Padding to round up to next cipher block.
Definition: EncoreBootImage.h:180
uint8_t m_minorVersion
Minor version of the boot image format, see ROM_BOOT_IMAGE_MINOR_VERSION.
Definition: EncoreBootImage.h:163
uint32_t m_count
Number of bytes on which to operate.
Definition: EncoreBootImage.h:255
uint32_t m_pattern
Fill pattern.
Definition: EncoreBootImage.h:657
key_list_t::iterator key_iterator_t
Iterator over KEKs.
Definition: EncoreBootImage.h:1190
uint32_t getImageSize()
Calculates the total number of cipher blocks the image consumes.
Definition: EncoreBootImage.cpp:488
ResetCommand()
Default constructor.
Definition: EncoreBootImage.h:912
EraseCommand()
Default constructor.
Definition: EncoreBootImage.h:704
virtual ~BootCommand()
Destructor.
Definition: EncoreBootImage.h:400
uint32_t m_index
Index to write to.
Definition: EncoreBootImage.h:823
uint32_t m_identifier
Unique identifier for this section.
Definition: EncoreBootImage.h:1062
Class to manage Encore boot image files.
Definition: EncoreBootImage.h:101
section_list_t::const_iterator const_section_iterator_t
Const iterator over sections.
Definition: EncoreBootImage.h:1187
uint32_t m_address
Address of the code to execute.
Definition: EncoreBootImage.h:878
Memory Enable bootloader command.
Definition: EncoreBootImage.h:937
bool m_isLast
Is this the last tag command?
Definition: EncoreBootImage.h:545
Fill with byte sized pattern.
Definition: EncoreBootImage.h:292
virtual void setDriveTag(uint16_t tag)
Specify the drive tag to be set in the output file header.
Definition: EncoreBootImage.h:1239
Entry in elftosb::EncoreBootImage::dek_dictionary_t.
Definition: EncoreBootImage.h:187
std::vector< AES128Key > key_list_t
List of KEKs.
Definition: EncoreBootImage.h:1189
uint16_t m_driveTag
System drive tag for this boot image.
Definition: EncoreBootImage.h:1258
Minimum alignment for a section is 16 bytes.
Definition: EncoreBootImage.h:124
Flash erase command.
Definition: EncoreBootImage.h:271
A non-bootable section of an Encore boot image.
Definition: EncoreBootImage.h:1142
bool m_isEightByte
True if doing 8-byte write.
Definition: EncoreBootImage.h:822
Program 8 bytes instead of 4 bytes.
Definition: EncoreBootImage.h:328
version_t m_componentVersion
Component version.
Definition: EncoreBootImage.h:1257
Changes jump or call command to a HAB jump or call.
Definition: EncoreBootImage.h:300
uint32_t getSectionOffset(Section *section)
Calculates the starting block number for the given section.
Definition: EncoreBootImage.cpp:430
unsigned getPadBlockCountForSection(Section *section, unsigned offset)
Definition: EncoreBootImage.cpp:464
bool isEncrypted() const
The image is encrypted if there is at least one key.
Definition: EncoreBootImage.h:1223
version_t m_productVersion
Product version.
Definition: EncoreBootImage.h:1256
aes128_key_t m_dek
AES-128 key with which the image payload is encrypted.
Definition: EncoreBootImage.h:190
Fill with half-word sized pattern.
Definition: EncoreBootImage.h:293
virtual void debugPrint() const
Print out a string representation of the object.
Definition: EncoreBootImage.h:380
Base class for objects that produce cipher blocks.
Definition: EncoreBootImage.h:350
Print progress reports.
Definition: EncoreBootImage.h:107
DataSection()
Default constructor.
Definition: EncoreBootImage.h:1146
ProgramCommand()
Default constructor.
Definition: EncoreBootImage.h:767
Definition: BootImage.h:13
Program persistent bits command.
Definition: EncoreBootImage.h:274
uint16_t m_driveTag
Drive tag for the system drive which this boot image belongs to.
Definition: EncoreBootImage.h:179
unsigned getAlignment() const
Returns the current alignment, the minimum of which will be 16.
Definition: EncoreBootImage.h:1048
Erase bootloader command.
Definition: EncoreBootImage.h:700
uint8_t m_signature[4]
'STMP', see ROM_IMAGE_HEADER_SIGNATURE.
Definition: EncoreBootImage.h:161
version_t m_componentVersion
Component version.
Definition: EncoreBootImage.h:178
Structure for a Piano bootloader command.
Definition: EncoreBootImage.h:249
virtual uint32_t getFlags() const
Returns the flags for this section.
Definition: EncoreBootImage.h:1029
uint32_t m_argument
Sole argument to pass to code.
Definition: EncoreBootImage.h:879
Abstract base class for all bootloader commands.
Definition: EncoreBootImage.h:386
uint32_t m_memSpace
ID of memory space, e.g. 1=IFR0.
Definition: EncoreBootImage.h:826
Progress reports are verbose.
Definition: EncoreBootImage.h:108
key_list_t::const_iterator const_key_iterator_t
Const iterator over KEKs.
Definition: EncoreBootImage.h:1191
version_t m_productVersion
Product version.
Definition: EncoreBootImage.h:177
uint32_t m_ivtSize
Whether this jump call has an initial stack pointer set.
Definition: EncoreBootImage.h:884
bool m_loadDCD
Whether to execute the DCD after loading.
Definition: EncoreBootImage.h:608
No operation bootloader command.
Definition: EncoreBootImage.h:480
cipher_block_t m_mac
CBC-MAC of the header.
Definition: EncoreBootImage.h:189
EncoreBootImage * getImage() const
Returns a pointer to the image that this section belongs to.
Definition: EncoreBootImage.h:1039
This tag command is the last one in the image.
Definition: EncoreBootImage.h:280
uint32_t m_sectionIdentifier
Unique identifier for the section containing this command.
Definition: EncoreBootImage.h:542
bool m_leaveUnencrypted
Set to true to prevent this section from being encrypted.
Definition: EncoreBootImage.h:1066
uint8_t m_padding0[2]
Padding to align m_timestamp to long word.
Definition: EncoreBootImage.h:173
Erase all unsecure (available on some Kinetis parts).
Definition: EncoreBootImage.h:322
BootSection(uint32_t identifier)
Constructor taking the unique identifier for this section.
Definition: EncoreBootImage.h:1087
The section contains bootloader commands.
Definition: EncoreBootImage.h:202
command_list_t m_commands
Commands held in this section.
Definition: EncoreBootImage.h:1132
Change boot mode command.
Definition: EncoreBootImage.h:270
virtual void debugPrint() const
Print out a string representation of the object.
Definition: EncoreBootImage.cpp:513
uint16_t m_keyCount
Number of entries in DEK dictionary.
Definition: EncoreBootImage.h:168
bool getLeaveUnencrypted() const
Returns true if the section will remain unencrypted.
Definition: EncoreBootImage.h:1058
uint32_t m_flags
Section flags set by the user.
Definition: EncoreBootImage.h:1065
Bit position of mem controller ID.
Definition: EncoreBootImage.h:308
BootSection()
Default constructor.
Definition: EncoreBootImage.h:1081
void addSection(Section *newSection)
Definition: EncoreBootImage.cpp:43
Memory Enable command.
Definition: EncoreBootImage.h:273
Section()
Default constructor.
Definition: EncoreBootImage.h:993
unsigned m_padCount
Number of pad bytes.
Definition: EncoreBootImage.h:605
An index of all sections within the boot image.
Definition: EncoreBootImage.h:235
uint32_t m_dataWord1
First 4 bytes to write.
Definition: EncoreBootImage.h:824
section_list_t::iterator section_iterator_t
Iterator over sections.
Definition: EncoreBootImage.h:1186
Bit mask for mem space ID.
Definition: EncoreBootImage.h:314
Abstract base class for all boot image format classes.
Definition: BootImage.h:25
virtual unsigned getDataBlocks(unsigned offset, unsigned maxCount, cipher_block_t *data)
Returns the contents of up to maxCount data blocks.
Definition: EncoreBootImage.h:459
Pattern fill bootloader command.
Definition: EncoreBootImage.h:617
uint32_t m_mode
New boot mode.
Definition: EncoreBootImage.h:694
Program persistent bits bootloader command.
Definition: EncoreBootImage.h:763
uint32_t m_length
Size of section data in blocks.
Definition: EncoreBootImage.h:213
smart_array_ptr< uint8_t > m_data
Pointer to data to load.
Definition: EncoreBootImage.h:603
Initial stack pointer is specified for jump command.
Definition: EncoreBootImage.h:301
uint16_t m_flags
Flags or options associated with the entire image.
Definition: EncoreBootImage.h:164
uint32_t m_address
Fill start address.
Definition: EncoreBootImage.h:655
The section is unencrypted. Applies only if the rest of the boot image is encrypted.
Definition: EncoreBootImage.h:203
Jump to address bootloader command.
Definition: EncoreBootImage.h:832
uint64_t getTimestamp()
Definition: EncoreBootImage.cpp:394
Same version struct used for 3600 boot image.
Definition: Version.h:16
smart_array_ptr< uint8_t > m_data
The section's contents.
Definition: EncoreBootImage.h:1180
Reset target bootloader command.
Definition: EncoreBootImage.h:908
NopCommand()
Default constructor.
Definition: EncoreBootImage.h:484
JumpCommand()
Default constructor.
Definition: EncoreBootImage.h:836
CallCommand()
Default constructor.
Definition: EncoreBootImage.h:894
Load data bootloader command.
Definition: EncoreBootImage.h:551
uint8_t m_signature2[4]
Definition: EncoreBootImage.h:174
uint32_t m_sectionFlags
Flags pertaining to this section.
Definition: EncoreBootImage.h:544
unsigned getCommandCount() const
Returns the number of commands in this section, excluding the tag command.
Definition: EncoreBootImage.h:1112
virtual uint8_t getTag() const
Returns the tag value for this command.
Definition: EncoreBootImage.h:900
uint32_t m_address
Address to which data will be loaded.
Definition: EncoreBootImage.h:607
uint16_t m_flags
Flags for this command.
Definition: EncoreBootImage.h:253
uint32_t m_offset
Offset to section data from start of image in blocks.
Definition: EncoreBootImage.h:212
virtual std::string getFileExtension() const
Returns the preferred ".sb" extension for Encore boot images.
Definition: EncoreBootImage.h:1244
virtual void writeToStream(std::ostream &stream)
Write the boot image to an output stream.
Definition: EncoreBootImage.cpp:84
uint8_t m_tag
Tag telling which command this is.
Definition: EncoreBootImage.h:252
uint32_t m_data
Additional data used by certain commands.
Definition: EncoreBootImage.h:256
Section * findFirstBootableSection()
Definition: EncoreBootImage.cpp:410
virtual unsigned getBlocks(unsigned offset, unsigned maxCount, cipher_block_t *data)
Returns the contents of up to maxCount cipher blocks.
Definition: EncoreBootImage.h:376
ModeCommand()
Default constructor.
Definition: EncoreBootImage.h:667
bool m_isHAB
Definition: EncoreBootImage.h:881
uint16_t m_sectionHeaderSize
Size in blocks of a section header.
Definition: EncoreBootImage.h:172
Execute the DCD after loading completes.
Definition: EncoreBootImage.h:286
External QuadSpi controller.
Definition: EncoreBootImage.h:334
uint16_t m_headerBlocks
Size of this header, including this size word, in blocks.
Definition: EncoreBootImage.h:170
uint32_t m_imageBlocks
Size of entire image in blocks.
Definition: EncoreBootImage.h:165
Current boot image minor version.
Definition: EncoreBootImage.h:118
uint32_t m_address
Target address.
Definition: EncoreBootImage.h:254
unsigned m_length
Number of bytes of data.
Definition: EncoreBootImage.h:1181
uint32_t m_flags
Section flags.
Definition: EncoreBootImage.h:214
uint64_t m_timestamp
Timestamp when image was generated in microseconds since 1-1-2000.
Definition: EncoreBootImage.h:176
uint8_t m_checksum
Simple checksum over other command fields.
Definition: EncoreBootImage.h:251
A no-op command.
Definition: EncoreBootImage.h:264
Bit mask for mem controller ID.
Definition: EncoreBootImage.h:307