Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
EncoreBootImageGenerator.h
1 /*
2  * File: EncoreBootImageGenerator.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_EncoreBootImageGenerator_h_)
8 #define _EncoreBootImageGenerator_h_
9 
10 #include "BootImageGenerator.h"
11 #include "EncoreBootImage.h"
12 #include "Keyblob.h"
13 
14 namespace elftosb
15 {
26 {
27 public:
31  , m_encryptKeyBlob(NULL)
32  {
33  }
34 
36  virtual BootImage *generate();
37 
39  void setSupportHAB(bool supportHAB) { m_supportHAB = supportHAB; }
40 protected:
41  bool m_supportHAB;
43 
44  void processOptions(EncoreBootImage *image);
45  void processSectionOptions(EncoreBootImage::Section *imageSection, OutputSection *modelSection);
46 
47  void processOperationSection(OperationSequenceSection *section, EncoreBootImage *image);
48  void processDataSection(BinaryDataSection *section, EncoreBootImage *image);
49 
50  void processLoadOperation(LoadOperation *op, EncoreBootImage::BootSection *section);
51  void processExecuteOperation(ExecuteOperation *op, EncoreBootImage::BootSection *section);
52  void processBootModeOperation(BootModeOperation *op, EncoreBootImage::BootSection *section);
53  void processFlashEraseOperation(FlashEraseOperation *op, EncoreBootImage::BootSection *section);
54  void processResetOperation(ResetOperation *op, EncoreBootImage::BootSection *section);
55  void processMemEnableOperation(MemEnableOperation *op, EncoreBootImage::BootSection *section);
56  void processProgramOperation(ProgramOperation *op, EncoreBootImage::BootSection *section);
57  void processKeywrapOperation(KeywrapOperation *op, EncoreBootImage::BootSection *section);
58  void processEncryptOperation(EncryptOperation *op, EncoreBootImage::BootSection *section);
59 
60  void setFillPatternFromValue(EncoreBootImage::FillCommand &command, SizedIntegerValue &pattern);
61 };
62 
63 }; // namespace elftosb
64 
65 #endif // _EncoreBootImageGenerator_h_
Operation to encrypt data for OTFAD.
Definition: Operation.h:293
bool m_supportHAB
True if HAB features are enabled.
Definition: EncoreBootImageGenerator.h:41
Operation to program persistent bits.
Definition: Operation.h:241
Base class for a section of an Encore boot image.
Definition: EncoreBootImage.h:989
A bootable section of an Encore boot image.
Definition: EncoreBootImage.h:1072
A section of the output that contains boot operations.
Definition: OutputSection.h:51
Operation to reset the device.
Definition: Operation.h:133
Operation to execute code at a certain address.
Definition: Operation.h:58
Operation to enable external memory access.
Definition: Operation.h:212
Class to manage Encore boot image files.
Definition: EncoreBootImage.h:101
Operation to erase flash memory.
Definition: Operation.h:145
Operation to wrap and program keys.
Definition: Operation.h:267
Adds a word size attribute to IntegerValue.
Definition: apps/elftosb/common/Value.h:72
A section of the output file that contains arbitrary binary data.
Definition: OutputSection.h:71
Generator for Encore boot images.
Definition: EncoreBootImageGenerator.h:25
Definition: BootImage.h:13
virtual BootImage * generate()
Builds the resulting boot image from previously added output sections.
Definition: EncoreBootImageGenerator.cpp:22
Keyblob specification.
Definition: Keyblob.h:27
EncoreBootImageGenerator()
Default constructor.
Definition: EncoreBootImageGenerator.h:29
Operation to switch boot modes.
Definition: Operation.h:115
Abstract base class for all boot image format classes.
Definition: BootImage.h:25
Pattern fill bootloader command.
Definition: EncoreBootImage.h:617
void setSupportHAB(bool supportHAB)
Enable or disable HAB support.
Definition: EncoreBootImageGenerator.h:39
Abstract base class for generators of specific boot image formats.
Definition: BootImageGenerator.h:33
Keyblob * m_encryptKeyBlob
Keyblob to use during load if encrypting for OTFAD.
Definition: EncoreBootImageGenerator.h:42
Load data into memory operation.
Definition: Operation.h:32
Base class for data model of sections of the output file.
Definition: OutputSection.h:20