Skip to content

Commit

Permalink
[REL] Rebuild for v5.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Heng <hengjie1989@foxmail.com>
  • Loading branch information
JayHeng committed May 23, 2023
1 parent c06cc4a commit e8d68a0
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 47 deletions.
Binary file modified bin/NXP-MCUBootUtility.exe
Binary file not shown.
Binary file modified img/RTyyyy_container/i.MX RT1180 image layout.pptx
Binary file not shown.
Binary file added img/RTyyyy_container/sdmmc_image_unsigned.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 43 additions & 21 deletions src/gen/RTyyyy_gencore.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,21 @@ def _setDestAppInitialBootHeaderInfo( self, bootDevice ):
self.destAppInitialLoadSize = RTyyyy_gendef.kInitialLoadSize_NOR
elif bootDevice == RTyyyy_uidef.kBootDevice_FlexspiNand or \
bootDevice == RTyyyy_uidef.kBootDevice_SemcNand or \
bootDevice == RTyyyy_uidef.kBootDevice_UsdhcSd or \
bootDevice == RTyyyy_uidef.kBootDevice_UsdhcMmc or \
bootDevice == RTyyyy_uidef.kBootDevice_LpspiNor:
self.destAppIvtOffset = RTyyyy_gendef.kIvtOffset_NAND_SD_EEPROM
self.destAppInitialLoadSize = RTyyyy_gendef.kInitialLoadSize_NAND_SD_EEPROM
if self.tgt.bootHeaderType == gendef.kBootHeaderType_Container:
self.destAppContainerOffset = RTyyyy_gendef.kContainerOffset_NAND_EEPROM
self.destAppInitialLoadSize = RTyyyy_gendef.kFirstLoadSize_NAND_EEPROM
elif self.tgt.bootHeaderType == gendef.kBootHeaderType_IVT:
self.destAppIvtOffset = RTyyyy_gendef.kIvtOffset_NAND_SD_EEPROM
self.destAppInitialLoadSize = RTyyyy_gendef.kInitialLoadSize_NAND_SD_EEPROM
elif bootDevice == RTyyyy_uidef.kBootDevice_UsdhcSd or \
bootDevice == RTyyyy_uidef.kBootDevice_UsdhcMmc:
if self.tgt.bootHeaderType == gendef.kBootHeaderType_Container:
self.destAppContainerOffset = RTyyyy_gendef.kContainerOffset_SD
self.destAppInitialLoadSize = RTyyyy_gendef.kFirstLoadSize_SD
elif self.tgt.bootHeaderType == gendef.kBootHeaderType_IVT:
self.destAppIvtOffset = RTyyyy_gendef.kIvtOffset_NAND_SD_EEPROM
self.destAppInitialLoadSize = RTyyyy_gendef.kInitialLoadSize_NAND_SD_EEPROM
elif bootDevice == RTyyyy_uidef.kBootDevice_RamFlashloader:
self.destAppIvtOffset = RTyyyy_gendef.kIvtOffset_RAM_FLASHLOADER
self.destAppInitialLoadSize = RTyyyy_gendef.kInitialLoadSize_RAM_FLASHLOADER
Expand Down Expand Up @@ -1158,30 +1168,42 @@ def _RTyyyy_signPartOfImage( self ):
return True

def _genCompleteContainerData( self, imageData ):
containerStruct = uiheader.containerStruct()
if self.bootDevice == RTyyyy_uidef.kBootDevice_FlexspiNor:
containerStruct = uiheader.containerStruct()
containerStruct.set_members(self.tgt.flexspiNorMemBase, self.destAppExecAddr, imageData)
return containerStruct.out_bytes_str()
elif self.bootDevice == RTyyyy_uidef.kBootDevice_UsdhcSd or \
self.bootDevice == RTyyyy_uidef.kBootDevice_UsdhcMmc:
containerStruct.set_members(0, self.destAppExecAddr, imageData)
return containerStruct.out_bytes_str()
return None

def _genCompleteAppWithContainer( self ):
if self.bootDevice == RTyyyy_uidef.kBootDevice_FlexspiNor:
imageDataBytes = None
with open(self.destAppRawBinFilename, 'rb') as fileObj:
imageDataBytes = fileObj.read()
fileObj.close()
containerDataBytes = self._genCompleteContainerData(imageDataBytes)
paddingByteNum = self.destAppVectorOffset -(RTyyyy_gendef.kContainerOffset_NOR + RTyyyy_memdef.kMemBlockSize_Container)
if paddingByteNum > 0:
paddingBytes = [0xFF] * paddingByteNum
paddingBytesStr = ''
for i in range(len(paddingBytes)):
paddingBytesStr += chr(paddingBytes[i])
containerDataBytes += paddingBytesStr
finalBtAppData = containerDataBytes + imageDataBytes
with open(self.destAppContainerFilename, 'wb') as fileObj:
fileObj.write(finalBtAppData)
fileObj.close()
pass
elif self.bootDevice == RTyyyy_uidef.kBootDevice_UsdhcSd or \
self.bootDevice == RTyyyy_uidef.kBootDevice_UsdhcMmc:
self._setDestAppFinalBootHeaderInfo(self.bootDevice)
else:
return
imageDataBytes = None
with open(self.destAppRawBinFilename, 'rb') as fileObj:
imageDataBytes = fileObj.read()
fileObj.close()
containerDataBytes = self._genCompleteContainerData(imageDataBytes)
paddingByteNum = self.destAppVectorOffset - self.destAppInitialLoadSize
#self.printDeviceStatus("destAppVectorOffset = " + str(hex(self.destAppVectorOffset)))
#self.printDeviceStatus("destAppInitialLoadSize = " + str(hex(self.destAppInitialLoadSize)))
if paddingByteNum > 0:
paddingBytes = [0xFF] * paddingByteNum
paddingBytesStr = ''
for i in range(len(paddingBytes)):
paddingBytesStr += chr(paddingBytes[i])
containerDataBytes += paddingBytesStr
finalBtAppData = containerDataBytes + imageDataBytes
with open(self.destAppContainerFilename, 'wb') as fileObj:
fileObj.write(finalBtAppData)
fileObj.close()

def RTyyyy_genBootableImage( self ):
if self.tgt.bootHeaderType == gendef.kBootHeaderType_IVT:
Expand Down
9 changes: 8 additions & 1 deletion src/gen/RTyyyy_gendef.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,12 @@
kSbFileType_Efuse = 0x2


kContainerOffset_NOR = 0x1000
kContainerOffset_NAND_EEPROM = 0x400
kContainerOffset_SD = 0x800
kContainerOffset_NOR = 0x1000
kContainerOffset_RAM_FLASHLOADER = 0x400

kFirstLoadSize_NAND_EEPROM = 0x2400
kFirstLoadSize_SD = 0x2800
kFirstLoadSize_NOR = 0x3000

12 changes: 8 additions & 4 deletions src/mem/RTyyyy_memcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,14 @@ def _showOneLineContentForContainerType( self, addr, imageMemBase, contentToShow
if (self.isXipableDevice and addr <= imageMemBase + self.tgt.xspiNorCfgInfoOffset):
self.printMem(contentToShow)
elif (self.isXipableDevice and addr <= imageMemBase + self.tgt.xspiNorCfgInfoOffset + RTyyyy_memdef.kMemBlockSize_FDCB) or (addr <= imageMemBase + RTyyyy_memdef.kMemBlockSize_FDCB):
if self.needToShowCfgIntr:
self.printMem('------------------------------------FDCB----------------------------------------------', RTyyyy_uidef.kMemBlockColor_FDCB)
self.needToShowCfgIntr = False
self.printMem(contentToShow, RTyyyy_uidef.kMemBlockColor_FDCB)
if not self.isSdmmcCard:
if self.needToShowCfgIntr:
self.printMem('------------------------------------FDCB----------------------------------------------', RTyyyy_uidef.kMemBlockColor_FDCB)
self.needToShowCfgIntr = False
self.printMem(contentToShow, RTyyyy_uidef.kMemBlockColor_FDCB)
else:
if addr >= self.bootDeviceMemBase + RTyyyy_memdef.kMemBlockSize_MBRDPT:
self.printMem(contentToShow)
elif addr <= imageMemBase + self.destAppContainerOffset:
self.printMem(contentToShow)
elif addr <= imageMemBase + self.destAppContainerOffset + uiheader.kContainerBlockSize_CntHdr:
Expand Down
17 changes: 14 additions & 3 deletions src/run/RTyyyy_runcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,9 @@ def _programFlexspiNorOtfadKeyBlob( self ):

def RTyyyy_flashBootableImage ( self ):
self._RTyyyy_prepareForBootDeviceOperation()
imageLen = os.path.getsize(self.destAppFilename)
imageLen = 0
if self.tgt.bootHeaderType == gendef.kBootHeaderType_IVT:
imageLen = os.path.getsize(self.destAppFilename)
if self.bootDevice == RTyyyy_uidef.kBootDevice_SemcNand:
semcNandOpt, semcNandFcbOpt, semcNandImageInfoList = uivar.getBootDeviceConfiguration(self.bootDevice)
memEraseLen = misc.align_up(imageLen, self.comMemEraseUnit)
Expand Down Expand Up @@ -1560,8 +1562,17 @@ def RTyyyy_flashBootableImage ( self ):
return False
elif self.bootDevice == RTyyyy_uidef.kBootDevice_UsdhcSd or \
self.bootDevice == RTyyyy_uidef.kBootDevice_UsdhcMmc:
headerOffset = 0
destAppFileToLoad = None
if self.tgt.bootHeaderType == gendef.kBootHeaderType_IVT:
headerOffset = RTyyyy_gendef.kIvtOffset_NAND_SD_EEPROM
destAppFileToLoad = self.destAppNoPaddingFilename
elif self.tgt.bootHeaderType == gendef.kBootHeaderType_Container:
headerOffset = RTyyyy_gendef.kContainerOffset_SD
destAppFileToLoad = self.destAppContainerFilename
imageLen = os.path.getsize(destAppFileToLoad) + headerOffset
memEraseLen = misc.align_up(imageLen, self.comMemEraseUnit)
imageLoadAddr = self.bootDeviceMemBase + RTyyyy_gendef.kIvtOffset_NAND_SD_EEPROM
imageLoadAddr = self.bootDeviceMemBase + headerOffset
if self.isSbFileEnabledToGen:
self._RTyyyy_addFlashActionIntoSbAppBdContent(" erase " + self.sbAccessBootDeviceMagic + " " + self.convertLongIntHexText(str(hex(imageLoadAddr))) + ".." + self.convertLongIntHexText(str(hex(imageLoadAddr + memEraseLen))) + ";\n")
self._RTyyyy_addFlashActionIntoSbAppBdContent(" load " + self.sbAccessBootDeviceMagic + " myBinFile > " + self.convertLongIntHexText(str(hex(imageLoadAddr))) + ";\n")
Expand All @@ -1570,7 +1581,7 @@ def RTyyyy_flashBootableImage ( self ):
self.printLog(cmdStr)
if status != boot.status.kStatus_Success:
return False
status, results, cmdStr = self.blhost.writeMemory(imageLoadAddr, self.destAppNoPaddingFilename, self.bootDeviceMemId)
status, results, cmdStr = self.blhost.writeMemory(imageLoadAddr, destAppFileToLoad, self.bootDeviceMemId)
self.printLog(cmdStr)
if status != boot.status.kStatus_Success:
return False
Expand Down
4 changes: 3 additions & 1 deletion src/targets/MIMXRT1189/bltargetconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
availableSecureBootTypes = [RTyyyy_uidef.kSecureBootType_Development
]
hasRemappedFuse = False
availableBootDevices = [RTyyyy_uidef.kBootDevice_FlexspiNor]
availableBootDevices = [RTyyyy_uidef.kBootDevice_FlexspiNor,
RTyyyy_uidef.kBootDevice_UsdhcSd,
RTyyyy_uidef.kBootDevice_UsdhcMmc]
flexspiNorDevice = uidef.kFlexspiNorDevice_ISSI_IS25LP064A
flexspiNorMemBase0 = 0x38000000
flexspiNorMemBase1 = 0x04000000
Expand Down
10 changes: 5 additions & 5 deletions src/ui/uiheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def __init__( self, parent=None):
self.hash = [0x0] * 64
self.iv = [0x0] * 32

def set_members( self, flexspiMapStart, imageExecAddr, imageData ):
if (flexspiMapStart & 0xFF000000) == (imageExecAddr & 0xFF000000):
self.offset = imageExecAddr - flexspiMapStart - RTyyyy_gendef.kContainerOffset_NOR
def set_members( self, deviceMapStart, imageExecAddr, imageData ):
if (deviceMapStart & 0xFF000000) == (imageExecAddr & 0xFF000000):
self.offset = imageExecAddr - deviceMapStart - RTyyyy_gendef.kContainerOffset_NOR
else:
self.offset = RTyyyy_memdef.kMemBlockSize_Container
self.size = len(imageData)
Expand Down Expand Up @@ -195,9 +195,9 @@ def __init__( self, parent=None):
self.imgEntryStruct = imgEntryStruct()
self.signBlockStruct = signBlockStruct()

def set_members( self, flexspiMapStart, imageExecAddr, imageData):
def set_members( self, deviceMapStart, imageExecAddr, imageData):
self.cntHdrStruct.set_members(1)
self.imgEntryStruct.set_members(flexspiMapStart, imageExecAddr, imageData)
self.imgEntryStruct.set_members(deviceMapStart, imageExecAddr, imageData)
self.signBlockStruct.set_members()

def out_bytes_str( self ):
Expand Down
22 changes: 10 additions & 12 deletions src/ui/uilang.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,30 +775,28 @@
" Feature: \n" + \
" 1. [Kinetis] Support MKE13Z/14Z/15Z/17Z \n" + \
" 2. [Kinetis] Support MKW45/K32W148 \n" + \
" 3. Support two more Octal NOR devices (ISSI, Winbond) \n" + \
" \n\n"
" 3. Support two more Octal NOR devices (ISSI, Winbond) \n\n"
kRevision_4_1_0_zh = u"【v4.1.0】 \n" + \
u" 特性: \n" + \
u" 1. [Kinetis] 支持MKE13Z/14Z/15Z/17Z \n" + \
u" 2. [Kinetis] 支持MKW45/K32W148 \n" + \
u" 3. 支持来自ISSI和Winbond的Octal Flash \n" + \
u" \n\n"
u" 3. 支持来自ISSI和Winbond的Octal Flash \n\n"
kRevision_4_1_1_en = "【v4.1.1】 \n" + \
" Bugfix: \n" + \
" 1. [RTyyyy] It doesn't take effect in DCD Descriptor window \n" + \
" \n\n"
" 1. [RTyyyy] It doesn't take effect in DCD Descriptor window \n\n"
kRevision_4_1_1_zh = u"【v4.1.1】 \n" + \
u" 修复: \n" + \
u" 1. [RTyyyy] 在DCD Desc窗口输入内容不生效\n" + \
u" \n\n"
u" 1. [RTyyyy] 在DCD Desc窗口输入内容不生效 \n\n"
kRevision_5_0_0_en = "【v5.0.0】 \n" + \
" Feature: \n" + \
" 1. [RTyyyy] Support i.MXRT118x A0\n" + \
" \n\n"
" 1. [RTyyyy] Support i.MXRT118x A0 \n" + \
" 2. [RT1180] Support FlexSPI NOR boot device \n" + \
" 3. [RT1180] Support uSDHC SD&MMC boot device \n\n"
kRevision_5_0_0_zh = u"【v5.0.0】 \n" + \
u" 特性: \n" + \
u" 1. [RTyyyy] 支持i.MXRT118x A0\n" + \
u" \n\n"
u" 1. [RTyyyy] 支持i.MXRT118x A0 \n" + \
u" 2. [RT1180] 支持FlexSPI NOR启动设备 \n" + \
u" 3. [RT1180] 支持uSDHC SD&MMC启动设备 \n\n"

kMsgLanguageContentDict = {
'homePage_title': ['Home Page', u"项目主页"],
Expand Down

0 comments on commit e8d68a0

Please sign in to comment.