Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 170ADC433F5 for ; Sat, 12 Mar 2022 09:44:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DF2D083A4F; Sat, 12 Mar 2022 10:44:08 +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="kGsKnFNH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 328CF83AE7; Sat, 12 Mar 2022 10:44:07 +0100 (CET) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 322308390E for ; Sat, 12 Mar 2022 10:44:03 +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=jbx6244@gmail.com Received: by mail-ej1-x62b.google.com with SMTP id qt6so23842717ejb.11 for ; Sat, 12 Mar 2022 01:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Q2LREoRcfR4WvPW+jjFydmgmesUaoeSgPSfMcSzWkX4=; b=kGsKnFNHPXBBphsGFsjpLOlLjHKhtLG+uw9LOFybZ6rJ7DYmSLzPH/rHPpU8GTboAz GwHj4WH+3FYHhZ30c3JIuvzeZBMK+rn5Vt5EgG5raF+JpYa8HpKb23y3vVPuxGf//4fp 5wH98x03muJIz36h7qmMK0OY5Vk+GNxKKdfT9OmMvkr1adKHrdvN/VaN1TA+sFHKllQp +Q6W5nK4K6QT5BB2P82y+5a2O/ZDuiTJwqVeTZvUHqR5abQGKBWxeN5NakfgbAK93ePe 795gQLCk1Qe0efMvz+/VaI2Y+YWk5CrUgjrHHQ8BFQtrXQcX6K+5PiN36U8rLr1qtrCG 6Mpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Q2LREoRcfR4WvPW+jjFydmgmesUaoeSgPSfMcSzWkX4=; b=MdnP3TccoEDtK+gH0rm3pt4D+TBtYRXsvcS/iiQELiZDaQm9W3/wIVvv7Z0b7Pq6XV xWeyixkRp1fYsznk+kRAfy2tJNsRvv1KXdAsOheLHF2w8JaJI3KKR8EGkFcJMPM5Zfmh u4pOSaBS4exFx/Dsfgh8cBwJ3M4ixJJOWJswsrMCt7F1ltl0A29+R9aPRWsAgdrpkwzx hPOYlukQJxjQMukSYVRgO5TWup2xgReZC8Wg5fanFsmoqyi5m2YvaezsNX6fNN4ykIvg 0AJhV+r76dfXGvEurPXFdaIu/k4hZeDazZoHURYsqrO5XExI5gBCS2VY0HwUvPJPCCOB 3x6w== X-Gm-Message-State: AOAM533P2RCARJcDQP5MnGJd1imsVmsQOwOAghtn0nRxlARH5GzgVuhX fC811rO7SYombMshvcI2nuQ= X-Google-Smtp-Source: ABdhPJyo20ih5e46w4N4qgqKDocITShaIcvKiF4norQXl/JLu+1qJjEBxBVHbDRv9seIHxGojKInVw== X-Received: by 2002:a17:906:c02:b0:6da:ebb3:b1c4 with SMTP id s2-20020a1709060c0200b006daebb3b1c4mr11528411ejf.719.1647078242773; Sat, 12 Mar 2022 01:44:02 -0800 (PST) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id g13-20020a50bf4d000000b00410d407da2esm4615269edk.13.2022.03.12.01.44.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Mar 2022 01:44:02 -0800 (PST) Message-ID: <5530f573-2725-db46-4b24-938c0e09925b@gmail.com> Date: Sat, 12 Mar 2022 10:44:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 2/2] mmc: dw_mmc: support transfer mode auto detection Content-Language: en-US To: Jagan Teki Cc: kever.yang@rock-chips.com, sjg@chromium.org, philipp.tomsich@vrull.eu, peng.fan@nxp.com, jh80.chung@samsung.com, paweljarosz3691@gmail.com, u-boot@lists.denx.de References: <20220223130714.2711-1-jbx6244@gmail.com> <20220223130714.2711-2-jbx6244@gmail.com> From: Johan Jonker In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 On 3/12/22 10:23, Jagan Teki wrote: > On Wed, Feb 23, 2022 at 6:37 PM Johan Jonker wrote: >> >> From: Paweł Jarosz >> >> dw_mmc supports two transfer modes in u-boot: IDMA and FIFO. >> This patch adds auto detection of transfer mode and >> eliminates the need to set this in host config struct. >> Allow handling for a u-boot,spl-fifo-mode host property in the >> logic to not put the MMC controllers into FIFO mode for all time. > > Does it mean fifo-mode property is not useful in SPI and U-Boot > proper? If yes better drop that change as part of this patch. This is about setting the fifo-mode for rk3066/rk3188 without DT as these early models don't seem to have IDMA. Handling of the fifo_mode variable is still needed for the Rockchip exception that needs to be included in the logic. rockchip: dwmmc: add handling for u-boot, spl-fifo-mode https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/commit/c8dd0e42d709c9734f313c547d0707e27ca0de51 We could remove normal fifo-mode parsing, but as this is a generic file for multiple SoC families I'm a little bit reluctant to change that for other drivers then Rockchip. Otherwise patch V1 does the job without changing dw_mmc.c Please advise what direction we should go or what changes should be made. Kind regards, Johan Jonker >> >> Signed-off-by: Paweł Jarosz >> Signed-off-by: Johan Jonker >> --- >> >> Changed V2: >> use bitfield_extract >> remove use_dma variable >> include fifo_mode from host in logic >> --- >> drivers/mmc/dw_mmc.c | 6 ++++++ >> include/dwmmc.h | 5 +++++ >> 2 files changed, 11 insertions(+) >> >> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c >> index a949dad5..7e2cd5ed 100644 >> --- a/drivers/mmc/dw_mmc.c >> +++ b/drivers/mmc/dw_mmc.c >> @@ -536,6 +536,12 @@ static int dwmci_init(struct mmc *mmc) >> return -EIO; >> } >> >> + if (!host->fifo_mode && >> + SDMMC_GET_TRANS_MODE(dwmci_readl(host, DWMCI_HCON)) == DMA_INTERFACE_IDMA) >> + host->fifo_mode = 0; >> + else >> + host->fifo_mode = 1; > > fifo_mode is bool so use true/false. > > Jagan.