From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Haojian Zhuang 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: [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: , X-List-Received-Date: Fri, 06 Jan 2017 06:52:38 -0000 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(+) 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); -- 2.7.4