* [PATCH 1/3] imx31: fix parent clock for rtc
@ 2010-03-24 11:32 Vladimir Zapolskiy
2010-03-24 11:32 ` [PATCH 2/3] imx3: Add rtc platform device support Vladimir Zapolskiy
0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Zapolskiy @ 2010-03-24 11:32 UTC (permalink / raw)
To: linux-arm-kernel
According to imx31 reference manual the signal from external low
frequency clock is sent to RTC clock.
The patch makes redundant the previously defined mxc_rtc clock.
Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Daniel Mack <daniel@caiaq.de>
---
arch/arm/mach-mx3/clock-imx31.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-mx3/clock-imx31.c b/arch/arm/mach-mx3/clock-imx31.c
index 80dba99..9a9eb6d 100644
--- a/arch/arm/mach-mx3/clock-imx31.c
+++ b/arch/arm/mach-mx3/clock-imx31.c
@@ -468,6 +468,7 @@ static struct clk ahb_clk = {
}
DEFINE_CLOCK(perclk_clk, 0, NULL, 0, NULL, NULL, &ipg_clk);
+DEFINE_CLOCK(ckil_clk, 0, NULL, 0, clk_ckil_get_rate, NULL, NULL);
DEFINE_CLOCK(sdhc1_clk, 0, MXC_CCM_CGR0, 0, NULL, NULL, &perclk_clk);
DEFINE_CLOCK(sdhc2_clk, 1, MXC_CCM_CGR0, 2, NULL, NULL, &perclk_clk);
@@ -490,7 +491,7 @@ DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk);
DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk);
DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &serial_pll_clk);
-DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk);
+DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ckil_clk);
DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk);
DEFINE_CLOCK(usb_clk2, 0, MXC_CCM_CGR1, 18, usb_get_rate, NULL, &ahb_clk);
@@ -514,7 +515,6 @@ DEFINE_CLOCK(usb_clk1, 0, NULL, 0, usb_get_rate, NULL, &usb_pll_clk)
DEFINE_CLOCK(nfc_clk, 0, NULL, 0, nfc_get_rate, NULL, &ahb_clk);
DEFINE_CLOCK(scc_clk, 0, NULL, 0, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk);
-DEFINE_CLOCK(ckil_clk, 0, NULL, 0, clk_ckil_get_rate, NULL, NULL);
#define _REGISTER_CLOCK(d, n, c) \
{ \
@@ -572,7 +572,6 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "iim", iim_clk)
_REGISTER_CLOCK(NULL, "mpeg4", mpeg4_clk)
_REGISTER_CLOCK(NULL, "mbx", mbx_clk)
- _REGISTER_CLOCK("mxc_rtc", NULL, ckil_clk)
};
int __init mx31_clocks_init(unsigned long fref)
--
1.6.6.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] imx3: Add rtc platform device support
2010-03-24 11:32 [PATCH 1/3] imx31: fix parent clock for rtc Vladimir Zapolskiy
@ 2010-03-24 11:32 ` Vladimir Zapolskiy
2010-03-24 11:32 ` [PATCH 3/3] imx31: add rtc device on litekit board Vladimir Zapolskiy
2010-03-25 7:35 ` [PATCH 2/3] imx3: Add rtc platform device support Sascha Hauer
0 siblings, 2 replies; 6+ messages in thread
From: Vladimir Zapolskiy @ 2010-03-24 11:32 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds support for build-in RTC device found on
Freescale imx31 and imx35 SoCs.
Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mx3/devices.c | 19 +++++++++++++++++++
arch/arm/mach-mx3/devices.h | 1 +
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index f891115..1ffed28 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -588,6 +588,25 @@ struct platform_device imx_wdt_device0 = {
.resource = imx_wdt_resources,
};
+static struct resource imx_rtc_resources[] = {
+ {
+ .start = MX31_RTC_BASE_ADDR,
+ .end = MX31_RTC_BASE_ADDR + 0x3fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = MX31_INT_RTC,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct platform_device imx_rtc_device0 = {
+ .name = "mxc_rtc",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(imx_rtc_resources),
+ .resource = imx_rtc_resources,
+};
+
static int __init mx3_devices_init(void)
{
if (cpu_is_mx31()) {
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 4f77eb5..b1687ad 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -27,3 +27,4 @@ extern struct platform_device imx_ssi_device0;
extern struct platform_device imx_ssi_device1;
extern struct platform_device imx_ssi_device1;
extern struct platform_device imx_wdt_device0;
+extern struct platform_device imx_rtc_device0;
--
1.6.6.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] imx31: add rtc device on litekit board.
2010-03-24 11:32 ` [PATCH 2/3] imx3: Add rtc platform device support Vladimir Zapolskiy
@ 2010-03-24 11:32 ` Vladimir Zapolskiy
2010-03-25 7:35 ` [PATCH 2/3] imx3: Add rtc platform device support Sascha Hauer
1 sibling, 0 replies; 6+ messages in thread
From: Vladimir Zapolskiy @ 2010-03-24 11:32 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds support for SoC build-in RTC device on litekit board.
Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mx3/mx31lite-db.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
index 0201683..466996e 100644
--- a/arch/arm/mach-mx3/mx31lite-db.c
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -207,5 +207,6 @@ void __init mx31lite_db_init(void)
mxc_register_device(&mxc_spi_device0, &spi0_pdata);
platform_device_register(&litekit_led_device);
mxc_register_device(&imx_wdt_device0, NULL);
+ mxc_register_device(&imx_rtc_device0, NULL);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] imx3: Add rtc platform device support
2010-03-24 11:32 ` [PATCH 2/3] imx3: Add rtc platform device support Vladimir Zapolskiy
2010-03-24 11:32 ` [PATCH 3/3] imx31: add rtc device on litekit board Vladimir Zapolskiy
@ 2010-03-25 7:35 ` Sascha Hauer
2010-03-25 11:36 ` Vladimir Zapolskiy
1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2010-03-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
Hi Vladimir,
On Wed, Mar 24, 2010 at 02:32:17PM +0300, Vladimir Zapolskiy wrote:
> This patch adds support for build-in RTC device found on
> Freescale imx31 and imx35 SoCs.
>
> Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/mach-mx3/devices.c | 19 +++++++++++++++++++
> arch/arm/mach-mx3/devices.h | 1 +
> 2 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
> index f891115..1ffed28 100644
> --- a/arch/arm/mach-mx3/devices.c
> +++ b/arch/arm/mach-mx3/devices.c
> @@ -588,6 +588,25 @@ struct platform_device imx_wdt_device0 = {
> .resource = imx_wdt_resources,
This patch does not apply. We do not have the watchdog in devices.c atm.
> };
>
> +static struct resource imx_rtc_resources[] = {
> + {
> + .start = MX31_RTC_BASE_ADDR,
> + .end = MX31_RTC_BASE_ADDR + 0x3fff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = MX31_INT_RTC,
> + .flags = IORESOURCE_IRQ,
> + },
Can you provide a fixup for i.MX35, please? See mx3_devices_init().
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] imx3: Add rtc platform device support
2010-03-25 7:35 ` [PATCH 2/3] imx3: Add rtc platform device support Sascha Hauer
@ 2010-03-25 11:36 ` Vladimir Zapolskiy
2010-03-26 7:54 ` Sascha Hauer
0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Zapolskiy @ 2010-03-25 11:36 UTC (permalink / raw)
To: linux-arm-kernel
Hi Sasha,
>
> On Wed, Mar 24, 2010 at 02:32:17PM +0300, Vladimir Zapolskiy wrote:
>> This patch adds support for build-in RTC device found on
>> Freescale imx31 and imx35 SoCs.
>>
>> Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
>> Cc: Sascha Hauer <s.hauer@pengutronix.de>
>> ---
>> arch/arm/mach-mx3/devices.c | 19 +++++++++++++++++++
>> arch/arm/mach-mx3/devices.h | 1 +
>> 2 files changed, 20 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
>> index f891115..1ffed28 100644
>> --- a/arch/arm/mach-mx3/devices.c
>> +++ b/arch/arm/mach-mx3/devices.c
>> @@ -588,6 +588,25 @@ struct platform_device imx_wdt_device0 = {
>> .resource = imx_wdt_resources,
>
> This patch does not apply. We do not have the watchdog in devices.c atm.
>
please could you suggest the appropriate branch, because this patch is
based on mxc-master branch, where the watchdog is already pushed, see
http://git.pengutronix.de/?p=imx/linux-2.6.git;a=shortlog;h=refs/heads/mxc-master
>> };
>>
>> +static struct resource imx_rtc_resources[] = {
>> + {
>> + .start = MX31_RTC_BASE_ADDR,
>> + .end = MX31_RTC_BASE_ADDR + 0x3fff,
>> + .flags = IORESOURCE_MEM,
>> + },
>> + {
>> + .start = MX31_INT_RTC,
>> + .flags = IORESOURCE_IRQ,
>> + },
>
> Can you provide a fixup for i.MX35, please? See mx3_devices_init().
Surely. Before patch submission I just checked that base address, size
and interrupt number are equal for i.MX31 and i.MX35 SoCs, and I've
found that in such cases the resources are defined using MX31 macros,
see imx_ssi_resources or mxc_usbhX_resources as reference.
Probably better to separate the devices.c file into two files? You see
one day I hope i.MX37 support will be included into the Linux kernel,
and it would be quite uncomfortable to support three kinds of peripheral
in a single file.
--
With best wishes,
Vladimir
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] imx3: Add rtc platform device support
2010-03-25 11:36 ` Vladimir Zapolskiy
@ 2010-03-26 7:54 ` Sascha Hauer
0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2010-03-26 7:54 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 02:36:31PM +0300, Vladimir Zapolskiy wrote:
> Hi Sasha,
>
> >
> > On Wed, Mar 24, 2010 at 02:32:17PM +0300, Vladimir Zapolskiy wrote:
> >> This patch adds support for build-in RTC device found on
> >> Freescale imx31 and imx35 SoCs.
> >>
> >> Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
> >> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> >> ---
> >> arch/arm/mach-mx3/devices.c | 19 +++++++++++++++++++
> >> arch/arm/mach-mx3/devices.h | 1 +
> >> 2 files changed, 20 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
> >> index f891115..1ffed28 100644
> >> --- a/arch/arm/mach-mx3/devices.c
> >> +++ b/arch/arm/mach-mx3/devices.c
> >> @@ -588,6 +588,25 @@ struct platform_device imx_wdt_device0 = {
> >> .resource = imx_wdt_resources,
> >
> > This patch does not apply. We do not have the watchdog in devices.c atm.
> >
>
> please could you suggest the appropriate branch, because this patch is
> based on mxc-master branch, where the watchdog is already pushed, see
> http://git.pengutronix.de/?p=imx/linux-2.6.git;a=shortlog;h=refs/heads/mxc-master
Oh, my bad. I myself tried to push it on master and not on mxc-master.
>
> >> };
> >>
> >> +static struct resource imx_rtc_resources[] = {
> >> + {
> >> + .start = MX31_RTC_BASE_ADDR,
> >> + .end = MX31_RTC_BASE_ADDR + 0x3fff,
> >> + .flags = IORESOURCE_MEM,
> >> + },
> >> + {
> >> + .start = MX31_INT_RTC,
> >> + .flags = IORESOURCE_IRQ,
> >> + },
> >
> > Can you provide a fixup for i.MX35, please? See mx3_devices_init().
>
> Surely. Before patch submission I just checked that base address, size
> and interrupt number are equal for i.MX31 and i.MX35 SoCs, and I've
> found that in such cases the resources are defined using MX31 macros,
> see imx_ssi_resources or mxc_usbhX_resources as reference.
Ok. I just saw that there are two defines without checking that they are
actually identical.
>
> Probably better to separate the devices.c file into two files? You see
> one day I hope i.MX37 support will be included into the Linux kernel,
> and it would be quite uncomfortable to support three kinds of peripheral
> in a single file.
We are already working on seperating them. Have a look at the i.MX21/27
devices.c.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-26 7:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 11:32 [PATCH 1/3] imx31: fix parent clock for rtc Vladimir Zapolskiy
2010-03-24 11:32 ` [PATCH 2/3] imx3: Add rtc platform device support Vladimir Zapolskiy
2010-03-24 11:32 ` [PATCH 3/3] imx31: add rtc device on litekit board Vladimir Zapolskiy
2010-03-25 7:35 ` [PATCH 2/3] imx3: Add rtc platform device support Sascha Hauer
2010-03-25 11:36 ` Vladimir Zapolskiy
2010-03-26 7:54 ` Sascha Hauer
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).