From patchwork Tue Nov 8 15:21:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 81348 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1604300qge; Tue, 8 Nov 2016 07:22:53 -0800 (PST) X-Received: by 10.99.150.10 with SMTP id c10mr7634946pge.46.1478618573297; Tue, 08 Nov 2016 07:22:53 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id y7si4321790pan.109.2016.11.08.07.22.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 07:22:53 -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 0C24881D80; Tue, 8 Nov 2016 07:22:48 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (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 43D0B81D57 for ; Tue, 8 Nov 2016 07:22:46 -0800 (PST) Received: by mail-pf0-x22e.google.com with SMTP id 189so109762733pfz.3 for ; Tue, 08 Nov 2016 07:22:49 -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=bAEXldJDIDaMEKejdIHQgqmwL6aA6K1BaLCcfTocOy4=; b=S5QEKpq2iAoEPtDDckyMiZt8v0evun/HRC0DU1n2n4wJ4pLyZtPFkWUSGfuI3qo+qd O2tdEBbo2LyvJsNf+SVfFoh2bsKH+M2Q1tA0vhmpF89OAAGNB2CvG5t2RinQQOQH0c0o RtzUkwDfMLxvxAYm4coGxurN1C9NILin97F0I= 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:in-reply-to :references; bh=bAEXldJDIDaMEKejdIHQgqmwL6aA6K1BaLCcfTocOy4=; b=GYFkIX+H8JWQBt80KJ0d80GCVhpiftbqG+/9eeccb7DvWXgH5o9THX3qJDba1GgiBV la+OB/K6DkRog5esWss2IYYL6B+t9VvYXnJu4mbUtTY4bGdKAG3BizAE4VnOjcO1BGco yhpUS4Hdtc1Mlhk69mMPhmbRvHLSlFET361CZUjvAZXvN1c9L97jkmPBh1g5ifjmLHCr Qse7+PxOnXe/wDWTZD0XauInBpdybjWmiZ3PtZ+CPCUxAymAC3ufi4b3iKUBFqZzShow L5BPT/89WQO12tLYBgoIsAr5rU035EoT/QY4fDmFUskZ8wmX/LKHUFJaRVNHh1c3yQ7E dF4g== X-Gm-Message-State: ABUngvdHw2j/zJqEps+/ceLCmEdjO7+YtjUR2hnCBP9g4OS6mKdhIfwt5nSmSN3NbbTARXvf X-Received: by 10.99.62.13 with SMTP id l13mr7524600pga.112.1478618569216; Tue, 08 Nov 2016 07:22:49 -0800 (PST) Received: from localhost.localdomain ([45.56.159.76]) by smtp.gmail.com with ESMTPSA id g10sm7971804pac.14.2016.11.08.07.22.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Nov 2016 07:22:48 -0800 (PST) From: Haojian Zhuang To: ryan.harkin@linaro.org, edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Tue, 8 Nov 2016 23:21:16 +0800 Message-Id: <1478618476-12608-12-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478618476-12608-1-git-send-email-haojian.zhuang@linaro.org> References: <1478618476-12608-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v4 11/11] 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 Tested-by: Ryan Harkin --- ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c index 4d839e7..b2ba4c0 100644 --- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c +++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c @@ -63,11 +63,6 @@ MciIsReadOnly ( return (MmioRead32 (FixedPcdGet32 (PcdPL180SysMciRegAddress)) & SYS_MCI_WPROT); } -#if 0 -//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 - // Convert block size to 2^n STATIC UINT32 @@ -87,7 +82,6 @@ GetPow2BlockLen ( return Pow2BlockLen; } -#endif VOID MciPrepareDataPath ( @@ -129,12 +123,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