From patchwork Fri Jan 6 06:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 90115 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9321495qgi; Thu, 5 Jan 2017 22:52:40 -0800 (PST) X-Received: by 10.84.211.144 with SMTP id c16mr101489422pli.37.1483685560732; Thu, 05 Jan 2017 22:52:40 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id r1si78420855pgd.318.2017.01.05.22.52.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 22:52:40 -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 dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5AE41819EB; Thu, 5 Jan 2017 22:52:40 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com [IPv6:2607:f8b0:400e:c05::22f]) (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 9C813819E9 for ; Thu, 5 Jan 2017 22:52:38 -0800 (PST) Received: by mail-pg0-x22f.google.com with SMTP id f188so248939415pgc.3 for ; Thu, 05 Jan 2017 22:52:38 -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=/KU3FPEqOpAI8calG+eFUiLSvbDHPXxLrjValu8A5Ec=; b=PRVYg7gFGjIZnf3Ubr7W7T3gLQbe/g4b8Pk+nmr4oF5dlFLgdBIoOdQEl+7WlhzA/l OPut2kusqSUpN40YaOvBLenEVnEaitUSHtDxeeAlfyrg5wJl7sYhDPPEmTdlkG/i3vbO OmSJCy8AlErQlgDO/fhM2SphmXslSg4vWmLh0= 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=/KU3FPEqOpAI8calG+eFUiLSvbDHPXxLrjValu8A5Ec=; b=tmh9UK6fvC11vImIqCkOBwts2Ztc/c9Nph/cYZLvuy/5QgXU01DtE5hRpX4WI/P4n/ vgTteFpccYmDHRvu3tnUAdzN2HN8JWc2eBeprc2AGoRSo4ugXF8o8peS57fTs2oFaaLm 4G39IGWyzSGpbYjjgacQAJjvJp1Knfhuw710J5/89gyufsgJJCyCFcOwFGOFLhoEnQLi uDx3yHUdLfdRANqZL3bOM9YcVM9E2RwS/Sd00lKdCI4W2daSJsrlyuoxxBGkHXJQ/Evx tWSn41u4RC6BOJgzlTqB5jc+1NGz8cYjcXDDObqfpQox0huNRAd2fGVY1a/qpeVMw33T m4VA== X-Gm-Message-State: AIkVDXJA2+IQXh16rNogg2Imw23w8HMSktHoNxGEcjZ9Pw79N077vSLZKKLpewSaf8kmN/Y7 X-Received: by 10.99.184.18 with SMTP id p18mr140713028pge.33.1483685558276; Thu, 05 Jan 2017 22:52:38 -0800 (PST) Received: from localhost.localdomain ([45.56.159.83]) by smtp.gmail.com with ESMTPSA id p13sm159096976pgf.47.2017.01.05.22.52.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 22:52:37 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Fri, 6 Jan 2017 14:52:13 +0800 Message-Id: <1483685538-11058-5-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> References: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH 4/9] Ufs: fix to set UTRLBA and UTRLBAU register 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" Although UfsInitTransferRequestList () assigns UTRLBA && UTRLBAU registers, UfsCreateScsiCommandDesc () creates a page of command buffer. It means that UTRLBA && UTRLBAU registers should be updated. Always set UTRLBA && UTRLBAU registers before sending UPIU packet. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 10 ++++++++++ 1 file changed, 10 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 e556b62..5c256a9 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -937,6 +937,8 @@ UfsRwDeviceDesc ( if (EFI_ERROR (Status)) { return Status; } + UfsMmioWrite32 (Private, UFS_HC_UTRLBA_OFFSET, (UINTN)Trd & 0xffffffff); + UfsMmioWrite32 (Private, UFS_HC_UTRLBAU_OFFSET, ((UINTN)Trd >> 32) & 0xffffffff); // // Check the transfer request result. @@ -1060,6 +1062,8 @@ UfsRwAttributes ( if (EFI_ERROR (Status)) { return Status; } + UfsMmioWrite32 (Private, UFS_HC_UTRLBA_OFFSET, (UINTN)Trd & 0xffffffff); + UfsMmioWrite32 (Private, UFS_HC_UTRLBAU_OFFSET, ((UINTN)Trd >> 32) & 0xffffffff); // // Check the transfer request result. @@ -1184,6 +1188,8 @@ UfsRwFlags ( if (EFI_ERROR (Status)) { return Status; } + UfsMmioWrite32 (Private, UFS_HC_UTRLBA_OFFSET, (UINTN)Trd & 0xffffffff); + UfsMmioWrite32 (Private, UFS_HC_UTRLBAU_OFFSET, ((UINTN)Trd >> 32) & 0xffffffff); // // Check the transfer request result. @@ -1351,6 +1357,8 @@ UfsExecNopCmds ( if (EFI_ERROR (Status)) { return Status; } + UfsMmioWrite32 (Private, UFS_HC_UTRLBA_OFFSET, (UINTN)Trd & 0xffffffff); + UfsMmioWrite32 (Private, UFS_HC_UTRLBAU_OFFSET, ((UINTN)Trd >> 32) & 0xffffffff); // // Check the transfer request result. @@ -1473,6 +1481,8 @@ UfsExecScsiCmds ( if (EFI_ERROR (Status)) { return Status; } + UfsMmioWrite32 (Private, UFS_HC_UTRLBA_OFFSET, (UINTN)TransReq->Trd & 0xffffffff); + UfsMmioWrite32 (Private, UFS_HC_UTRLBAU_OFFSET, ((UINTN)TransReq->Trd >> 32) & 0xffffffff); TransReq->CmdDescSize = TransReq->Trd->PrdtO * sizeof (UINT32) + TransReq->Trd->PrdtL * sizeof (UTP_TR_PRD);