Add warning if component is in CSME mapped flash region

On APL the last 256KB flash address space (4GB-256KB to 4GB) is
remapped to CSME SRAM read-only region. During stitching due to space
limitation, if a component gets pushed into this region, then direct
memory mapped access might not work since it will be decoded by CSME.
To access components within this region, SPI command based interfaces
has to be used instead of memory mapped interface.
This patch added warning message when this condition is detected in
the stitching process.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma 2019-05-17 12:14:13 -07:00
parent 2309a8f5fc
commit ddbf479f53
1 changed files with 10 additions and 1 deletions

View File

@ -458,6 +458,16 @@ def PatchFlashMap (ImageData, PlatformData = 0xffffffff):
if (Bp1.Offset + Bp1.Length - 0x1000) <= (Desc.Offset + Desc.Size) <= (Bp1.Offset + Bp1.Length):
raise Exception("Component '%s' offset is in bootloader reserved region, please try to reduce compoent size !" % CompBpdtDict[Desc.Sig])
Limit = Bp1.Offset + Bp1.Length - Bp0.Offset - 0x40000
for Idx in range (EntryNum):
Desc = FlashMapDesc.from_buffer (OutputImageData, Stage1AOffset + FlaMapOff + sizeof(FlashMap) + Idx * sizeof(FlashMapDesc))
if Desc.Sig == 'RSVD':
continue
# Last 256K flash space (4GB - 256KB to 4GB) is remapped to CSME read-only SRAM on APL
# Directly access is not available.
if Desc.Offset >= Limit or Desc.Offset + Desc.Size > Limit:
print "WARNING: Component '%s' in BP%d is located inside CSME memory mapped region, direct access might fail." % (Desc.Sig, Part)
print ("Flash map was patched successfully!")
return 0
@ -829,7 +839,6 @@ def CreateIfwiImage (IfwiIn, IfwiOut, BiosOut, PlatformData, NonRedundant, Stitc
('EPLD' , 'EPLD'),
('UVAR' , 'UVAR'),
('PLD' , 'PLD'),
]
if RedundantPayload: