* imx: PWM module on mx35
@ 2010-10-21 22:30 Radoslav Kolev
2010-10-22 1:10 ` Fabio Estevam
0 siblings, 1 reply; 3+ messages in thread
From: Radoslav Kolev @ 2010-10-21 22:30 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
I am trying to use the PWM module on a Freescale MX35 SOC but all writes
to the PWM module registers seem to be ignored.
I have found two issues reported as fixed in the changelog of
Freescales's Linux BSP for the i.MX31ADS (with similar PWM module) at
http://www.freescale.com/files/soft_dev_tools/doc/support_info/BSPIMX31ADSLTIB__RN.txt
851 Unable to write to PWM registers
1438 Cannot write to PWM registers
Unfortunately I couldn't find any more info about how/where these issues
were fixed or find the issues in some public issue tracking system.
I added this code to the plat-mxc/pwm.c module after request_mem and
ioremap of the PWM registers to make a simple test writing to the period
register:
//read value of period register and print to console
reg=ioread32(pwm->mmio_base+0x10);
printk("PWMPR1: %lx \n", reg);
//write new value
iowrite32(0x123, pwm->mmio_base+0x10);
//read value and print to console
reg=ioread32(pwm->mmio_base + 0x10);
printk("PWMPR2: %lx \n", reg);
Which yields the following output:
PWMPR1: fffe
PWMPR2: fffe
According to the MX35 reference manual 0xfffe is exactly the default
reset value of the PWM period register, so it seems I'm accessing the
right register and reads work fine, but all writes are ignored. It is
the same with other registers like PWM control register.
Any ideas, pointers to possible cause of this problem or just sharing if
you have been (un)successful using the PWM module on the MX35 will be
greatly appreciated.
Best regards,
Radoslav Kolev
^ permalink raw reply [flat|nested] 3+ messages in thread* imx: PWM module on mx35
2010-10-21 22:30 imx: PWM module on mx35 Radoslav Kolev
@ 2010-10-22 1:10 ` Fabio Estevam
2010-10-22 10:13 ` Radoslav Kolev
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2010-10-22 1:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi Radoslav,
On Thu, Oct 21, 2010 at 8:30 PM, Radoslav Kolev <radoslav.kolev@rnd.bg> wrote:
> Hello,
>
> I am trying to use the PWM module on a Freescale MX35 SOC but all writes
> to the PWM module registers seem to be ignored.
>
> I have found two issues reported as fixed in the changelog of
> Freescales's Linux BSP for the i.MX31ADS (with similar PWM module) at
> http://www.freescale.com/files/soft_dev_tools/doc/support_info/BSPIMX31ADSLTIB__RN.txt
>
> 851 ? ? Unable to write to PWM registers
> 1438 ? ?Cannot write to PWM registers
These patches fixed the MXC_CCM_CGR1 offset for the pwm_clk in the
Freescale kernel.
Another thing that was needed was to enable the PWM clock.
Please try the patch below.
Regards,
Fabio Estevam
Subject: [PATCH] Enable PWM clocks on MX31 and MX35
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-mx3/clock-imx31.c | 1 +
arch/arm/mach-mx3/clock-imx35.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx3/clock-imx31.c b/arch/arm/mach-mx3/clock-imx31.c
index 109e98f..3926915 100644
--- a/arch/arm/mach-mx3/clock-imx31.c
+++ b/arch/arm/mach-mx3/clock-imx31.c
@@ -612,6 +612,7 @@ int __init mx31_clocks_init(unsigned long fref)
clk_enable(&iim_clk);
clk_enable(&serial_pll_clk);
+ clk_enable(&pwm_clk);
mx31_read_cpu_rev();
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 61e4a31..968982b 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -536,6 +536,7 @@ int __init mx35_clocks_init()
__raw_writel(cgr3, CCM_BASE + CCM_CGR3);
clk_enable(&iim_clk);
+ clk_enable(&pwm_clk);
mx35_read_cpu_rev();
#ifdef CONFIG_MXC_USE_EPIT
--
^ permalink raw reply related [flat|nested] 3+ messages in thread
* imx: PWM module on mx35
2010-10-22 1:10 ` Fabio Estevam
@ 2010-10-22 10:13 ` Radoslav Kolev
0 siblings, 0 replies; 3+ messages in thread
From: Radoslav Kolev @ 2010-10-22 10:13 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2010-10-21 at 23:10 -0200, Fabio Estevam wrote:
> Hi Radoslav,
>
> On Thu, Oct 21, 2010 at 8:30 PM, Radoslav Kolev <radoslav.kolev@rnd.bg> wrote:
> > Hello,
> >
> > I am trying to use the PWM module on a Freescale MX35 SOC but all writes
> > to the PWM module registers seem to be ignored.
> >
> > I have found two issues reported as fixed in the changelog of
> > Freescales's Linux BSP for the i.MX31ADS (with similar PWM module) at
> > http://www.freescale.com/files/soft_dev_tools/doc/support_info/BSPIMX31ADSLTIB__RN.txt
> >
> > 851 Unable to write to PWM registers
> > 1438 Cannot write to PWM registers
>
> These patches fixed the MXC_CCM_CGR1 offset for the pwm_clk in the
> Freescale kernel.
>
> Another thing that was needed was to enable the PWM clock.
>
> Please try the patch below.
>
Thanks, Fabio!
That solved the register writing problem.
Regards,
Radoslav Kolev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-22 10:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-21 22:30 imx: PWM module on mx35 Radoslav Kolev
2010-10-22 1:10 ` Fabio Estevam
2010-10-22 10:13 ` Radoslav Kolev
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).