Hi, all
I`m yangcheng, and I found this bug when using the edk2-platforms/Silicon/Synopsys/DesignWare/Drivers/DwEmmcDxe driver on my VisionFive2 development board, which does not support the CMO instruction set. There are many functions in DwEmmcDxe.c that call Cache operations. For example, the DwEmmcReadBlockData function below calls WriteBackDataCacheRange().
EFI_STATUS
DwEmmcReadBlockData (
IN EFI_MMC_HOST_PROTOCOL *This,
IN EFI_LBA Lba,
IN UINTN Length,
IN UINT32* Buffer
)
{
.......
WriteBackDataCacheRange (gpIdmacDesc, DescPages * EFI_PAGE_SIZE);
StartDma (Length);
Status = SendCommand (mDwEmmcCommand, mDwEmmcArgument);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to read data, mDwEmmcCommand:%x, mDwEmmcArgument:%x, Status:%r\n", mDwEmmcCommand, mDwEmmcArgument, Status));
goto out;
}
out:
// Restore Tpl
gBS->RestoreTPL (Tpl);
return Status;
}
Initially, I didn't set PcdRiscVFeatureOverride, so I got an illegal instruction exception. Then I set my PcdRiscVFeatureOverride to 0xFFFFFFFFFFFFFFFE to avoid using the CMO instruction set, and I got an ASSERT.
Most cross-platform driver codes may call Cache management operations. Modifying these driver codes may cost a lot, and I think we may need some better way than ASSERT.
_._,_._,_
Groups.io Links:
You receive all messages sent to this group.
View/Reply Online (#113404) |
|
Mute This Topic
| New Topic
Your Subscription |
Contact Group Owner |
Unsubscribe
[rebecca@openfw.io]
_._,_._,_