public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 7/9] mxc_i2c: Allow MX6Q I2C3 to work
Date: Thu, 31 May 2012 15:24:41 -0700	[thread overview]
Message-ID: <4FC7EFA9.3050103@boundarydevices.com> (raw)
In-Reply-To: <1338485043-21666-7-git-send-email-fabio.estevam@freescale.com>

On 5/31/2012 10:24 AM, Fabio Estevam wrote:
> Allow MX6Q I2C3 to work.
>
> Cc: Heiko Schocher<hs@denx.de>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
> ---
>   drivers/i2c/mxc_i2c.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> index c88ac7c..d3c323e 100644
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -78,6 +78,8 @@ struct mxc_i2c_regs {
>   #define I2C_BASE	I2C2_BASE_ADDR
>   #elif defined(CONFIG_SYS_I2C_MX35_PORT3)
>   #define I2C_BASE	I2C3_BASE_ADDR
> +#elif defined(CONFIG_SYS_I2C_MX6Q_PORT3)
> +#define I2C_BASE	I2C3_BASE_ADDR
>   #else
>   #error "define CONFIG_SYS_I2C_MX<Processor>_PORTx to use the mx I2C driver"
>   #endif
This conflicts with the patch that Stefano acked on May 6.

[PATCH 1/3] mxc_i2c: specify i2c base address in config file

The following platforms had their config files changed
flea3, imx31_phycore, mx35pdk, mx53ard, mx53evk, mx53smd

Signed-off-by: Troy Kisky<troy.kisky@boundarydevices.com>
---
  arch/arm/include/asm/arch-mx31/imx-regs.h |    7 +++++++
  arch/arm/include/asm/arch-mx35/imx-regs.h |    2 +-
  drivers/i2c/mxc_i2c.c                     |   25 ++++---------------------
  include/configs/flea3.h                   |    2 +-
  include/configs/imx31_phycore.h           |    3 ++-
  include/configs/mx35pdk.h                 |    2 +-
  include/configs/mx53ard.h                 |    2 +-
  include/configs/mx53evk.h                 |    2 +-
  include/configs/mx53smd.h                 |    2 +-
  9 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx31/imx-regs.h b/arch/arm/include/asm/arch-mx31/imx-regs.h
index 6454acb..7ddbbd6 100644
--- a/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -606,6 +606,13 @@ struct esdc_regs {
  #define UART4_BASE	0x43FB0000
  #define UART5_BASE	0x43FB4000

+#define I2C1_BASE_ADDR          0x43f80000
+#define I2C1_CLK_OFFSET		26
+#define I2C2_BASE_ADDR          0x43F98000
+#define I2C2_CLK_OFFSET		28
+#define I2C3_BASE_ADDR          0x43f84000
+#define I2C3_CLK_OFFSET		30
+
  #define ESDCTL_SDE			(1<<  31)
  #define ESDCTL_CMD_RW			(0<<  28)
  #define ESDCTL_CMD_PRECHARGE		(1<<  28)
diff --git a/arch/arm/include/asm/arch-mx35/imx-regs.h b/arch/arm/include/asm/arch-mx35/imx-regs.h
index e570ad1..3146006 100644
--- a/arch/arm/include/asm/arch-mx35/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx35/imx-regs.h
@@ -39,7 +39,7 @@
  #define MAX_BASE_ADDR           0x43F04000
  #define EVTMON_BASE_ADDR        0x43F08000
  #define CLKCTL_BASE_ADDR        0x43F0C000
-#define I2C_BASE_ADDR           0x43F80000
+#define I2C1_BASE_ADDR		0x43F80000
  #define I2C3_BASE_ADDR          0x43F84000
  #define ATA_BASE_ADDR           0x43F8C000
  #define UART1_BASE		0x43F90000
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index c88ac7c..416ffee 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -59,27 +59,10 @@ struct mxc_i2c_regs {
  #define I2SR_IIF	(1<<  1)
  #define I2SR_RX_NO_AK	(1<<  0)

-#if defined(CONFIG_SYS_I2C_MX31_PORT1)
-#define I2C_BASE	0x43f80000
-#define I2C_CLK_OFFSET	26
-#elif defined (CONFIG_SYS_I2C_MX31_PORT2)
-#define I2C_BASE	0x43f98000
-#define I2C_CLK_OFFSET	28
-#elif defined (CONFIG_SYS_I2C_MX31_PORT3)
-#define I2C_BASE	0x43f84000
-#define I2C_CLK_OFFSET	30
-#elif defined(CONFIG_SYS_I2C_MX53_PORT1)
-#define I2C_BASE        I2C1_BASE_ADDR
-#elif defined(CONFIG_SYS_I2C_MX53_PORT2)
-#define I2C_BASE        I2C2_BASE_ADDR
-#elif defined(CONFIG_SYS_I2C_MX35_PORT1)
-#define I2C_BASE	I2C_BASE_ADDR
-#elif defined(CONFIG_SYS_I2C_MX35_PORT2)
-#define I2C_BASE	I2C2_BASE_ADDR
-#elif defined(CONFIG_SYS_I2C_MX35_PORT3)
-#define I2C_BASE	I2C3_BASE_ADDR
+#ifdef CONFIG_SYS_I2C_BASE
+#define I2C_BASE	CONFIG_SYS_I2C_BASE
  #else
-#error "define CONFIG_SYS_I2C_MX<Processor>_PORTx to use the mx I2C driver"
+#error "define CONFIG_SYS_I2C_BASE to use the mxc_i2c driver"
  #endif

  #define I2C_MAX_TIMEOUT		10000
@@ -114,7 +97,7 @@ static uint8_t i2c_imx_get_clk(unsigned int rate)
  		(struct clock_control_regs *)CCM_BASE;

  	/* start the required I2C clock */
-	writel(readl(&sc_regs->cgr0) | (3<<  I2C_CLK_OFFSET),
+	writel(readl(&sc_regs->cgr0) | (3<<  CONFIG_SYS_I2C_CLK_OFFSET),
  		&sc_regs->cgr0);
  #endif

diff --git a/include/configs/flea3.h b/include/configs/flea3.h
index f046a58..75330c4 100644
--- a/include/configs/flea3.h
+++ b/include/configs/flea3.h
@@ -68,7 +68,7 @@
   */
  #define CONFIG_HARD_I2C
  #define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_MX35_PORT3
+#define CONFIG_SYS_I2C_BASE		I2C3_BASE_ADDR
  #define CONFIG_SYS_I2C_SPEED		100000
  #define CONFIG_SYS_I2C_SLAVE		0xfe
  #define CONFIG_MXC_SPI
diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
index 3153eb5..197cefa 100644
--- a/include/configs/imx31_phycore.h
+++ b/include/configs/imx31_phycore.h
@@ -54,7 +54,8 @@

  #define CONFIG_HARD_I2C
  #define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_MX31_PORT2
+#define CONFIG_SYS_I2C_BASE		I2C2_BASE_ADDR
+#define CONFIG_SYS_I2C_CLK_OFFSET	I2C2_CLK_OFFSET
  #define CONFIG_SYS_I2C_SPEED		100000
  #define CONFIG_SYS_I2C_SLAVE		0xfe

diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index de4b954..dfe39b8 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -59,7 +59,7 @@
   */
  #define CONFIG_HARD_I2C
  #define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_MX35_PORT1
+#define CONFIG_SYS_I2C_BASE		I2C1_BASE_ADDR
  #define CONFIG_SYS_I2C_SPEED		100000
  #define CONFIG_SYS_I2C_SLAVE		0xfe
  #define CONFIG_MXC_SPI
diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index f48a41e..0bdf6a3 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -50,7 +50,7 @@
  #define CONFIG_CMD_I2C
  #define CONFIG_HARD_I2C
  #define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_MX53_PORT2
+#define CONFIG_SYS_I2C_BASE		I2C2_BASE_ADDR
  #define CONFIG_SYS_I2C_SPEED            100000
  #define CONFIG_SYS_I2C_SLAVE            0xfe

diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index a77e5b2..3c7c329 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -53,7 +53,7 @@
  #define CONFIG_CMD_I2C
  #define CONFIG_HARD_I2C
  #define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_MX53_PORT2       1
+#define CONFIG_SYS_I2C_BASE		I2C2_BASE_ADDR
  #define CONFIG_SYS_I2C_SPEED            100000
  #define CONFIG_SYS_I2C_SLAVE            0xfe

diff --git a/include/configs/mx53smd.h b/include/configs/mx53smd.h
index a04db3f..a904130 100644
--- a/include/configs/mx53smd.h
+++ b/include/configs/mx53smd.h
@@ -50,7 +50,7 @@
  #define CONFIG_CMD_I2C
  #define CONFIG_HARD_I2C
  #define CONFIG_I2C_MXC
-#define CONFIG_SYS_I2C_MX53_PORT2
+#define CONFIG_SYS_I2C_BASE		I2C2_BASE_ADDR
  #define CONFIG_SYS_I2C_SPEED            100000
  #define CONFIG_SYS_I2C_SLAVE            0xfe

-- 1.7.5.4

  reply	other threads:[~2012-05-31 22:24 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 17:23 [U-Boot] [PATCH 1/9] mx6: Allow mx6 to access the IPUv3 registers Fabio Estevam
2012-05-31 17:23 ` [U-Boot] [PATCH 2/9] video: Rename CONFIG_VIDEO_MX5 Fabio Estevam
2012-06-22 11:36   ` Anatolij Gustschin
2012-05-31 17:23 ` [U-Boot] [PATCH 3/9] ipu_common: Only apply the erratum to MX51 Fabio Estevam
2012-06-22 11:36   ` Anatolij Gustschin
2012-05-31 17:23 ` [U-Boot] [PATCH 4/9] ipu_common: Let clk_ipu_enable/disable only run on MX51 and MX53 Fabio Estevam
2012-06-22 11:37   ` Anatolij Gustschin
2012-05-31 17:23 ` [U-Boot] [PATCH 5/9] ipu_common: Rename MXC_CCM_BASE Fabio Estevam
2012-06-22 11:37   ` Anatolij Gustschin
2012-05-31 17:24 ` [U-Boot] [PATCH 6/9] ipu_common: Do not hardcode the ipu_clk frequency Fabio Estevam
2012-06-22 11:38   ` Anatolij Gustschin
2012-05-31 17:24 ` [U-Boot] [PATCH 7/9] mxc_i2c: Allow MX6Q I2C3 to work Fabio Estevam
2012-05-31 22:24   ` Troy Kisky [this message]
2012-05-31 22:48     ` Fabio Estevam
2012-06-02  6:44       ` Dirk Behme
2012-05-31 17:24 ` [U-Boot] [PATCH 8/9] ipu_common: Add ldb_clk for use in parenting the pixel clock Fabio Estevam
2012-06-22 11:39   ` Anatolij Gustschin
2012-05-31 17:24 ` [U-Boot] [PATCH 9/9] mx6qsabrelite: Add splaschscreen support Fabio Estevam
2012-06-02  6:46   ` Dirk Behme
2012-06-02 18:22     ` Fabio Estevam
2012-06-02 18:52       ` Dirk Behme
2012-06-02 22:36         ` Fabio Estevam
2012-06-03  0:12           ` Troy Kisky
2012-06-03  7:29             ` Fabio Estevam
2012-07-31  9:07   ` Dirk Behme
2012-09-17 20:20   ` [U-Boot] [PATCH 0/2] i.MX6: mx6qsabrelite: Add splash screen support Eric Nelson
2012-09-17 20:20     ` [U-Boot] [PATCH 1/2] i.MX6: change register name for CCM_CHSCCDR to match ref. manual Eric Nelson
2012-09-17 20:20     ` [U-Boot] [PATCH 2/2] i.MX6: mx6qsabrelite: Add splash screen support Eric Nelson
2012-09-17 20:29       ` Fabio Estevam
2012-09-17 20:45     ` [U-Boot] [PATCH 0/2] " Anatolij Gustschin
2012-09-17 23:14     ` [U-Boot] [PATCH V2 " Eric Nelson
2012-09-17 23:14       ` [U-Boot] [PATCH V2 1/2] i.MX6: change register name for CCM_CHSCCDR to match ref. manual Eric Nelson
2012-09-17 23:14       ` [U-Boot] [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support Eric Nelson
2012-09-17 23:43         ` Fabio Estevam
2012-09-18  0:08           ` Eric Nelson
2012-09-18  0:43             ` Eric Nelson
2012-09-18  0:45               ` Fabio Estevam
2012-09-18 14:02           ` Eric Nelson
2012-09-18 14:42             ` Stefano Babic
2012-09-18 15:12               ` Eric Nelson
2012-09-18  7:47         ` Stefano Babic
2012-09-18 13:28           ` Eric Nelson
2012-09-18 13:50             ` Stefano Babic
2012-09-18 23:56               ` [U-Boot] Cleanup of CCGR registers (was [PATCH V2 2/2] i.MX6: mx6qsabrelite: Add splash screen support) Eric Nelson
2012-09-19  7:31                 ` Stefano Babic
2012-06-22 11:35 ` [U-Boot] [PATCH 1/9] mx6: Allow mx6 to access the IPUv3 registers Anatolij Gustschin

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=4FC7EFA9.3050103@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --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