From patchwork Tue Feb 22 01:31:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 1595797 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=FPYkvE1e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K2hVr5B5mz9sGH for ; Tue, 22 Feb 2022 12:32:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E09A83C6E; Tue, 22 Feb 2022 02:32:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FPYkvE1e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E00083C93; Tue, 22 Feb 2022 02:31:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (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 F01FB83C6E for ; Tue, 22 Feb 2022 02:31:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pgwipeout@gmail.com Received: by mail-qk1-x72d.google.com with SMTP id z66so13594450qke.10 for ; Mon, 21 Feb 2022 17:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehHYxJmFteREp43JkGoELWgScEXPvJyd4WUXqcF0gNA=; b=FPYkvE1efeGKGQ6BCyq6bVbYUCoZkhebk5V2UzcHtjeaxKOsQ4cclmlNOlo69sdf7y AmCkw/qK7xaj2DrMTKVniPnXMkJLOXBgQ+OOFtkSb9I/mIsvdytyDVHhzNJkZPfsIfTV S65mSiB66Ojg7q+cUaWB/HhId6gJtCejs8nTj27YaoWBcdawpH75F2CNJmdWdEkG9Rlb nIwi3WbLV8+eMkYV0F8ElEuxzhCKc5PlMlyWCCS9C7qX6njjxLU1nEhlVNftKdTuqQGO 9OMfAz5e5UGWg7yj7ZsJHCN5g/QOhbHs8kD4Cv98N/ihLh3ytzp4u6YmqCufer8/ImP5 wzMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ehHYxJmFteREp43JkGoELWgScEXPvJyd4WUXqcF0gNA=; b=W7vgUeJA+htVT7bcrTLdMFPBZKHk1VjWe1mI8OAVnEJYhgbTxULYBZrbA9khTf5Sac nrAqo0TMJWt0wYkSZKhQLO5I92sHLHJFtv3eU8apm5ZYLebOhcIjDcZmsx4ipT3IjtDQ uW7wUmDM26Rpy5LG3k//2TM3Be11DvsCaNwyIgY96ESEzNPuZPaR8TM2OrBcDoAPwm9Y mK8o8h5WnhtCQ9hZIdExUZxEzzSM6fY1RHJ0bEewZ0TCUSQwiX+K4iW01oAWfHHaQHfT xm3d28F+/vitwUTQGYQVOMIY86ynxCYrJ7s1+dmP45hBBsBzPTdZ6LaxzN3r9lly1njX veBA== X-Gm-Message-State: AOAM532tUOmspGlX1LxjlB14aIw3ua52EwgLDruQVNmDvuJbfKjQG19W cSLOQgTsh7W6MZpVXzudNeg= X-Google-Smtp-Source: ABdhPJyatP6ooF6fTiPb0Rt1sRHbXbUo1KzyahnlQHdnGeK3LxbGHGb3gER/Y0iGE6cfbG9CVF6nbQ== X-Received: by 2002:a05:620a:1902:b0:5f1:8f5d:b0f2 with SMTP id bj2-20020a05620a190200b005f18f5db0f2mr14090413qkb.60.1645493494768; Mon, 21 Feb 2022 17:31:34 -0800 (PST) Received: from master-x64.sparksnet (c-98-233-193-225.hsd1.dc.comcast.net. [98.233.193.225]) by smtp.gmail.com with ESMTPSA id q12sm31597841qtx.51.2022.02.21.17.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 17:31:34 -0800 (PST) From: Peter Geis To: Peng Fan , Jaehoon Chung Cc: Peter Geis , u-boot@lists.denx.de Subject: [PATCH v1 02/11] mmc: sdhci: allow disabling sdma in spl Date: Mon, 21 Feb 2022 20:31:21 -0500 Message-Id: <20220222013131.3114990-3-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222013131.3114990-1-pgwipeout@gmail.com> References: <20220222013131.3114990-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Rockchip emmc devices have a similar issue to Rockchip dwmmc devices, where performing dma to sram causes errors with suspend/resume. Allow us to toggle sdma in spl for sdhci similar to adma support, so we can ensure dma is not used when loading the sram code. Signed-off-by: Peter Geis Reviewed-by: Jaehoon Chung Reviewed-by: Kever Yang --- drivers/mmc/Kconfig | 7 +++++++ drivers/mmc/sdhci.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index f04cc44e1973..1e4342285ce7 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -468,6 +468,13 @@ config MMC_SDHCI_SDMA This enables support for the SDMA (Single Operation DMA) defined in the SD Host Controller Standard Specification Version 1.00 . +config SPL_MMC_SDHCI_SDMA + bool "Support SDHCI SDMA in SPL" + depends on MMC_SDHCI + help + This enables support for the SDMA (Single Operation DMA) defined + in the SD Host Controller Standard Specification Version 1.00 in SPL. + config MMC_SDHCI_ADMA bool "Support SDHCI ADMA2" depends on MMC_SDHCI diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 766e4a6b0c5e..6285e53d12a2 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -70,7 +70,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host, struct mmc_data *data) } } -#if (defined(CONFIG_MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)) +#if (CONFIG_IS_ENABLED(MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)) static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data, int *is_aligned, int trans_bytes) { @@ -177,7 +177,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data) } } while (!(stat & SDHCI_INT_DATA_END)); -#if (defined(CONFIG_MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)) +#if (CONFIG_IS_ENABLED(MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)) dma_unmap_single(host->start_addr, data->blocks * data->blocksize, mmc_get_dma_dir(data)); #endif @@ -836,7 +836,7 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, #endif debug("%s, caps: 0x%x\n", __func__, caps); -#ifdef CONFIG_MMC_SDHCI_SDMA +#if CONFIG_IS_ENABLED(MMC_SDHCI_SDMA) if ((caps & SDHCI_CAN_DO_SDMA)) { host->flags |= USE_SDMA; } else {