[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trying to get qom-{get,set} working with gpio on qemu-x86_64
From: |
Ben Dooks |
Subject: |
trying to get qom-{get,set} working with gpio on qemu-x86_64 |
Date: |
Thu, 24 Feb 2022 10:52:49 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 |
I have been trying to get qom-get/qom-set scripts working to make an
virtual GPIO device on qemu-system-x86_64. I have a working TMP105
and I can see the MAX7310 being instantiated with the relevant Linux
devices showing up (i2c, gpio).
I can read the sensor from QEmu console:
(qemu) qom-get /machine/peripheral/sensor temperature
20000
(qemu) qom-set /machine/peripheral/sensor temperature 19000
(qemu) qom-get /machine/peripheral/sensor temperature
19000
When trying to get or set anything from the GPIO chip it doesn't
seem to be working. How do I get this working, I haven't found
any useful reference online and need some help:
(qemu) qom-set /machine/peripheral/gpio unnamed-gpio-out[0] 0
Error: Device '0' not found
(qemu) qom-set /machine/peripheral/gpio unnamed-gpio-in[0] 0
Error: Insufficient permission to perform this operation
I am also having issues with both sensor and the gpio via the
qom-set, as so:
$ sudo ./scripts/qmp/qom-set --socket ~/qmp.sock
/machine/peripheral/sensor.temperature 20200
ExecuteError: Invalid parameter type for 'temperature', expected: integer
Task was destroyed but it is pending!
Is this also a known issue?
QEmu is git checkout from 31e3caf21b6cdf54d11f3744b8b341f07a30b5d7 as
needed to enable the relevant QEmu configs so built from source. The
command line additions are:
-device max7310,id=gpio,address=0x20
-device tmp105,id=sensor,address=0x50
-qmp unix:$HOME/qmp.sock,server,nowait
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
- trying to get qom-{get,set} working with gpio on qemu-x86_64,
Ben Dooks <=