Message ID | 1490015485-53685-11-git-send-email-chenhui.sun@linaro.org |
---|---|
State | New |
Headers | show |
Series | D02/D03 platforms bug fix | expand |
On Mon, Mar 20, 2017 at 09:11:14PM +0800, Chenhui Sun wrote: > Add Reset interface for block IO protocol to make it compliant with > UEFI specification, or it will cause exception when the interface > is called. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: wanglijun <wanglijun@huawei.com> > Signed-off-by: Heyi Guo <heyi.guo@linaro.org> > Signed-off-by: Yi Li <phoenix.liyi@huawei.com> > --- > Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c | 12 ++++++++++++ > Drivers/Block/ramdisk/ramdisk.c | 12 ++++++++++++ These are two completely unrelated drivers - could they be split up into separate patches? > 2 files changed, 24 insertions(+) > > diff --git a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c > index 544228a..d118a90 100644 > --- a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c > +++ b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c > @@ -444,6 +444,17 @@ FvbGetBlockSize ( > return Status; > } > STATIC > +EFI_STATUS > +EFIAPI > +FvbReset( > + IN EFI_BLOCK_IO_PROTOCOL *This, > + IN BOOLEAN ExtendedVerification > +) > +{ > + return EFI_SUCCESS; > +} > + > + > /** > Reads the specified number of bytes into a buffer from the specified block. > > @@ -921,6 +932,7 @@ FlashCreateInstance ( > Instance->Size = FlashSize; > > Instance->BlockIoProtocol.Media = &Instance->Media; > + Instance->BlockIoProtocol.Reset = FvbReset; > Instance->Media.MediaId = MediaId; > Instance->Media.BlockSize = BlockSize; > Instance->Media.LastBlock = (FlashSize / BlockSize) - 1; > diff --git a/Drivers/Block/ramdisk/ramdisk.c b/Drivers/Block/ramdisk/ramdisk.c > index 21e090b..bd2607d 100644 > --- a/Drivers/Block/ramdisk/ramdisk.c > +++ b/Drivers/Block/ramdisk/ramdisk.c > @@ -200,6 +200,17 @@ UINT8 TestSize(UINT32 ts) > > EFI_SYSTEM_TABLE BackupSystemTable; > STATIC > +EFI_STATUS > +EFIAPI > +RamDiskReset( > + IN EFI_BLOCK_IO_PROTOCOL *This, > + IN BOOLEAN ExtendedVerification > +) > +{ > + return EFI_SUCCESS; > +} > + > + > /* > * Entry point for RamDisk driver. > */ > @@ -274,6 +285,7 @@ EFI_STATUS InitializeRamDiskDriver( > RamDiskDev->BlkIo.ReadBlocks = RamDiskReadBlocks; > RamDiskDev->BlkIo.WriteBlocks = RamDiskWriteBlocks; > RamDiskDev->BlkIo.FlushBlocks = RamDiskFlushBlocks; > + RamDiskDev->BlkIo.Reset = RamDiskReset; > > RamDiskDev->DevicePath = DuplicateDevicePath((EFI_DEVICE_PATH*)&RamDiskDevicePath); > > -- > 1.9.1 > / Leif
diff --git a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c index 544228a..d118a90 100644 --- a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c +++ b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c @@ -444,6 +444,17 @@ FvbGetBlockSize ( return Status; } +EFI_STATUS +EFIAPI +FvbReset( + IN EFI_BLOCK_IO_PROTOCOL *This, + IN BOOLEAN ExtendedVerification +) +{ + return EFI_SUCCESS; +} + + /** Reads the specified number of bytes into a buffer from the specified block. @@ -921,6 +932,7 @@ FlashCreateInstance ( Instance->Size = FlashSize; Instance->BlockIoProtocol.Media = &Instance->Media; + Instance->BlockIoProtocol.Reset = FvbReset; Instance->Media.MediaId = MediaId; Instance->Media.BlockSize = BlockSize; Instance->Media.LastBlock = (FlashSize / BlockSize) - 1; diff --git a/Drivers/Block/ramdisk/ramdisk.c b/Drivers/Block/ramdisk/ramdisk.c index 21e090b..bd2607d 100644 --- a/Drivers/Block/ramdisk/ramdisk.c +++ b/Drivers/Block/ramdisk/ramdisk.c @@ -200,6 +200,17 @@ UINT8 TestSize(UINT32 ts) EFI_SYSTEM_TABLE BackupSystemTable; +EFI_STATUS +EFIAPI +RamDiskReset( + IN EFI_BLOCK_IO_PROTOCOL *This, + IN BOOLEAN ExtendedVerification +) +{ + return EFI_SUCCESS; +} + + /* * Entry point for RamDisk driver. */ @@ -274,6 +285,7 @@ EFI_STATUS InitializeRamDiskDriver( RamDiskDev->BlkIo.ReadBlocks = RamDiskReadBlocks; RamDiskDev->BlkIo.WriteBlocks = RamDiskWriteBlocks; RamDiskDev->BlkIo.FlushBlocks = RamDiskFlushBlocks; + RamDiskDev->BlkIo.Reset = RamDiskReset; RamDiskDev->DevicePath = DuplicateDevicePath((EFI_DEVICE_PATH*)&RamDiskDevicePath);