i2c device(fram) on i.mx28 evk

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i2c device(fram) on i.mx28 evk

2,447 次查看
mehmet
Contributor I

Hi,

 I need some help. I have to use i2c device(fram) on i.mx28 evk. I think I can use instead of U50(i2c eeprom). I mounted fram to place of u50. I added i2c device to arch/arm/mach-mx28/mx28evk.c file like below.

static struct i2c_board_info __initdata mxs_i2c_device[] =

{

// { I2C_BOARD_INFO("sgtl5000-i2c", 0xa), .flags = I2C_M_TEN },

    { I2C_BOARD_INFO("fram-i2c", 0xa), .flags = I2C_M_TEN }

};

 

There is another i2c device on the board( sound device:sgtl5000). And both of them have same chip-id.

Because of chip-id of fram, I have commented  sgtl5000-i2c device. And disable from linux config(device drivers/sound card support/ALSA/ALSA for Soc auido support).

 

I booted linux-sb, but I cannot see fram. How can I use u50 interface for i2c-fram?

 

Thanks.

Mehmet Kurnaz

标签 (1)
0 项奖励
回复
5 回复数

1,282 次查看
Ramtry
Contributor III

Hi,

I am trying to interface RTC (ISL1208) to I2C1 channel of

i.mx28evk. The steps which followed are as follows

1) In Menuconfig option.. Selected Device Drivers ->Real Time

Clock-> Intersil ISL1208

2) In Menuconfig option. I2C support-> I2C Hardware BUS

support -> Enable I2C1 module

3) In mx28evk.c ->

static struct i2c_board_info __initdata mxs_i2c_device[] = {

    { I2C_BOARD_INFO("sgtl5000-i2c", 0xa), .flags =

I2C_M_TEN },

    { I2C_BOARD_INFO("rtc-isl1208", 0x6f), .flags =

I2C_M_TEN }

    

};

static void __init i2c_device_init(void)

{

    i2c_register_board_info(0, mxs_i2c_device,

ARRAY_SIZE(mxs_i2c_device));

    i2c_register_board_info(1, mxs_i2c_device,

ARRAY_SIZE(mxs_i2c_device));

}

4) Compiled the kernel and booted the board through NFS.

5) In debug serial window,

$cd /sys/class/i2c-dev

$ls

i2c-0 i2c-1

but i can't read the time and set the time in ISL1208 IC.

I can't find anyfile to read the time and other setting. Please

help me sort out..

Thanks & Regards,

RAM :smileyhappy:

0 项奖励
回复

1,282 次查看
mehmet
Contributor I

I did not try 7 bit addressing, but I have no any hope .

I wrote 2 different drivers for fram one of them with soft-i2c with gpio and other is with i2c of kernel(i2c_transfer). In previous projects on another platforms, soft-i2c driver was ok. 

I checked scl and sda with oscilloscope. 

with soft-i2c;

There is no scl; now I work with it.

with kernel-i2c;

scl and sda are ok(or I guess so), but there is no ack from device.

 

Thanks.

Mehmet


Ahmet YUCE said:

I've used an RTC in this socket of iMX28EVK with a converter PCB (pinout different than eeprom). Did you try 7-bit addressing in I2C_BOARD_INFO ? I've noticed such a change between 2.6.31 and 2.6.35 kernel of LTIB.

If you have an access to an oscilloscope (preferably with I2C decoding capabilities) it is best to check signals and see what's going wrong.

Regards
Ahmet
0 项奖励
回复

1,282 次查看
AhmetYUCE
Contributor II
I've used an RTC in this socket of iMX28EVK with a converter PCB (pinout different than eeprom). Did you try 7-bit addressing in I2C_BOARD_INFO ? I've noticed such a change between 2.6.31 and 2.6.35 kernel of LTIB. If you have an access to an oscilloscope (preferably with I2C decoding capabilities) it is best to check signals and see what's going wrong. Regards Ahmet
0 项奖励
回复

1,282 次查看
mehmet
Contributor I

Hi Ahmet,

Thanks for response.

I wrote driver, Already I used fram on previous projects. Linux drivers and user applications are ready. In this platform, I added it as i2c device to kernel. And I want to use i2c-tools(i2cset and i2cget).  When I tried i2cset or i2cget I got write or read failed output. 

i2cset 0 0x0a 0 0x11 (write 0x11 value to device; chip id is 0x0a)

write failed

Thanks.

Mehmet

 



Ahmet YUCE said:

Off my top, did you write a device driver for FRAM or found a ready to use driver for it? Modifiying board_xyz.c is not enough, appropriate driver in kernel kernel configuration should be selected and built into kernel.

Regards
Ahmet
0 项奖励
回复

1,282 次查看
AhmetYUCE
Contributor II
Off my top, did you write a device driver for FRAM or found a ready to use driver for it? Modifiying board_xyz.c is not enough, appropriate driver in kernel kernel configuration should be selected and built into kernel. Regards Ahmet
0 项奖励
回复