Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1236090imm; Tue, 2 Oct 2018 05:11:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV61J3mC5Hx+wzwEpcFWS8/iq23415s5M801rWtwvjQ07EVdmo3osCMPsT5njzDldNrQN8ujK X-Received: by 2002:a63:6bc2:: with SMTP id g185-v6mr14395701pgc.25.1538482299476; Tue, 02 Oct 2018 05:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482299; cv=none; d=google.com; s=arc-20160816; b=GZzZekoKdTwXFACPYTxwO9tSzkFX30OU2xIxcrjmAH0NNruUNad2gng+s3OMwwB/eq 8sokJH5GnPAh2DDWR0uBrvH5Bfp1tmNWD+NEspzZmkyt0VnvxZScK3pGEtZdq5Ng26Rm N+n+8ZHORbot7mgZqWfc4YA6dqjD+QwYVlFRQwhvY9bHF4NLeQFAa73HUV3vsnj3MeVd 0dj12XUN15SofRmqUHlMKbeaIU8L9wsIeq345LFCd7zltbYxFcatzJEN85SltLbnsWHP sxmesisdPV/ik8SwV+3sa7g5KM2NlLNG9gHvHkeZ06iUrjMpF6DfBW6+Vbk8fAIwoUH/ Njsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=HOLC281C/9qCViCFC0GLo3MM3lTiiqiUqktgYM/9VuM=; b=I1UAwT3uIf1jMERJCGMe0XDMWgvcQ6QQyqXPsoZIdJZEfxcvORgslIi4LTum1YXVvp opcZuIM6vf/Q7KNb7uaWQ5zPQWdcsWAU5JUzuFpVthuLuS6mk0TB0XCWal16WLw/7OC7 cn5PKhZwbLTsKQG9S0juxq1Tu3VVGObYmIKMziMEMs8LNGIBgh2SBky95GLI480oaUqE IiV+/+w07sh1lVHqY/VAvvpBanDMgdAabfuz4fvMZ/Kv5ubWySt+zoaPz3qcFbcl5Iq3 yWrbQ3v0h43aDi/Hi4g5nQhbufiPQ+EOrfmDeSc+5bPHcXtpwi9LyeyeQu+Z8x6jRokd TyEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i189-v6si15682412pfg.281.2018.10.02.05.11.24; Tue, 02 Oct 2018 05:11:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727871AbeJBSxO (ORCPT + 99 others); Tue, 2 Oct 2018 14:53:14 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:40779 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727768AbeJBSxN (ORCPT ); Tue, 2 Oct 2018 14:53:13 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w92C8egX013766; Tue, 2 Oct 2018 14:10:02 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2msxh6gsmw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 02 Oct 2018 14:10:02 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9969C34; Tue, 2 Oct 2018 12:10:01 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7EB6C2A3B; Tue, 2 Oct 2018 12:10:01 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:10:01 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:10:00 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , , Gerald Baeza , Loic Pallardy , , , , , , Ludovic Barre Subject: [PATCH V4 18/25] mmc: mmci: add variant property to write datactrl before command Date: Tue, 2 Oct 2018 14:09:20 +0200 Message-ID: <1538482167-13819-19-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> References: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-02_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre This patch adds a boolean property to allow to write datactrl before to send command, whatever the command type (read or write). Needed to support the STM32 sdmmc variant. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 6 ++++-- drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index ac33d23..e639841 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1262,7 +1262,8 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, mmci_request_end(host, host->mrq); } else if (sbc) { mmci_start_command(host, host->mrq->cmd, 0); - } else if (!(cmd->data->flags & MMC_DATA_READ)) { + } else if (!host->variant->datactrl_first && + !(cmd->data->flags & MMC_DATA_READ)) { mmci_start_data(host, cmd->data); } } @@ -1526,7 +1527,8 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) if (mrq->data) mmci_get_next_data(host, mrq->data); - if (mrq->data && mrq->data->flags & MMC_DATA_READ) + if (mrq->data && + (host->variant->datactrl_first || mrq->data->flags & MMC_DATA_READ)) mmci_start_data(host, mrq->data); if (mrq->sbc) diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 4b10c82..4e5c6c6 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -223,6 +223,7 @@ struct mmci_host; * @datactrl_mask_sdio: SDIO enable mask in datactrl register * @datactrl_blksz: block size in power of two * @datactrl_dpsm_enable: enable value for DPSM + * @datactrl_first: true if data must be setup before send command * @pwrreg_powerup: power up value for MMCIPOWER register * @f_max: maximum clk frequency supported by the controller. * @signal_direction: input/out direction of bus signals can be indicated @@ -262,6 +263,7 @@ struct variant_data { unsigned int datactrl_mask_sdio; unsigned int datactrl_blocksz; unsigned int datactrl_dpsm_enable; + u8 datactrl_first:1; u8 st_sdio:1; u8 st_clkdiv:1; u8 blksz_datactrl16:1; -- 2.7.4