From: Bin Meng <bin.meng@processmission.com>
To: QEMU <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org
Subject: [PATCH v2 19/32] hw/arm: phytium: Connect the Phytium E2000 I2C controller
Date: Tue, 8 Sep 2026 18:41:28 +0800 [thread overview]
Message-ID: <20260908104159.1621764-20-bin.meng@processmission.com> (raw)
In-Reply-To: <20260908104159.1621764-1-bin.meng@processmission.com>
Instantiate the DesignWare-compatible I2C controller during E2000 SoC
realization and wire its documented interrupt.
Leave board-specific I2C slave devices unmodeled.
Signed-off-by: Bin Meng <bin.meng@processmission.com>
---
Changes in v2:
- Move the I2C controller into the E2000 SoC
include/hw/arm/phytium_e2000.h | 1 +
hw/arm/phytium_e2000.c | 18 ++++++++++++++++++
hw/arm/Kconfig | 1 +
3 files changed, 20 insertions(+)
diff --git a/include/hw/arm/phytium_e2000.h b/include/hw/arm/phytium_e2000.h
index 15aa1cddd1..228d1ecab0 100644
--- a/include/hw/arm/phytium_e2000.h
+++ b/include/hw/arm/phytium_e2000.h
@@ -40,6 +40,7 @@ enum {
PHYTIUM_E2000_UART3,
PHYTIUM_E2000_UART4,
PHYTIUM_E2000_UART5,
+ PHYTIUM_E2000_I2C,
PHYTIUM_E2000_UART6,
PHYTIUM_E2000_CLK_CTRL,
PHYTIUM_E2000_SYSTEM_CTRL,
diff --git a/hw/arm/phytium_e2000.c b/hw/arm/phytium_e2000.c
index e3fea5ada1..c282de7088 100644
--- a/hw/arm/phytium_e2000.c
+++ b/hw/arm/phytium_e2000.c
@@ -21,6 +21,7 @@
#include "hw/core/qdev-properties.h"
#include "hw/intc/arm_gicv3_common.h"
#include "hw/intc/arm_gicv3_its_common.h"
+#include "hw/i2c/designware_i2c.h"
#include "hw/misc/phytium_e2000_ddr.h"
#include "hw/misc/phytium_e2000_mhu.h"
#include "hw/misc/phytium_e2000_pbr.h"
@@ -67,6 +68,7 @@ const MemMapEntry phytium_e2000_memmap[] = {
[PHYTIUM_E2000_UART3] = { 0x2800f000, 0x00001000 },
[PHYTIUM_E2000_UART4] = { 0x28014000, 0x00001000 },
[PHYTIUM_E2000_UART5] = { 0x2802a000, 0x00001000 },
+ [PHYTIUM_E2000_I2C] = { 0x28030000, 0x00001000 },
[PHYTIUM_E2000_UART6] = { 0x28032000, 0x00001000 },
[PHYTIUM_E2000_CLK_CTRL] = { 0x28100000, 0x00001000 },
[PHYTIUM_E2000_SYSTEM_CTRL] = { 0x30000000, 0x00001000 },
@@ -108,6 +110,8 @@ static const int phytium_e2000_uart_irqmap[] = {
[6] = 107,
};
+static const int phytium_e2000_i2c_irq = 106;
+
static const uint8_t phytium_e2000_gem_num_queues[] = { 8, 4, 4, 4 };
static const int
@@ -341,6 +345,19 @@ static void phytium_e2000_create_unimplemented_region(
phytium_e2000_memmap[map_idx].base, -1000);
}
+static void phytium_e2000_create_i2c(PhytiumE2000SoCState *s)
+{
+ DeviceState *dev = qdev_new(TYPE_DESIGNWARE_I2C);
+ SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
+
+ object_property_add_child(OBJECT(s), "i2c", OBJECT(dev));
+ sysbus_realize_and_unref(sbd, &error_fatal);
+ sysbus_mmio_map_overlap(sbd, 0,
+ phytium_e2000_memmap[PHYTIUM_E2000_I2C].base, 1);
+ sysbus_connect_irq(sbd, 0,
+ qdev_get_gpio_in(s->gic, phytium_e2000_i2c_irq));
+}
+
static void phytium_e2000_create_gem(PhytiumE2000SoCState *s, int index)
{
DeviceState *dev = qdev_new(TYPE_CADENCE_GEM);
@@ -774,6 +791,7 @@ static void phytium_e2000_soc_realize(DeviceState *dev, Error **errp)
for (i = 0; i < PHYTIUM_E2000_NUM_UARTS; i++) {
phytium_e2000_create_uart(s, i);
}
+ phytium_e2000_create_i2c(s);
for (i = 0; i < PHYTIUM_E2000_NUM_GEMS; i++) {
phytium_e2000_create_gem(s, i);
}
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e4111eaec2..a77a4c2a09 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -133,6 +133,7 @@ config PHYTIUM_E2000
imply PCI_DEVICES
select ARM_GIC
select CADENCE
+ select DESIGNWARE_I2C
select DW_MCI
select PCI_EXPRESS
select PCI_EXPRESS_GENERIC_BRIDGE
--
2.53.0
next prev parent reply other threads:[~2026-09-08 10:47 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 10:41 [PATCH v2 00/32] hw/arm: Add Phytium E2000Q SoC and board support Bin Meng
2026-09-08 10:41 ` [PATCH v2 01/32] hw/arm: Add Phytium E2000 SoC and Phytium Pi machine Bin Meng
2026-09-08 10:41 ` [PATCH v2 02/32] hw/arm: phytium: Add Phytium E2000 PCIe host Bin Meng
2026-09-08 10:41 ` [PATCH v2 03/32] hw/sd: Add Synopsys DesignWare MCI controller Bin Meng
2026-09-08 10:41 ` [PATCH v2 04/32] hw/sd: Add Phytium E2000 " Bin Meng
2026-09-08 10:41 ` [PATCH v2 05/32] hw/arm: phytium: Connect Phytium E2000 MCI controllers Bin Meng
2026-09-08 10:41 ` [PATCH v2 06/32] tests/qtest: Add Synopsys DesignWare MCI coverage Bin Meng
2026-09-08 10:41 ` [PATCH v2 07/32] hw/arm: phytium: Connect Phytium E2000 GEM controllers Bin Meng
2026-09-08 10:41 ` [PATCH v2 08/32] hw/misc: Add Phytium E2000 DDR controller Bin Meng
2026-09-08 10:41 ` [PATCH v2 09/32] hw/arm: phytium: Connect the " Bin Meng
2026-09-08 10:41 ` [PATCH v2 10/32] hw/misc: Add Phytium E2000 MHU doorbell Bin Meng
2026-09-08 10:41 ` [PATCH v2 11/32] hw/arm: phytium: Connect the Phytium E2000 MHU Bin Meng
2026-09-08 10:41 ` [PATCH v2 12/32] hw/ssi: Add Phytium E2000 QSPI controller Bin Meng
2026-09-08 10:41 ` [PATCH v2 13/32] hw/arm: phytium: Connect the " Bin Meng
2026-09-08 10:41 ` [PATCH v2 14/32] hw/misc: Add Phytium E2000 PBR model Bin Meng
2026-09-08 10:41 ` [PATCH v2 15/32] hw/arm: phytium: Integrate the Phytium E2000 PBR Bin Meng
2026-09-08 10:41 ` [PATCH v2 16/32] hw/arm: phytium: Add Phytium E2000 control region placeholders Bin Meng
2026-09-08 10:41 ` [PATCH v2 17/32] hw/misc: Support Phytium E2000 SCMI CPU power control Bin Meng
2026-09-08 10:41 ` [PATCH v2 18/32] hw/arm: phytium: Select the Phytium E2000 PBR boot medium Bin Meng
2026-09-08 10:41 ` Bin Meng [this message]
2026-09-08 10:41 ` [PATCH v2 20/32] hw/arm: phytium: Add Phytium E2000 xHCI controllers Bin Meng
2026-09-08 10:41 ` [PATCH v2 21/32] hw/misc: Model the Phytium E2000 random generator Bin Meng
2026-09-08 10:41 ` [PATCH v2 22/32] hw/arm: phytium: Connect " Bin Meng
2026-09-08 10:41 ` [PATCH v2 23/32] hw/arm: phytium: Support Phytium E2000 direct Linux boot Bin Meng
2026-09-08 10:41 ` [PATCH v2 24/32] hw/arm: phytium: Add Phytium E2000Q COMe machine Bin Meng
2026-09-08 10:41 ` [PATCH v2 25/32] hw/block: m25p80: Add GigaDevice GD25Q128 flash Bin Meng
2026-09-08 10:41 ` [PATCH v2 26/32] hw/arm: phytium: Connect the Phytium E2000Q COMe QSPI flash Bin Meng
2026-09-08 10:41 ` [PATCH v2 27/32] hw/arm: phytium: Add Phytium E2000 AHCI controllers Bin Meng
2026-09-08 10:41 ` [PATCH v2 28/32] hw/arm: Add Phytium E2000 Linux SCMI channel Bin Meng
2026-09-08 10:41 ` [PATCH v2 29/32] hw/arm: phytium: Connect the Phytium E2000 SMMUv3 Bin Meng
2026-09-08 10:41 ` [PATCH v2 30/32] docs/system/arm: Document Phytium E2000 machines Bin Meng
2026-09-08 10:41 ` [PATCH v2 31/32] tests/functional/aarch64: Add Phytium Pi boot tests Bin Meng
2026-09-08 10:41 ` [PATCH v2 32/32] MAINTAINERS: Add Phytium E2000Q machines Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260908104159.1621764-20-bin.meng@processmission.com \
--to=bin.meng@processmission.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.