public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@collabora.co.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/7] pwm: imx: Enable PWM support on i.MX53
Date: Wed, 01 Nov 2017 15:42:35 +0000	[thread overview]
Message-ID: <1509550955.20613.32.camel@collabora.co.uk> (raw)
In-Reply-To: <45c4b431-a6c8-0596-24f1-ec0e8b5177ee@denx.de>

On Wed, 2017-11-01 at 16:31 +0100, Stefano Babic wrote:
> On 01/11/2017 15:23, Martyn Welch wrote:
> > Add missing parts for i.MX53 PWM support
> > 
> > Acked-by: Nandor Han <nandor.han@ge.com>
> > Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
> > Cc: Stefano Babic <sbabic@denx.de>
> > ---
> >  arch/arm/include/asm/arch-mx5/imx-regs.h | 19 +++++++++++++++++++
> >  drivers/pwm/pwm-imx-util.c               |  2 ++
> >  2 files changed, 21 insertions(+)
> > 
> > diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
> > index 3e79fa3..c2ff798 100644
> > --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
> > +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
> > @@ -508,6 +508,25 @@ struct fuse_bank4_regs {
> >  };
> >  #endif
> >  
> > +#if defined(CONFIG_MX53)
> 
> It looks to me this is not MX53 specific. You are already changing a MX5
> file. As far as I see, this is valid at least for MX51. Do we need the
> #ifdef ?
> 

I only have access to an MX53, I'm not familiar with the rest of the MX5
family and was thus playing it safe.

> > +#define PWMCR_PRESCALER(x)	(((x - 1) & 0xFFF) << 4)
> > +#define PWMCR_DOZEEN		(1 << 24)
> > +#define PWMCR_WAITEN		(1 << 23)
> > +#define PWMCR_DBGEN		(1 << 22)
> > +#define PWMCR_CLKSRC_IPG_HIGH	(2 << 16)
> > +#define PWMCR_CLKSRC_IPG	(1 << 16)
> > +#define PWMCR_EN		(1 << 0)
> > +
> > +struct pwm_regs {
> > +	u32	cr;
> > +	u32	sr;
> > +	u32	ir;
> > +	u32	sar;
> > +	u32	pr;
> > +	u32	cnr;
> > +};
> > +#endif
> > +
> >  #endif /* __ASSEMBLER__*/
> >  
> >  #endif				/* __ASM_ARCH_MX5_IMX_REGS_H__ */
> > diff --git a/drivers/pwm/pwm-imx-util.c b/drivers/pwm/pwm-imx-util.c
> > index 534dd8e..97ac0c8 100644
> > --- a/drivers/pwm/pwm-imx-util.c
> > +++ b/drivers/pwm/pwm-imx-util.c
> > @@ -23,10 +23,12 @@ struct pwm_regs *pwm_id_to_reg(int pwm_id)
> >  		return (struct pwm_regs *)PWM1_BASE_ADDR;
> >  	case 1:
> >  		return (struct pwm_regs *)PWM2_BASE_ADDR;
> > +#ifdef CONFIG_MX6
> >  	case 2:
> >  		return (struct pwm_regs *)PWM3_BASE_ADDR;
> >  	case 3:
> >  		return (struct pwm_regs *)PWM4_BASE_ADDR;
> > +#endif
> >  #ifdef CONFIG_MX6SX
> >  	case 4:
> >  		return (struct pwm_regs *)PWM5_BASE_ADDR;
> > 
> 
> 
> Best regards,
> Stefano Babic
> 

  reply	other threads:[~2017-11-01 15:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 14:23 [U-Boot] [PATCH v3 0/7] Add support for GE PPD Martyn Welch
2017-11-01 14:23 ` [U-Boot] [PATCH v3 1/7] imx: mxc_i2c: tweak the i2c transfer method Martyn Welch
2017-11-01 14:23 ` [U-Boot] [PATCH v3 2/7] ext4: recover from filesystem corruption when reading Martyn Welch
2017-11-01 14:23 ` [U-Boot] [PATCH v3 3/7] pwm: imx: Enable PWM support on i.MX53 Martyn Welch
2017-11-01 15:31   ` Stefano Babic
2017-11-01 15:42     ` Martyn Welch [this message]
2017-11-01 15:58       ` Stefano Babic
2017-11-01 14:23 ` [U-Boot] [PATCH v3 4/7] arm: mx5: Add more register definitions Martyn Welch
2017-11-01 15:33   ` Stefano Babic
2017-11-01 14:23 ` [U-Boot] [PATCH v3 5/7] bootcount: add support for bootcounter on EXT filesystem Martyn Welch
2017-11-01 14:41   ` Tom Rini
2017-11-01 15:28   ` Stefano Babic
2017-11-01 16:24     ` Tom Rini
2017-11-01 14:23 ` [U-Boot] [PATCH v3 6/7] rtc: add support for s35392a Martyn Welch
2017-11-01 14:23 ` [U-Boot] [PATCH v3 7/7] mx53: Add Board support for GE PPD Martyn Welch
2017-11-01 15:53   ` Stefano Babic
2017-11-01 17:56     ` Martyn Welch

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=1509550955.20613.32.camel@collabora.co.uk \
    --to=martyn.welch@collabora.co.uk \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox