All of lore.kernel.org
 help / color / mirror / Atom feed
From: <patrice.chotard@st.com>
To: Russell King <linux@armlinux.org.uk>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexandre Torgue <alexandre.torgue@st.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	Patrice Chotard <patrice.chotard@st.com>,
	Andrea Merello <andrea.merello@gmail.com>
Subject: [PATCH v2 02/15] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag
Date: Tue, 16 Jan 2018 13:30:46 +0100	[thread overview]
Message-ID: <1516105859-3525-3-git-send-email-patrice.chotard@st.com> (raw)
In-Reply-To: <1516105859-3525-1-git-send-email-patrice.chotard@st.com>

From: Patrice Chotard <patrice.chotard@st.com>

This patch prepares for supporting the STM32 variant that
has no such bit in the status register.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

v2: _ replace start_err bool type by u32

 drivers/mmc/host/mmci.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 3125dc0..8a4fbc2 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -83,6 +83,8 @@
  * @qcom_dml: enables qcom specific dma glue for dma transfers.
  * @reversed_irq_handling: handle data irq before cmd irq.
  * @mmcimask1: true if variant have a MMCIMASK1 register.
+ * @start_err: bitmask identifying the STARTBITERR bit inside MMCISTATUS
+ *	       register.
  */
 struct variant_data {
 	unsigned int		clkreg;
@@ -113,6 +115,7 @@ struct variant_data {
 	bool			qcom_dml;
 	bool			reversed_irq_handling;
 	bool			mmcimask1;
+	u32			start_err;
 };
 
 static struct variant_data variant_arm = {
@@ -123,6 +126,7 @@ struct variant_data {
 	.f_max			= 100000000,
 	.reversed_irq_handling	= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_arm_extended_fifo = {
@@ -132,6 +136,7 @@ struct variant_data {
 	.pwrreg_powerup		= MCI_PWR_UP,
 	.f_max			= 100000000,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_arm_extended_fifo_hwfc = {
@@ -142,6 +147,7 @@ struct variant_data {
 	.pwrreg_powerup		= MCI_PWR_UP,
 	.f_max			= 100000000,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_u300 = {
@@ -158,6 +164,7 @@ struct variant_data {
 	.pwrreg_clkgate		= true,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_nomadik = {
@@ -175,6 +182,7 @@ struct variant_data {
 	.pwrreg_clkgate		= true,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_ux500 = {
@@ -198,6 +206,7 @@ struct variant_data {
 	.busy_detect_mask	= MCI_ST_BUSYENDMASK,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_ux500v2 = {
@@ -223,6 +232,7 @@ struct variant_data {
 	.busy_detect_mask	= MCI_ST_BUSYENDMASK,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_qcom = {
@@ -242,6 +252,7 @@ struct variant_data {
 	.qcom_fifo		= true,
 	.qcom_dml		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 /* Busy detection for the ST Micro variant */
@@ -935,8 +946,9 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 		return;
 
 	/* First check for errors */
-	if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR|
-		      MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
+	if (status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT |
+		      host->variant->start_err |
+		      MCI_TXUNDERRUN | MCI_RXOVERRUN)) {
 		u32 remain, success;
 
 		/* Terminate the DMA transfer */
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: <patrice.chotard@st.com>
To: Russell King <linux@armlinux.org.uk>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexandre Torgue <alexandre.torgue@st.com>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-clk@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-gpio@vger.kernel.org>, <devicetree@vger.kernel.org>,
	Patrice Chotard <patrice.chotard@st.com>,
	Andrea Merello <andrea.merello@gmail.com>
Subject: [PATCH v2 02/15] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag
Date: Tue, 16 Jan 2018 13:30:46 +0100	[thread overview]
Message-ID: <1516105859-3525-3-git-send-email-patrice.chotard@st.com> (raw)
In-Reply-To: <1516105859-3525-1-git-send-email-patrice.chotard@st.com>

From: Patrice Chotard <patrice.chotard@st.com>

This patch prepares for supporting the STM32 variant that
has no such bit in the status register.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

v2: _ replace start_err bool type by u32

 drivers/mmc/host/mmci.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 3125dc0..8a4fbc2 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -83,6 +83,8 @@
  * @qcom_dml: enables qcom specific dma glue for dma transfers.
  * @reversed_irq_handling: handle data irq before cmd irq.
  * @mmcimask1: true if variant have a MMCIMASK1 register.
+ * @start_err: bitmask identifying the STARTBITERR bit inside MMCISTATUS
+ *	       register.
  */
 struct variant_data {
 	unsigned int		clkreg;
@@ -113,6 +115,7 @@ struct variant_data {
 	bool			qcom_dml;
 	bool			reversed_irq_handling;
 	bool			mmcimask1;
+	u32			start_err;
 };
 
 static struct variant_data variant_arm = {
@@ -123,6 +126,7 @@ struct variant_data {
 	.f_max			= 100000000,
 	.reversed_irq_handling	= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_arm_extended_fifo = {
@@ -132,6 +136,7 @@ struct variant_data {
 	.pwrreg_powerup		= MCI_PWR_UP,
 	.f_max			= 100000000,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_arm_extended_fifo_hwfc = {
@@ -142,6 +147,7 @@ struct variant_data {
 	.pwrreg_powerup		= MCI_PWR_UP,
 	.f_max			= 100000000,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_u300 = {
@@ -158,6 +164,7 @@ struct variant_data {
 	.pwrreg_clkgate		= true,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_nomadik = {
@@ -175,6 +182,7 @@ struct variant_data {
 	.pwrreg_clkgate		= true,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_ux500 = {
@@ -198,6 +206,7 @@ struct variant_data {
 	.busy_detect_mask	= MCI_ST_BUSYENDMASK,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_ux500v2 = {
@@ -223,6 +232,7 @@ struct variant_data {
 	.busy_detect_mask	= MCI_ST_BUSYENDMASK,
 	.pwrreg_nopower		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 static struct variant_data variant_qcom = {
@@ -242,6 +252,7 @@ struct variant_data {
 	.qcom_fifo		= true,
 	.qcom_dml		= true,
 	.mmcimask1		= true,
+	.start_err		= MCI_STARTBITERR,
 };
 
 /* Busy detection for the ST Micro variant */
@@ -935,8 +946,9 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 		return;
 
 	/* First check for errors */
-	if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR|
-		      MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
+	if (status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT |
+		      host->variant->start_err |
+		      MCI_TXUNDERRUN | MCI_RXOVERRUN)) {
 		u32 remain, success;
 
 		/* Terminate the DMA transfer */
-- 
1.9.1

  parent reply	other threads:[~2018-01-16 12:32 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 12:30 [PATCH v2 00/15] Add MMCI support for STM32F SoCs family patrice.chotard
2018-01-16 12:30 ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 01/15] mmc: mmci: Don't pretend all variants to have MMCIMASK1 register patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` patrice.chotard [this message]
2018-01-16 12:30   ` [PATCH v2 02/15] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag patrice.chotard
2018-01-16 12:30 ` [PATCH v2 03/15] mmc: mmci: Don't pretend all variants to have OPENDRAIN bit patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-17  9:33   ` Ulf Hansson
2018-01-17  9:33     ` Ulf Hansson
2018-01-18 13:24     ` Patrice CHOTARD
2018-01-18 13:24       ` Patrice CHOTARD
2018-01-18 13:24       ` Patrice CHOTARD
2018-01-18 13:24       ` Patrice CHOTARD
2018-01-16 12:30 ` [PATCH v2 04/15] mmc: mmci: Add support for setting pad type via pinctrl patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-17  9:34   ` Ulf Hansson
2018-01-17  9:34     ` Ulf Hansson
2018-01-18 13:35     ` Patrice CHOTARD
2018-01-18 13:35       ` Patrice CHOTARD
2018-01-18 13:35       ` Patrice CHOTARD
2018-01-16 12:30 ` [PATCH v2 05/15] mmc: mmci: Add STM32 variant patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 06/15] ARM: dts: stm32: Add SDIO controller for stm32f746 patrice.chotard
2018-01-16 12:30   ` patrice.chotard
     [not found] ` <1516105859-3525-1-git-send-email-patrice.chotard-qxv4g6HH51o@public.gmane.org>
2018-01-16 12:30   ` [PATCH v2 07/15] ARM: dts: stm32: Add SDIO controller for stm32f429 patrice.chotard-qxv4g6HH51o
2018-01-16 12:30     ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 08/15] ARM: dts: stm32: Add pin map for SDIO controller on stm32f4 patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 09/15] ARM: dts: stm32: Enable SDIO controller on stm32f469 disco board patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 10/15] ARM: dts: stm32: Enable SDIO controller on stm32429i-eval board patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 11/15] ARM: stm32: Add AMBA support for STM32F4 and STM32F7 SoCs patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 12/15] ARM: configs: stm32: Enable MMC_ARMMMCI support patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 13/15] ARM: configs: stm32: Enable EXT3_FS support patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-01-16 12:30 ` [PATCH v2 14/15] clk: stm32: Add clk entry for SDMMC2 on stm32F769 patrice.chotard
2018-01-16 12:30   ` patrice.chotard
2018-02-26  8:41   ` Patrice CHOTARD
2018-02-26  8:41     ` Patrice CHOTARD
2018-02-26  8:41     ` Patrice CHOTARD
2018-03-01  9:12     ` Linus Walleij
2018-03-01  9:12       ` Linus Walleij
2018-03-01  9:42       ` Patrice CHOTARD
2018-03-01  9:42         ` Patrice CHOTARD
2018-03-01  9:42         ` Patrice CHOTARD
2018-03-01  9:42         ` Patrice CHOTARD
2018-03-15 21:24       ` Stephen Boyd
2018-03-15 21:24         ` Stephen Boyd
2018-03-15 21:24         ` Stephen Boyd
2018-01-16 12:30 ` [PATCH v2 15/15] gpio: stmpe: i2c transfer are forbiden in atomic context patrice.chotard
2018-01-16 12:30   ` patrice.chotard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516105859-3525-3-git-send-email-patrice.chotard@st.com \
    --to=patrice.chotard@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=andrea.merello@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.