All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: [PATCH 3/3] mmc: sunxi: Add support to the Allwinner A83T
Date: Wed, 20 Jul 2016 20:28:47 +0200	[thread overview]
Message-ID: <0ddc5f7d9a42515f901c95b8c0c1f5a5e4d575e9.1469082481.git.moinejf@free.fr> (raw)
In-Reply-To: <cover.1469082481.git.moinejf-GANU6spQydw@public.gmane.org>

The rate of the PLL-PERIPH clock is usually set to 1.2GHz in the A83T.
This patch sets the phase delays of the output and sample clocks
accordingly.

Signed-off-by: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
---
Note: The impacted phase delays are only for 50MHz.
The phase delays are not used in 50MHz 8 bits DDR (new timing mode).
---
 drivers/mmc/host/sunxi-mmc.c | 11 +++++++++++
 1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 7f9c31a..e161a64 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -961,6 +961,7 @@ static int sunxi_mmc_card_busy(struct mmc_host *mmc)
 static const struct of_device_id sunxi_mmc_of_match[] = {
 	{ .compatible = "allwinner,sun4i-a10-mmc", },
 	{ .compatible = "allwinner,sun5i-a13-mmc", },
+	{ .compatible = "allwinner,sun8i-a83t-mmc", },
 	{ .compatible = "allwinner,sun9i-a80-mmc", },
 	{ /* sentinel */ }
 };
@@ -986,6 +987,14 @@ static const struct sunxi_mmc_clk_delay sunxi_mmc_clk_delays[] = {
 	[SDXC_CLK_50M_DDR_8BIT]	= { .output =  90, .sample = 180 },
 };
 
+static const struct sunxi_mmc_clk_delay sun8i_a83t_mmc_clk_delays[] = {
+	[SDXC_CLK_400K]		= { .output = 180, .sample = 180 },
+	[SDXC_CLK_25M]		= { .output = 180, .sample =  75 },
+	[SDXC_CLK_50M]		= { .output =  90, .sample = 105 },
+	[SDXC_CLK_50M_DDR]	= { .output =  60, .sample = 120 },
+	[SDXC_CLK_50M_DDR_8BIT]	= { .output =  180, .sample = 180 },
+};
+
 static const struct sunxi_mmc_clk_delay sun9i_mmc_clk_delays[] = {
 	[SDXC_CLK_400K]		= { .output = 180, .sample = 180 },
 	[SDXC_CLK_25M]		= { .output = 180, .sample =  75 },
@@ -1007,6 +1016,8 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 
 	if (of_device_is_compatible(np, "allwinner,sun9i-a80-mmc"))
 		host->clk_delays = sun9i_mmc_clk_delays;
+	else if (of_device_is_compatible(np, "allwinner,sun8i-a83t-mmc"))
+		host->clk_delays = sun8i_a83t_mmc_clk_delays;
 	else
 		host->clk_delays = sunxi_mmc_clk_delays;
 
-- 
2.9.2

WARNING: multiple messages have this Message-ID (diff)
From: moinejf@free.fr (Jean-Francois Moine)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] mmc: sunxi: Add support to the Allwinner A83T
Date: Wed, 20 Jul 2016 20:28:47 +0200	[thread overview]
Message-ID: <0ddc5f7d9a42515f901c95b8c0c1f5a5e4d575e9.1469082481.git.moinejf@free.fr> (raw)
In-Reply-To: <cover.1469082481.git.moinejf@free.fr>

The rate of the PLL-PERIPH clock is usually set to 1.2GHz in the A83T.
This patch sets the phase delays of the output and sample clocks
accordingly.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
Note: The impacted phase delays are only for 50MHz.
The phase delays are not used in 50MHz 8 bits DDR (new timing mode).
---
 drivers/mmc/host/sunxi-mmc.c | 11 +++++++++++
 1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 7f9c31a..e161a64 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -961,6 +961,7 @@ static int sunxi_mmc_card_busy(struct mmc_host *mmc)
 static const struct of_device_id sunxi_mmc_of_match[] = {
 	{ .compatible = "allwinner,sun4i-a10-mmc", },
 	{ .compatible = "allwinner,sun5i-a13-mmc", },
+	{ .compatible = "allwinner,sun8i-a83t-mmc", },
 	{ .compatible = "allwinner,sun9i-a80-mmc", },
 	{ /* sentinel */ }
 };
@@ -986,6 +987,14 @@ static const struct sunxi_mmc_clk_delay sunxi_mmc_clk_delays[] = {
 	[SDXC_CLK_50M_DDR_8BIT]	= { .output =  90, .sample = 180 },
 };
 
+static const struct sunxi_mmc_clk_delay sun8i_a83t_mmc_clk_delays[] = {
+	[SDXC_CLK_400K]		= { .output = 180, .sample = 180 },
+	[SDXC_CLK_25M]		= { .output = 180, .sample =  75 },
+	[SDXC_CLK_50M]		= { .output =  90, .sample = 105 },
+	[SDXC_CLK_50M_DDR]	= { .output =  60, .sample = 120 },
+	[SDXC_CLK_50M_DDR_8BIT]	= { .output =  180, .sample = 180 },
+};
+
 static const struct sunxi_mmc_clk_delay sun9i_mmc_clk_delays[] = {
 	[SDXC_CLK_400K]		= { .output = 180, .sample = 180 },
 	[SDXC_CLK_25M]		= { .output = 180, .sample =  75 },
@@ -1007,6 +1016,8 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 
 	if (of_device_is_compatible(np, "allwinner,sun9i-a80-mmc"))
 		host->clk_delays = sun9i_mmc_clk_delays;
+	else if (of_device_is_compatible(np, "allwinner,sun8i-a83t-mmc"))
+		host->clk_delays = sun8i_a83t_mmc_clk_delays;
 	else
 		host->clk_delays = sunxi_mmc_clk_delays;
 
-- 
2.9.2

  parent reply	other threads:[~2016-07-20 18:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  6:28 [PATCH 0/3] mmc: sunxi: Changes in the host driver Jean-Francois Moine
2016-07-21  6:28 ` Jean-Francois Moine
     [not found] ` <cover.1469082481.git.moinejf-GANU6spQydw@public.gmane.org>
2016-07-20 18:01   ` [PATCH 1/3] mmc: sunxi: Check the value returned by clk_round_rate Jean-Francois Moine
2016-07-20 18:01     ` Jean-Francois Moine
     [not found]     ` <c2231f3df66cf77e4fb9051f7b0c27ea69b8e63d.1469082481.git.moinejf-GANU6spQydw@public.gmane.org>
2016-07-21  8:49       ` Maxime Ripard
2016-07-21  8:49         ` Maxime Ripard
2016-07-20 18:16   ` [PATCH 2/3] mmc: sunxi: Set the 'New Timing' register for 8 bits DDR transfers Jean-Francois Moine
2016-07-20 18:16     ` Jean-Francois Moine
     [not found]     ` <bc7b767cad6db159a44c4b98d5b1f3eb53c26bd3.1469082481.git.moinejf-GANU6spQydw@public.gmane.org>
2016-07-21  8:56       ` Maxime Ripard
2016-07-21  8:56         ` Maxime Ripard
2016-07-21  9:26         ` Jean-Francois Moine
2016-07-21  9:26           ` Jean-Francois Moine
     [not found]           ` <20160721112655.941b1dad04f7a5b94d4172c1-GANU6spQydw@public.gmane.org>
2016-07-29 19:17             ` Maxime Ripard
2016-07-29 19:17               ` Maxime Ripard
2016-07-30  5:18               ` Jean-Francois Moine
2016-07-30  5:18                 ` Jean-Francois Moine
2016-07-30 10:19               ` [linux-sunxi] " Hans de Goede
2016-07-30 10:19                 ` Hans de Goede
     [not found]                 ` <9414aab0-ac2b-01c2-e16b-8f7394ea7b68-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-01 13:52                   ` Jean-Francois Moine
2016-08-01 13:52                     ` [linux-sunxi] " Jean-Francois Moine
     [not found]                     ` <20160801155246.b7b3c7f0f582394b4c25f6dc-GANU6spQydw@public.gmane.org>
2016-08-02  8:37                       ` Hans de Goede
2016-08-02  8:37                         ` [linux-sunxi] " Hans de Goede
2016-07-29 19:36             ` Maxime Ripard
2016-07-29 19:36               ` Maxime Ripard
2016-07-30  5:20               ` Jean-Francois Moine
2016-07-30  5:20                 ` Jean-Francois Moine
2016-07-20 18:28   ` Jean-Francois Moine [this message]
2016-07-20 18:28     ` [PATCH 3/3] mmc: sunxi: Add support to the Allwinner A83T Jean-Francois Moine
2016-07-21  8:58     ` Maxime Ripard
2016-07-21  8:58       ` Maxime Ripard
2016-07-21  9:18       ` Jean-Francois Moine
2016-07-21  9:18         ` Jean-Francois Moine
     [not found]         ` <20160721111851.133a3f16d6e9de1ee45b3654-GANU6spQydw@public.gmane.org>
2016-07-22 19:00           ` Jean-Francois Moine
2016-07-22 19:00             ` Jean-Francois Moine

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=0ddc5f7d9a42515f901c95b8c0c1f5a5e4d575e9.1469082481.git.moinejf@free.fr \
    --to=moinejf-ganu6spqydw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.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.