From patchwork Mon Mar 18 22:48:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1058131 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K8VP9jVR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44NWYh1djmz9s6w for ; Tue, 19 Mar 2019 09:48:24 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id DB45FC21F06; Mon, 18 Mar 2019 22:48:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 50F27C21D83; Mon, 18 Mar 2019 22:48:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 91378C21D83; Mon, 18 Mar 2019 22:48:18 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id 0BC70C21BE5 for ; Mon, 18 Mar 2019 22:48:18 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id d17so18889572wre.10 for ; Mon, 18 Mar 2019 15:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DMlxDMaNAwyuDfyxslYuDYd4quD39SVOEp8jeOxk0Mk=; b=K8VP9jVRgSbnFIfj4hGnYHS8iDR9/zwc/xuw1EnZYhaT5JF2iaEYYninPMz2XNKZoQ TVMoN1nQC9pmZz5AVrQucs59V2hMGmTnC5viMgaVuHWLdE2ItTfmUXc7iMCjVzWB8uM1 Bf34WI4oabbWJasyjDhG5D6ZfQ8XhCUGFK7zKx2awzwqkkKdFO3dBFj0BlfLxveU5kcv ase1on1Lpa+dw2bq5rUhTmzRooueJKYrFU1YlygBWxJ+9bqSOPPzZO7XUSz6p1op76VA 5oLVK00AZGVdQWGiHZYf1iwlLf+0uXlYqgmScZwxIqJiie70XCF1kFsaAiRpuKneCPPV LeeQ== 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:mime-version :content-transfer-encoding; bh=DMlxDMaNAwyuDfyxslYuDYd4quD39SVOEp8jeOxk0Mk=; b=FYZuk6Oh2V+rn2C4Ik50xtO7DVzBeiKEkDd8WnVU3ZAOGXClp2CnVYIEJIOeytDWbB uW2R6NY4KM1JIQmuTMh0m6vPoTgmfuqDRkYQeigys5Fi0OPVR+VoG1HfBnxhywpjGEAN SKOozBOzzGJAnOruyg86SSZvn/DGq4L8dSs9lzsMjJMyuUQqP+EnmepcsqPDFiItHcYU ktUxnB3AiyVisq3WEYeJVuQuLpmrnPLVxB2/Y/KYNPR7/vEeFgx3vPOklnxCj5sO31fh sxNQMgmeo02mo6gddOrqlJgTQJrLdTu20GPDlLHP0U+ZrFb+d1tmakEjDZajBGuIKVdG I8PQ== X-Gm-Message-State: APjAAAXBiDwUAifKwBQqrzXt/xM9Hf05otNJoOWiiCuSpXdPk01h9DER rpYBPV9hKZSK1LR3bBSLwHVV/HgL X-Google-Smtp-Source: APXvYqxQtP/RcvE1ejb9Rt8jrOhAJMWEgpA1SB/V4Mw6Km0ntUw09S6jhQ7lbgEDlaKZkYCPS/JrLQ== X-Received: by 2002:adf:ba84:: with SMTP id p4mr14174287wrg.156.1552949297372; Mon, 18 Mar 2019 15:48:17 -0700 (PDT) Received: from kurokawa.lan (ip-86-49-110-70.net.upcbroadband.cz. [86.49.110.70]) by smtp.gmail.com with ESMTPSA id y7sm1237915wmi.34.2019.03.18.15.48.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 15:48:16 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 18 Mar 2019 23:48:14 +0100 Message-Id: <20190318224814.27108-1-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Marek Vasut Subject: [U-Boot] [PATCH] mmc: tmio: Clamp SD_SECCNT to 16bit values on 16bit IP X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On 16bit variants of the TMIO SD IP, the SECCNT register can only be programmed to 16bit values, while on the 32bit and 64bit variants it can be programmed to 32bit values. The SECCNT register indicates the maximum number of blocks in a continuous transfer. Hence, limit the maximum continuous transfer block count to 65535 blocks on 16bit variants of the TMIO IP and to BIT(32)-1 blocks on 32bit and 64bit variants. Signed-off-by: Marek Vasut Cc: Masahiro Yamada --- drivers/mmc/tmio-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c index 01d8c2b925..812205a21f 100644 --- a/drivers/mmc/tmio-common.c +++ b/drivers/mmc/tmio-common.c @@ -783,7 +783,10 @@ int tmio_sd_probe(struct udevice *dev, u32 quirks) plat->cfg.f_min = mclk / (priv->caps & TMIO_SD_CAP_DIV1024 ? 1024 : 512); plat->cfg.f_max = mclk; - plat->cfg.b_max = U32_MAX; /* max value of TMIO_SD_SECCNT */ + if (quirks & TMIO_SD_CAP_16BIT) + plat->cfg.b_max = U16_MAX; /* max value of TMIO_SD_SECCNT */ + else + plat->cfg.b_max = U32_MAX; /* max value of TMIO_SD_SECCNT */ upriv->mmc = &plat->mmc;