From patchwork Mon Jan 16 12:22:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 91564 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1395370qgi; Mon, 16 Jan 2017 04:23:10 -0800 (PST) X-Received: by 10.84.192.107 with SMTP id b98mr37997731pld.160.1484569390870; Mon, 16 Jan 2017 04:23:10 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id i5si21409778pgh.191.2017.01.16.04.23.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 04:23:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 06C0E81D9B; Mon, 16 Jan 2017 04:23:10 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (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 3158081CCC for ; Mon, 16 Jan 2017 04:23:09 -0800 (PST) Received: by mail-pf0-x22c.google.com with SMTP id f144so53414077pfa.2 for ; Mon, 16 Jan 2017 04:23:09 -0800 (PST) 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=WH6lctLaFW7vK5HBDR5+K16tou6mQWqPD70NQK2wXnw=; b=JD64c9T//CX0dgmI/iMP8updfJUcjZQJ8+UocoQWHkZlgDx/Vk3cZ12ouO4wryp5F4 CDplDVB1Y0FEe0ihAJC8CtPbHiYp/DHrh26fK6IFN3BPvq/+X8Fbh8HhZ2MHsndeZyY4 zGb2HmEfxbnhssQpm/vjMhbKCH3TNGbzKYh/o= 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=WH6lctLaFW7vK5HBDR5+K16tou6mQWqPD70NQK2wXnw=; b=NrnfvVQ2uuORh5h0hzy1scSJ5r9vVghhebIzWWn45KE8kRwCL5hTvjwElwiMWR7RTV 8H+X9Ku1uQYd7rf7imu8M8u3oTeNqZCPfNoR4zXOsrSmalREM7Pd5YUwmOHs7lSp2FCY BAek3DrDdLIA5wamBr0WqIvp15+sQjltUhFUVkB8uqMR7/VdUjjsHsqP1brIeMrfIsSd cRVbWojalZYLKYdXEgANVKwIDuzNaLiRIgjq87kkMqwzEy0ePj6zzyb0BQODiIj7HFFh 16vOJkLtW2wzb/llXjt+0OIdLha+sgfXCH2gFpO11z4p2VoToLktDgzwWp8NjVtTQaO4 4lEg== X-Gm-Message-State: AIkVDXJjTcj4RlV0bMTc4MRLXiCqgOc4rmbi0OySF7jx0iybDL1LyX8uEh0Gr8Jbo7TD4Ats X-Received: by 10.84.232.78 with SMTP id f14mr50641608pln.27.1484569389366; Mon, 16 Jan 2017 04:23:09 -0800 (PST) Received: from localhost.localdomain ([45.56.159.104]) by smtp.gmail.com with ESMTPSA id v186sm10361286pgv.44.2017.01.16.04.23.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 04:23:08 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Mon, 16 Jan 2017 20:22:54 +0800 Message-Id: <1484569378-16126-2-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> References: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 1/5] MdeModuelPkg/UfsPassThruDxe: fix to identify 32 bits address mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" When UFS_HC_CAP_64ADDR bit is set, it means 64-bit address, not 32-bit address. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang Reviewed-by: Feng Tian --- MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 3bd6dad..2b95f80 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -1749,9 +1749,9 @@ UfsAllocateAlignCommonBuffer ( EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc; if ((Private->Capabilities & UFS_HC_CAP_64ADDR) == UFS_HC_CAP_64ADDR) { - Is32BitAddr = TRUE; - } else { Is32BitAddr = FALSE; + } else { + Is32BitAddr = TRUE; } UfsHc = Private->UfsHostController; From patchwork Mon Jan 16 12:22:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 91565 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1395396qgi; Mon, 16 Jan 2017 04:23:14 -0800 (PST) X-Received: by 10.98.3.7 with SMTP id 7mr37616000pfd.9.1484569394004; Mon, 16 Jan 2017 04:23:14 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id v66si21432219pfd.284.2017.01.16.04.23.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 04:23:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2603C81D97; Mon, 16 Jan 2017 04:23:13 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com [IPv6:2607:f8b0:400e:c05::236]) (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 E3FEC81D97 for ; Mon, 16 Jan 2017 04:23:11 -0800 (PST) Received: by mail-pg0-x236.google.com with SMTP id 204so15493352pge.0 for ; Mon, 16 Jan 2017 04:23:12 -0800 (PST) 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=PNdqGwJgeMJ4qMHv+SpvX0ISA2WEvJ1Fefdvsp3eb+g=; b=Tj+qMqzoYRDcgvf/XVS9AIo6le27vU6fme0xzmTibMFfxvE8HtOHLE0tplJ/op1uWn XzyithoiEcVCEAmzjw6jEoWsqY3QOKEbi78TTYU2iw7ecw+W/ses2Ueuvc3yDqGlEGs9 wYAK0nD4bOZ8mWhxlDf+HL1A4wNF/IlJIyMe4= 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=PNdqGwJgeMJ4qMHv+SpvX0ISA2WEvJ1Fefdvsp3eb+g=; b=j3PaYDG7Sp9w3vYGhwHuMcAXb75/OP7rFyQiupIHi6bFdCVvpg3W8MC5BA+7Agz9re 1joFAn8U4cs8s7A7k3HWnRWhYDa+IOm0t4Q7kB39Fg7O622FGINhR+LoEsdUc6LV5KrM gtolypO7AlJ5BWN6x3QtARVPFGMIeaY9oBtpS5Kd8r9GoNQs5DeFywxjD5noOUk42gop Sd6hAWYRAvY4EgBDP4vH32MeofHlpumKKggd+ZnwbpXOWpjXMaV8Lj09yjz4cfnXaj50 qB5vfRxBeMflqiYlV7VTwZyiRl8ZvwWhOp5m7ZefC2kasNb0r1As3bVu/+lYDYlrSteA 62xA== X-Gm-Message-State: AIkVDXIuTWzI0Bue3QbmQ1Un6ROyFezjqV7pJhVZ88Km+0+YChmo0E7NlG/knBuA/InthEEE X-Received: by 10.84.239.16 with SMTP id w16mr15928776plk.73.1484569392102; Mon, 16 Jan 2017 04:23:12 -0800 (PST) Received: from localhost.localdomain ([45.56.159.104]) by smtp.gmail.com with ESMTPSA id v186sm10361286pgv.44.2017.01.16.04.23.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 04:23:11 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Mon, 16 Jan 2017 20:22:55 +0800 Message-Id: <1484569378-16126-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> References: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 2/5] MdeModulePkg/UfsPassThruDxe: fix the bit in UFS_HC_UTRLDBR_OFFSET reg X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" When UPIU packet is sent, (BIT0 << Slot) should be set according to context. But BIT0 is used without Slot when UfsWaitMemSet () is invoked. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang Reviewed-by: Feng Tian --- MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 2b95f80..3793c6a 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -954,7 +954,7 @@ UfsRwDeviceDesc ( // // Wait for the completion of the transfer request. // - Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, Packet.Timeout); + Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, Packet.Timeout); if (EFI_ERROR (Status)) { goto Exit; } @@ -1077,7 +1077,7 @@ UfsRwAttributes ( // // Wait for the completion of the transfer request. // - Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, Packet.Timeout); + Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, Packet.Timeout); if (EFI_ERROR (Status)) { goto Exit; } @@ -1201,7 +1201,7 @@ UfsRwFlags ( // // Wait for the completion of the transfer request. // - Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, Packet.Timeout); + Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, Packet.Timeout); if (EFI_ERROR (Status)) { goto Exit; } @@ -1368,7 +1368,7 @@ UfsExecNopCmds ( // // Wait for the completion of the transfer request. // - Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, UFS_TIMEOUT); + Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << Slot, 0, UFS_TIMEOUT); if (EFI_ERROR (Status)) { goto Exit; } @@ -1534,7 +1534,7 @@ UfsExecScsiCmds ( // // Wait for the completion of the transfer request. // - Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0, 0, Packet->Timeout); + Status = UfsWaitMemSet (Private, UFS_HC_UTRLDBR_OFFSET, BIT0 << TransReq->Slot, 0, Packet->Timeout); if (EFI_ERROR (Status)) { goto Exit; } From patchwork Mon Jan 16 12:22:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 91566 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1395416qgi; Mon, 16 Jan 2017 04:23:16 -0800 (PST) X-Received: by 10.99.52.11 with SMTP id b11mr39297240pga.131.1484569396146; Mon, 16 Jan 2017 04:23:16 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id f88si21455470pfk.36.2017.01.16.04.23.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 04:23:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 451D281D98; Mon, 16 Jan 2017 04:23:15 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (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 91FFE81D98 for ; Mon, 16 Jan 2017 04:23:14 -0800 (PST) Received: by mail-pf0-x231.google.com with SMTP id 189so53509721pfu.3 for ; Mon, 16 Jan 2017 04:23:15 -0800 (PST) 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=q2hLrSHMu2Nxb2+7pFugpLiRVBfoG56uaefoGz9hypE=; b=Od0mjOsuZTAKyZjgdO7QGn430La+2KqSzHTFT3bx+7pC0KWYBcottXWzNBoW5VJm98 bujmxb/KqlGY48OV2/OmGaMISNZNDso8xFakCYfqEED7j5iqBrZ3IcCdpQv1SdX3WhP5 bMV1EvqwfPx4+FlGdYFO8WNyO1dePaT8wKVWw= 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=q2hLrSHMu2Nxb2+7pFugpLiRVBfoG56uaefoGz9hypE=; b=N7NIu8+0HaH5X9HZ2a1ue2iukyVklUmn8bej8/SOniGi460ImC4Hu9l9sMC9DH4S3y UJYTbhws0PFjGyAZajOO5h4MeDCEMKUALFShD1jshJVNALlHvAno6jrkD/Al5E1CVFsj BBcxq10Y2N0gWKXBjHI41vdAhnRP1Av0NGlS5Uuzh/T7/+nB6ohSic6PifETxBkJq2L+ KEXpi6U+c8bKFZYJcfFKgEyHBzPR3SR0C5LshafkdN6eSYCWRU8n2LjTDBMv/gTrWjFY kjpaoFrr8vcsrm4mmKQdt8dgKE3BimutG7ImNTng/bASvdl+0eKOeGx3BlV9yRfW6Ucg EMfg== X-Gm-Message-State: AIkVDXLkC2MdxVMbyHaNkW9tilYeegX9FkzqV6iittnvZYmXRl5MJvQtBA/OKxjZbEsvH+5U X-Received: by 10.84.202.163 with SMTP id x32mr50224850pld.46.1484569394805; Mon, 16 Jan 2017 04:23:14 -0800 (PST) Received: from localhost.localdomain ([45.56.159.104]) by smtp.gmail.com with ESMTPSA id v186sm10361286pgv.44.2017.01.16.04.23.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 04:23:14 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Mon, 16 Jan 2017 20:22:56 +0800 Message-Id: <1484569378-16126-4-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> References: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 3/5] MdeModulePkg/UfsBlockIoPei: fix the bit in UFS_HC_UTRLDBR_OFFSET reg X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" When UPIU packet is sent, (BIT0 << Slot) should be set according to context. But BIT0 is used without Slot when UfsWaitMemSet () is invoked. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c index 7e90ecf..cccacce 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c @@ -842,7 +842,7 @@ UfsRwDeviceDesc ( // Wait for the completion of the transfer request. // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; - Status = UfsWaitMemSet (Address, BIT0, 0, Packet.Timeout); + Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout); if (EFI_ERROR (Status)) { goto Exit; } @@ -956,7 +956,7 @@ UfsRwAttributes ( // Wait for the completion of the transfer request. // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; - Status = UfsWaitMemSet (Address, BIT0, 0, Packet.Timeout); + Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout); if (EFI_ERROR (Status)) { goto Exit; } @@ -1070,7 +1070,7 @@ UfsRwFlags ( // Wait for the completion of the transfer request. // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; - Status = UfsWaitMemSet (Address, BIT0, 0, Packet.Timeout); + Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout); if (EFI_ERROR (Status)) { goto Exit; } @@ -1228,7 +1228,7 @@ UfsExecNopCmds ( // Wait for the completion of the transfer request. // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; - Status = UfsWaitMemSet (Address, BIT0, 0, UFS_TIMEOUT); + Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, UFS_TIMEOUT); if (EFI_ERROR (Status)) { goto Exit; } @@ -1312,7 +1312,7 @@ UfsExecScsiCmds ( // Wait for the completion of the transfer request. // Address = Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; - Status = UfsWaitMemSet (Address, BIT0, 0, Packet->Timeout); + Status = UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet->Timeout); if (EFI_ERROR (Status)) { goto Exit; } From patchwork Mon Jan 16 12:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 91567 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1395433qgi; Mon, 16 Jan 2017 04:23:19 -0800 (PST) X-Received: by 10.98.77.67 with SMTP id a64mr37193659pfb.124.1484569399270; Mon, 16 Jan 2017 04:23:19 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id a5si3563398pgg.89.2017.01.16.04.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 04:23:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 645B281D9D; Mon, 16 Jan 2017 04:23:18 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pg0-x22d.google.com (mail-pg0-x22d.google.com [IPv6:2607:f8b0:400e:c05::22d]) (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 95CA681CCC for ; Mon, 16 Jan 2017 04:23:17 -0800 (PST) Received: by mail-pg0-x22d.google.com with SMTP id 14so15479644pgg.1 for ; Mon, 16 Jan 2017 04:23:18 -0800 (PST) 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=0zOYAsnmYPHR67n4Ex9K9aWU+QblTkJx6Wr1vqbgw04=; b=UExkrD+7REwkfhydYslSpBONh4upcJAn+BapdgYIPkT0k4maKNz6u9/VUuLQAtjPnb GowGSntLCGbauROQ5OZbNI+wrLYEgRQynFln8OmlhAo6d84YXG0ePGSvJv6wQGPoS1Ag JYPtID3fR9+WQNUsRxtCIaRCarw0tMKnDs2xI= 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=0zOYAsnmYPHR67n4Ex9K9aWU+QblTkJx6Wr1vqbgw04=; b=BXdvv4M8pdiWrWyIXNivyrpVafeuzS95WITTn/0EoAsHIUkXY5RSbPr+a6T3n6lGTr TzBvo5eWK7PNib0ckfMb40cftEYB5CB3Hl5EmawTn/jMap4MvfeTYKKscQ0P+vigdkqT O5sz5P2w9fM4XF1a9wyMQCUazBo6VG/I6tqlXaPDeyG7zEtPJMp61eoYswKLvyyD8DDC +UuOsCUVzElUJ53lo2CLgfGz9LScjkvRQQwNRSr4vs4P8aPpMbx7v0mDTerz/4bajp5w BeYv7JrCkui1KN0zYnLzpHho0fiLHmng+hKazgpi8FdNBcgtKFFLqYn4ridfI75xHaur YREw== X-Gm-Message-State: AIkVDXJfwwQSZFuvqfI1rxwqRs6ugupf3UifbIQygts//btm0DzRZomu938gqEJGu8O9HlJ7 X-Received: by 10.84.208.102 with SMTP id f35mr50077348plh.137.1484569397566; Mon, 16 Jan 2017 04:23:17 -0800 (PST) Received: from localhost.localdomain ([45.56.159.104]) by smtp.gmail.com with ESMTPSA id v186sm10361286pgv.44.2017.01.16.04.23.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 04:23:17 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Mon, 16 Jan 2017 20:22:57 +0800 Message-Id: <1484569378-16126-5-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> References: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 4/5] MdeModulePkg/UfsPassThruDxe: fix initialize OCS value to 0x0F X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The OCS value should be initiliazed as 0x0F according to UFS spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang Reviewed-by: Feng Tian --- MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 3793c6a..9432c63 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -551,6 +551,7 @@ UfsCreateScsiCommandDesc ( Trd->Int = UFS_INTERRUPT_COMMAND; Trd->Dd = DataDirection; Trd->Ct = UFS_STORAGE_COMMAND_TYPE; + Trd->Ocs = 0x0F; Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 7); Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32); Trd->RuL = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof (UTP_RESPONSE_UPIU)), sizeof (UINT32)); @@ -719,6 +720,7 @@ UfsCreateNopCommandDesc ( Trd->Int = UFS_INTERRUPT_COMMAND; Trd->Dd = 0x00; Trd->Ct = UFS_STORAGE_COMMAND_TYPE; + Trd->Ocs = 0x0F; Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 7); Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32); Trd->RuL = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof (UTP_NOP_IN_UPIU)), sizeof (UINT32)); From patchwork Mon Jan 16 12:22:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 91568 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1395456qgi; Mon, 16 Jan 2017 04:23:22 -0800 (PST) X-Received: by 10.99.5.15 with SMTP id 15mr11406806pgf.109.1484569402454; Mon, 16 Jan 2017 04:23:22 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id p83si20832485pfi.65.2017.01.16.04.23.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 04:23:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9541581DA9; Mon, 16 Jan 2017 04:23:21 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (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 6448581CCC for ; Mon, 16 Jan 2017 04:23:20 -0800 (PST) Received: by mail-pg0-x22a.google.com with SMTP id 14so15479899pgg.1 for ; Mon, 16 Jan 2017 04:23:20 -0800 (PST) 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=Pee7GlCqazNZnyfUBQSi42h+V80jWjwu+ShlRva+PHQ=; b=Cu6nQnArkFpLW1Vww3eVheEBQz8/M3ZZCBt6RCiGCh6NcHdXZxSCYgH2ZlU5jCU3xW ozWcdLt0HEWXJfc0p9B/Nh/cfKA3sZg8CSKZcvYkXeCzF+AUDcpxjlhVsVl6VYdMWKjN cuGKMafOIGVYGONvFCreWyRd18UDucgXqDLVk= 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=Pee7GlCqazNZnyfUBQSi42h+V80jWjwu+ShlRva+PHQ=; b=pYNMgc1Y5ibf5GZTQyaDtRFhjGhATPhD0oqT9EBvvJ/uhkczcd3hyZCngMAXNk5TBQ wSM2TpeXiTz3xen66tybaK5f6H6JAxulpdtvczN7pJtFehdBJr5L1rHFPcbr7JJxIg8c 2JTM4KlsNThgaQmpPZGHGlfjYFN4OuP/PmIR80h+6TtgtK+DUiFNrLw03XnnHQ6HtW9s HjzdLi16Rq9kd2H2RgF5IwiFqGiCi/pt/tmLl9yeIhx7gsxAyLFsbJf6XG7gmW9dO4oR jEMVymtIpiHsDbRkr0uDIbHSx/soC1cBHv1TuMvnhtB6aYx+sTqsjmuYagVCPKvTnpv6 wv/w== X-Gm-Message-State: AIkVDXJviCY66lHzg0yLmFZnDAe6pVNFxGPQp5/71gCWn3ut4zZKzU51aH4lJ4iNpU/bxbEx X-Received: by 10.84.217.68 with SMTP id e4mr16164041plj.99.1484569400637; Mon, 16 Jan 2017 04:23:20 -0800 (PST) Received: from localhost.localdomain ([45.56.159.104]) by smtp.gmail.com with ESMTPSA id v186sm10361286pgv.44.2017.01.16.04.23.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 04:23:20 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Mon, 16 Jan 2017 20:22:58 +0800 Message-Id: <1484569378-16126-6-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> References: <1484569378-16126-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 5/5] MdeModulePkg/UfsBlockIoPei: fix initialize OCS value to 0x0F X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The OCS value should be initiliazed as 0x0F according to UFS spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c index cccacce..67042b7 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c @@ -480,6 +480,7 @@ UfsCreateScsiCommandDesc ( Trd->Int = UFS_INTERRUPT_COMMAND; Trd->Dd = DataDirection; Trd->Ct = UFS_STORAGE_COMMAND_TYPE; + Trd->Ocs = 0x0F; Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)(UINTN)CommandUpiu, 7); Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)(UINTN)CommandUpiu, 32); Trd->RuL = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof (UTP_RESPONSE_UPIU)), sizeof (UINT32)); @@ -637,6 +638,7 @@ UfsCreateNopCommandDesc ( Trd->Int = UFS_INTERRUPT_COMMAND; Trd->Dd = 0x00; Trd->Ct = UFS_STORAGE_COMMAND_TYPE; + Trd->Ocs = 0x0F; Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)(UINTN)NopOutUpiu, 7); Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)(UINTN)NopOutUpiu, 32); Trd->RuL = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof (UTP_NOP_IN_UPIU)), sizeof (UINT32));