From nobody Mon Nov 23 04:52:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.tenstorrent.com ARC-Seal: i=1; a=rsa-sha256; t=1791948277; cv=none; d=zohomail.com; s=zohoarc; b=cthr2p1+ZGd4nS6FkWCaKh2Ido0Cm1/CJ9gXHHmfAvP3vFxdykfIPkthY/fDXO4RveRQaW3c5xoYhnUmv8iN27dwR0LF02hyYdEr4NgmDZn0eslEgEtKKe94tC3ci8oAhb65/Jus6dKy3uCRxjcYk/PGW9UIs8SWx1EfxTJ/7+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791948277; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Usb3J/CszNW/AvO0rKKglFAwXucL/cNKskKSFigipT4=; b=oA8+wkvK6w6SED3K1VjWhzKMY2+3d2bqBwKIaYVQGQ+9eZSa+AnJ2+Le8TMnFedB+AnVoHmF7h7dEmvBLK7KGke3AZ1X6mKpqLo/8vHml45xHV5OB8ppgQteAmo9Ko0e79/y5sZ1RYocPmkYsdSKHJBhXOw55tVvBLNwkxCj6Sk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791948277585255.39281111564128; Tue, 13 Oct 2026 20:24:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xGpbD-0001W1-UV; Tue, 13 Oct 2026 23:24:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xGpb1-0001S3-KB for qemu-devel@nongnu.org; Tue, 13 Oct 2026 23:24:03 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xGpaz-0000BV-Mt for qemu-devel@nongnu.org; Tue, 13 Oct 2026 23:24:03 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-3a47d4fb7feso224078a91.0 for ; Tue, 13 Oct 2026 20:24:01 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ac6069ca15sm2211261a91.11.2026.10.13.20.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2026 20:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1791948240; x=1792553040; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Usb3J/CszNW/AvO0rKKglFAwXucL/cNKskKSFigipT4=; b=CXPBY1AjHTS16Ue6K9KoS3mLL3TRq5QHEwW15e6wL/50kO4pMNO590o5lgAmh+cYNF tmdD4cUlN8GovFkmFhaCqXMU9a4b58bRcOecuvp6EatsjE1VQ40C2kqhpJ/AHpMQrdCV HE8p5e6lRTXyK1GNHgdCjhzoBz6UbWzsQnwgM6K4IiduUFpnh2G0JDrqdHBA0Yf+2noD zc8QpnjIfM1SdnKhm2j0QTr6c+rSyuB4WjMFVnTvwSfzZE3R70FixMAt6ROhyl+XH39u ueqQu8hLK5C/VVuY1xCNjMplt4D9gB6puc5bqQY+10ZCLX7LqH6Z7IxfmKP7xwkh4YRf iWuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791948240; x=1792553040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Usb3J/CszNW/AvO0rKKglFAwXucL/cNKskKSFigipT4=; b=VVAM5Pi7rhf+EWS9ghFTjIMo/U80OYPlP6IUcN8DQ6EGigUbmkjUIJmqBbv77epIAG E3flf0F8mVG7OfE3b3jiql3AO/9g/G4rXqUl+7uKIYqz/Ty5haFasPqEzF+MeEdkJFKr cvL0vVZaJRe/X09etE/m/U4P9PZr170bIO4aG+iQ/sgRv1H/x4JgMZrTR48wr54DZ9rD 85v0KROphvciFHYhTpe1UFYAMnftf1MwlxtBVtTZ7Lk7LVVqMhKL+8R6aaaRQbOtQjX1 LRXznVq2lxesAfVjJTlvMPvgnJfJTcYqCAh2oPmv18a71egyrVvxtLXTVZrq8395VOmB jx9w== X-Gm-Message-State: AFq9FYK0/1nDdvVWCp9iFrvXatYLOy9/VLnQebBCq7ZDhxK7ihT+1g3A m/IUeVz33QoucAC8p3a4d6UKvyyT1Cm9eR9hp9Yq2ZU+qf21e+14ysYaUzCbR+mLFdxo/TNQrv8 RXnrBQFM= X-Gm-Gg: AYBFou0ry32OgxEfluqEbclSTzCwnVzDSZWhm3lg2FfNczAFE/NOZQPF3Kr2OLqeCeL C4jUae3niiCWHq2WQLBtSBKP7edVTd32rIaWe49AAUupc+omnf+Cd+mUko2j3C0wrHqkHr2p2Ky as140NfPf7/jFuZV+1DsRQIwAJh3aHr3fYyDSB7xpCHuO4TcSeOaxE0EIb7KgrzSowdN/NVAeD8 JWn7V7Z+CjjvOsc7lEiS6HTaay/YA3fKNPuL0WBsXskBHmqv6OOBwwxV/QHoRRRXeOx/rkpuDhx 9y3kyJ04h9FdeujY3DTj53vPPSsn5I/uuAb+Y/S2ZGOQnN7xWH2zr31nkuaQJEqaBGhgAA1g7sU g52bZbq8bAfRw4uaYvrLQjf+l8IW+KcO9kH6bHeSrLTghw8pP19fP9yMGduitJYYlywBMh6w1MU wmHA81ZJIyulUAt1AkN8AIMk9jHgPasLf1vwvpNXShLlCeKqWMnPod1eir90NexIufeFeILq5m0 jUoIVglYO4cZpbWPhh9e0grswRSze3cqM6j/WDes3cMFDY= X-Received: by 2002:a17:90b:224e:b0:3a8:9db2:a59 with SMTP id 98e67ed59e1d1-3ab3a0f0a2amr20618986a91.0.1791948240483; Tue, 13 Oct 2026 20:24:00 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Chao Liu , Anirudh Srinivasan , Weiwei Li , Alistair Francis , qemu-riscv@nongnu.org, Nicholas Piggin , Joel Stanley , Portia Stephens , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Liu Zhiwei , Palmer Dabbelt , Michael Ellerman , Daniel Henrique Barboza , Pierrick Bouvier Subject: [PATCH v4 1/3] hw/riscv/atlantis: Use dw8250 UART model Date: Wed, 14 Oct 2026 13:23:44 +1000 Message-ID: <20261014032346.732257-2-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261014032346.732257-1-portias@oss.tenstorrent.com> References: <20261014032346.732257-1-portias@oss.tenstorrent.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=portias@tenstorrent.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tenstorrent.com) X-ZM-MESSAGEID: 1791948278485158500 Content-Type: text/plain; charset="utf-8" Replace the ns16550 UART with a Designware UART now that a model is available. The hack which sets the rest of the UART register space as unimplemented can be removed. Signed-off-by: Portia Stephens Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- hw/riscv/Kconfig | 2 +- hw/riscv/tt_atlantis.c | 45 +++++++++++----------------------- include/hw/riscv/tt_atlantis.h | 4 +-- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig index d06ac26648..5d2abdbb67 100644 --- a/hw/riscv/Kconfig +++ b/hw/riscv/Kconfig @@ -127,7 +127,7 @@ config TENSTORRENT select RISCV_ACLINT select RISCV_APLIC select RISCV_IMSIC - select SERIAL_MM + select DW8250 select DEVICE_TREE select DESIGNWARE_I2C select DS1338 diff --git a/hw/riscv/tt_atlantis.c b/hw/riscv/tt_atlantis.c index 8a219afef7..70815e12ef 100644 --- a/hw/riscv/tt_atlantis.c +++ b/hw/riscv/tt_atlantis.c @@ -24,9 +24,8 @@ #include "hw/riscv/fdt-common.h" #include "hw/riscv/riscv_hart.h" =20 -#include "hw/char/serial-mm.h" +#include "hw/char/dw8250.h" #include "hw/intc/riscv_aclint.h" -#include "hw/misc/unimp.h" =20 #include "system/system.h" #include "system/device_tree.h" @@ -262,11 +261,15 @@ static void create_fdt_cpu(void *fdt, TTAtlantisSoCSt= ate *s, static void create_fdt_uart(void *fdt, const MemMapEntry *mem, int irq, int irqchip_phandle) { + static const char * const compat[2] =3D { + "snps,dw-apb-uart", "ns16550a" + }; g_autofree char *name =3D g_strdup_printf("/soc/serial@%"HWADDR_PRIX, mem->base); =20 qemu_fdt_add_subnode(fdt, name); - qemu_fdt_setprop_string(fdt, name, "compatible", "ns16550a"); + qemu_fdt_setprop_string_array(fdt, name, "compatible", + (char **)&compat, ARRAY_SIZE(compat)); qemu_fdt_setprop_sized_cells(fdt, name, "reg", 2, mem->base, 2, mem->s= ize); qemu_fdt_setprop_cell(fdt, name, "reg-shift", 2); qemu_fdt_setprop_cell(fdt, name, "reg-io-width", 4); @@ -409,17 +412,6 @@ static void load_fdt(TTAtlantisState *ams) create_fdt_memory(ms->fdt, &ams->soc); } =20 -static void mmio_map_unimplemented(MemoryRegion *memory, SysBusDevice *dev, - const char *name, hwaddr addr, uint64_t= size) -{ - qdev_prop_set_string(DEVICE(dev), "name", name); - qdev_prop_set_uint64(DEVICE(dev), "size", size); - sysbus_realize(dev, &error_abort); - - memory_region_add_subregion_overlap(memory, addr, - sysbus_mmio_get_region(dev, 0), -1= 000); -} - static void tt_atlantis_machine_done(Notifier *n, void *data) { TTAtlantisState *ams =3D container_of(n, TTAtlantisState, machine_done= ); @@ -488,8 +480,7 @@ static void tt_atlantis_soc_init(Object *obj) =20 object_initialize_child(obj, "cpus", &s->cpus, TYPE_RISCV_HART_ARRAY); =20 - object_initialize_child(obj, "uart1", &s->uart1, - TYPE_UNIMPLEMENTED_DEVICE); + object_initialize_child(obj, "uart1", &s->uart1, TYPE_DW8250); =20 for (int i =3D 0; i < TT_ATL_NUM_I2C; i++) { object_initialize_child(obj, "i2c[*]", &s->i2c[i], @@ -584,21 +575,13 @@ static void tt_atlantis_soc_realize(DeviceState *dev,= Error **errp) &s->bootrom); =20 /* UART1, the soc console (UART0 is for the boot microcontroller) */ - serial_mm_init(s->memory, s->memmap[TT_ATL_UART1].base, 2, - qdev_get_gpio_in(s->irqchip, TT_ATL_UART1_IRQ), - 115200, serial_hd(0), DEVICE_LITTLE_ENDIAN); - /* - * Atlantis contains a DesignWare uart while the QEMU machine - * uses the serial_mm model with the base ns16550 register set. - * Linux's dw driver writes outside of serial_mm's 0x20 sized - * mapping and faults. - * - * Create an unimplemented device region so writes don't fault - * and reads return zero, which keeps Linux happy. - */ - mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->uart1), - "tt-atlantis.uart1", s->memmap[TT_ATL_UART1].ba= se, - s->memmap[TT_ATL_UART1].size); + qdev_prop_set_chr(DEVICE(&s->uart1), "chardev", serial_hd(0)); + sysbus_realize(SYS_BUS_DEVICE(&s->uart1), &error_fatal); + memory_region_add_subregion(s->memory, + s->memmap[TT_ATL_UART1].base, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->= uart1), 0)); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart1), 0, + qdev_get_gpio_in(s->irqchip, TT_ATL_UART1_IRQ)); =20 /* I2C */ for (int i =3D 0; i < TT_ATL_NUM_I2C; i++) { diff --git a/include/hw/riscv/tt_atlantis.h b/include/hw/riscv/tt_atlantis.h index 3923308b7c..000988c037 100644 --- a/include/hw/riscv/tt_atlantis.h +++ b/include/hw/riscv/tt_atlantis.h @@ -13,7 +13,7 @@ #include "hw/core/sysbus.h" #include "hw/i2c/designware_i2c.h" #include "hw/intc/riscv_imsic.h" -#include "hw/misc/unimp.h" +#include "hw/char/dw8250.h" #include "hw/riscv/riscv_hart.h" =20 #define TYPE_TT_ATLANTIS_MACHINE MACHINE_TYPE_NAME("tt-atlantis") @@ -39,7 +39,7 @@ struct TTAtlantisSoCState { RISCVHartArrayState cpus; DeviceState *irqchip; DesignWareI2CState i2c[TT_ATL_NUM_I2C]; - UnimplementedDeviceState uart1; + DW8250State uart1; MemoryRegion bootrom; =20 uint32_t num_harts; --=20 2.43.0 From nobody Mon Nov 23 04:52:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.tenstorrent.com ARC-Seal: i=1; a=rsa-sha256; t=1791948268; cv=none; d=zohomail.com; s=zohoarc; b=Tc74TS25D+osv5XSVZBhZfssCm3v6H5xUTlrwRN7vWQg7GzEMX/sRAUGUrodr/p2DoczVnrgRngNpMye5eWkAhPnp+xVfBpEDd+ZA0tvGfCFaNL8+ksJxqZadLcDto/u2MG5diIx5orRaP3IMeh6ZrtAypz2XI4GfetCgte2WUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791948268; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=K01QCnnb27X3LHcQOnx4YnlR9MTY0rWVtmtVD4RUyZM=; b=krhaeKG2eba1bJ/ld+XRY7VEWrd6D5pgE7DUyf/4iBtczG+FjOxBFAhXOAeomP8BX5wVoUhqCWyslwVaUhq6KSii+IlOi0LK3hXi7ztVkPrMou4j269Zt2JVKZ4Ll5p2lUO+n2MSYm5r6FRNn/L37inIb4Ljv6M3YBHKQCKyuLs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791948268746895.3530162308955; Tue, 13 Oct 2026 20:24:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xGpbF-0001Xh-IX; Tue, 13 Oct 2026 23:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xGpb7-0001UE-A4 for qemu-devel@nongnu.org; Tue, 13 Oct 2026 23:24:09 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xGpb5-0000C6-Ia for qemu-devel@nongnu.org; Tue, 13 Oct 2026 23:24:09 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-cd1006978ecso203124a12.0 for ; Tue, 13 Oct 2026 20:24:07 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ac6069ca15sm2211261a91.11.2026.10.13.20.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2026 20:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1791948246; x=1792553046; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=K01QCnnb27X3LHcQOnx4YnlR9MTY0rWVtmtVD4RUyZM=; b=GL5z2Bv3KPTnbTsfWGPN4VnWm8MWZm9wqjEN5ah5OWJfc3Qx+knsL9ThyioWhoB4Yg LJ0DoIaNk1Chz6tmXSfuM2ZDYtsTrrvQ2jwBHnKa5FTQx0QPid9cmJdXv8rIW/ZjAgWd H/1PaU7REZ1a2V2z9kYhHv3Y7VUf71l8Zo1DACFvupnWa+ExsyviDbPckyqRc115hXK3 VDY1XUbilGDVAK2aZ79A87pIfoxr13PSBOnl5be9t5R4Jo3b/ZIHt/1c2loHHCHMrTUV 46FfaCCJE/5WXOjKXf5XNfAJUFinMra1RbxIvy8/ZQ3M58pBJiwMMz1mTc+atyQZmqZj 1wYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791948246; x=1792553046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=K01QCnnb27X3LHcQOnx4YnlR9MTY0rWVtmtVD4RUyZM=; b=ARfV2VQATt4sTsd29pg7VayryGZd2TVZ1sVZupKOkeHpOofWChlLj5hRqyzZSoNrQq cW05/eUiSwY1xxkuzyR8WXZSLREDMid9t0Fbq70aqZiNODGK3i8vvZHxFCIeSEdQZx7R jWmwSdz+f0b6t55Vueym2cSnXcuC0DTUPhon9tFFlU5UF69pmTTD9aHL22peWRkPijGN 71/+m7lvfvMVM/Q/0bu0Wh5LW7NSporEU3z0WhcL0lbeO6IzJshocjtX7as77/goImRF aNdXsVSHTcBWLHdoUhE+0bAgCgtttPMigvP6ib3pVLp7to42Plg+QPhtk0USTD5MuW5u xMvg== X-Gm-Message-State: AFq9FYI/+uI2wAI/oThT46w0/URgXUxR9F8j6myrucpeK8pYPP3YWiYi FzAb34/aHKpjUaPCoX0rtJ7c17DsmRgRxS9pvzfeKPCoKWrrNKY6yrpYoSjIWFPjdZ2eNjiHFJ5 DSuf3 X-Gm-Gg: AYBFou3lGH8Iu/AJCI65cq68j6LBzktQwa5bI/QnTcHTTkMzOgHfoN1RpgARel1x7Oj Mldz+vNRCzazA/OM8uy+bLbiVVZ1amiaxWA04ScFyZGs1jl6wUYZe6sAvwsY4icUxh++kyUEhDv CzwYJrsbEnhNB+D7P4jvgpZXDyA7Uu38xYoaR4slv3dVED9WWJFkKnEJME5OMWssm571si50AOy 9VUTYuoclm06MtE7bv/mLRkQ6Br7CN8ez9VE09QjdKpbdhbgBKoSUm3MCqE0kFXRUiM5MWeZJXP pMFqt+LX81NCbXV4VY0jKEbK3asz/i6VxITiIK6YKrF64KUDSxWU1yiPKN+NOxozuidjDA/2pB1 xOgbGvF42sxw5JxLHX/oiVihrbqY6OxZq+WZ+ZgMpmDYZYCPbRaSeTPugvdI3iJrXc2WWZvsmTI 3MUuIB6PRcISwLFezacw0schzLqlVMw3Gxzm0FNvt7llQQuWm4WOJtiBxqmPkwnqAt9SPDrcm0Z bqX7OTuBmU6x5xUL56AIde7LIbM5LHcPlbArYLDMQe9b44= X-Received: by 2002:a17:90b:224c:b0:3a6:f1d2:57fa with SMTP id 98e67ed59e1d1-3ab3a9d3e21mr23214663a91.4.1791948246050; Tue, 13 Oct 2026 20:24:06 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Chao Liu , Anirudh Srinivasan , Weiwei Li , Alistair Francis , qemu-riscv@nongnu.org, Nicholas Piggin , Joel Stanley , Portia Stephens , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Liu Zhiwei , Palmer Dabbelt , Michael Ellerman , Daniel Henrique Barboza , Pierrick Bouvier Subject: [PATCH v4 2/3] hw/riscv/atlantis: Add all UARTs for Atlantis SoC Date: Wed, 14 Oct 2026 13:23:45 +1000 Message-ID: <20261014032346.732257-3-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261014032346.732257-1-portias@oss.tenstorrent.com> References: <20261014032346.732257-1-portias@oss.tenstorrent.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=portias@tenstorrent.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tenstorrent.com) X-ZM-MESSAGEID: 1791948270214158500 Content-Type: text/plain; charset="utf-8" Previously only the Ascalon console UART was enabled, this enables all 5 UARTs on the SoC. Only UART1 is added to the serial interface for now. Signed-off-by: Portia Stephens Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- hw/riscv/tt_atlantis.c | 54 +++++++++++++++++++++++++--------- include/hw/riscv/tt_atlantis.h | 11 ++++++- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/hw/riscv/tt_atlantis.c b/hw/riscv/tt_atlantis.c index 70815e12ef..2342edce93 100644 --- a/hw/riscv/tt_atlantis.c +++ b/hw/riscv/tt_atlantis.c @@ -62,7 +62,11 @@ static const MemMapEntry tt_atlantis_memmap[] =3D { [TT_ATL_I2C2] =3D { 0xd4060000, 0x10000 }, [TT_ATL_I2C3] =3D { 0xd4070000, 0x10000 }, [TT_ATL_I2C4] =3D { 0xd4080000, 0x10000 }, + [TT_ATL_UART0] =3D { 0xd4100000, 0x10000 }, [TT_ATL_UART1] =3D { 0xd4110000, 0x10000 }, + [TT_ATL_UART2] =3D { 0xd4120000, 0x10000 }, + [TT_ATL_UART3] =3D { 0xd4130000, 0x10000 }, + [TT_ATL_UART4] =3D { 0xd4140000, 0x10000 }, [TT_ATL_SAPLIC] =3D { 0xe8000000, 0x4000000 }, [TT_ATL_DDR_HI] =3D { 0x100000000, 0x1000000000 }, }; @@ -259,13 +263,14 @@ static void create_fdt_cpu(void *fdt, TTAtlantisSoCSt= ate *s, } =20 static void create_fdt_uart(void *fdt, const MemMapEntry *mem, int irq, - int irqchip_phandle) + int irqchip_phandle, int index) { static const char * const compat[2] =3D { "snps,dw-apb-uart", "ns16550a" }; g_autofree char *name =3D g_strdup_printf("/soc/serial@%"HWADDR_PRIX, mem->base); + g_autofree char *alias =3D g_strdup_printf("serial%d", index); =20 qemu_fdt_add_subnode(fdt, name); qemu_fdt_setprop_string_array(fdt, name, "compatible", @@ -277,8 +282,10 @@ static void create_fdt_uart(void *fdt, const MemMapEnt= ry *mem, int irq, qemu_fdt_setprop_cell(fdt, name, "interrupt-parent", irqchip_phandle); qemu_fdt_setprop_cells(fdt, name, "interrupts", irq, 0x4); =20 - qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", name); - qemu_fdt_setprop_string(fdt, "/aliases", "serial0", name); + if (index =3D=3D 0) { + qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", name); + } + qemu_fdt_setprop_string(fdt, "/aliases", alias, name); } =20 static void create_fdt_rng(void *fdt) @@ -347,8 +354,11 @@ static void finalize_fdt(void *fdt, TTAtlantisSoCState= *s) * aplic_s_phandle); */ =20 - create_fdt_uart(fdt, &s->memmap[TT_ATL_UART1], TT_ATL_UART1_IRQ, - aplic_s_phandle); + /* Skip UART0 since it is the RCPU console, UART1 is the Ascalon conso= le */ + for (int i =3D 0; i < TT_ATL_NUM_UARTS - 1; i++) { + create_fdt_uart(fdt, &s->memmap[TT_ATL_UART1 + i], TT_ATL_UART1_IR= Q + i, + aplic_s_phandle, i); + } =20 create_fdt_clk(fdt, "periph-clk", 100000000, periph_clk_phandle); =20 @@ -474,13 +484,21 @@ static void tt_atlantis_machine_done(Notifier *n, voi= d *data) fdt_load_addr); } =20 +static inline int tt_atlantis_uart_index(int uart_dev) +{ + return uart_dev - TT_ATL_UART0; +} + static void tt_atlantis_soc_init(Object *obj) { TTAtlantisSoCState *s =3D TT_ATLANTIS_SOC(obj); =20 object_initialize_child(obj, "cpus", &s->cpus, TYPE_RISCV_HART_ARRAY); =20 - object_initialize_child(obj, "uart1", &s->uart1, TYPE_DW8250); + for (int i =3D 0; i < TT_ATL_NUM_UARTS; i++) { + object_initialize_child(obj, "uart[*]", &s->uart[i], + TYPE_DW8250); + } =20 for (int i =3D 0; i < TT_ATL_NUM_I2C; i++) { object_initialize_child(obj, "i2c[*]", &s->i2c[i], @@ -574,14 +592,22 @@ static void tt_atlantis_soc_realize(DeviceState *dev,= Error **errp) memory_region_add_subregion(s->memory, s->memmap[TT_ATL_BOOTROM].base, &s->bootrom); =20 - /* UART1, the soc console (UART0 is for the boot microcontroller) */ - qdev_prop_set_chr(DEVICE(&s->uart1), "chardev", serial_hd(0)); - sysbus_realize(SYS_BUS_DEVICE(&s->uart1), &error_fatal); - memory_region_add_subregion(s->memory, - s->memmap[TT_ATL_UART1].base, - sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->= uart1), 0)); - sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart1), 0, - qdev_get_gpio_in(s->irqchip, TT_ATL_UART1_IRQ)); + /* UART1, the soc console (UART0 is for the boot microcontroller */ + qdev_prop_set_chr(DEVICE(&s->uart[tt_atlantis_uart_index(TT_ATL_UART1)= ]), + "chardev", serial_hd(0)); + + for (int i =3D 0; i < TT_ATL_NUM_UARTS; i++) { + SysBusDevice *sbd =3D SYS_BUS_DEVICE(&s->uart[i]); + if (!sysbus_realize(sbd, errp)) { + return; + } + + memory_region_add_subregion(s->memory, + s->memmap[TT_ATL_UART0 + i].base, + sysbus_mmio_get_region(sbd, 0)); + sysbus_connect_irq(sbd, 0, + qdev_get_gpio_in(s->irqchip, TT_ATL_UART0_IRQ += i)); + } =20 /* I2C */ for (int i =3D 0; i < TT_ATL_NUM_I2C; i++) { diff --git a/include/hw/riscv/tt_atlantis.h b/include/hw/riscv/tt_atlantis.h index 000988c037..b81b7c8abd 100644 --- a/include/hw/riscv/tt_atlantis.h +++ b/include/hw/riscv/tt_atlantis.h @@ -23,6 +23,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(TTAtlantisState, TT_ATLANTIS_M= ACHINE) OBJECT_DECLARE_SIMPLE_TYPE(TTAtlantisSoCState, TT_ATLANTIS_SOC) =20 #define TT_ATL_NUM_I2C 5 +#define TT_ATL_NUM_UARTS 5 =20 struct TTAtlantisSoCState { /*< private >*/ @@ -39,7 +40,7 @@ struct TTAtlantisSoCState { RISCVHartArrayState cpus; DeviceState *irqchip; DesignWareI2CState i2c[TT_ATL_NUM_I2C]; - DW8250State uart1; + DW8250State uart[TT_ATL_NUM_UARTS]; MemoryRegion bootrom; =20 uint32_t num_harts; @@ -63,7 +64,11 @@ enum { TT_ATL_I2C2_IRQ =3D 35, TT_ATL_I2C3_IRQ =3D 36, TT_ATL_I2C4_IRQ =3D 37, + TT_ATL_UART0_IRQ =3D 38, TT_ATL_UART1_IRQ =3D 39, + TT_ATL_UART2_IRQ =3D 40, + TT_ATL_UART3_IRQ =3D 41, + TT_ATL_UART4_IRQ =3D 42, }; =20 enum { @@ -80,7 +85,11 @@ enum { TT_ATL_MIMSIC, TT_ATL_SAPLIC, TT_ATL_SIMSIC, + TT_ATL_UART0, TT_ATL_UART1, + TT_ATL_UART2, + TT_ATL_UART3, + TT_ATL_UART4, }; =20 #endif --=20 2.43.0 From nobody Mon Nov 23 04:52:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oss.tenstorrent.com ARC-Seal: i=1; a=rsa-sha256; t=1791948272; cv=none; d=zohomail.com; s=zohoarc; b=OYPXqQznnQKRWkIflPV2arhkyNPe4HA22TP+iuUTg7Yak4OoL7tBz0I0lbecVuod4+yzsef0LRcLgDrPZLO4TqGH9qi7ZfLWwwr0ek47oLwFv6SHPuzq2Kjw6oikQGEY7rtN3al0JoBlyA5NYoZMvn3Uqssz2INJWCyQUb8ieUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791948272; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5Yrq0zmhnCQ6jmfiCd+0Py/eNG5Woc0hw6n8wML7KAM=; b=TGSoQDHz+kWrfYmg0kgDS+DMQOszHFKJH+htR7Lz7gxuWKqLVO6OWlE2LdN+pa/JrAetaW9teKwlEQoS7mo2ZZnl0c1Td5qpQ0JXi/6/00S1qCm4+JPs5UFk8q8KZom7JjK5zVYCt/l3Po161Lo239l8rlbr5RCI0s0/Gh4aN5A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179194827232539.33791240354401; Tue, 13 Oct 2026 20:24:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xGpbK-0001dB-FA; Tue, 13 Oct 2026 23:24:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xGpbE-0001XX-Vr for qemu-devel@nongnu.org; Tue, 13 Oct 2026 23:24:17 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xGpbB-0000CV-Le for qemu-devel@nongnu.org; Tue, 13 Oct 2026 23:24:16 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-3a81e149649so259800a91.2 for ; Tue, 13 Oct 2026 20:24:12 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ac6069ca15sm2211261a91.11.2026.10.13.20.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2026 20:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1791948251; x=1792553051; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=5Yrq0zmhnCQ6jmfiCd+0Py/eNG5Woc0hw6n8wML7KAM=; b=QsctJxzm9L6M0oLnJQWuQOLwBUvuP/UhWk9QkFstG4EHPNSMYfTvR3BmZfen185aGl BbICq3bQ0mNEwmQozimiFqTDTOurqkA08koXEt5hNvXM6W9gDgjQQZBGbctoXJm5uMKe gKUnPJ5WuQKpMfJFHMAHLrLpFaFI82cy8qj+9pYhqAdLoxi08KFMI0Yd5hlC8gdZIzrZ 3EBOpHONYzV6ljquRFca85gqPgPmfYYVB6zGf8CiYEEfiXUK4C1DfzHojycfeBBX2Jir wc+8KzlLLrm5BjGbD9MlPOEMxWytpmtXUuq+FHzIHIeZyF2gtsUHvTt+xCwQDx7vSYrr 7yoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791948251; x=1792553051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=5Yrq0zmhnCQ6jmfiCd+0Py/eNG5Woc0hw6n8wML7KAM=; b=io+Sh5pR4agvpaIfgf/0DvSlslC2IpPMHk/ubeEaJL4I2cgali5YpsV3vYSqRY8hYd F9ljvUrhzqZv0ynAu5jGYoRJ7URd8hHuqxVi49wnn8X1Rk6UqmE+A178qK2rszeYOOlY s2KR4jxjmhEsRHt5zHdEie/quBiCWGOS9oVr1BzSXMRqV+/2e6zX5FXDUGodMjr0VNfl 5XCxhxgdiV/JI8g7Q1P+MBMTq/08iJz7YrwnZwUy+yhEmaM+f0Qio0CWs94ggOVjURiC zkNw5UV0egygOgJG0y0uiYyjAiBnkhpOq5MzEEgIyIlBnr0sTBVNDmav6WngG3WI+sAP kJNA== X-Gm-Message-State: AFq9FYK+tMr7Em/yknsNZrAgo7ZsnNRLBuUptW6yIL3AUTrvrLXpo6Z4 nRiIFIzxhKTcxmmrXXravJVa8t4kCwj2RTsgpveXdTRXbj9xeUADelYFz18+USSho1JHgPbD5qo BnXOsA90= X-Gm-Gg: AYBFou1xu3OQiEmYt1UTwQRbajfHqX6WL9xIk4jwLUTo7hf+TgUQv6P6csvzdJk6pM5 tA6HndulqTd00iJr3Dd1X3KlIQ9wrnuaiqK0CQpjPjphAl/+oEU6YfnPCTh25cOzh9gmT5hTe+T yoUfwexnbHEfe07L7jxob0ZjhSzFqWIhVaAbBCvEiV/PKvtZMkm6qzczXeXRpJMjbkSoLDwPEOy d6uvCFZJp4k/oiaKvv1EqsbNaZOe7LYdh+x84U1U2KTV+myAnsSiVxqGskC0I5vjM1XoRSimxGG FsMmYbsJ43JR+5S4SJmyOqlu5/1IfRvHbjEWWruzhHcBaePMX5080exDj7Li8jJTeeudTjhmyGq eYfzccyy83MGmbfNjBBxIYLxaP89oUg6G+SVkpTlztk3769vmXazwTR8gUI5ebjBsMf5MJg2QZl /iOaibvvUEIK9Ym/h0F8pRTIV5NWfYAsdaswNFxpRsdW6QngyrCNhWEeXdNdqyQzvoO7xGEJ3IH B1cuYnbhtwRx0A83v5DFgtiAYdmoQh3m8jm7LaGI7PNFhU= X-Received: by 2002:a17:90b:3145:b0:3a6:f7be:fee6 with SMTP id 98e67ed59e1d1-3ab3a346e9dmr19919437a91.1.1791948251551; Tue, 13 Oct 2026 20:24:11 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Chao Liu , Anirudh Srinivasan , Weiwei Li , Alistair Francis , qemu-riscv@nongnu.org, Nicholas Piggin , Joel Stanley , Portia Stephens , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Liu Zhiwei , Palmer Dabbelt , Michael Ellerman , Daniel Henrique Barboza , Pierrick Bouvier Subject: [PATCH v4 3/3] docs/atlantis: Update Atlantis UART documentation Date: Wed, 14 Oct 2026 13:23:46 +1000 Message-ID: <20261014032346.732257-4-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261014032346.732257-1-portias@oss.tenstorrent.com> References: <20261014032346.732257-1-portias@oss.tenstorrent.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=portias@tenstorrent.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tenstorrent.com) X-ZM-MESSAGEID: 1791948274351158501 Content-Type: text/plain; charset="utf-8" Update Atlantis documentation to describe the DesignWare UART used. Signed-off-by: Portia Stephens Reviewed-by: Alistair Francis --- docs/system/riscv/tt_atlantis.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/system/riscv/tt_atlantis.rst b/docs/system/riscv/tt_atlan= tis.rst index 1f2880d617..0150140a39 100644 --- a/docs/system/riscv/tt_atlantis.rst +++ b/docs/system/riscv/tt_atlantis.rst @@ -13,7 +13,7 @@ tt-atlantis QEMU model features =20 * 8-core Ascalon-X CPU Cluster * RISC-V compliant Advanced Interrupt Architecture -* 16550A compatible UART +* DW8250 compatible UART x5 =20 Known limitations ----------------- @@ -24,9 +24,8 @@ real platform. Notably: * There is no PCI host bridge, so virtio-pci devices cannot be attached. Boots that need block storage must use ``-initrd`` with an initramfs. -* The DesignWare UART is modelled with QEMU's ns16550-compatible - ``serial_mm`` device; DesignWare-specific registers beyond that - set return 0. +* The Atlantis platform has 5 UARTs but only ``UART1`` is currently exposed + on the command line serial interface. ``UART1`` is the Ascalon console. =20 Supported software ------------------ --=20 2.43.0