All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajeshwari S Shinde <rajeshwari.s@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 10/10 V6] DWMMC: SMDK5420: Disable SMU for eMMC
Date: Tue, 29 Oct 2013 12:53:13 +0530	[thread overview]
Message-ID: <1383031393-6093-11-git-send-email-rajeshwari.s@samsung.com> (raw)
In-Reply-To: <1383031393-6093-1-git-send-email-rajeshwari.s@samsung.com>

SMDK5420 has a new Security Management Unit added
for dwmmc driver, hence, configuring the control
registers to support booting via eMMC.

Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
---
Changes in V3:
	- New patch.
Changes in V4:
	Added flag to dissble SMU
Changes in V5:
	- None
Changes in V6:
	- Moved the SMU definitions to arch/arm dwmmc.h
 arch/arm/include/asm/arch-exynos/dwmmc.h | 13 +++++++++++++
 drivers/mmc/dw_mmc.c                     | 11 +++++++++++
 drivers/mmc/exynos_dw_mmc.c              |  3 +++
 include/dwmmc.h                          |  3 +++
 4 files changed, 30 insertions(+)

diff --git a/arch/arm/include/asm/arch-exynos/dwmmc.h b/arch/arm/include/asm/arch-exynos/dwmmc.h
index b9eca76..d1c5d4f 100644
--- a/arch/arm/include/asm/arch-exynos/dwmmc.h
+++ b/arch/arm/include/asm/arch-exynos/dwmmc.h
@@ -14,6 +14,19 @@
 #define DWMCI_SET_DRV_CLK(x)	((x) << 16)
 #define DWMCI_SET_DIV_RATIO(x)	((x) << 24)
 
+#define EMMCP_MPSBEGIN0		0x1200
+#define EMMCP_SEND0		0x1204
+#define EMMCP_CTRL0		0x120C
+
+#define MPSCTRL_SECURE_READ_BIT		(0x1<<7)
+#define MPSCTRL_SECURE_WRITE_BIT	(0x1<<6)
+#define MPSCTRL_NON_SECURE_READ_BIT	(0x1<<5)
+#define MPSCTRL_NON_SECURE_WRITE_BIT	(0x1<<4)
+#define MPSCTRL_USE_FUSE_KEY		(0x1<<3)
+#define MPSCTRL_ECB_MODE		(0x1<<2)
+#define MPSCTRL_ENCRYPTION		(0x1<<1)
+#define MPSCTRL_VALID			(0x1<<0)
+
 #ifdef CONFIG_OF_CONTROL
 int exynos_dwmmc_init(const void *blob);
 #endif
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 9a803a0..a3506d4 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -11,6 +11,7 @@
 #include <mmc.h>
 #include <dwmmc.h>
 #include <asm-generic/errno.h>
+#include <asm/arch/dwmmc.h>
 
 #define PAGE_SIZE 4096
 
@@ -301,6 +302,16 @@ static int dwmci_init(struct mmc *mmc)
 	struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
 	u32 fifo_size;
 
+	if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
+		dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
+		dwmci_writel(host, EMMCP_SEND0, 0);
+		dwmci_writel(host, EMMCP_CTRL0,
+			     MPSCTRL_SECURE_READ_BIT |
+			     MPSCTRL_SECURE_WRITE_BIT |
+			     MPSCTRL_NON_SECURE_READ_BIT |
+			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
+	}
+
 	dwmci_writel(host, DWMCI_PWREN, 1);
 
 	if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) {
diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
index 4ef9fec..f7439a0 100644
--- a/drivers/mmc/exynos_dw_mmc.c
+++ b/drivers/mmc/exynos_dw_mmc.c
@@ -62,6 +62,9 @@ int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel)
 	host->name = "EXYNOS DWMMC";
 	host->ioaddr = (void *)regbase;
 	host->buswidth = bus_width;
+#ifdef CONFIG_EXYNOS5420
+	host->quirks = DWMCI_QUIRK_DISABLE_SMU;
+#endif
 
 	if (clksel) {
 		host->clksel_val = clksel;
diff --git a/include/dwmmc.h b/include/dwmmc.h
index 08ced0b..6263140 100644
--- a/include/dwmmc.h
+++ b/include/dwmmc.h
@@ -123,6 +123,9 @@
 #define DWMCI_BMOD_IDMAC_FB	(1 << 1)
 #define DWMCI_BMOD_IDMAC_EN	(1 << 7)
 
+/* quirks */
+#define DWMCI_QUIRK_DISABLE_SMU		(1 << 0)
+
 struct dwmci_host {
 	char *name;
 	void *ioaddr;
-- 
1.7.12.4

  parent reply	other threads:[~2013-10-29  7:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  7:23 [U-Boot] [PATCH 00/10 V6] EXYNOS5420: Add SMDK5420 board support Rajeshwari S Shinde
2013-10-29  7:23 ` [U-Boot] [PATCH 01/10 V6] EXYNOS5: Create a common board file Rajeshwari S Shinde
2013-11-08  8:13   ` Przemyslaw Marczak
2013-11-08  8:37     ` Rajeshwari Birje
2013-11-08  9:03       ` Przemyslaw Marczak
2013-11-08  9:27         ` Rajeshwari Birje
2013-11-08  9:46           ` Przemyslaw Marczak
2013-11-08  9:52             ` Rajeshwari Birje
2013-10-29  7:23 ` [U-Boot] [PATCH 02/10 V6] Exynos5420: Add base addresses for 5420 Rajeshwari S Shinde
2013-11-13  3:20   ` Minkyu Kang
2013-10-29  7:23 ` [U-Boot] [PATCH 03/10 V6] Exynos5420: Add clock initialization " Rajeshwari S Shinde
2013-11-13  2:45   ` Minkyu Kang
2013-11-13 11:17     ` Rajeshwari Birje
2013-11-14  1:56       ` Minkyu Kang
2013-10-29  7:23 ` [U-Boot] [PATCH 04/10 V6] Exynos5420: Add DDR3 " Rajeshwari S Shinde
2013-11-13  3:24   ` Minkyu Kang
2013-10-29  7:23 ` [U-Boot] [PATCH 05/10 V6] Exynos5420: Add support for 5420 in pinmux and gpio Rajeshwari S Shinde
2013-11-13  3:01   ` Minkyu Kang
2013-11-13  6:04     ` Rajeshwari Birje
2013-11-13  6:08       ` Rajeshwari Birje
2013-11-14  2:46       ` Minkyu Kang
2013-10-29  7:23 ` [U-Boot] [PATCH 06/10 V6] Exynos5420: Add base patch for SMDK5420 Rajeshwari S Shinde
2013-11-13  3:09   ` Minkyu Kang
2013-10-29  7:23 ` [U-Boot] [PATCH 07/10 V6] DTS: Add dts support " Rajeshwari S Shinde
2013-11-13  3:17   ` Minkyu Kang
2013-11-13  4:26     ` Rajeshwari Birje
2013-11-14  2:01       ` Minkyu Kang
2013-11-15  2:32         ` Rajeshwari Birje
2013-10-29  7:23 ` [U-Boot] [PATCH 08/10 V6] Config: Add initial config " Rajeshwari S Shinde
2013-11-13  3:31   ` Minkyu Kang
2013-10-29  7:23 ` [U-Boot] [PATCH 09/10 V6] SPL: EXYNOS: Prepare for variable size SPL support Rajeshwari S Shinde
2013-10-29  7:23 ` Rajeshwari S Shinde [this message]
2013-10-29 10:24   ` [U-Boot] [PATCH 10/10 V6] DWMMC: SMDK5420: Disable SMU for eMMC Jaehoon Chung
2013-10-31  7:50   ` Pantelis Antoniou
2013-10-31  8:42 ` [U-Boot] [PATCH 00/10 V6] EXYNOS5420: Add SMDK5420 board support Rajeshwari Birje
2013-11-06 11:42   ` Rajeshwari Birje
2013-11-07  1:32     ` Minkyu Kang

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=1383031393-6093-11-git-send-email-rajeshwari.s@samsung.com \
    --to=rajeshwari.s@samsung.com \
    --cc=u-boot@lists.denx.de \
    /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.