From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::243; helo=mail-io0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 F09DC210D83D0 for ; Fri, 3 Aug 2018 03:31:16 -0700 (PDT) Received: by mail-io0-x243.google.com with SMTP id w11-v6so4590894iob.2 for ; Fri, 03 Aug 2018 03:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3TNxYFtsijAi5GkqygyHdauitQrAp7EC2EcG7gFGcEU=; b=f2G28M8N9xGqHsnH/MayJjrTv1diOxn8E/KAwOnthKr39oMTALnN5tA8embUguA1RH QA4gSNnh1ff/5lUbTW35HJo9iWmZzwOQ10Z9pUr9/i+xL2uJ930Dw4u2U2p+vItNsZLI CcVccDqaR029zPUek0Y5hcqRX1MX8EzlfXQr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3TNxYFtsijAi5GkqygyHdauitQrAp7EC2EcG7gFGcEU=; b=SOVOVDkcvZUmxhUMCzTfuFeR2+CRwhaSqKhCGxPtdPXAly6AT5fPpbUSvrIoIHI7rp tRNo8myFXVf0Cb5YR7Hv15FEfvTmjv2X+xEaa1uvyhaFqDjJmAssY6fVyjCio7aNfCD0 E4Gztk2c8AsSxnrn2RtGKfB0awymqut5FjzpofvApA8pvUelVzndYgMUiQTIUCfWWkn3 TWAjxKHSN9XTXeeGQiRUWS2RokpFZDAYs4PDcW5VJl0MCrntI5GaSWUuqh+eWsrvlBYB ljE3tID5trlVRmHxKXnmmTRAYcVGHiui9FS7/j3Hw9HIqZyFnoZr8tAOXKpug39nSZCf Bjrg== X-Gm-Message-State: AOUpUlF/2Tspojfs6iPKd0RM8pcu5wnlPWHdWbFFyz4ioC/KYjYJ3rdn 3lUsiO3fh2rs/7hNAYZ00QFJDGAtrlYwJ2L3wh+hIw== X-Google-Smtp-Source: AA+uWPxAY3pz93y03VvZZ54FDOA3huxj+mbcoEF5EJ5DfsB/wKTA2pT+Ws6uzSzQL4iwgiTS24ehJjIRpxOmlTJTLtg= X-Received: by 2002:a6b:be83:: with SMTP id o125-v6mr5432993iof.173.1533292276108; Fri, 03 Aug 2018 03:31:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Fri, 3 Aug 2018 03:31:15 -0700 (PDT) In-Reply-To: <20180724070922.63362-13-ming.huang@linaro.org> References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-13-ming.huang@linaro.org> From: Ard Biesheuvel Date: Fri, 3 Aug 2018 12:31:15 +0200 Message-ID: To: Ming Huang Cc: Leif Lindholm , linaro-uefi , "edk2-devel@lists.01.org" , Graeme Gregory , guoheyi@huawei.com, wanghuiqiang , huangming , Jason Zhang , huangdaode@hisilicon.com, John Garry , Xinliang Liu , Sun Yuanchen , Wang Yue , Heyi Guo Subject: Re: [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: , X-List-Received-Date: Fri, 03 Aug 2018 10:31:17 -0000 Content-Type: text/plain; charset="UTF-8" On 24 July 2018 at 09:08, Ming Huang wrote: > From: Sun Yuanchen > > according as watchdog design on D06, watchdog should be > stoped befor boot a option. > Why? The DXE core already handles the watchdog, why do you need something special here? > 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(+) > > 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 > -- > 2.17.0 >