public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] mxc_i2c: add support for MX53 processor
Date: Thu, 16 Dec 2010 11:37:41 +0100	[thread overview]
Message-ID: <4D09EBF5.4020104@denx.de> (raw)
In-Reply-To: <1292494665-25674-5-git-send-email-r64343@freescale.com>

Hello Jason,

Jason Liu wrote:
> This patch add I2C support for Freescale MX53 processor
> 
> Signed-off-by: Jason Liu <r64343@freescale.com>
> ---
>  drivers/i2c/mxc_i2c.c |   18 +++++++++++++-----
>  1 files changed, 13 insertions(+), 5 deletions(-)
>  mode change 100644 => 100755 drivers/i2c/mxc_i2c.c
> 
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> old mode 100644
> new mode 100755
> index 8e10fbb..f9f32cc
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -24,10 +24,11 @@
>  
>  #include <common.h>
>  
> -#if defined(CONFIG_HARD_I2C)
> +#if defined(CONFIG_MX53)
> +#include <asm/arch/clock.h>
> +#endif
>  
> -#include <asm/arch/mx31.h>
> -#include <asm/arch/mx31-regs.h>

Why do you delete this includes? That will break mx31 boards.
Please add instead a

#if defined(CONFIG_MX31) around it

> +#if defined(CONFIG_HARD_I2C)

Why you move this define here?

>  #define IADR	0x00
>  #define IFDR	0x04
> @@ -56,8 +57,10 @@
>  #elif defined (CONFIG_SYS_I2C_MX31_PORT3)
>  #define I2C_BASE	0x43f84000
>  #define I2C_CLK_OFFSET	30
> +#elif defined(CONFIG_SYS_I2C_PORT)
> +#define I2C_BASE CONFIG_SYS_I2C_PORT
>  #else
> -#error "define CONFIG_SYS_I2C_MX31_PORTx to use the mx31 I2C driver"
> +#error "define CONFIG_SYS_I2C_PORT to use the I2C driver"

This error message will be not correct on mx31 based boards,
as they have to define CONFIG_SYS_I2C_MX31_PORTx, please correct.

>  #endif
>  
>  #ifdef DEBUG
> @@ -72,11 +75,16 @@ static u16 div[] = { 30, 32, 36, 42, 48, 52, 60, 72, 80, 88, 104, 128, 144,
>  
>  void i2c_init(int speed, int unused)
>  {
> -	int freq = mx31_get_ipg_clk();
> +	int freq;
>  	int i;
>  
> +#ifdef CONFIG_MX31
> +	freq = mx31_get_ipg_clk();
>  	/* start the required I2C clock */
>  	__REG(CCM_CGR0) = __REG(CCM_CGR0) | (3 << I2C_CLK_OFFSET);
> +#else
> +	freq = mxc_get_clock(MXC_IPG_PERCLK);
> +#endif
>  
>  	for (i = 0; i < 0x1f; i++)
>  		if (freq / div[i] <= speed)

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2010-12-16 10:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16 10:17 [U-Boot] [PATCH 0/5] Add support for Freescale MX53 Jason Liu
2010-12-16 10:17 ` [U-Boot] [PATCH 1/5] MX5: Add initial support for MX53 Jason Liu
2010-12-16 12:27   ` Wolfgang Denk
2010-12-17  3:20     ` Jason Liu
2010-12-16 13:34   ` Stefano Babic
2010-12-17  3:18     ` Jason Liu
2010-12-16 10:17 ` [U-Boot] [PATCH 2/5] serial_mxc: add support for MX53 processor Jason Liu
2010-12-16 10:17 ` [U-Boot] [PATCH 3/5] fec_mxc: " Jason Liu
2010-12-16 10:17 ` [U-Boot] [PATCH 4/5] mxc_i2c: " Jason Liu
2010-12-16 10:37   ` Heiko Schocher [this message]
2010-12-17  3:28     ` Jason Liu
2010-12-16 10:17 ` [U-Boot] [PATCH 5/5] MX5:MX53: add initial support for MX53EVK board Jason Liu
2010-12-16 10:48   ` Albert ARIBAUD
2010-12-16 12:23     ` Wolfgang Denk
2010-12-16 13:19   ` Stefano Babic
2010-12-17  3:05     ` Jason Liu
2010-12-17  5:41       ` Wolfgang Denk
2010-12-17 10:20       ` Albert ARIBAUD
2010-12-17 13:05       ` Stefano Babic
2010-12-20  5:19         ` Jason Liu
2010-12-20  6:52           ` John Rigby
2010-12-22 13:40             ` Jason Liu
2010-12-27 10:03             ` Stefano Babic
2010-12-20  6:52           ` Albert ARIBAUD
2010-12-16 23:04   ` Wolfgang Denk
2010-12-17  3:04     ` Jason Liu
2010-12-17  5:36       ` Wolfgang Denk
2010-12-16 12:25 ` [U-Boot] [PATCH 0/5] Add support for Freescale MX53 Wolfgang Denk

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=4D09EBF5.4020104@denx.de \
    --to=hs@denx.de \
    --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