Patchwork [U-Boot] mpc5200: digsy_mtc: fix extension board EEPROM I2C address for rev5

login
register
mail settings
Submitter Anatolij Gustschin
Date Aug. 1, 2011, 2:16 p.m.
Message ID <1312208189-27933-1-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/107746/
State Accepted
Commit eccfb49046fde7af9ae12ab59d97ae867368eaa8
Headers show

Comments

Anatolij Gustschin - Aug. 1, 2011, 2:16 p.m.
On newer rev5 hardware the extension board EEPROM I2C address
has been changed to 0x54. Make this I2C address configurable
depending on CONFIG_DIGSY_REV5 so that extention board presence
detection works correctly on newer hardware.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 board/intercontrol/digsy_mtc/digsy_mtc.c |    5 +----
 include/configs/digsy_mtc.h              |    7 +++++++
 2 files changed, 8 insertions(+), 4 deletions(-)
Wolfgang Denk - Aug. 4, 2011, 9:32 p.m.
Dear Anatolij Gustschin,

In message <1312208189-27933-1-git-send-email-agust@denx.de> you wrote:
> On newer rev5 hardware the extension board EEPROM I2C address
> has been changed to 0x54. Make this I2C address configurable
> depending on CONFIG_DIGSY_REV5 so that extention board presence
> detection works correctly on newer hardware.
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  board/intercontrol/digsy_mtc/digsy_mtc.c |    5 +----
>  include/configs/digsy_mtc.h              |    7 +++++++
>  2 files changed, 8 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/intercontrol/digsy_mtc/digsy_mtc.c b/board/intercontrol/digsy_mtc/digsy_mtc.c
index 784ba2a..4d6b33d 100644
--- a/board/intercontrol/digsy_mtc/digsy_mtc.c
+++ b/board/intercontrol/digsy_mtc/digsy_mtc.c
@@ -220,9 +220,6 @@  int checkboard(void)
 
 #define GPT_GPIO_ON		0x00000034	/* GPT as simple GPIO, high */
 
-/* ExBo I2C Addresses */
-#define EXBO_EE_I2C_ADDRESS	0x56
-
 static void exbo_hw_init(void)
 {
 	struct mpc5xxx_gpt *gpt = (struct mpc5xxx_gpt *)MPC5XXX_GPT;
@@ -232,7 +229,7 @@  static void exbo_hw_init(void)
 	unsigned char val;
 
 	/* 1st, check if extension board is present */
-	if (i2c_read(EXBO_EE_I2C_ADDRESS, 0, 1, &val, 1))
+	if (i2c_read(CONFIG_SYS_EXBO_EE_I2C_ADDRESS, 0, 1, &val, 1))
 		return;
 
 	/* configure IrDA pins (PSC6 port) as gpios */
diff --git a/include/configs/digsy_mtc.h b/include/configs/digsy_mtc.h
index 40ab631..1e52299 100644
--- a/include/configs/digsy_mtc.h
+++ b/include/configs/digsy_mtc.h
@@ -293,6 +293,13 @@ 
 #define CONFIG_SYS_DS1339_TCR_VAL	0xAB	/* diode + 4k resistor */
 #endif
 
+/* ExBo I2C Addresses */
+#if defined(CONFIG_DIGSY_REV5)
+#define CONFIG_SYS_EXBO_EE_I2C_ADDRESS	0x54
+#else
+#define CONFIG_SYS_EXBO_EE_I2C_ADDRESS	0x56
+#endif
+
 /*
  * Flash configuration
  */