From: "Heiko Stübner" <mmind@debian.org>
To: linux-samsung-soc@vger.kernel.org
Cc: Alexander Neumann <fd0@lochraster.org>
Subject: Re: s3c-sdhci s3c-sdhci.1: failed to get io clock on a s3c2416
Date: Sun, 2 Jan 2011 21:35:22 +0100 [thread overview]
Message-ID: <201101022135.22156.mmind@debian.org> (raw)
In-Reply-To: <201101022125.37327.heiko@sntech.de>
>From c3db3b64502ba991af7c51aa0571583772069db4 Mon Sep 17 00:00:00 2001
From: Alexander Neumann <alexander@bumpern.de>
Date: Sun, 2 Jan 2011 21:02:01 +0100
Subject: [PATCH] fix initialize on HSMMC channel 1
---
.../mach-s3c2410/include/mach/regs-s3c2443-clock.h | 6 ++++--
arch/arm/mach-s3c2443/clock.c | 13 ++++++++-----
arch/arm/plat-s3c24xx/s3c2443-clock.c | 8 +++++++-
3 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
index 101aeea..bcb3090 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
@@ -86,7 +86,8 @@
#define S3C2443_HCLKCON_LCDC (1<<9)
#define S3C2443_HCLKCON_USBH (1<<11)
#define S3C2443_HCLKCON_USBD (1<<12)
-#define S3C2443_HCLKCON_HSMMC (1<<16)
+#define S3C2443_HCLKCON_HSMMC1 (1<<16)
+#define S3C2443_HCLKCON_HSMMC0 (1<<15)
#define S3C2443_HCLKCON_CFC (1<<17)
#define S3C2443_HCLKCON_SSMC (1<<18)
#define S3C2443_HCLKCON_DRAMC (1<<19)
@@ -111,11 +112,12 @@
#define S3C2443_SCLKCON_SSMCCLK (1<<15)
#define S3C2443_SCLKCON_HSSPICLK (1<<14)
#define S3C2443_SCLKCON_HSMMCCLK_EXT (1<<13)
-#define S3C2443_SCLKCON_HSMMCCLK_EPLL (1<<12)
+#define S3C2443_SCLKCON_HSMMCCLK_0 (1<<12)
#define S3C2443_SCLKCON_CAMCLK (1<<11)
#define S3C2443_SCLKCON_DISPCLK (1<<10)
#define S3C2443_SCLKCON_I2SCLK (1<<9)
#define S3C2443_SCLKCON_UARTCLK (1<<8)
+#define S3C2443_SCLKCON_HSMMCCLK_1 (1<<6)
#define S3C2443_SCLKCON_USBHOST (1<<1)
#define S3C2443_PWRCFG_SLEEP (1<<15)
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 0c3c0c8..65bc378 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -206,16 +206,19 @@ static int s3c2443_setparent_hsmmc(struct clk *clk, struct clk *parent)
{
unsigned long clksrc = __raw_readl(S3C2443_SCLKCON);
+ /* reset register, disable clock for hsmmc channels 0 and 1 */
clksrc &= ~(S3C2443_SCLKCON_HSMMCCLK_EXT |
- S3C2443_SCLKCON_HSMMCCLK_EPLL);
+ S3C2443_SCLKCON_HSMMCCLK_0 |
+ S3C2443_SCLKCON_HSMMCCLK_1);
- if (parent == &clk_epll)
- clksrc |= S3C2443_SCLKCON_HSMMCCLK_EPLL;
- else if (parent == &clk_ext)
+ if (parent == &clk_ext)
clksrc |= S3C2443_SCLKCON_HSMMCCLK_EXT;
- else
+ else if (parent != &clk_epll)
return -EINVAL;
+ /* enable clock generation for hsmmc channels 0 and 1 */
+ clksrc |= S3C2443_SCLKCON_HSMMCCLK_0 | S3C2443_SCLKCON_HSMMCCLK_1;
+
if (clk->usage > 0) {
__raw_writel(clksrc, S3C2443_SCLKCON);
}
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c
index 461f070..9e2ae9a 100644
--- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
@@ -274,7 +274,13 @@ static struct clk init_clocks[] = {
.id = 0,
.parent = &clk_h,
.enable = s3c2443_clkcon_enable_h,
- .ctrlbit = S3C2443_HCLKCON_HSMMC,
+ .ctrlbit = S3C2443_HCLKCON_HSMMC0,
+ }, {
+ .name = "hsmmc",
+ .id = 1,
+ .parent = &clk_h,
+ .enable = s3c2443_clkcon_enable_h,
+ .ctrlbit = S3C2443_HCLKCON_HSMMC1,
}, {
.name = "gpio",
.id = -1,
--
1.7.2.3
prev parent reply other threads:[~2011-01-02 20:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-02 17:42 s3c-sdhci s3c-sdhci.1: failed to get io clock on a s3c2416 Heiko Stübner
2011-01-02 20:25 ` Heiko Stübner
2011-01-02 20:35 ` Heiko Stübner [this message]
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=201101022135.22156.mmind@debian.org \
--to=mmind@debian.org \
--cc=fd0@lochraster.org \
--cc=linux-samsung-soc@vger.kernel.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.