Hi,
I am trying to port edk2 to our ARM64 platform simulator and seeing strange behaviour.
I see the content of FdtDevicePath is getting changed, after executing the function BdsLoadImage() to load the Linux Image file. Because of this, when BdsLoadImage function is called to load the fdt.dtb file, the execution goes in infinite loop.
After debugging, i am seeing that, it is happenig due to corrution of FDT device path.
Before the BdsLoadImage() called to load Linux Image file, the FDT device path(0xFBC8B918) content is valid, ie DevicePathFdt->Type = 1. DevicePathFdt ->SubType= 4. DevicePathFdt->Lenght[0] = 20.
After the Linux Image is loaded, it is changes as below, DevicePathFdt->Type = 112 DevicePathFdt ->SubType= 111 DevicePathFdt->Lenght[0] = 100
further debugging, i see this happening by below lines of code, in function CoreLocateHandle(), MdeModulePkg/Core/Dxe/Hand/Locate.c
// // Increase the resulting buffer size, and if this handle // fits return it // ResultSize += sizeof(Handle); if (ResultSize <= *BufferSize) { *ResultBuffer = Handle; <= this line is corrupting the devicepath of FDT. ResultBuffer += 1; } }
Not able to understand what causing this corruption. Any clue on what is going wrong? Any suggestions for further debugging?
BTW, I am using edk2 source from git://git.linaro.org/uefi/linaro-edk2.git, branch master
thanks Ganapat