From patchwork Tue Jul 24 07:08:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142716 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6933004ljj; Tue, 24 Jul 2018 00:15:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpco+5WTW4/wJC1GfipgFg2xuxctmcXbhbiBV0Pmxdjgqji24el+349GBiS7IET70k2JSZdn X-Received: by 2002:a65:5141:: with SMTP id g1-v6mr15032681pgq.418.1532416500358; Tue, 24 Jul 2018 00:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532416500; cv=none; d=google.com; s=arc-20160816; b=qLjE3twEHVLBxPnlKPPQGmOHWGVQfDj2fneggK31prwZ1hMvgT0Z8UIeURZsStExcG MbrTUFo42ug7RW7ysxdHvTyxfcmzKDQQL+Ptfpf/6t2UHkehLqdy6fZevYl1QOA5hH/H 8UmOfdZVguhnfrL/Mbc+OsoXia9dSRp6bfWqAae74/t549PIKh4vbbDwBn/L+DI8R0e4 +gVOqi7emyNNcZkVs/E+nJR4YuR1I+JgzNohliNb0i9gfPn0sKHdBH4P81pXtaPSEazA tPXpm5C8WVVmtjHJECmofWUXvrQAtuQ9t/swjH51P6uM0SJ1BSS3/BqHu6o0EiObpYhk F2EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=Y00SSeszTr9dEHREy+zlC7kdfuL2IAJbgnwIyn9wmJ4=; b=jrhxM6nvHHMnY9VNZrEzMfQxARbGvgVFDSvnt9Ialh45sPvKHK/0OzdH5C5wF9TrL8 PnSk5HepYBLS6Aczi5ckRCH9coq8CLYuy8itKUweE0eCLRfNXeTgKixlMO6Qfz4CM4N7 6+xy6aE3EP7luG3rtMEn/dmZhhRX7/BPlEcxOEoxhOIbHgEz4z27PpaW+arAA4QSLj13 FQudh786OKI15jiswouGYgWoYkoLQR4UIEfPdxS/BCpI8D5hORbjnmAPm5UhOkqdh4Hm kR6nFHUY1zvoBbf1W7DJYM/4NPKJKBAkR7cph0Md8gPSUgILIg1lKt4It5a3xACXkoXF kM1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QpcjoEaS; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id x16-v6si10844205pgf.311.2018.07.24.00.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 00:15:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QpcjoEaS; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D2568210C123B; Tue, 24 Jul 2018 00:14:59 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 83E83210C1234 for ; Tue, 24 Jul 2018 00:14:58 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id y10-v6so632659pfn.8 for ; Tue, 24 Jul 2018 00:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hgTfote7VpIRf+7hlLCR9LKD7DTp4QJPInM89hpPMwA=; b=QpcjoEaSKoPOHUp+z7M7P+5x0sT1MEf2EHUnIweu8sKfw50+D53kVHRDXIi78Y9wpm GU7dFqVxQ4vTzflU5QZJKeCZg0SetPLfqcsQt+3FSPHCwwkqrh3Y4DnSWb+73ImgrpGr qeIMIqO7Rhiqd8SpLjzrirR38qSzWGsVescNw= 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=hgTfote7VpIRf+7hlLCR9LKD7DTp4QJPInM89hpPMwA=; b=LtDIs+ad0xI0v89fmM454wrYs+/2aNfI2s+0T9VTMvXoJMiAw57K0WZPDAI1zjYFQ5 14JnrXe1Yee8noJWAbvQ4iju3hU29wRe5Su5ji7ug074hszEZajdG+cxlsVjpqEqX1Nq KEadTfy9GXQa4uEglLibRnTYTGGeFMVG+htisGRQVz2DMFZ6XsWWiJ/a24KEa0MT9dsP rw4aUTXL4RDgOh/srJrUSpSS3Eq1mvr6Zvr/q2fGuJ/3eIXtfpnD1g/fwiq4zpCP8QOS /lRxjqUD0vh9Fb7C1s4xf9qJQh+SbzUcY6L0BdXUDS/3bnEyILATXWeP4NtW0jBrSUFX TdaA== X-Gm-Message-State: AOUpUlFNGfNxJhGrESqDoXwoKVnosc6eUUu3d1a3zchoJZDuYCr9jEts vy6U1ojPREZL0UBizZxu7NzFYg== X-Received: by 2002:a62:9042:: with SMTP id a63-v6mr16657112pfe.52.1532416498268; Tue, 24 Jul 2018 00:14:58 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t14-v6sm11449788pgu.0.2018.07.24.00.14.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:14:57 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Tue, 24 Jul 2018 15:08:56 +0800 Message-Id: <20180724070922.63362-13-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180724070922.63362-1-ming.huang@linaro.org> References: <20180724070922.63362-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 12/38] Silicon/Hisilicon/D06: Stop watchdog X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, Sun Yuanchen , Wang Yue , huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Sun Yuanchen according as watchdog design on D06, watchdog should be stoped befor boot a option. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wang Yue Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Silicon/Hisilicon/Include/Library/IpmiCmdLib.h | 16 ++++++++++++++ Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c | 22 ++++++++++++++++++++ Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 ++ 3 files changed, 40 insertions(+) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h b/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h index 8868b76135..b956ee6d07 100644 --- a/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h +++ b/Silicon/Hisilicon/Include/Library/IpmiCmdLib.h @@ -19,6 +19,17 @@ #define BOOT_OPTION_BOOT_FLAG_VALID 1 #define BOOT_OPTION_BOOT_FLAG_INVALID 0 +typedef enum { + EfiReserved, + EfiBiosFrb2, + EfiBiosPost, + EfiOsLoad, + EfiSmsOs, + EfiOem, + EfiFrbReserved1, + EfiFrbReserved2 +} EFI_WDT_USER_TYPE; + typedef enum { NoOverride = 0x0, ForcePxe, @@ -91,4 +102,9 @@ IpmiCmdGetSysBootOptions ( IN IPMI_GET_BOOT_OPTION *BootOption ); +EFI_STATUS +IpmiCmdStopWatchdogTimer ( + IN EFI_WDT_USER_TYPE UserType + ); + #endif diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c index f7536bfea3..9636f29dce 100644 --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c @@ -19,8 +19,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -615,6 +617,8 @@ PlatformBootManagerAfterConsole ( { EFI_STATUS Status; ESRT_MANAGEMENT_PROTOCOL *EsrtManagement = NULL; + OEM_CONFIG_DATA SetupData; + UINTN DataSize = sizeof (OEM_CONFIG_DATA); // // Show the splash screen. @@ -651,6 +655,24 @@ PlatformBootManagerAfterConsole ( ); HandleBmcBootType (); + + //Disable POST Watch Dog before enter setup + Status = gRT->GetVariable ( + OEM_CONFIG_NAME, + &gOemConfigGuid, + NULL, + &DataSize, + &SetupData + ); + + if (!EFI_ERROR (Status)) { + if (SetupData.BmcWdtEnable) { + Status = IpmiCmdStopWatchdogTimer (EfiBiosPost); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a:%r\n", __FUNCTION__, Status)); + } + } + } } /** diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index a093f13fb0..21afb53fc5 100644 --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -47,6 +47,7 @@ DevicePathLib DxeServicesLib MemoryAllocationLib + IpmiCmdLib PcdLib PrintLib TimerLib @@ -69,6 +70,7 @@ gEfiEndOfDxeEventGroupGuid gEfiTtyTermGuid gHisiOemVariableGuid + gOemConfigGuid [Protocols] gEfiGenericMemTestProtocolGuid