[U-Boot] [PATCH] arm: rmobile: Add register infomation of i2c for rcar

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Thu Jul 24 08:01:17 CEST 2014


This move to to the rcar_i2c.h the register address of the i2c
that is defined in board config.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
---
 arch/arm/include/asm/arch-rmobile/rcar_i2c.h | 29 ++++++++++++++++++++++++++++
 drivers/i2c/rcar_i2c.c                       |  1 +
 include/configs/lager.h                      |  5 -----
 3 files changed, 30 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-rmobile/rcar_i2c.h

diff --git a/arch/arm/include/asm/arch-rmobile/rcar_i2c.h b/arch/arm/include/asm/arch-rmobile/rcar_i2c.h
new file mode 100644
index 0000000..763b91e
--- /dev/null
+++ b/arch/arm/include/asm/arch-rmobile/rcar_i2c.h
@@ -0,0 +1,29 @@
+/*
+ * arch/arm/include/asm/arch-rmobile/rcar_i2c.h
+ *
+ * Copyright (C) 2014 Renesas Electronics Corporation
+ * Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+*/
+
+#ifndef __ASM_ARCH_RCAR_I2C_H
+#define __ASM_ARCH_RCAR_I2C_H
+
+/*
+ * R-Car (R8A7790/R8A7791) I2C Addresses
+ */
+#define RCAR_I2C0_BASE		0xE6508000
+#define RCAR_I2C1_BASE		0xE6518000
+#define RCAR_I2C2_BASE		0xE6530000
+#define RCAR_I2C3_BASE		0xE6540000
+#define RCAR_I2C4_BASE		0xE6520000
+#define RCAR_I2C5_BASE		0xE6528000
+
+#if defined(CONFIG_R8A7790)
+  #define RCAR_I2C_NUM_CONTROLLERS	4
+#elif defined(CONFIG_R8A7791)
+  #define RCAR_I2C_NUM_CONTROLLERS	6
+#endif
+
+#endif /* __ASM_ARCH_RCAR_I2C_H */
diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
index 50cebd6..d624637 100644
--- a/drivers/i2c/rcar_i2c.c
+++ b/drivers/i2c/rcar_i2c.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <asm/io.h>
+#include <asm/arch/rca_i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/include/configs/lager.h b/include/configs/lager.h
index f39a788..d1ea79d 100644
--- a/include/configs/lager.h
+++ b/include/configs/lager.h
@@ -148,15 +148,10 @@
 /* I2C */
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_RCAR
-#define CONFIG_SYS_RCAR_I2C0_BASE	0xE6508000
 #define CONFIG_SYS_RCAR_I2C0_SPEED	400000
-#define CONFIG_SYS_RCAR_I2C1_BASE	0xE6518000
 #define CONFIG_SYS_RCAR_I2C1_SPEED	400000
-#define CONFIG_SYS_RCAR_I2C2_BASE	0xE6530000
 #define CONFIG_SYS_RCAR_I2C2_SPEED	400000
-#define CONFIG_SYS_RCAR_I2C3_BASE	0xE6540000
 #define CONFIG_SYS_RCAR_I2C3_SPEED	400000
-#define CONFIF_SYS_RCAR_I2C_NUM_CONTROLLERS	4
 
 #define CONFIG_SYS_I2C_POWERIC_ADDR 0x58 /* da9063 */
 
-- 
2.0.0



More information about the U-Boot mailing list