From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Haojian Zhuang 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: [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: , X-List-Received-Date: Mon, 07 Nov 2016 15:49:19 -0000 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(-) 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 -- 2.7.4