From patchwork Mon Mar 20 13:11:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenhui Sun X-Patchwork-Id: 95536 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp937409qgd; Mon, 20 Mar 2017 06:18:19 -0700 (PDT) X-Received: by 10.107.62.68 with SMTP id l65mr31935046ioa.213.1490015899776; Mon, 20 Mar 2017 06:18:19 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y126si10625587itf.109.2017.03.20.06.18.19; Mon, 20 Mar 2017 06:18:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2EEFA63E7B; Mon, 20 Mar 2017 13:18:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BC4D463E9E; Mon, 20 Mar 2017 13:15:59 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C6E0563E89; Mon, 20 Mar 2017 13:15:55 +0000 (UTC) Received: from mail-pg0-f42.google.com (mail-pg0-f42.google.com [74.125.83.42]) by lists.linaro.org (Postfix) with ESMTPS id 57E4D63E74 for ; Mon, 20 Mar 2017 13:15:17 +0000 (UTC) Received: by mail-pg0-f42.google.com with SMTP id 21so44055320pgg.1 for ; Mon, 20 Mar 2017 06:15:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v4Q1H8d/RZ8d17xhiIPREIT3XnNFue0bBgxUXS0nqr8=; b=rgTDvLgd+HsN/rz7MknI6Ke8nwYnGogiwVN2bjJCh7ElJaCnQmW138wSTsmmIUw2Dt mJ/Q9AKPI2g6lQ3iX+D+NETUO2N3F+kDTE5EzJt3goDNqPP5UWUFULxMCqHdlAFyIAjs s0I32fk7y9UkjMTlw32BQveQavG8q5kHL6yoz+o3IcNOtQJ51HY4tXrBahR94kOED5bX 1YeCW0Cx/8hZKrk9tu8OLrUEiEKHSE7MiVzcq2Tpu+pUVKTiA1AtVK7wcIrdvrTLBF/C o4QA4ojZpW1MeTfSdJRLFXWGmCNML2h0s+H9VCELgl81CjqkoTEE+rfmNIuGuAKF5HzU Ylcw== X-Gm-Message-State: AFeK/H2NuerB1oiE6d12nXfbhuKkU+9a1SLqLFMS+q8sOBhB77GGfqrWZsRDpweTBsZdmjQu5nw= X-Received: by 10.98.54.196 with SMTP id d187mr33335539pfa.33.1490015716615; Mon, 20 Mar 2017 06:15:16 -0700 (PDT) Received: from localhost.localdomain ([119.145.15.121]) by smtp.gmail.com with ESMTPSA id a62sm33573787pgc.60.2017.03.20.06.15.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Mar 2017 06:15:16 -0700 (PDT) From: Chenhui Sun To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org Date: Mon, 20 Mar 2017 21:11:14 +0800 Message-Id: <1490015485-53685-11-git-send-email-chenhui.sun@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490015485-53685-1-git-send-email-chenhui.sun@linaro.org> References: <1490015485-53685-1-git-send-email-chenhui.sun@linaro.org> Cc: Yi Li , Chenhui Sun , wanglijun , sunchenhui@huawei.com, wanghuiqiang@huawei.com Subject: [Linaro-uefi] [Linaro-uefi v1 10/21] Hisilicon: Add Reset interface for block IO protocol X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" 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 Signed-off-by: Heyi Guo Signed-off-by: Yi Li --- Chips/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.c | 12 ++++++++++++ Drivers/Block/ramdisk/ramdisk.c | 12 ++++++++++++ 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; } +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);