aboutsummaryrefslogtreecommitdiff
path: root/hw/loongarch
diff options
context:
space:
mode:
authorXiaojuan Yang <yangxiaojuan@loongson.cn>2022-06-06 20:43:28 +0800
committerRichard Henderson <richard.henderson@linaro.org>2022-06-06 18:14:13 +0000
commitc117f68a46f4b3fa363635fd610873707d4899fa (patch)
tree2bd5aecf7e84358b05b4290ca19b85284d42ed0e /hw/loongarch
parentdc93b8df8a166d2df0c007affd49bcfd93e77391 (diff)
downloadqemu-c117f68a46f4b3fa363635fd610873707d4899fa.zip
qemu-c117f68a46f4b3fa363635fd610873707d4899fa.tar.gz
qemu-c117f68a46f4b3fa363635fd610873707d4899fa.tar.bz2
hw/loongarch: Add LoongArch ls7a rtc device support
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220606124333.2060567-39-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/loongarch')
-rw-r--r--hw/loongarch/Kconfig1
-rw-r--r--hw/loongarch/loongson3.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig
index 8552ff4..35b6680 100644
--- a/hw/loongarch/Kconfig
+++ b/hw/loongarch/Kconfig
@@ -13,3 +13,4 @@ config LOONGARCH_VIRT
select LOONGARCH_PCH_PIC
select LOONGARCH_PCH_MSI
select LOONGARCH_EXTIOI
+ select LS7A_RTC
diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c
index 7bc1711..95984c9 100644
--- a/hw/loongarch/loongson3.c
+++ b/hw/loongarch/loongson3.c
@@ -97,6 +97,9 @@ static void loongarch_devices_init(DeviceState *pch_pic)
* Create some unimplemented devices to emulate this.
*/
create_unimplemented_device("pci-dma-cfg", 0x1001041c, 0x4);
+ sysbus_create_simple("ls7a_rtc", LS7A_RTC_REG_BASE,
+ qdev_get_gpio_in(pch_pic,
+ LS7A_RTC_IRQ - PCH_PIC_IRQ_OFFSET));
}
static void loongarch_irq_init(LoongArchMachineState *lams)