All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/5] I2C: add i2c support for Pantheon platform
Date: Tue, 15 Mar 2011 07:58:32 +0100	[thread overview]
Message-ID: <4D7F0E18.2000106@denx.de> (raw)
In-Reply-To: <1300160443-12552-4-git-send-email-leiwen@marvell.com>

Hello Lei,

Lei Wen wrote:
> Add i2c support to dkb board with pantheon soc.
> 
> Signed-off-by: Lei Wen <leiwen@marvell.com>
> ---
>  arch/arm/cpu/arm926ejs/pantheon/cpu.c    |   10 ++++++++++
>  arch/arm/include/asm/arch-pantheon/cpu.h |    4 +++-
>  arch/arm/include/asm/arch-pantheon/mfp.h |    2 ++
>  board/Marvell/dkb/dkb.c                  |    4 ++++
>  include/configs/dkb.h                    |   11 +++++++++++
>  5 files changed, 30 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
> index 9ddc77c..88ecfae 100644
> --- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c
> +++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
> @@ -59,6 +59,10 @@ int arch_cpu_init(void)
>  	/* Enable GPIO clock */
>  	writel(APBC_APBCLK, &apbclkres->gpio);
>  
> +	/* Enable I2C clock */
> +	writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apbclkres->twsi);
> +	writel(APBC_FNCLK | APBC_APBCLK, &apbclkres->twsi);
> +
>  	icache_enable();
>  
>  	return 0;
> @@ -76,3 +80,9 @@ int print_cpuinfo(void)
>  	return 0;
>  }
>  #endif
> +
> +#ifdef CONFIG_I2C_MV
> +void i2c_clk_enable (void)
> +{
> +}
> +#endif
> diff --git a/arch/arm/include/asm/arch-pantheon/cpu.h b/arch/arm/include/asm/arch-pantheon/cpu.h
> index 30f4393..60955c5 100644
> --- a/arch/arm/include/asm/arch-pantheon/cpu.h
> +++ b/arch/arm/include/asm/arch-pantheon/cpu.h
> @@ -50,7 +50,9 @@ struct panthapb_registers {
>  	u32 uart0;	/*0x000*/
>  	u32 uart1;	/*0x004*/
>  	u32 gpio;	/*0x008*/
> -	u8 pad0[0x034 - 0x08 - 4];
> +	u8 pad0[0x02c - 0x08 - 4];
> +	u32 twsi;	/*0x02c*/
> +	u8 pad1[0x034 - 0x2c - 4];
>  	u32 timers;	/*0x034*/
>  };
>  
> diff --git a/arch/arm/include/asm/arch-pantheon/mfp.h b/arch/arm/include/asm/arch-pantheon/mfp.h
> index fb291cf..041e64c 100644
> --- a/arch/arm/include/asm/arch-pantheon/mfp.h
> +++ b/arch/arm/include/asm/arch-pantheon/mfp.h
> @@ -34,6 +34,8 @@
>  /* UART2 */
>  #define MFP47_UART2_RXD		MFP_REG(0x198) | MFP_AF6 | MFP_DRIVE_MEDIUM
>  #define MFP48_UART2_TXD		MFP_REG(0x19c) | MFP_AF6 | MFP_DRIVE_MEDIUM
> +#define MFP53_CI2C_SCL		MFP_REG(0x1b0) | MFP_AF2 | MFP_DRIVE_MEDIUM
> +#define MFP54_CI2C_SDA		MFP_REG(0x1b4) | MFP_AF2 | MFP_DRIVE_MEDIUM

Please add braces around this multiple or concatenation

>  /* More macros can be defined here... */
>  
> diff --git a/board/Marvell/dkb/dkb.c b/board/Marvell/dkb/dkb.c
> index 72a2d2a..00f73e7 100644
> --- a/board/Marvell/dkb/dkb.c
> +++ b/board/Marvell/dkb/dkb.c
> @@ -36,6 +36,10 @@ int board_early_init_f(void)
>  		MFP47_UART2_RXD,
>  		MFP48_UART2_TXD,
>  
> +		/* I2C */
> +		MFP53_CI2C_SCL,
> +		MFP54_CI2C_SDA,
> +
>  		MFP_EOC		/*End of configureation*/
>  	};
>  	/* configure MFP's */
> diff --git a/include/configs/dkb.h b/include/configs/dkb.h
> index 638af5e..75c4b99 100644
> --- a/include/configs/dkb.h
> +++ b/include/configs/dkb.h
> @@ -56,6 +56,17 @@
>  #include "mv-common.h"
>  
>  #undef CONFIG_ARCH_MISC_INIT
> +
> +/*
> + * I2C definition
> + */
> +#define CONFIG_CMD_I2C
> +#define CONFIG_I2C_MV			1
> +#define CONFIG_PXA_I2C_REG		0xd4011000
> +#define CONFIG_HARD_I2C			1
> +#define CONFIG_SYS_I2C_SPEED		0
> +#define CONFIG_SYS_I2C_SLAVE		0xfe
> +
>  /*
>   * Environment variables configurations
>   */

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

  reply	other threads:[~2011-03-15  6:58 UTC|newest]

Thread overview: 123+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 10:16 [U-Boot] [PATCH 1/8] pxa: move i2c driver to the common place Lei Wen
2011-03-14 10:16 ` [U-Boot] [PATCH 2/8] pxa_i2c: use structure to replace the direclty define Lei Wen
2011-03-14 10:16 ` [U-Boot] [PATCH 3/8] I2C: add i2c support for Pantheon platform Lei Wen
2011-03-14 10:16 ` [U-Boot] [PATCH 4/8] I2C: pxa_i2c: add multi bus support Lei Wen
2011-03-14 10:16 ` [U-Boot] [PATCH 5/8] I2C: add i2c support for Armada100 platform Lei Wen
2011-03-14 12:03 ` [U-Boot] [PATCH 1/8] pxa: move i2c driver to the common place Prafulla Wadaskar
2011-03-15  1:36   ` Lei Wen
2011-03-15  3:40     ` [U-Boot] [PATCH 0/5] add i2c support to pantheon and aramada100 Lei Wen
2011-03-15  8:12       ` Wolfgang Denk
2011-03-17  6:26         ` Lei Wen
2011-03-17  6:45       ` [U-Boot] [PATCH V3 " Lei Wen
2011-03-28  5:48         ` [U-Boot] [PATCH V4 0/6] " Lei Wen
2011-03-28  6:53           ` [U-Boot] [PATCH V5 " Lei Wen
2011-03-31  8:37             ` [U-Boot] [PATCH V6 0/5] " Lei Wen
2011-04-03 13:00               ` [U-Boot] [PATCH V7 " Lei Wen
2011-04-05  8:00                 ` [U-Boot] [PATCH V8 0/6] " Lei Wen
2011-04-07 13:29                   ` Prafulla Wadaskar
2011-04-07 13:33                     ` Heiko Schocher
2011-04-13 14:01                   ` Prafulla Wadaskar
2011-04-13 14:14                     ` Lei Wen
2011-04-13 14:26                       ` Prafulla Wadaskar
2011-04-13 14:36                         ` Lei Wen
2011-04-13 14:38                   ` Prafulla Wadaskar
2011-04-05  8:00                 ` [U-Boot] [PATCH V8 1/6] pxa: move i2c driver to the common place Lei Wen
2011-04-20 22:32                   ` Wolfgang Denk
2011-04-21  2:42                     ` Lei Wen
2011-04-21  2:47                       ` Macpaul Lin
2011-04-21  2:50                         ` Lei Wen
2011-04-21  3:31                     ` [U-Boot] [PATCH V8.1 " Lei Wen
2011-04-05  8:00                 ` [U-Boot] [PATCH V8 2/6] mv_i2c: fix timeout value to be consistent with comments Lei Wen
2011-04-05  8:00                 ` [U-Boot] [PATCH V8 3/6] mv_i2c: use structure to replace the direclty define Lei Wen
2011-04-05  8:00                 ` [U-Boot] [PATCH V8 4/6] I2C: add i2c support for Pantheon platform Lei Wen
2011-04-05  8:00                 ` [U-Boot] [PATCH V8 5/6] I2C: mv_i2c: add multi bus support Lei Wen
2011-04-05  8:01                 ` [U-Boot] [PATCH V8 6/6] I2C: add i2c support for Armada100 platform Lei Wen
2011-04-03 13:00               ` [U-Boot] [PATCH V7 1/5] pxa: move i2c driver to the common place Lei Wen
2011-04-03 13:00               ` [U-Boot] [PATCH V7 2/5] mv_i2c: use structure to replace the direclty define Lei Wen
2011-04-03 13:27                 ` Wolfgang Denk
2011-04-03 13:00               ` [U-Boot] [PATCH V7 3/5] I2C: add i2c support for Pantheon platform Lei Wen
2011-04-03 13:00               ` [U-Boot] [PATCH V7 4/5] I2C: mv_i2c: add multi bus support Lei Wen
2011-04-03 13:00               ` [U-Boot] [PATCH V7 5/5] I2C: add i2c support for Armada100 platform Lei Wen
2011-03-31  8:37             ` [U-Boot] [PATCH V6 1/5] pxa: move i2c driver to the common place Lei Wen
2011-03-31  8:37             ` [U-Boot] [PATCH V6 2/5] mv_i2c: use structure to replace the direclty define Lei Wen
2011-04-01 18:29               ` Prafulla Wadaskar
2011-04-03 11:30                 ` Lei Wen
2011-04-03 13:21                   ` Wolfgang Denk
2011-03-31  8:37             ` [U-Boot] [PATCH V6 3/5] I2C: add i2c support for Pantheon platform Lei Wen
2011-04-01 18:34               ` Prafulla Wadaskar
2011-04-03 11:32                 ` Lei Wen
2011-03-31  8:37             ` [U-Boot] [PATCH V6 4/5] I2C: mv_i2c: add multi bus support Lei Wen
2011-04-01 18:36               ` Prafulla Wadaskar
2011-03-31  8:37             ` [U-Boot] [PATCH V6 5/5] I2C: add i2c support for Armada100 platform Lei Wen
2011-04-01 18:39               ` Prafulla Wadaskar
2011-03-28  6:53           ` [U-Boot] [PATCH V5 1/6] io: add and* and or* operation api to set and clear bit Lei Wen
2011-03-28  6:53           ` [U-Boot] [PATCH V5 2/6] pxa: move i2c driver to the common place Lei Wen
2011-03-28  6:53           ` [U-Boot] [PATCH V5 3/6] mv_i2c: use structure to replace the direclty define Lei Wen
2011-03-29 13:27             ` Prafulla Wadaskar
2011-03-30 14:11               ` Lei Wen
2011-03-30 18:54                 ` Prafulla Wadaskar
2011-03-28  6:53           ` [U-Boot] [PATCH V5 4/6] I2C: add i2c support for Pantheon platform Lei Wen
2011-03-29 13:07             ` Prafulla Wadaskar
2011-03-30 14:05               ` Lei Wen
2011-03-30 18:56                 ` Prafulla Wadaskar
2011-03-31  7:49                   ` Lei Wen
2011-03-28  6:53           ` [U-Boot] [PATCH V5 5/6] I2C: mv_i2c: add multi bus support Lei Wen
2011-03-28  6:53           ` [U-Boot] [PATCH V5 6/6] I2C: add i2c support for Armada100 platform Lei Wen
2011-03-29 13:09             ` Prafulla Wadaskar
2011-03-28  5:48         ` [U-Boot] [PATCH V4 1/6] io: add and* and or* operation api to set and clear bit Lei Wen
2011-03-28  5:57           ` Wolfgang Denk
2011-03-28  6:01             ` Lei Wen
2011-03-28  6:03             ` Lei Wen
2011-03-28  6:29               ` Wolfgang Denk
2011-03-28  7:04                 ` Lei Wen
2011-03-28 16:05           ` Scott Wood
2011-03-29  2:47             ` Lei Wen
2011-03-29 16:03               ` Scott Wood
2011-03-30 14:08                 ` Lei Wen
2011-03-29  2:53             ` [U-Boot] [PATCH V5.1 " Lei Wen
2011-03-29  5:40               ` Prafulla Wadaskar
2011-03-29  5:44                 ` Mike Frysinger
2011-03-28  5:48         ` [U-Boot] [PATCH V4 2/6] pxa: move i2c driver to the common place Lei Wen
2011-03-28  5:48         ` [U-Boot] [PATCH V4 3/6] mv_i2c: use structure to replace the direclty define Lei Wen
2011-03-28  5:48         ` [U-Boot] [PATCH V4 4/6] I2C: add i2c support for Pantheon platform Lei Wen
2011-03-28  5:48         ` [U-Boot] [PATCH V4 5/6] I2C: mv_i2c: add multi bus support Lei Wen
2011-03-28  5:48         ` [U-Boot] [PATCH V4 6/6] I2C: add i2c support for Armada100 platform Lei Wen
2011-03-17  6:45       ` [U-Boot] [PATCH V3 1/5] pxa: move i2c driver to the common place Lei Wen
2011-03-22 11:42         ` Prafulla Wadaskar
2011-03-22 12:43           ` Lei Wen
2011-03-23  7:38             ` Prafulla Wadaskar
2011-03-23  8:22               ` Heiko Schocher
2011-03-23  8:43                 ` Lei Wen
2011-03-23  8:53                   ` Heiko Schocher
2011-03-23  8:56                     ` Lei Wen
2011-03-23  9:07                       ` Heiko Schocher
2011-03-23  9:16                         ` Prafulla Wadaskar
2011-03-23  9:12                     ` Prafulla Wadaskar
2011-03-17  6:45       ` [U-Boot] [PATCH V3 2/5] mv_i2c: use structure to replace the direclty define Lei Wen
2011-03-22 11:17         ` Prafulla Wadaskar
2011-03-22 12:34           ` Lei Wen
2011-03-22 15:16             ` Wolfgang Denk
2011-03-23  8:48               ` Lei Wen
2011-03-17  6:45       ` [U-Boot] [PATCH V3 3/5] I2C: add i2c support for Pantheon platform Lei Wen
2011-03-22 11:22         ` Prafulla Wadaskar
2011-03-22 12:38           ` Lei Wen
2011-03-17  6:45       ` [U-Boot] [PATCH V3 4/5] I2C: mv_i2c: add multi bus support Lei Wen
2011-03-17  6:45       ` [U-Boot] [PATCH V3 5/5] I2C: add i2c support for Armada100 platform Lei Wen
2011-03-22 11:40         ` Prafulla Wadaskar
2011-03-22 12:39           ` Lei Wen
2011-03-15  3:40     ` [U-Boot] [PATCH V2 1/5] pxa: move i2c driver to the common place Lei Wen
2011-03-15  6:48       ` Heiko Schocher
2011-03-17  6:25         ` Lei Wen
2011-03-15  8:09       ` Wolfgang Denk
2011-03-15  3:40     ` [U-Boot] [PATCH v2 2/5] mvi2c: use structure to replace the direclty define Lei Wen
2011-03-15  6:54       ` Heiko Schocher
2011-03-17  6:28         ` Lei Wen
2011-03-17  7:12           ` Heiko Schocher
2011-03-15  3:40     ` [U-Boot] [PATCH v2 3/5] I2C: add i2c support for Pantheon platform Lei Wen
2011-03-15  6:58       ` Heiko Schocher [this message]
2011-03-15  3:40     ` [U-Boot] [PATCH v2 4/5] I2C: mvi2c: add multi bus support Lei Wen
2011-03-15  7:01       ` Heiko Schocher
2011-03-15  3:40     ` [U-Boot] [PATCH v2 5/5] I2C: add i2c support for Armada100 platform Lei Wen
2011-03-15  7:08       ` Heiko Schocher
2011-03-17  6:38         ` Lei Wen
2011-03-17  7:15           ` Heiko Schocher

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=4D7F0E18.2000106@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 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.