Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D64C4338F for ; Sun, 25 Jul 2021 23:35:42 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03F2A60E77 for ; Sun, 25 Jul 2021 23:35:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 03F2A60E77 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=yifangu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ACB6583287; Mon, 26 Jul 2021 01:34:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=yifangu.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 035E683249; Mon, 26 Jul 2021 01:17:18 +0200 (CEST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E471C83242 for ; Mon, 26 Jul 2021 01:16:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=yifangu.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=gyf304@gmail.com Received: by mail-qt1-f173.google.com with SMTP id m11so5855216qtx.7 for ; Sun, 25 Jul 2021 16:16:53 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Izm6UtJCGluCX+unv37XOwDf66bBF+9eQXnWW5Hvld0=; b=TDvuxvUS7P2G+Kzw66uDClf2awkENP5QOlWgaOWWkunYIhoyY+syqEF67+/x5Cb6dQ pbFNv6oQaZITLV3TDIUG3wZbYleWUsfxgQ57rK1vf6aTAYEGI2DfmyZDfD7ko+IPxADF gquAIOuSUUeOak3nFfsBiqzLvzGOsZL4cFDK+6tjNUNxy/J5dVcwhzFLwhHmooUeI+se BddphFdYQtVs2wBG8dZQSxZdvVWF7AWD63uOJJDBsLRHaj9BNAA2UQgvC92aJIGt6N2+ Fc/S+/cKLgl1buzCCFcBPrrzisggL+VlodAyA3tJ2ff0DB0ECl8KPc3BHVlXqdYE6vJy OeRQ== X-Gm-Message-State: AOAM530SP3/NvSRi9rRVMo80FBsXr3D4Ysueuqw0ACBbNsAlIDL9rKIq onCoAdK8KE6pgxX8QAMw1B+k/6lykblILw7Y X-Google-Smtp-Source: ABdhPJxs8Q881a5ffXQ3zWYNUKvnqHWkk8afqkDHCEayQir4VcvFTaNNHq3CJeFU0D/zXcbeXCWG3Q== X-Received: by 2002:ac8:7e86:: with SMTP id w6mr13414992qtj.194.1627255012427; Sun, 25 Jul 2021 16:16:52 -0700 (PDT) Received: from yifangu-Virtual-Machine.mshome.net (pool-100-6-159-43.pitbpa.fios.verizon.net. [100.6.159.43]) by smtp.gmail.com with ESMTPSA id u184sm17754694qkd.53.2021.07.25.16.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jul 2021 16:16:52 -0700 (PDT) From: Yifan Gu To: u-boot@lists.denx.de Cc: Yifan Gu , Jagan Teki , Andre Przywara , Icenowy Zheng , George Hilliard Subject: [PATCH 25/27] sunxi: suniv: disable mmc optimization for suniv Date: Sun, 25 Jul 2021 19:16:34 -0400 Message-Id: <20210725231636.879913-26-me@yifangu.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210725231636.879913-1-me@yifangu.com> References: <20210725231636.879913-1-me@yifangu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 26 Jul 2021 01:32:10 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean suniv cannot boot with this mmc optimization, as suniv fifo level register is only 4 bits. Disable this optimization for suniv for now. Signed-off-by: Yifan Gu --- drivers/mmc/sunxi_mmc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index 178b8cf106..779c10407a 100644 --- a/drivers/mmc/sunxi_mmc.c +++ b/drivers/mmc/sunxi_mmc.c @@ -324,7 +324,7 @@ static int mmc_trans_data_by_cpu(struct sunxi_mmc_priv *priv, struct mmc *mmc, start = get_timer(0); for (i = 0; i < word_cnt;) { - unsigned int in_fifo; + __maybe_unused unsigned int in_fifo; while ((status = readl(&priv->reg->status)) & status_bit) { if (get_timer(start) > timeout_msecs) @@ -343,6 +343,9 @@ static int mmc_trans_data_by_cpu(struct sunxi_mmc_priv *priv, struct mmc *mmc, continue; } +#ifdef CONFIG_MACH_SUNIV + buff[i++] = readl(&priv->reg->fifo); +#else /* * The status register holds the current FIFO level, so we * can be sure to collect as many words from the FIFO @@ -355,6 +358,7 @@ static int mmc_trans_data_by_cpu(struct sunxi_mmc_priv *priv, struct mmc *mmc, in_fifo--) buff[i++] = readl_relaxed(&priv->reg->fifo); dmb(); +#endif } return 0; -- 2.25.1