summaryrefslogtreecommitdiff
path: root/board/hardkernel/odroidc4/odroidc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/hardkernel/odroidc4/odroidc4.c')
-rw-r--r--board/hardkernel/odroidc4/odroidc4.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/board/hardkernel/odroidc4/odroidc4.c b/board/hardkernel/odroidc4/odroidc4.c
index 7cbc9b509f..53e202e751 100644
--- a/board/hardkernel/odroidc4/odroidc4.c
+++ b/board/hardkernel/odroidc4/odroidc4.c
@@ -15,6 +15,7 @@
#include <asm/cpu_id.h>
#include <asm/arch/secure_apb.h>
#ifdef CONFIG_SYS_I2C_AML
+#include <amlogic/i2c.h>
#include <aml_i2c.h>
#endif
#ifdef CONFIG_AML_VPU
@@ -221,21 +222,32 @@ int board_mmc_init(bd_t *bis)
#endif
#ifdef CONFIG_SYS_I2C_AML
-struct aml_i2c_platform g_aml_i2c_plat = {
- .wait_count = 1000000,
- .wait_ack_interval = 5,
- .wait_read_interval = 5,
- .wait_xfer_interval = 5,
- .master_no = AML_I2C_MASTER_AO,
- .use_pio = 0,
- .master_i2c_speed = AML_I2C_SPPED_400K,
- .master_ao_pinmux = {
- .scl_reg = (unsigned long)MESON_I2C_MASTER_AO_GPIOAO_4_REG,
- .scl_bit = MESON_I2C_MASTER_AO_GPIOAO_4_BIT,
- .sda_reg = (unsigned long)MESON_I2C_MASTER_AO_GPIOAO_5_REG,
- .sda_bit = MESON_I2C_MASTER_AO_GPIOAO_5_BIT,
- }
+struct aml_i2c_platform g_aml_i2c_plat[] = {
+ {
+ .wait_count = 1000000,
+ .wait_ack_interval = 5,
+ .wait_read_interval = 5,
+ .wait_xfer_interval = 5,
+ .master_no = AML_I2C_MASTER_B,
+ .use_pio = 0,
+ .master_i2c_speed = AML_I2C_SPPED_400K,
+ .master_b_pinmux = {
+ .scl_reg = (unsigned long)MESON_I2C_MASTER_B_GPIOX_11_REG,
+ .scl_bit = MESON_I2C_MASTER_B_GPIOX_11_BIT,
+ .sda_reg = (unsigned long)MESON_I2C_MASTER_B_GPIOX_10_REG,
+ .sda_bit = MESON_I2C_MASTER_B_GPIOX_10_BIT,
+ },
+ },
};
+
+static void board_i2c_init(void)
+{
+ //Amlogic I2C controller initialized
+ //note: it must be call before any I2C operation
+ //aml_i2c_init();
+ extern void aml_i2c_set_ports(struct aml_i2c_platform *i2c_plat);
+ aml_i2c_set_ports(g_aml_i2c_plat);
+}
#endif
#if defined(CONFIG_BOARD_EARLY_INIT_F)
@@ -372,6 +384,7 @@ int board_late_init(void)
/* select the default mmc device */
mmc_select_hwpart(mmc_devnum, 0);
#endif
+
#ifdef CONFIG_AML_VPU
vpu_probe();
#endif
@@ -386,6 +399,9 @@ int board_late_init(void)
board_cvbs_probe();
#endif
+#ifdef CONFIG_SYS_I2C_AML
+ board_i2c_init();
+#endif
setenv("variant", board_is_odroidc4() ? "c4" : "hc4");
board_set_dtbfile("meson64_odroid%s.dtb");