On 14/2/23 18:18, Cédric Le Goater wrote:
From: Klaus Jensen <k.jensen@samsung.com>
Add an example I2C device to demonstrate how a slave may master the bus
and send data asynchronously to another slave.
What a rebellion...
The device will echo whatever it is sent to the device identified by the
first byte received.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
[ clg: - Changed to build to use CONFIG_ASPEED_SOC since only supported
on such SoCs
- folded in these fixes :
https://lore.kernel.org/qemu-devel/Y3yMKAhOkYGtnkOp@cormorant.local/
]
Message-Id: <20220601210831.67259-7-its@irrelevant.dk>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/misc/i2c-echo.c | 156 ++++++++++++++++++++++++++++++++++++++++++++
hw/misc/meson.build | 2 +
2 files changed, 158 insertions(+)
create mode 100644 hw/misc/i2c-echo.c
diff --git a/hw/misc/meson.build b/hw/misc/meson.build
index 448e14b531..3eb1bda710 100644
--- a/hw/misc/meson.build
+++ b/hw/misc/meson.build
@@ -129,6 +129,8 @@ softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true:
files('nrf51_rng.c'))
softmmu_ss.add(when: 'CONFIG_GRLIB', if_true:
files('grlib_ahb_apb_pnp.c'))
+softmmu_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('i2c-echo.c'))
s/CONFIG_ASPEED_SOC/CONFIG_I2C/ since this is a generic device.