All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/7] mmc: sunxi: Add DM_MMC support for H6
Date: Thu, 17 Jan 2019 22:39:48 +0530	[thread overview]
Message-ID: <20190117170951.23623-5-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20190117170951.23623-1-jagan@amarulasolutions.com>

Unlike other Allwinner SoC's, H6 comes with different
clock and reset control offset values. So support them
via driver data.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 .../arm/include/asm/arch-sunxi/clock_sun50i_h6.h |  3 +++
 drivers/mmc/sunxi_mmc.c                          | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h b/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h
index e36937059b..baf9b2e6e2 100644
--- a/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h
+++ b/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h
@@ -301,6 +301,9 @@ struct sunxi_ccm_reg {
 #define DRAM_CLK_SRC_PLL5		(0 << 24)
 #define DRAM_CLK_M(m)			(((m)-1) << 0)
 
+/* MMC ahb clock bit field */
+#define AHB_GATE_OFFSET_MMC(n)		((n))
+
 /* MMC clock bit field */
 #define CCM_MMC_CTRL_M(x)		((x) - 1)
 #define CCM_MMC_CTRL_N(x)		((x) << 8)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index b1c177bba3..5b9ac5f82c 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -697,6 +697,14 @@ static const struct sunxi_mmc_variant sun7i_a20_variant = {
 	.reset_start_bit = 8,
 };
 
+static const struct sunxi_mmc_variant sun50i_h6_variant = {
+	.has_reset = true,
+	.gate_offset = 0x84c,
+	.mclk_offset = 0x830,
+	.reset_offset = 0x84c,
+	.reset_start_bit = 16,
+};
+
 static const struct udevice_id sunxi_mmc_ids[] = {
 	{
 	  .compatible = "allwinner,sun4i-a10-mmc",
@@ -722,6 +730,14 @@ static const struct udevice_id sunxi_mmc_ids[] = {
 	  .compatible = "allwinner,sun50i-a64-emmc",
 	  .data = (ulong)&sun7i_a20_variant,
 	},
+	{
+	  .compatible = "allwinner,sun50i-h6-mmc",
+	  .data = (ulong)&sun50i_h6_variant,
+	},
+	{
+	  .compatible = "allwinner,sun50i-h6-emmc",
+	  .data = (ulong)&sun50i_h6_variant,
+	},
 	{ /* sentinel */ }
 };
 
-- 
2.18.0.321.gffc6fa0e3

  parent reply	other threads:[~2019-01-17 17:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 17:09 [U-Boot] [PATCH v2 0/7] mmc: sunxi: Enable DM_MMC Jagan Teki
2019-01-17 17:09 ` [U-Boot] [PATCH v2 1/7] mmc: sunxi: Configure reset support for DM_MMC Jagan Teki
2019-01-17 17:09 ` [U-Boot] [PATCH v2 2/7] mmc: sunxi: Add A83T emmc compatible Jagan Teki
2019-01-17 17:09 ` [U-Boot] [PATCH v2 3/7] mmc: sunxi: Add mmc, emmc H5/A64 compatible Jagan Teki
2019-01-17 17:09 ` Jagan Teki [this message]
2019-01-17 17:09 ` [U-Boot] [PATCH v2 5/7] mmc: sunxi: Add DM_MMC support for A80 Jagan Teki
2019-01-17 17:09 ` [U-Boot] [PATCH v2 6/7] arm: sunxi: Enable DM_MMC Jagan Teki
2019-01-17 17:09 ` [U-Boot] [PATCH v2 7/7] arm: dts: sunxi: Enumerate MMC2 as MMC1 Jagan Teki
2019-01-18 11:53 ` [U-Boot] [PATCH v2 0/7] mmc: sunxi: Enable DM_MMC Andre Przywara
2019-01-18 12:17   ` Tom Rini
2019-01-18 12:30     ` Andre Przywara
2019-01-18 16:41       ` Jagan Teki
2019-01-18 17:48         ` Andre Przywara
2019-01-19  5:50           ` Jagan Teki
2019-01-19 10:17             ` André Przywara

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=20190117170951.23623-5-jagan@amarulasolutions.com \
    --to=jagan@amarulasolutions.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.