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 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-Google-Smtp-Source: AAOMgpeLrB0rpnryumzYUGJuPZu2erEuUwUOsfB66pC3dBfyQlIWZ8Eyu+p5fVUEB7B6SipD6orgzQ== 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 Cc: 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 , Ming Huang , Heyi Guo 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: [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: Tue, 24 Jul 2018 07:14:58 -0000 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(+) 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