Add custom recovery method using ACPI.
Add gpio bus recovery support.
Hi shaowangming, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @成坚 (CHENG Jian) , @jiaoff , @zhengzengkai , @刘勇强 , @wangxiongfeng , @朱科潜 , @WangShaoBo , @lujialin , @wuxu_buque , @Xu Kuohai , @冷嘲啊 , @Lingmingqiang , @yuzenghui , @juntian , @OSSIM , @陈结松 , @whoisxxx , @koulihong , @刘恺 , @hanjun-guo , @woqidaideshi , @Chiqijun , @Kefeng , @ThunderTown , @AlexGuo , @kylin-mayukun , @Zheng Zucheng , @柳歆 , @Jackie Liu , @zhujianwei001 , @郑振鹏 , @SuperSix173 , @colyli , @Zhang Yi , @htforge , @Qiuuuuu , @Yuehaibing , @xiehaocheng , @guzitao , @CTC-Xibo.Wang , @zhanghongchen , @chen wei , @Jason Zeng , @Xie XiuQi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
验证通过日志:
root@fpga:/# ls
bin i2c_test lib64 ptt_test sbin tmp var
dev init linuxrc root sys usb_test
etc lib proc run sysroot usr
root@fpga:/# cd i2c
root@fpga:/# cd i2c_test/
root@fpga:/i2c_test# ls
i2c-hisi.ko i2cdetect i2ctransfer libi2c.so.0 lsgpio
root@fpga:/i2c_test# ls
i2c-hisi.ko i2cdetect i2ctransfer libi2c.so.0 lsgpio
root@fpga:/i2c_test# insmod i2c-hisi.ko
[ 97.670800] hisi-i2c HISI03D1:00: speed mode is Standard Mode (100 kHz). hw version 0x30
root@fpga:/i2c_test# lsmod
i2c_hisi 16384 0 - Live 0xffff800008e80000
root@fpga:/i2c_test# ls
i2c-hisi.ko i2cdetect i2ctransfer libi2c.so.0 lsgpio
root@fpga:/i2c_test# cp i2cdetect ?l-l
i2c-0i2c HiSilicon I2C Controller HISI03D1:00I2C adapter
root@fpga:/i2c_test# ./i2cdetect ?l-l
./i2cdetect: error while loading shared libraries: libi2c.so.0: cannot open shared object file: No such file or directory
root@fpga:/i2c_test#
root@fpga:/i2c_test# ./i2cdetect -l
root@fpga:/i2c_test# i2cdetect -l
i2c-0i2c HiSilicon I2C Controller HISI03D1:00I2C adapter
root@fpga:/i2c_test#
root@fpga:/i2c_test# i2cdetect -ly -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@fpga:/i2c_test# i2ctransfer -y 0 w3@0x50 0x0 0x0 0x11
root@fpga:/i2c_test# i2ctransfer -y 0 w2@0x50 0x0 0x0 r1
0x11
root@fpga:/i2c_test# c
root@fpga:/i2c_test#
root@fpga:/i2c_test#
root@fpga:/i2c_test# ^C
root@fpga:/i2c_test# ^C
root@fpga:/i2c_test# ^C
root@fpga:/i2c_test# ^C
root@fpga:/i2c_test# QEMU 6.0.91 monitor - type 'help' for more information
(qemu) ttrtratractracetrace-trace-etrace-evtrace-evetrace-eventrace-eventtrace-event trace-event ptrace-event pltrace-event pl0trace-event pl06trace-event pl061trace-event pl061_trace-event pl061_wtrace-event pl061_wrtrace-event pl061_writrace-event pl061_writtrace-event pl061_writetrace-event pl061_write trace-event pl061_write otrace-event pl061_write on
(qemu)
(qemu)
(qemu)
(qemu)
^C
root@fpga:/i2c_test#
root@fpga:/i2c_test#
root@fpga:/i2c_test# lsmod
i2c_hisi 16384 0 - Live 0xffff800008e80000
root@fpga:/i2c_test# rm i2
root@fpga:/i2c_test# rm i2c_Z
root@fpga:/i2c_test# rm i2crmoodmod i
root@fpga:/i2c_test# rmmod i2c_hisi
root@fpga:/i2c_test# ls
i2c-hisi.ko i2cdetect i2ctransfer libi2c.so.0 lsgpio
root@fpga:/i2c_test# insmod i2
root@fpga:/i2c_test# insmod i2c-hi
root@fpga:/i2c_test# insmod i2c-hisi.ko
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x400 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x400 value 0x80
[ 455.203183] hisi-i2c HISI03D1:00: speed mode is Standard Mode (100 kHz). hw version 0x30
root@fpga:/i2c_test# devmem 0x09021060 32 0x1
root@fpga:/i2c_test# i2ctransfer -y 0 w3@0x50 0x0 0x0 0x11
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
[ 541.955906] hisi-i2c HISI03D1:00: bus transfer timeout
i2ctransfer: I2C_RDWR: Input/output error
root@fpga:/i2c_test# i2ctransfer -y 0 w2@0x50 0x0 0x0 r1
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
pl061_write /machine/unattached/device[15] offset 0x200 value 0x80
pl061_write /machine/unattached/device[15] offset 0x200 value 0x0
[ 567.395891] hisi-i2c HISI03D1:00: bus transfer timeout
i2ctransfer: I2C_RDWR: Input/output error
root@fpga:/i2c_test# lsgpio
sh: lsgpio: not found
root@fpga:/i2c_test# ./lspio
sh: ./lspio: not found
root@fpga:/i2c_test#
root@fpga:/i2c_test# ./lspiogpiopio
GPIO chip: gpiochip0, "ARMH0061:00", 8 GPIO lines
line 0: unnamed unused [input]
line 1: unnamed unused [input]
line 2: unnamed unused [input]
line 3: unnamed "ACPI:Event" [used, input]
line 4: unnamed unused [input]
line 5: unnamed unused [input]
line 6: unnamed "sda" [used, input, pull-up]
line 7: unnamed "scl" [used, output, active-low, pull-up]
root@fpga:/i2c_test# QEMU: Terminated
[root@localhost vm]#
登录 后才可以发表评论