All of lore.kernel.org
 help / color / mirror / Atom feed
* about i2cset tool
@ 2020-05-19  7:40 zhouyuanqing8
  2020-05-19 19:24 ` Brandon Wyman
  0 siblings, 1 reply; 4+ messages in thread
From: zhouyuanqing8 @ 2020-05-19  7:40 UTC (permalink / raw)
  To: openbmc; +Cc: uperic

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Hi All

    I use the i2cget to read the device data, but the i2cset did not write the data to the device, and the operation of i2cset did not report any errors.

for example:

root@starlake-bmc:/usr/sbin# i2cget 9 0x10 0x00 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x00, 3 bytes using read I2C block data.
Continue? [Y/n]
3: 0x02 0x32 0xcc

root@starlake-bmc:/usr/sbin# i2cset 9 0x10 0x82 0x0101 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x00, using read word data.

when I check the 0x82 reg,the value is not changed.

Thanks
harley


[-- Attachment #2: Type: text/html, Size: 2855 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: about i2cset tool
  2020-05-19  7:40 about i2cset tool zhouyuanqing8
@ 2020-05-19 19:24 ` Brandon Wyman
  2020-05-20  1:52   ` 回复: " zhouyuanqing8
  0 siblings, 1 reply; 4+ messages in thread
From: Brandon Wyman @ 2020-05-19 19:24 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]


On 2020-05-19 02:40, zhouyuanqing8@outlook.com wrote:
> Hi All
>
>     I use the i2cget to read the device data, but the i2cset did not 
> write the data to the device, and the operation of i2cset did not 
> report any errors.
>
> for example:
>
> root@starlake-bmc:/usr/sbin# i2cget 9 0x10 0x00 i 3
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will read from device file /dev/i2c-9, chip address 0x10, data address
> 0x00, 3 bytes using read I2C block data.
> Continue? [Y/n]
> 3: 0x02 0x32 0xcc
>
> root@starlake-bmc:/usr/sbin# i2cset 9 0x10 0x82 0x0101 2
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will read from device file /dev/i2c-9, chip address 0x10, data address
> 0x00, using read word data.

Well, that is a bit odd. It looks like that just did a read, not a write.


Do you need to use the force access option? What is that 2? Should it be 
a word (w)?

https://linux.die.net/man/8/i2cset

i2cset -f 9 0x10 0x82 0x0101 w

>
> when I check the 0x82 reg,the value is not changed.
>
> Thanks
> harley
>

[-- Attachment #2: Type: text/html, Size: 4312 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 回复: about i2cset tool
  2020-05-19 19:24 ` Brandon Wyman
@ 2020-05-20  1:52   ` zhouyuanqing8
  2020-05-20 12:10     ` zhouyuanqing8
  0 siblings, 1 reply; 4+ messages in thread
From: zhouyuanqing8 @ 2020-05-20  1:52 UTC (permalink / raw)
  To: Brandon Wyman, openbmc

[-- Attachment #1: Type: text/plain, Size: 2736 bytes --]

Hi Brandon,

   Sorry, I did not retain the output information of the i2cset command before, I copied the output information from the i2cget command.

   I tried the following command, the register still cannot be written, and there was no error message.This command is to turn on the LED light.

/usr/sbin# i2cset -f 9 0x10 0x82 0xffff w
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-9, chip address 0x10, data address
0x82, data 0x102, mode word.
Continue? [Y/n] Y

    i2cget command works just fine.
/usr/sbin# i2cget 9 0x10 0x02 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x02, 3 bytes using read I2C block data.
Continue? [Y/n] Y
3: 0x03 0x00 0x00

/usr/sbin# i2cget 9 0x10 0x02 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x02, 3 bytes using read I2C block data.
Continue? [Y/n] Y
3: 0x03 0xff 0x00

/usr/sbin# i2cget 9 0x10 0x02 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x02, 3 bytes using read I2C block data.
Continue? [Y/n] y
3: 0x03 0x00 0x00


________________________________
发件人: openbmc <openbmc-bounces+zhouyuanqing8=outlook.com@lists.ozlabs.org> 代表 Brandon Wyman <bjwyman@gmail.com>
发送时间: 2020年5月20日 3:24
收件人: openbmc@lists.ozlabs.org <openbmc@lists.ozlabs.org>
主题: Re: about i2cset tool



On 2020-05-19 02:40, zhouyuanqing8@outlook.com<mailto:zhouyuanqing8@outlook.com> wrote:
Hi All

    I use the i2cget to read the device data, but the i2cset did not write the data to the device, and the operation of i2cset did not report any errors.

for example:

:/usr/sbin# i2cget 9 0x10 0x00 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x00, 3 bytes using read I2C block data.
Continue? [Y/n]
3: 0x02 0x32 0xcc

:/usr/sbin# i2cset 9 0x10 0x82 0x0101 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x00, using read word data.

Well, that is a bit odd. It looks like that just did a read, not a write.


Do you need to use the force access option? What is that 2? Should it be a word (w)?

https://linux.die.net/man/8/i2cset

i2cset -f 9 0x10 0x82 0x0101 w

when I check the 0x82 reg,the value is not changed.

Thanks
harley


[-- Attachment #2: Type: text/html, Size: 7839 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 回复: about i2cset tool
  2020-05-20  1:52   ` 回复: " zhouyuanqing8
@ 2020-05-20 12:10     ` zhouyuanqing8
  0 siblings, 0 replies; 4+ messages in thread
From: zhouyuanqing8 @ 2020-05-20 12:10 UTC (permalink / raw)
  To: Brandon Wyman, openbmc; +Cc: uperic

[-- Attachment #1: Type: text/plain, Size: 3119 bytes --]

Hi Brandon,

    This issue has been resolved, the old CPLD version does not support writing to this register.

Thanks

________________________________
发件人: zhouyuanqing8@outlook.com <zhouyuanqing8@outlook.com>
发送时间: 2020年5月20日 9:52
收件人: Brandon Wyman <bjwyman@gmail.com>; openbmc@lists.ozlabs.org <openbmc@lists.ozlabs.org>
主题: 回复: about i2cset tool

Hi Brandon,

   Sorry, I did not retain the output information of the i2cset command before, I copied the output information from the i2cget command.

   I tried the following command, the register still cannot be written, and there was no error message.This command is to turn on the LED light.

/usr/sbin# i2cset -f 9 0x10 0x82 0xffff w
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-9, chip address 0x10, data address
0x82, data 0x102, mode word.
Continue? [Y/n] Y

    i2cget command works just fine.
/usr/sbin# i2cget 9 0x10 0x02 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x02, 3 bytes using read I2C block data.
Continue? [Y/n] Y
3: 0x03 0x00 0x00

/usr/sbin# i2cget 9 0x10 0x02 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x02, 3 bytes using read I2C block data.
Continue? [Y/n] Y
3: 0x03 0xff 0x00

/usr/sbin# i2cget 9 0x10 0x02 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x02, 3 bytes using read I2C block data.
Continue? [Y/n] y
3: 0x03 0x00 0x00


________________________________
发件人: openbmc <openbmc-bounces+zhouyuanqing8=outlook.com@lists.ozlabs.org> 代表 Brandon Wyman <bjwyman@gmail.com>
发送时间: 2020年5月20日 3:24
收件人: openbmc@lists.ozlabs.org <openbmc@lists.ozlabs.org>
主题: Re: about i2cset tool



On 2020-05-19 02:40, zhouyuanqing8@outlook.com<mailto:zhouyuanqing8@outlook.com> wrote:
Hi All

    I use the i2cget to read the device data, but the i2cset did not write the data to the device, and the operation of i2cset did not report any errors.

for example:

:/usr/sbin# i2cget 9 0x10 0x00 i 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x00, 3 bytes using read I2C block data.
Continue? [Y/n]
3: 0x02 0x32 0xcc

:/usr/sbin# i2cset 9 0x10 0x82 0x0101 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-9, chip address 0x10, data address
0x00, using read word data.

Well, that is a bit odd. It looks like that just did a read, not a write.


Do you need to use the force access option? What is that 2? Should it be a word (w)?

https://linux.die.net/man/8/i2cset

i2cset -f 9 0x10 0x82 0x0101 w

when I check the 0x82 reg,the value is not changed.

Thanks
harley


[-- Attachment #2: Type: text/html, Size: 9907 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-20 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19  7:40 about i2cset tool zhouyuanqing8
2020-05-19 19:24 ` Brandon Wyman
2020-05-20  1:52   ` 回复: " zhouyuanqing8
2020-05-20 12:10     ` zhouyuanqing8

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.