Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10819283imu; Thu, 6 Dec 2018 07:16:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VR1Pj59Qci1ZTTK06nqQuK46wKpFexH0NEsfSoth2s4CBS2wmLtZDmqDb5rn+Gvc8GT/c8 X-Received: by 2002:a62:710a:: with SMTP id m10mr28175428pfc.69.1544109378218; Thu, 06 Dec 2018 07:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544109378; cv=none; d=google.com; s=arc-20160816; b=MojEuiEeexnNSANCSZ2xzkJ+E0mzJobV04Vdu413pShJw3s5LAzkV1hfNV2+Cx/L2s cQhAcWYVpl9BurD/hJ2XuPX2F+gZroTUtz6IM0ifoLdFlShfvHEQcNmfzI/QtijhF4tU 8eJTENAgtJmmG9Hv+gbdBoIcB3NNCpCtcqSG+diORDhlR/jcT+KHYEOOqQEXfp5NoUqw gQiTC3vcSEW+gKUZ678hHOfcC0i0K5WAGP4rAQCwVqyAc8/4U2JOT2374kVDjXB556j3 PEHRQxgnXVLmF5/qOoa0T7aQfu/QTuM2+IU76Tjg5Vg7TXXobaUfG9+D+GiSGoE9R40/ m8Ig== 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=UOQa5Fm4Uf0qhIRQA99PieOlGXvhwHv7CfV0pXSu4go=; b=HbnyBmeNq+KphosGOG8eZH5PNSjV78fPGsqMaIqp/yhk/NO1KICUfG4Y7/3oq9Vx87 6QaIAFnyPV8hwjGQ92aJJSMZCoOqfe5dUJYsEPHLmTZIF038rRnAnulcGUJWl8ak3ZEl vmBc+LfsI4a3JOJacnN9oFvvCuozqq+9XCy2rhhnONdO3JC26Rb/mfbo+RHE2X6/Fn2w jwsY4M2HobSBqtN9lHbzYAVvRiS75GXkvOIUNsKD0XZ80S5jzVEP9YzolbLEARYyVRkf mTw4tCnZXbuHgziTCJiRvkwq8WBi9bxDjpRAx8QKnlwRIyulKQjGp9DJ9pT183cxtWDs LWTQ== 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 r11si365174pgg.327.2018.12.06.07.15.29; Thu, 06 Dec 2018 07:16:18 -0800 (PST) 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 S1726096AbeLFPOI (ORCPT + 99 others); Thu, 6 Dec 2018 10:14:08 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:58487 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725930AbeLFPOD (ORCPT ); Thu, 6 Dec 2018 10:14:03 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wB6FCLCh010541; Thu, 6 Dec 2018 16:13:37 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2p3wt6w3cp-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 06 Dec 2018 16:13:37 +0100 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 E14983A; Thu, 6 Dec 2018 15:13:36 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B6CD84E1B; Thu, 6 Dec 2018 15:13:36 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.92) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 6 Dec 2018 16:13:37 +0100 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; Thu, 6 Dec 2018 16:13:36 +0100 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: , Maxime Coquelin , Alexandre Torgue , , , , , , Ludovic Barre Subject: [PATCH V3 1/2] mmc: mmci: add variant property to set command stop bit Date: Thu, 6 Dec 2018 16:13:31 +0100 Message-ID: <1544109212-12621-2-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544109212-12621-1-git-send-email-ludovic.Barre@st.com> References: <1544109212-12621-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-12-06_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre On cmd12 (STOP_TRANSMISSION), STM32 sdmmc variant needs to set cmdstop bit in command register. The CPSM ("Command Path State Machine") treats the command as a Stop Transmission command and signals abort to the DPSM ("Data Path State Machine"). Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 6 ++++++ drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 13fa640..e352f5a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -274,6 +275,7 @@ static struct variant_data variant_stm32_sdmmc = { .cmdreg_lrsp_crc = MCI_CPSM_STM32_LRSP_CRC, .cmdreg_srsp_crc = MCI_CPSM_STM32_SRSP_CRC, .cmdreg_srsp = MCI_CPSM_STM32_SRSP, + .cmdreg_stop = MCI_CPSM_STM32_CMDSTOP, .data_cmd_enable = MCI_CPSM_STM32_CMDTRANS, .irq_pio_mask = MCI_IRQ_PIO_STM32_MASK, .datactrl_first = true, @@ -1100,6 +1102,10 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) mmci_reg_delay(host); } + if (host->variant->cmdreg_stop && + cmd->opcode == MMC_STOP_TRANSMISSION) + c |= host->variant->cmdreg_stop; + c |= cmd->opcode | host->variant->cmdreg_cpsm_enable; if (cmd->flags & MMC_RSP_PRESENT) { if (cmd->flags & MMC_RSP_136) diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 550dd39..2422909 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -264,6 +264,7 @@ struct mmci_host; * @cmdreg_lrsp_crc: enable value for long response with crc * @cmdreg_srsp_crc: enable value for short response with crc * @cmdreg_srsp: enable value for short response without crc + * @cmdreg_stop: enable value for stop and abort transmission * @datalength_bits: number of bits in the MMCIDATALENGTH register * @fifosize: number of bytes that can be written when MMCI_TXFIFOEMPTY * is asserted (likewise for RX) @@ -316,6 +317,7 @@ struct variant_data { unsigned int cmdreg_lrsp_crc; unsigned int cmdreg_srsp_crc; unsigned int cmdreg_srsp; + unsigned int cmdreg_stop; unsigned int datalength_bits; unsigned int fifosize; unsigned int fifohalfsize; -- 2.7.4