From patchwork Mon Nov 7 15:49:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 81116 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1078605qge; Mon, 7 Nov 2016 07:49:23 -0800 (PST) X-Received: by 10.98.73.21 with SMTP id w21mr14722233pfa.26.1478533763864; Mon, 07 Nov 2016 07:49:23 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 76si31978219pfo.238.2016.11.07.07.49.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 07:49:23 -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 dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6799381C8D; Mon, 7 Nov 2016 07:49:20 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (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 3650B81C51 for ; Mon, 7 Nov 2016 07:49:19 -0800 (PST) Received: by mail-pf0-x232.google.com with SMTP id n85so92714395pfi.1 for ; Mon, 07 Nov 2016 07:49:22 -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; bh=AcELeImJZbD6wfZAjIQGnRZbBGVP4fPcXHkwqPdNFWA=; b=jDsVMBnX6d1diTY+3AkEmB1zmic8gnZnIl7xGjDpNe2WKz9u9p8uBS8RkPqltUFEDf CUkxk7ZHZAI7QM1CkVMP2nFpZgcEKsMRffRReOJ4xlJsbJN1NMfm9StGw0W7mtOJ1B6P kDuaPaeJFUMdiGyXzIHvmV4ciaIpmzYfvk/RA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AcELeImJZbD6wfZAjIQGnRZbBGVP4fPcXHkwqPdNFWA=; b=hb2Zij5mXSXKxVVA3SMrpdrcwJ5UIO7TsOQYYRQZrYqP7j9eeaWW5RXS0iIIG0HtFS hzzozT4q8QHkT4fna0i8UjKvDzb10I+eXorx5ZnEY970b959t4OdgrFddcdNfm72V1ea iir3l6l4lm7FzDZbBFuPn3qnADhb/ce2Jy1eRJM/mAzx5OlP/ntB4jQJp5qQMXmfLM0E xZVieNxxUGFTFAjeUujJfanG+IU7CLM9ttCgxP/e7N+Bd1QV1qhv3Oy00F4yXzhYe0jm 9867raouGtxPpADTJv6/zfNlq7rxbvRGn0S/MvMQjN98Wa25NjUmSwe4HlztJCrjHQyM 6vgQ== X-Gm-Message-State: ABUngvfRYhy0g1uGNmuf58LgJYJMkdrYErR24U9O2sMUXj4Vz9C4q7d6YO8IySiwF+JvAb1O X-Received: by 10.98.36.91 with SMTP id r88mr14698457pfj.10.1478533761863; Mon, 07 Nov 2016 07:49:21 -0800 (PST) Received: from localhost.localdomain ([45.56.159.118]) by smtp.gmail.com with ESMTPSA id s3sm41489026pfe.27.2016.11.07.07.49.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Nov 2016 07:49:21 -0800 (PST) From: Haojian Zhuang To: ryan.harkin@linaro.org, edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Mon, 7 Nov 2016 23:49:09 +0800 Message-Id: <1478533749-17387-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH] PL180: set variable length for CMD6 and ACMD51 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" Since CMD6 & ACMD51 needs to read data size less than 512, proper variable length should be set. Signed-off-by: Haojian Zhuang --- ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Tested-by: Ryan Harkin diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c index 4d839e7..c3e8830 100644 --- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c +++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c @@ -63,7 +63,7 @@ MciIsReadOnly ( return (MmioRead32 (FixedPcdGet32 (PcdPL180SysMciRegAddress)) & SYS_MCI_WPROT); } -#if 0 +#if 1 //Note: This function has been commented out because it is not used yet. // This function could be used to remove the hardcoded BlockLen used // in MciPrepareDataPath @@ -129,12 +129,20 @@ MciSendCommand ( } else if (MmcCmd == MMC_CMD6) { MmioWrite32 (MCI_DATA_TIMER_REG, 0xFFFFFFF); MmioWrite32 (MCI_DATA_LENGTH_REG, 64); +#ifndef USE_STREAM + MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | GetPow2BlockLen (64)); +#else MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | MCI_DATACTL_STREAM_TRANS); +#endif } else if (MmcCmd == MMC_ACMD51) { MmioWrite32 (MCI_DATA_TIMER_REG, 0xFFFFFFF); /* SCR register is 8 bytes long. */ MmioWrite32 (MCI_DATA_LENGTH_REG, 8); +#ifndef USE_STREAM + MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | GetPow2BlockLen (8)); +#else MmioWrite32 (MCI_DATA_CTL_REG, MCI_DATACTL_ENABLE | MCI_DATACTL_CARD_TO_CONT | MCI_DATACTL_STREAM_TRANS); +#endif } // Create Command for PL180