linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks
@ 2010-12-20  4:28 Philip Rakity
  0 siblings, 0 replies; 6+ messages in thread
From: Philip Rakity @ 2010-12-20  4:28 UTC (permalink / raw)
  To: linux-arm-kernel

The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC
clock.  This feature is useful and required depending on the board
design.  Add infrastructure to support SD clock tuning.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Mark F. Brown <markb@marvell.com>
Tested-by: Philip Rakity <prakity@marvell.com>
---
 arch/arm/plat-pxa/include/plat/sdhci.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-pxa/include/plat/sdhci.h b/arch/arm/plat-pxa/inc=
lude/plat/sdhci.h
index 2762f99..3f73f1f 100644
--- a/arch/arm/plat-pxa/include/plat/sdhci.h
+++ b/arch/arm/plat-pxa/include/plat/sdhci.h
@@ -28,6 +28,9 @@
 struct sdhci_pxa_platdata {
 	unsigned int	max_speed;
 	unsigned int	flags;
+	unsigned short	adjust_clocks;
+	unsigned short	clk_select;
+	unsigned short	clk_delay;
 };
=20
 #endif /* __PLAT_PXA_SDHCI_H */
--=20
1.6.0.4

--_002_1F0BAC0EEB604E73A1C789667289DDAAmarvellcom_
Content-Type: application/octet-stream;
	name="0012-plat-pxa-Enable-ability-to-adjust-SD-MMC-clocks.patch"
Content-Description: 0012-plat-pxa-Enable-ability-to-adjust-SD-MMC-clocks.patch
Content-Disposition: attachment;
	filename="0012-plat-pxa-Enable-ability-to-adjust-SD-MMC-clocks.patch";
	size=1115; creation-date="Tue, 21 Dec 2010 23:09:27 GMT";
	modification-date="Tue, 21 Dec 2010 23:09:27 GMT"
Content-Transfer-Encoding: base64

RnJvbSA1NTc3OWI4NjEwMTkyMWNmNjRjMGNjNGEyZTk1Nzg5ZDkxYzliMTZlIE1vbiBTZXAgMTcg
MDA6MDA6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IGIvYXJjaC9hcm0vcGxhdC1w
eGEvaW5jbHVkZS9wbGF0L3NkaGNpLmgKQEAgLTI4LDYgKzI4LDkgQEAKIHN0cnVjdCBzZGhjaV9w
eGFfcGxhdGRhdGEgewogCXVuc2lnbmVkIGludAltYXhfc3BlZWQ7CiAJdW5zaWduZWQgaW50CWZs
YWdzOworCXVuc2lnbmVkIHNob3J0CWFkanVzdF9jbG9ja3M7CisJdW5zaWduZWQgc2hvcnQJY2xr
X3NlbGVjdDsKKwl1bnNpZ25lZCBzaG9ydAljbGtfZGVsYXk7CiB9OwogCiAjZW5kaWYgLyogX19Q
TEFUX1BYQV9TREhDSV9IICovCi0tIAoxLjYuMC40Cgo=

--_002_1F0BAC0EEB604E73A1C789667289DDAAmarvellcom_--

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

* [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks
@ 2011-04-22 20:13 Philip Rakity
  2011-04-27  9:33 ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Rakity @ 2011-04-22 20:13 UTC (permalink / raw)
  To: linux-arm-kernel

The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC
clock.  This feature is useful and required depending on the board
design.  Add infrastructure to support SD clock tuning.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Mark F. Brown <markb@marvell.com>
---
 arch/arm/plat-pxa/include/plat/sdhci.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-pxa/include/plat/sdhci.h b/arch/arm/plat-pxa/include/plat/sdhci.h
index 1ab332e..dd1ce96 100644
--- a/arch/arm/plat-pxa/include/plat/sdhci.h
+++ b/arch/arm/plat-pxa/include/plat/sdhci.h
@@ -30,6 +30,9 @@ struct sdhci_pxa_platdata {
 	unsigned int	max_speed;
 	unsigned int	quirks;
 	unsigned int	flags;
+	unsigned short	adjust_clocks;
+	unsigned short	clk_select;
+	unsigned short	clk_delay;
 };
 
 #endif /* __PLAT_PXA_SDHCI_H */
-- 
1.7.0.4

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

* [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks
  2011-04-22 20:13 Philip Rakity
@ 2011-04-27  9:33 ` Russell King - ARM Linux
  2011-04-27 15:02   ` Philip Rakity
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-04-27  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 22, 2011 at 01:13:28PM -0700, Philip Rakity wrote:
> The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC
> clock.  This feature is useful and required depending on the board
> design.  Add infrastructure to support SD clock tuning.

It just adds fields to a structure which remain unused.  On its own this
patch is useless, and I don't see a patch which makes use of these new
fields in any way.  Did you forget to copy it to the linux-arm-kernel
list?

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

* [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks
  2011-04-27  9:33 ` Russell King - ARM Linux
@ 2011-04-27 15:02   ` Philip Rakity
  2011-04-27 20:49     ` Philip Rakity
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Rakity @ 2011-04-27 15:02 UTC (permalink / raw)
  To: linux-arm-kernel





Begin forwarded message:

> From: Philip Rakity <prakity@marvell.com>
> Date: April 22, 2011 1:18:33 PM PDT
> To: "linux-mmc at vger.kernel.org" <linux-mmc@vger.kernel.org>
> Cc: Zhangfei Gao <zgao6@marvell.com>
> Subject: [PATCH] sdhci: sdhci-pxa.c: Add post reset processing for chip specific registers 
> 
> 
> RESET_ALL resets chips private registers.
> Reset to values specified in board file.
> 
> depends on board specific mach-mmp/plat-pxa sdhci.h definitions
> 
> Signed-off-by: Philip Rakity <prakity@marvell.com>
> ---
> drivers/mmc/host/sdhci-pxa.c |   42 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 42 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
> index c8abf0f..1dc0988 100644
> --- a/drivers/mmc/host/sdhci-pxa.c
> +++ b/drivers/mmc/host/sdhci-pxa.c
> @@ -29,6 +29,13 @@
> 
> #define DRIVER_NAME	"sdhci-pxa"
> 
> +#define SD_CLOCK_AND_BURST_SIZE_SETUP   0x10A
> +#define SDCLK_DELAY_MASK     0x1F
> +#define SDCLK_SEL_MASK       0x1
> +#define SDCLK_DELAY_SHIFT    9
> +#define SDCLK_SEL_SHIFT      8
> +
> +
> struct sdhci_pxa {
> 	struct sdhci_host		*host;
> 	struct sdhci_pxa_platdata	*pdata;
> @@ -53,7 +60,42 @@ static void enable_clock(struct sdhci_host *host)
> 	}
> }
> 
> +static void set_clock_and_burst_size(struct sdhci_host *host)
> +{
> +	u16 tmp;
> +	struct sdhci_pxa *pxa = sdhci_priv(host);
> +
> +	pr_debug("%s:%s: adjust = %d\n",
> +		__func__, mmc_hostname(host->mmc), pxa->pdata->adjust_clocks);
> +
> +	if (pxa->pdata->adjust_clocks) {
> +		tmp = readw(host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP);
> +		pr_debug("%s:%s: (B) SD_CLOCK_AND_BURST = %04X, "
> +			"delay = %d, sel = %d\n",
> +			__func__, mmc_hostname(host->mmc), tmp,
> +			pxa->pdata->clk_delay, pxa->pdata->clk_select);
> +		tmp &= ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT);
> +		tmp &= ~(SDCLK_SEL_MASK << SDCLK_SEL_SHIFT);
> +		tmp |= (pxa->pdata->clk_delay & SDCLK_DELAY_MASK) <<
> +			SDCLK_DELAY_SHIFT;
> +		tmp |= (pxa->pdata->clk_select & SDCLK_SEL_MASK) <<
> +			SDCLK_SEL_SHIFT;
> +		writew(tmp, host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP);
> +		pr_debug("%s:%s: (A) SD_CLOCK_AND_BURST_SIZE_SETUP = %04X\n",
> +			__func__, mmc_hostname(host->mmc), tmp);
> +	}
> +}
> +
> +static void platform_reset_exit(struct sdhci_host *host, u8 mask)
> +{
> +	if (mask == SDHCI_RESET_ALL) {
> +		/* reset private registers */
> +		set_clock_and_burst_size(host);
> +	}
> +}
> +
> static struct sdhci_ops sdhci_pxa_ops = {
> +	.platform_reset_exit = platform_reset_exit,
> };
> 
> /*****************************************************************************\
> -- 
> 1.7.0.4
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


On Apr 27, 2011, at 2:33 AM, Russell King - ARM Linux wrote:

> On Fri, Apr 22, 2011 at 01:13:28PM -0700, Philip Rakity wrote:
>> The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC
>> clock.  This feature is useful and required depending on the board
>> design.  Add infrastructure to support SD clock tuning.
> 
> It just adds fields to a structure which remain unused.  On its own this
> patch is useless, and I don't see a patch which makes use of these new
> fields in any way.  Did you forget to copy it to the linux-arm-kernel
> list?

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

* [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks
  2011-04-27 15:02   ` Philip Rakity
@ 2011-04-27 20:49     ` Philip Rakity
  2011-04-28  9:51       ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Rakity @ 2011-04-27 20:49 UTC (permalink / raw)
  To: linux-arm-kernel


The patches were submitted a while ago.

Enclosed.

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

* [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks
  2011-04-27 20:49     ` Philip Rakity
@ 2011-04-28  9:51       ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-04-28  9:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 27, 2011 at 01:49:45PM -0700, Philip Rakity wrote:
> The patches were submitted a while ago.

It would be a good idea to reference them so that people know where to
find then and what the status of them is.  It's also a good idea to
Cc interested parties on related patches.

A couple of points in one of those patches though:

> +	if(gpio_request(reset, "sd8xxx reset")) {

space between if and (.

> +		printk(KERN_INFO "gpio %d request failed\n", reset);
> +		return;
> +	}
> +
> +	if(gpio_request(poweron, "sd8xxx PDn")) {
> +		gpio_free(reset);
> +		printk(KERN_INFO "gpio %d request failed\n", poweron);
> +		return;
> +	}
> +
> +	gpio_direction_output(poweron, 1);
> +	msleep (1);

No space between msleep and (.

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

end of thread, other threads:[~2011-04-28  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-20  4:28 [PATCH] plat-pxa: Enable ability to adjust SD/MMC clocks Philip Rakity
  -- strict thread matches above, loose matches on Subject: below --
2011-04-22 20:13 Philip Rakity
2011-04-27  9:33 ` Russell King - ARM Linux
2011-04-27 15:02   ` Philip Rakity
2011-04-27 20:49     ` Philip Rakity
2011-04-28  9:51       ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).