public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-esdhc-imx: Enable boot partition access from DT
@ 2014-09-02 15:49 Jean-Michel Hautbois
  2014-09-03  2:59 ` Dong Aisheng
  2014-09-03  8:30 ` Ulf Hansson
  0 siblings, 2 replies; 7+ messages in thread
From: Jean-Michel Hautbois @ 2014-09-02 15:49 UTC (permalink / raw)
  To: linux-mmc, linux-kernel, devicetree
  Cc: rmk+kernel, shawn.guo, b29396, peter.griffin, tgih.jun, h80.chung,
	ulf.hansson, chris, galak, ijc+devicetree, mark.rutland,
	pawel.moll, robh+dt, Jean-Michel Hautbois

This property is useful when we don't want to access boot partitions on eMMC

Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
---
 Documentation/devicetree/bindings/mmc/mmc.txt | 1 +
 drivers/mmc/host/sdhci-esdhc-imx.c            | 8 ++++++++
 include/linux/platform_data/mmc-esdhc-imx.h   | 1 +
 3 files changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 431716e..59cc854 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -40,6 +40,7 @@ Optional properties:
 - mmc-hs200-1_2v: eMMC HS200 mode(1.2V I/O) is supported
 - mmc-hs400-1_8v: eMMC HS400 mode(1.8V I/O) is supported
 - mmc-hs400-1_2v: eMMC HS400 mode(1.2V I/O) is supported
+- no-boot-part : when preset, tells to access boot partitions

 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index ccec0e3..439e663 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -942,6 +942,11 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
	if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
		boarddata->delay_line = 0;

+	if (of_find_property(np, "no-boot-part", NULL))
+		boarddata->access_boot_part = false;
+	else
+		boarddata->access_boot_part = true;
+
	return 0;
 }
 #else
@@ -1119,6 +1124,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
	}

+	if (!boarddata->access_boot_part)
+		host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC;
+
	err = sdhci_add_host(host);
	if (err)
		goto disable_clk;
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h
index 75f70f6..a34ee9e 100644
--- a/include/linux/platform_data/mmc-esdhc-imx.h
+++ b/include/linux/platform_data/mmc-esdhc-imx.h
@@ -46,5 +46,6 @@ struct esdhc_platform_data {
	unsigned int f_max;
	bool support_vsel;
	unsigned int delay_line;
+	bool access_boot_part;
 };
 #endif /* __ASM_ARCH_IMX_ESDHC_H */

2.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-04  0:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-02 15:49 [PATCH] mmc: sdhci-esdhc-imx: Enable boot partition access from DT Jean-Michel Hautbois
2014-09-03  2:59 ` Dong Aisheng
2014-09-03  8:30 ` Ulf Hansson
2014-09-03  9:02   ` Adrian Hunter
2014-09-03  9:09     ` Ulf Hansson
2014-09-03 13:08       ` Jean-Michel Hautbois
2014-09-04  0:59         ` Hsin-Hsiang Tseng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox