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