From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C3688210E3DC2 for ; Thu, 9 Aug 2018 04:40:44 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id k19-v6so2740036pfi.1 for ; Thu, 09 Aug 2018 04:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=DE29j5mupSuAZbYKaVI9nVaSCGIHZbf47LOK2VabxBg=; b=OtWHUD/VOYJdeKf/oDWY8sK5ZdSonAUSIsolV9tSji+CnEgEU8swAPYACMJabYYqwK TpwAZSHkrwbSKtG3MKjcKXk33O2cBG6ByfJ6vJpk6G27PJYBwbPevZRsaKKRnDQ29JWs suept6fvlxRW9a1CCoAY8TBs9AO7X2OwBa+RE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=DE29j5mupSuAZbYKaVI9nVaSCGIHZbf47LOK2VabxBg=; b=WLtMnJyxJ2KanT6XnEX9kRv3V6XWkuguAa+UnnomYrDmxhUOodexfU1NXDuBMEHXiQ AWSIexrWc0yYF7qj5bpzKA3dleb0Lyqrv3Hx4q8aT80FHPZ3aXGuvrmoxSN7jqIEsjcp jXABMirmYEbrcaznjiZ6is3o9xd3enZSQ5i5NJFT73+v49jw0vqsp5eXsDXzLh6YFy5k 1RjB5Bzsq2T85V2CQppMVWQ3Ep+MMN8NjKkDyGktb+6UInFJ7QyUFQ6bg91XRWBC8sbP tpVyzyVBSQ8HhsTkvghhDt33KN4XkgMymo1xYJgnHJLxy4/5OPny4cbOhzVrbHzOpPxu wmQA== X-Gm-Message-State: AOUpUlFqjbSUOML+NOw6Op8gM3JRU1ujApa9PQZTAZ6x24oEk2shMWU6 nZqzmih7RFTP5Pl+TjUFH+bJbg== X-Google-Smtp-Source: AA+uWPy7ICDKI7//pQX1MiYDBrtxRpnuZwGTBjnS9qIlJSvdnRA6dLpmWIwfCqRXRIHitv5CgsDw7w== X-Received: by 2002:a63:bf08:: with SMTP id v8-v6mr1783134pgf.3.1533814843813; Thu, 09 Aug 2018 04:40:43 -0700 (PDT) Received: from [10.199.0.182] ([64.64.108.224]) by smtp.gmail.com with ESMTPSA id d19-v6sm19940421pfm.48.2018.08.09.04.40.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 04:40:43 -0700 (PDT) To: Ard Biesheuvel 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 References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-13-ming.huang@linaro.org> From: Ming Message-ID: Date: Thu, 9 Aug 2018 19:40:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: 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: Thu, 09 Aug 2018 11:40:44 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 在 8/3/2018 6:31 PM, Ard Biesheuvel 写道: > 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? This is an out of band watchdog timer in BMC; it is used to monitor the whole BIOS boot process and reset the system in case BIOS hangs somewhere, i.e. it is armed when system is power on, and disabled before handling system control to OS, while UEFI boot services watchdog is only armed before invoking a boot option. So they are two different watchdogs. Thanks. > >> 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 >>