From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::441; helo=mail-wr1-x441.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450: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 241C0210D7F4E for ; Fri, 3 Aug 2018 03:28:41 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id g1-v6so1453825wru.2 for ; Fri, 03 Aug 2018 03:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pi1yqzxinPLx+LTw6Kd4PZmb+LeN6DkqfWbYpA9bz18=; b=UiqDNxjiDLC0BO7DVpocqpr768NQFG01I2ztA5V8tTWI6SCLN+0BbBUEYQh9T2oYqp +/JLaXtyPSIoPsmwmSaFf/LFaCZvRPsITRKASTdsPzLujaHD19iykXLiDnGnTeMvBAYW eh3t6P/0QxViSzgTNPKsELhp3rSo2tfJXyFak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pi1yqzxinPLx+LTw6Kd4PZmb+LeN6DkqfWbYpA9bz18=; b=FdZyCJ+Ue1XixeFRVbMnifYqqGbrbHVUbN9vcHCkr0OpXWYhjE4jflapN3OXcjP5fE rxoRQG8zfgdS57Po63pap6UNn+Zz+w+Oxzcn3mG18NnflIWgAciegBjUxPbYUQNs+eJg hV1P4C/EPopGEn01rgVpWKjVc1zI+VmY2yHzzcSMi5UqB16kZKPyqqJV3pYnXbhcX85O taLi0MMZxoOwAZMAsBZjz5BYOHhbO03PPhlM41XOMElUK3B/ciQVoK519VBBJk4llIp+ hxKqnnaMmYwM5a54E3u4h5W+E8diRtUVCHRi52qdDHDu62Kp1J98aK7me3EcDy0ttaiF u8hw== X-Gm-Message-State: AOUpUlGHc6ZmuUqSMx6AjB1W2cBifTBXsh8mkp6tpMzN1hBg2IaLZ1w1 mnskPPjBFJAW5lhrPmikWPKMFA== X-Google-Smtp-Source: AAOMgpeb6W+XRopjkm7FAHMuUmSBVGH8cIoYCX1ZYHwf9gaUVDNRV1tFboctwr1BHMD7Sr0+bocIEQ== X-Received: by 2002:adf:e542:: with SMTP id z2-v6mr2189397wrm.40.1533292119602; Fri, 03 Aug 2018 03:28:39 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i14-v6sm7587109wmd.13.2018.08.03.03.28.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Aug 2018 03:28:38 -0700 (PDT) Date: Fri, 3 Aug 2018 11:28:36 +0100 From: Leif Lindholm To: Ming Huang Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org, ard.biesheuvel@linaro.org, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org, Sun Yuanchen , Wang Yue , Heyi Guo Message-ID: <20180803102836.reor73uzgb3rnina@bivouac.eciton.net> References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-13-ming.huang@linaro.org> MIME-Version: 1.0 In-Reply-To: <20180724070922.63362-13-ming.huang@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) 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:28:41 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 24, 2018 at 03:08:56PM +0800, Ming Huang wrote: > From: Sun Yuanchen > > according as watchdog design on D06, watchdog should be > stoped befor boot a option. stopped before > > 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 Please put this line after Library/DevicePathLib.h. > #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 Before entering setup (as stated here) or before attempting boot (as stated in commit message)? > + 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 Please move up one line. / Leif > PcdLib > PrintLib > TimerLib > @@ -69,6 +70,7 @@ > gEfiEndOfDxeEventGroupGuid > gEfiTtyTermGuid > gHisiOemVariableGuid > + gOemConfigGuid > > [Protocols] > gEfiGenericMemTestProtocolGuid > -- > 2.17.0 >