From nobody Mon Feb 9 16:01:55 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1532416362852214.83258009339386; Tue, 24 Jul 2018 00:12:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9FEA7210C1234; Tue, 24 Jul 2018 00:12:42 -0700 (PDT) Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (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 B62C7210C1226 for ; Tue, 24 Jul 2018 00:12:40 -0700 (PDT) Received: by mail-pl0-x242.google.com with SMTP id z7-v6so1342933plo.9 for ; Tue, 24 Jul 2018 00:12:40 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t14-v6sm11449788pgu.0.2018.07.24.00.12.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:12:39 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::242; helo=mail-pl0-x242.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org 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=96ACGAvqL1bDwTUppxmDIqOB11evBf9gr8OSNjPxEYM=; b=JvlQ6lFxZ6GTL+wTXGVUzsb3jQHhtVxD4lH46Kg2SEBcqDkAryx9Cn67LsiQgB4XTE mm5lscTP0st+duQj4GuCyprk0h4cYEjhIqnlRA10MkjEhmcXKja6P0sePGoJ9aB+iA9x x/7DZPxil3PqVZ3whWdEbxzjsVlz3sGGPuLRs= 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=96ACGAvqL1bDwTUppxmDIqOB11evBf9gr8OSNjPxEYM=; b=dLgz2c31pJ/dyAdueeILc4ITMrSURGZwgMdfPXQuZzy12G4o8euS+rp2R6vg6L92aa Lm+eg14NEebOYoy+F6rGY12TlsoLIqNUIf/lohq0rdFDNJ4Rm97bl7i+goq13o+umRPi HT8mxyppdiP/els8EgbRzsLlHCJQVhBoqp3SWILPxG4kkhBcrxh6HOYma3ZBNqaA7BPG kaRyJzxWBwKkXT5iwcEFrROVg2xOP+Jpdhc/DvgleV1WafPLYS+yGAw3vLplLnkVCpm5 d+R6R0hQKyYKVTpmX2RidTHNtI5Eu2Mxxi4mBPIV/Jt2GOWL9UJKRDM/XiXEQRkq61Ak RgvA== X-Gm-Message-State: AOUpUlEdmEgNKmxSqHT4G17AmjKOv2ugNTIkIO80tjEtkRVvkNlSqJTr CgtWGX4c0wVcoJ3faZ4hTWSi+Q== X-Google-Smtp-Source: AAOMgpeM6rCGL190FsCwmGHO3Hy0+br9s+dRjZOO6RARe2m4Rpx9FOWOpNHIu+GI7zwtPlWUvIU/Rg== X-Received: by 2002:a17:902:9a8a:: with SMTP id w10-v6mr14854954plp.14.1532416360408; Tue, 24 Jul 2018 00:12:40 -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:51 +0800 Message-Id: <20180724070922.63362-8-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 07/38] Silicon/Hisilicon/D06: Wait for all disk ready 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, huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch is relative to D06 SasDxe driver. The SasDxe set a variable to notice this libray. Here Wait for all disk ready for 30S at most. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Silicon/Hisilicon/HisiPkg.dec = | 1 + Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c = | 43 ++++++++++++++++++++ Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerLib.in= f | 2 + 3 files changed, 46 insertions(+) diff --git a/Silicon/Hisilicon/HisiPkg.dec b/Silicon/Hisilicon/HisiPkg.dec index 35bea970ec..b56a6a6af7 100644 --- a/Silicon/Hisilicon/HisiPkg.dec +++ b/Silicon/Hisilicon/HisiPkg.dec @@ -45,6 +45,7 @@ =20 gHisiEfiMemoryMapGuid =3D {0xf8870015, 0x6994, 0x4b98, {0x95, 0xa2, 0xb= d, 0x56, 0xda, 0x91, 0xc0, 0x7f}} gVersionInfoHobGuid =3D {0xe13a14c, 0x859c, 0x4f22, {0x82, 0xbd, 0x18, 0= xe, 0xe1, 0x42, 0x12, 0xbf}} + gHisiOemVariableGuid =3D {0xac62b9a5, 0x9939, 0x41d3, {0xff, 0x5c, 0xc5,= 0x80, 0x32, 0x7d, 0x9b, 0x29}} gOemBootVariableGuid =3D {0xb7784577, 0x5aaf, 0x4557, {0xa1, 0x99, 0xd4,= 0xa4, 0x2f, 0x45, 0x06, 0xf8}} gEfiHisiSocControllerGuid =3D {0xee369cc3, 0xa743, 0x5382, {0x75, 0x64, = 0x53, 0xe4, 0x31, 0x19, 0x38, 0x35}} =20 diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c = b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c index 7dd5ba615c..f7536bfea3 100644 --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -554,6 +555,47 @@ PlatformBootManagerBeforeConsole ( PlatformRegisterOptionsAndKeys (); } =20 +STATIC +VOID +WaitForDiskReady ( + ) +{ + EFI_STATUS Status; + UINT32 Index; + UINTN DataSize; + UINT32 DiskInfo; + UINT8 IsFinished; + + Status =3D EFI_NOT_FOUND; + DataSize =3D sizeof (UINT32); + // Wait for 30 seconds at most. + for (Index=3D0; Index<30; Index++) { + Status =3D gRT->GetVariable ( + L"SASDiskInfo", + &gHisiOemVariableGuid, + NULL, + &DataSize, + &DiskInfo + ); + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_ERROR, "Get DiskInfo:%r\n", Status)); + break; + } + + IsFinished =3D (UINT8)(DiskInfo >> 24); + if (IsFinished) { + break; + } + DEBUG ((DEBUG_ERROR, "%a", Index =3D=3D 0 ? "Wait for disk." : ".")); + MicroSecondDelay(1000*1000); // 1S + } + + if (!EFI_ERROR(Status)) { + DEBUG ((DEBUG_ERROR, "DiskInfo:%x\n", DiskInfo)); + EfiBootManagerConnectAll (); + } +} + /** Do the platform specific action after the console is ready Possible things that can be done in PlatformBootManagerAfterConsole: @@ -583,6 +625,7 @@ PlatformBootManagerAfterConsole ( // Connect the rest of the devices. // EfiBootManagerConnectAll (); + WaitForDiskReady (); =20 // // Enumerate all possible boot options. diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootM= anagerLib.inf b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf index 7a53befc44..a093f13fb0 100644 --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerL= ib.inf +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBootManagerL= ib.inf @@ -49,6 +49,7 @@ MemoryAllocationLib PcdLib PrintLib + TimerLib UefiBootManagerLib UefiBootServicesTableLib UefiLib @@ -67,6 +68,7 @@ [Guids] gEfiEndOfDxeEventGroupGuid gEfiTtyTermGuid + gHisiOemVariableGuid =20 [Protocols] gEfiGenericMemTestProtocolGuid --=20 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel