嵌入式爱好者

查看: 5022|回复: 1

[Linux] [IMX6Q] u-boot How to enable I2C3

[复制链接]

4

主题

9

帖子

59

积分

i.MX6Q通行证

扫一扫,手机访问本帖
发表于 2019-8-16 11:35:56 | 显示全部楼层 |阅读模式
Hi,Is IMX6Q u-boot support I2C3 function and how to enable I2C3 ?

This is my setting as follows:
static struct i2c_pads_info i2c_pad_info2 = {
  .scl = {
    .i2c_mode = MX6_PAD_EIM_D17__I2C3_SCL | I2C_PAD,
    .gpio_mode = MX6_PAD_EIM_D17__GPIO3_IO17 | I2C_PAD,
    .gp = IMX_GPIO_NR(3, 17)
  },
  .sda = {
    .i2c_mode = MX6_PAD_EIM_D18__I2C3_SDA | I2C_PAD,
    .gpio_mode = MX6_PAD_EIM_D18__GPIO3_IO18 | I2C_PAD,
    .gp = IMX_GPIO_NR(3, 18)
  }
};

int board_init(void)
{
   ...
  setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
  setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);


But seem not works in this setting!
My test command is u-boot i2c command:
=>i2c dev 2
=>i2c probe
but "i2c dev 1" is ok!
"i2c dev 2" is no any i2c signal output


My u-boot version is
====================================
U-Boot 2016.03-svn9469 (Aug 16 2019 - 11:14:31 +0800)
arm-poky-linux-gnueabi-gcc (GCC) 5.3.0
GNU ld (GNU Binutils) 2.26.0.20160214
====================================

回复

使用道具 举报

4

主题

9

帖子

59

积分

i.MX6Q通行证

 楼主| 发表于 2019-8-16 19:14:59 | 显示全部楼层
Hi, This issues has fixed.
I2C3 setting should be
static struct i2c_pads_info i2c_pad_info2 = {
  .scl = {
    .i2c_mode = MX6_PAD_GPIO_3__I2C3_SCL | I2C_PAD,
    .gpio_mode = MX6_PAD_GPIO_3__GPIO1_IO03 | I2C_PAD,
    .gp = IMX_GPIO_NR(1, 3)
  },
  .sda = {
    .i2c_mode = MX6_PAD_GPIO_6__I2C3_SDA | I2C_PAD,
    .gpio_mode = MX6_PAD_GPIO_6__GPIO1_IO06 | I2C_PAD,
    .gp = IMX_GPIO_NR(1, 6)
  }
};
点评回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-4-19 07:24

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表