[Linaro-uefi,Linaro-uefi,v2,09/17] Hisilicon/FlashFvbDxe: Add Reset interface for block IO protocol

Message ID 1491046162-53797-10-git-send-email-chenhui.sun@linaro.org
State New
Headers show
Series
  • D03/D05 platforms bug fix
Related show

Commit Message

Chenhui Sun April 1, 2017, 11:29 a.m.
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: Heyi Guo <heyi.guo@linaro.org>
Signed-off-by: Yi Li <phoenix.liyi@huawei.com>
Signed-off-by: Chenhui Sun <chenhui.sun@linaro.org>
---
 Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Leif Lindholm April 6, 2017, 5:43 p.m. | #1
On Sat, Apr 01, 2017 at 07:29: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: Heyi Guo <heyi.guo@linaro.org>
> Signed-off-by: Yi Li <phoenix.liyi@huawei.com>
> Signed-off-by: Chenhui Sun <chenhui.sun@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

Pushed.

> ---
>  Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> index 544228a..7c6b64c 100644
> --- a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> +++ b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
> @@ -444,6 +444,18 @@ 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 +933,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;
> -- 
> 1.9.1
>

Patch hide | download patch | download mbox

diff --git a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
index 544228a..7c6b64c 100644
--- a/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
+++ b/Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c
@@ -444,6 +444,18 @@  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 +933,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;