From nobody Sat Oct 24 00:34:49 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=1790897676; cv=none; d=zohomail.com; s=zohoarc; b=BVnUo+hvOd56C59ccnhr+jtIEJJSlHi9YqmvzC/K7FNiPiSuvbYxWsLr8BKlWQYz6uTTqksjFQ77b/dvp+QY4S3I26TI0ar/N1i0EZKShSXeTqliogdqABWRWCRU6+0/G9eo+jt0bn8DpiKrHCME2LxRvJhkKOsSlFDmiqR6oQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790897676; 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=MkDl3c8LPPz050XyetI38d0jsLwvUZeyJQEy7v99li8JneZ2xN56TJ2BwOGCPZOsXTPhu+3k7sFBWp9McOc8crWZQwIacdniOd1hcz77zaJEuopSCc0OV6GGCjXvts3GQCwJrc78MxxEX8TrAJDa0jqku6/PP7VOfu1sfi76CAU= 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 1790897676042973.6313080344636; Thu, 1 Oct 2026 16:34:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCQHX-0003RW-F4; Thu, 01 Oct 2026 19:33:43 -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 1xCQHV-0003R3-SO for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:41 -0400 Received: from mail-pj2-x0e.google.com ([2607:f8b0:4864:39::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xCQHU-0002Br-1L for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:41 -0400 Received: by mail-pj2-x0e.google.com with SMTP id d9443c01a7336-2df8a4eac2aso3917365ad.1 for ; Thu, 01 Oct 2026 16:33:39 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e49f6aea97sm1851855ad.45.2026.10.01.16.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 16:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1790897619; x=1791502419; 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=Z7pEwQEazHCZt731UdF5UUYNVqUIqsO7mZn/o21BXoeqflngdEyK98FKb+WCtC4+iL LtR89gC/57rKIV2NO15RJx7w0FHBpw4IsvVxfmifaKcuQqBpDj4RzQ8M+5ttefJovWjf seWgGXJHox6e4VR5lIyWG6Yn/ptQMgzK1pwG25SszUQT7STWt3kF+v3YJly/U/Utselt FAOMYnvSv2oaVTNbNzfxdx82CqteCCFs9wrifwpMmRIRHSLTF589rj1spJt2lZ5rDNF1 ivy3e4+0XvDZkqvZBIBZUUISlTPPNYcY1BtDvWgjoVOAZEyBBHMUY0SCN1YPZ1U8C1q9 4ffw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790897619; x=1791502419; 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=vup9zhPxx9O2pAJUnV5jUx5iOCQA9hpA15g7zHZRldvL/0SruomcMZ4gnIxI8PgOAg cIszSat3uDV+58/VzUkUzppz+XbzoGHnocH3iKA74iyHdIVi6L9+DoZeUGsF1T4Enyl5 fo1KOtKcFw3FSy6UbEkd/q1FU0y8BcAZaAkmQz9T+9iO+GlpZ6OumzVoC8tgtCHBxY0u aGhtzb2OcjFszqItoDT5VDtMKz4LCxaBsBoXxdC4unGtrXShY9y29A5f85yfT6YKPIiT BgfK8in+fJ4NRE/jOir0QEAT3jkqi3fxrP80l/sk7c/J/sB0vPQ0ox7cCfH6mrOMkhtz U6sQ== X-Gm-Message-State: AFq9FYKS7a8O7PCyeqZsrHUmUnbSzdtKZwvLJvW1uxZ5pRaBqgQ8l+sm v9nil5AdF3QFCWTB0kgBtA0lJHLKhUTPU4tZjgONvkwwIVrp0sRVSXHz0sT+FemVA00SuRyF4m4 BF+UJm7Y= X-Gm-Gg: AYBFou0+zz43frT8GhZEdMAvFipH9vDhegoJAIdkIG+EzFSz3DBqRRvGpXF4mLhezGo Ki3ReyKMxvGhhecM7vruU53w9IM4o/qrFtmBpNn4PxOfOq7xysJWa9Yf79kg9dwPaBsRiCC7BB3 BlCYuZC/B1+YWBGUoJ2nMKwJORzw7mwzFDdVenzZJ5pqwDplL14vAC4KzZmKNxrKg2IbewTTz2p qy6EsLBv/NPI+RXA1tG5BOnrN4fYdjA+hoHjEPIBykmu9bZd4DhBzGcykmeUEEHjEZlpoE4tnQe aclZeYaHAn8IHC+i0vz0wBZrZIJ7Hp2IuEhjHPEc8V4mN9ekHGyGtugpznmInLwVLiHyXxPdML+ Xd7ldCAuXVrJczSQfykIHb31R+Y1rolIB6Z3HyxE2MLizR801nM/A11F5ZgtjAUWXyuG4TQLsXc E7saiyU9+S7dml2j430lYqt9YkfXGqWr1TKwtVgPDp89WD1ZrzMQIXIC6cFYszUr65oTiYn4mDB gQdc1kc+Xs/LTqt+RgUbhELIc78vQglNwQSgSnGNT8dkNXU X-Received: by 2002:a17:902:f709:b0:2dd:b95a:e1db with SMTP id d9443c01a7336-2e49b61ecddmr13008465ad.3.1790897618529; Thu, 01 Oct 2026 16:33:38 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Anirudh Srinivasan , Daniel Henrique Barboza , Weiwei Li , Palmer Dabbelt , Nicholas Piggin , Alistair Francis , Michael Ellerman , Portia Stephens , Chao Liu , qemu-riscv@nongnu.org, Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Liu Zhiwei , Joel Stanley Subject: [PATCH v3 1/4] hw/riscv/atlantis: Use dw8250 UART model Date: Fri, 2 Oct 2026 09:33:21 +1000 Message-ID: <20261001233324.2636629-2-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261001233324.2636629-1-portias@oss.tenstorrent.com> References: <20261001233324.2636629-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:39::e; envelope-from=portias@tenstorrent.com; helo=mail-pj2-x0e.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: 1790897678610158500 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 Sat Oct 24 00:34:49 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=1790897689; cv=none; d=zohomail.com; s=zohoarc; b=l914NdHAGmJBsSa4C/MCvulakxEjhhc2yXFRYKJXzQppAnYjJ2/QfbupJVNfBwdgRsjuURqyyx9KoINsyG2joZaYcRzfe5tzzGkwSMyG8F6yUcjwS4XdEr0kirSILo4u7wkrVLxFl6sGRwpj1qEIxNIehjmX5lVvu/enckiEIaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790897689; 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=IetKryFUORcBJg/H10qABabXkGxY8h+PiZulcPbrm28=; b=A/Sd8r0Mn/5tW+2IAOvqzqkW6nAHiFxkN5EcAi2OXWqrG9H470XBY1Z/PJWu6P6WOnsCcxQgAz2LPStbB+s+VMKInvxg0t7sfMKzJaubG3/q5VInGdOVEabBw6UPlXql4Le8t8lS0B/SK+E6OSfZhbCzakMghyvYRFpeB+hROb4= 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 179089768975413.061830670519157; Thu, 1 Oct 2026 16:34:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCQHc-0003Sc-UJ; Thu, 01 Oct 2026 19:33:48 -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 1xCQHb-0003SI-8b for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:47 -0400 Received: from mail-pj2-x21.google.com ([2607:f8b0:4864:39::21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xCQHZ-0002CD-Ba for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:47 -0400 Received: by mail-pj2-x21.google.com with SMTP id d9443c01a7336-2dfae9a76c7so5188085ad.3 for ; Thu, 01 Oct 2026 16:33:44 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e49f6aea97sm1851855ad.45.2026.10.01.16.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 16:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1790897624; x=1791502424; 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=IetKryFUORcBJg/H10qABabXkGxY8h+PiZulcPbrm28=; b=hDSWHA5FH18AjULJ6yL047jdZ908QlXzyuQ3iU10XHaJdbhKiv9d1Tz7giNnsn8GPX SE2399ffOz4GajwBYGHU6WKqv+Kfv4tIdlhbKj75wZGdOoFhf/cEYzCO7yO/v1XR8xcK PndHSzKo+tem5+BjRTZZ7hve95g1GJjd0VeIrv5BsWxjnqwWHul284j+LxRP7uLdtxXI CDm+eit4YLPhikiq6NhQ6hd4CjQ3fFCx30w8UjAuJQa+NTtDpHx9iLAHwtOjFyLrjjZZ 3EB2FIcI0Qe2q+g6kg1utBomaKyh6l1fyouykQDmFNNnUaL0Gukje99FHzcn+V9J2vCd mF7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790897624; x=1791502424; 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=IetKryFUORcBJg/H10qABabXkGxY8h+PiZulcPbrm28=; b=wFAJZregPXRp+y1EFb9jhewCSLiViiL9uPXc/kOWMYL8Lix5ECNbruMAPuQwruVY/T 4IA1n9Fva1Ja+klx/mjXZhMTsfYabnB8cNgfe24Fes/M7loRrFsb83Tp3M7iNSI7NLhh JWOGFy1jYpHKCwFFcKqZbNlZrLUdmK7jDYut1inFyE9fhXUG0inGgxxBpwABqjdkAVDO 4Asb2Kvzk7oH6X9/TwswcNVST7YJAqW7mNqlEdQtaThPOpCjlfIJFywneU2t1/11peF+ wSkFG7QH5lqOBbUbOIDEnNhPfDa8IHt4pAhUxQyYfjxaTWdxtsiYk/ixpfiqLRLM4j1p mrFA== X-Gm-Message-State: AFq9FYKnfG3eiPtxI/VgIQf5gVySWoX3hM5g1y36Nq1rqe6p2lrJjRa6 FtaiBi+JxpH9xuhDauCZSDX23bj1nA9ZIoXyYsb4uACQ28zJKxHQSgLbY3mW2FyeIErtXoXH5Ti talCI8YQ= X-Gm-Gg: AYBFou0idEM4DlR9JdBJuLSmnmxRZVxr09owifgcZqF0dk6GGxq/tbfo99+35yrMCjm 2nVtf78y+YJSeogt8YYATi6/cp/nhKEq3ljLTS+R1RxIGkzn2r+8fDm0IMOVGaW+j2zp6oWZd6R Fm2vD5qKgwPTgWGTbtVyZ9u6QknANSXZi85vRpm/GVA08fOoVVrt5LyfXCSnOGJQShvXVpM3Gy4 RDGrFB1IXGPiTEmOdk9eg2GZfx/xvJBNnXHeshvKxRs1SOpihohPmtxh4v9jCvyQ8aR/Mp8S8/a 8r48g6bUxH1Pdbj78W+QB2MlvJXAO/HFH6SPOZbHt+wmtmkgdF0uDkuKA3O5y57ikAh8bR90eKI FzIDs/siRdKK13bc0teW/uk/1pVdfyABg6avHCCpph4ZvbofURJCe3b8mMSryVQEbx6m/rWRAOP wywFcdvgZGNET5j6bTZSybfcqSJwBfJp9o6cs9852Unact3H1KZcNCQpy7CnDx/x0rlvhhFwEnU 9eENfRMmyfDN+kg41cnBAT4kkKqB7RVkfawMLUiYEn78ws= X-Received: by 2002:a17:902:da8d:b0:2e2:d09f:d762 with SMTP id d9443c01a7336-2e49b692966mr13720945ad.3.1790897623930; Thu, 01 Oct 2026 16:33:43 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Anirudh Srinivasan , Daniel Henrique Barboza , Weiwei Li , Palmer Dabbelt , Nicholas Piggin , Alistair Francis , Michael Ellerman , Portia Stephens , Chao Liu , qemu-riscv@nongnu.org, Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Liu Zhiwei , Joel Stanley Subject: [PATCH v3 2/4] hw/riscv/atlantis: Add all UARTs for Atlantis SoC Date: Fri, 2 Oct 2026 09:33:22 +1000 Message-ID: <20261001233324.2636629-3-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261001233324.2636629-1-portias@oss.tenstorrent.com> References: <20261001233324.2636629-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:39::21; envelope-from=portias@tenstorrent.com; helo=mail-pj2-x21.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, 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: 1790897690565158500 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. The next change will handle adding the rest of the UARTs. 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 Sat Oct 24 00:34:49 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=1790897685; cv=none; d=zohomail.com; s=zohoarc; b=BOP2zK8KSZcFkj3pD2R/V7F1j4jbH0NaqkGwWbz85BJQUqMdIcesdcjhWi+qm6e3nW0ke59RlPIYEf8YQwkF1RU+pnv+SFDXkei49ThaJKvJMTCWWaWyYQaU+UUqh8sfgbhlc/AqLqd704XgWCSX2qfvpyWqgzl2aWTIXUBNayI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790897685; 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=z0CZJjgL7f++vEKCbjrGqpyRC/763kspkVSq1+XR7pY=; b=PT4K/gvlMEnl6fe4qEd+jvVcMyefnWOpNauSXGDlVVzlYBJ/2lkfbK06xycfVXPVb8VR9Z/1F0y8qxencyZdT2AMrZkmATGg4LyVUhtivTybrBZkwnUQL0ursHSol33yijPmiCu7nxX5y7uA9iQ8XdqzHYTB5OGmBaBgLJQFM54= 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 1790897684722846.3980354995265; Thu, 1 Oct 2026 16:34:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCQHj-0003UB-08; Thu, 01 Oct 2026 19:33:55 -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 1xCQHg-0003TN-SH for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:52 -0400 Received: from mail-pj2-x0f.google.com ([2607:f8b0:4864:39::f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xCQHe-0002CX-US for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:52 -0400 Received: by mail-pj2-x0f.google.com with SMTP id d9443c01a7336-2d6ff23d81eso5775945ad.2 for ; Thu, 01 Oct 2026 16:33:50 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e49f6aea97sm1851855ad.45.2026.10.01.16.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 16:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1790897629; x=1791502429; 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=z0CZJjgL7f++vEKCbjrGqpyRC/763kspkVSq1+XR7pY=; b=MrnCVv/1MdlJ2gjvqDJkV6pHcf9Y33MC+E3tQjqgsWqJAWjSin3yUQOojNKGXy23pi /LuxV07wbkdqRLtAT3KJmHG2qWQeDk0sYRfc3aD0wkPT2DtLTVFj9E0LSuZYB79Hy3Co mKRzJehRPOuoI6ZEw1VO41+e1loKxLPaDQvPZPJAIiR57ly3ZW/NQEOqyO/YHz1S8bGh N8UJQ7Z76LHa1VTdsJTtbFK2hJappsg9g+ISeAY1aZyPAPivWeOHVD6U9UjE0iw02/qj +DOH6BzMVkv7ZCa4eU4S5s/WFyi0v0t+qMczPDvQPkL//I9EOXoYgUKiuoy68vT9x+0q 3gwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790897629; x=1791502429; 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=z0CZJjgL7f++vEKCbjrGqpyRC/763kspkVSq1+XR7pY=; b=2sPorHF8u1kRtZ46PDfOBlGrYDR2S7ANjuzxn7TkDT1zLzX3/mRPMZctg/mnZsZI+C GTSLkx4TKCfjG9S77lblfb3q0gNa/qrG3j5jPaIFRjPGLlgSSvg3UyMdM4KCap6DhwGX bpH0xfZWj5zg4BYbzRWJx8jlnTxH+REEwns0iE9M52FIe3pTT0euZlAhBmTYdQgYEmFM jeyncX8JF0903DDCgVLqRFsxUeHmvkaRRqqHsI+KQ6Cvh+TtGCJcK4+rUuEu7Jc1y2J4 UUIwEXY4dXOw2ctGpWxjEB8h1FGGpihBf8mng9UQaCIQcohXzR4CIlIgc2z75r1xUmSq /07A== X-Gm-Message-State: AFq9FYK+CGLa+3nnjhdYjkkQVm6Zg/OkbwWvezMyIXIfP2/0MPHFeRCM a9wAQUqrz8EB2nUhLOKeSuvtZ1HoCKlFyqv/dU8wjNKJfX+/JhMXpgH2cJXin8sk32NmHicTeNj FlKT+Ips= X-Gm-Gg: AYBFou0ToAXcXikC/kZMUpWCnMEcZCIfViHhQE0kufnM9MOJaLLMS7WafqwFX2vDxd/ XIQ5byO6HeeHkG+DxQQDBFu/A6Pz0VEHHh0ZSNBa2vWRoIHxU24LjA8fSHtx74yoYte05m8HnwR 80CRc8ITIKg+oTRgepSvsKH7VmqN90rchhtXbq1e46RfmWynHLloMdvRQrXl69XrPqj1Y5Gt1HY /l7/JTMD+sR+Ao3WijQV95P1FG0XfXhxhztamcCLGdV0krVAz4wEbvFj225WX2I3Ah6xRy5trvJ T1+Nyb/GWeMV3heZKwN+90vdwYDGNP6/iVO3SVheFTLeGTjqoNHG+trXHwxjTssgFb6jWSotzCp i8rrbNH+LrD7Z5HG4/2an2R72yEz2mnMu5h1CseKvHdnHYspsDqMSAHdpJ1XQa3ThqoxQKxXKS2 HcQemfh+VMQ08cLTTNbstilm7AmnaeckaMU98y8ARsk8JlFS8GTA8wvqj3SPpYFsLG19uEkbfHN MUBFTsqoEu8gWbBAFzuXf4IT1vLNBz6MrtZc1A/E3z2qVUiezDbikhtgA== X-Received: by 2002:a17:902:da85:b0:2e2:dd98:59da with SMTP id d9443c01a7336-2e49b659ebfmr14081465ad.4.1790897629391; Thu, 01 Oct 2026 16:33:49 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Anirudh Srinivasan , Daniel Henrique Barboza , Weiwei Li , Palmer Dabbelt , Nicholas Piggin , Alistair Francis , Michael Ellerman , Portia Stephens , Chao Liu , qemu-riscv@nongnu.org, Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Liu Zhiwei , Joel Stanley Subject: [PATCH v3 3/4] hw/riscv/atlantis: Add machine property to select default uart Date: Fri, 2 Oct 2026 09:33:23 +1000 Message-ID: <20261001233324.2636629-4-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261001233324.2636629-1-portias@oss.tenstorrent.com> References: <20261001233324.2636629-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:39::f; envelope-from=portias@tenstorrent.com; helo=mail-pj2-x0f.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: 1790897686654158500 Content-Type: text/plain; charset="utf-8" The Atlantis SoC has 5 UARTs. This adds a machine property to set which uart is on the first serial interface. This is the same pattern that is used by aspeed. The rest of the uart's will be added in sequential order starting at serial interface 1. The default value is uart1 which means the Ascalon console will be on serial interface 0 by default. Signed-off-by: Portia Stephens Reviewed-by: Daniel Henrique Barboza --- hw/riscv/tt_atlantis.c | 77 ++++++++++++++++++++++++++++++---- include/hw/riscv/tt_atlantis.h | 1 + 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/hw/riscv/tt_atlantis.c b/hw/riscv/tt_atlantis.c index 2342edce93..7a5e1ddcd1 100644 --- a/hw/riscv/tt_atlantis.c +++ b/hw/riscv/tt_atlantis.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "qemu/guest-random.h" #include "qemu/units.h" +#include "qapi/visitor.h" =20 #include "hw/core/boards.h" #include "hw/core/loader.h" @@ -422,6 +423,26 @@ static void load_fdt(TTAtlantisState *ams) create_fdt_memory(ms->fdt, &ams->soc); } =20 +static inline int tt_atlantis_uart_index(int uart_dev) +{ + return uart_dev - TT_ATL_UART0; +} + +static void tt_atlantis_connect_serial_hds_to_uarts(TTAtlantisState *ams) +{ + TTAtlantisSoCState *s =3D &ams->soc; + int uart_index =3D tt_atlantis_uart_index(ams->uart_chosen); + + qdev_prop_set_chr(DEVICE(&s->uart[uart_index]), "chardev", serial_hd(0= )); + + for (int i =3D 1, uart =3D 0; i < TT_ATL_NUM_UARTS; uart++) { + if (uart =3D=3D uart_index) { + continue; + } + qdev_prop_set_chr(DEVICE(&s->uart[uart]), "chardev", serial_hd(i++= )); + } +} + static void tt_atlantis_machine_done(Notifier *n, void *data) { TTAtlantisState *ams =3D container_of(n, TTAtlantisState, machine_done= ); @@ -484,11 +505,6 @@ static void tt_atlantis_machine_done(Notifier *n, void= *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); @@ -592,10 +608,6 @@ 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->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)) { @@ -663,6 +675,10 @@ static void tt_atlantis_machine_init(MachineState *mac= hine) OBJECT(&ams->soc_memory), &error_abort); object_property_set_link(OBJECT(&ams->soc), "dram", OBJECT(machine->ra= m), &error_abort); + + /* Map serial interfaces to uart */ + tt_atlantis_connect_serial_hds_to_uarts(ams); + qdev_realize(DEVICE(&ams->soc), NULL, &error_fatal); =20 /* I2C peripherals: qemu specific */ @@ -680,6 +696,47 @@ static void tt_atlantis_machine_init(MachineState *mac= hine) qemu_add_machine_init_done_notifier(&ams->machine_done); } =20 +static void tt_atlantis_get_console(Object *obj, Visitor *v, const char *n= ame, + void *opaque, Error **errp) +{ + TTAtlantisState *ams =3D TT_ATLANTIS_MACHINE(obj); + uint32_t uart_index =3D tt_atlantis_uart_index(ams->uart_chosen); + + visit_type_uint32(v, name, &uart_index, errp); +} + +static void tt_atlantis_set_console(Object *obj, Visitor *v, const char *n= ame, + void *opaque, Error **errp) +{ + TTAtlantisState *ams =3D TT_ATLANTIS_MACHINE(obj); + uint32_t value; + + if (!visit_type_uint32(v, name, &value, errp)) { + return; + } + + if (value >=3D TT_ATL_NUM_UARTS) { + error_setg(errp, "\"console\" should be in range [%d - %d]", + 0, TT_ATL_NUM_UARTS - 1); + return; + } + ams->uart_chosen =3D value + TT_ATL_UART0; +} + +static void tt_atlantis_machine_class_props_init(ObjectClass *oc) +{ + ObjectProperty *console; + + console =3D object_class_property_add(oc, "console", "uint32_t", + tt_atlantis_get_console, + tt_atlantis_set_console, NULL, NUL= L); + object_class_property_set_description(oc, "console", + "Change the default UART index on -serial. Valid values are 0 = " \ + "through 4"); + /* Default to UART1, the Ascalon console */ + object_property_set_default_uint(console, 1); +} + static void tt_atlantis_machine_class_init(ObjectClass *oc, const void *da= ta) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -693,6 +750,8 @@ static void tt_atlantis_machine_class_init(ObjectClass = *oc, const void *data) mc->block_default_type =3D IF_VIRTIO; mc->no_cdrom =3D 1; mc->default_ram_id =3D "tt_atlantis.ram"; + + tt_atlantis_machine_class_props_init(oc); } =20 static const TypeInfo tt_atlantis_types[] =3D { diff --git a/include/hw/riscv/tt_atlantis.h b/include/hw/riscv/tt_atlantis.h index b81b7c8abd..7bd46e9c9b 100644 --- a/include/hw/riscv/tt_atlantis.h +++ b/include/hw/riscv/tt_atlantis.h @@ -56,6 +56,7 @@ struct TTAtlantisState { =20 MemoryRegion soc_memory; TTAtlantisSoCState soc; + uint32_t uart_chosen; }; =20 enum { --=20 2.43.0 From nobody Sat Oct 24 00:34:49 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=1790897685; cv=none; d=zohomail.com; s=zohoarc; b=hwJymC2CEO5gZAiykaPZUCsv8mfQi4V6o2g7TfaDxjdyT16ctU2xbOZs3raLTfkj9LX/Z1gO+WGS6lofkphslGbEmIN9Ge2pf5XMe5cBvuO2SC+nIDnBZutbQZhkzuukze4MNZYr8V1iG7TWEADxH/vhmsCMXB1MhQ6pyt67Qak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790897685; 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=ruvoRhnnsi30rjj0KB8ImDUhrr8e0NpGQKtL3X4JwoE=; b=hIx0KlRKBBo/QAkW1xKy+ISjcxiedw+PTKep9wVvx30eFDSiFCam7ZX8L5oSPdr72nT4t/7sDentp7h2PXf5/IyHSkc0Pf3Gdic+iLrJpfOBsrOkoxwEtrUd2R9avQbtTh4/OLuttMcZmLyTTQl81XNGRAP3jyN7d7uDsvMyB2U= 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 1790897684513469.9687994126484; Thu, 1 Oct 2026 16:34:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xCQHn-0003WC-SY; Thu, 01 Oct 2026 19:33:59 -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 1xCQHl-0003VA-Ol for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:57 -0400 Received: from mail-pj2-x11.google.com ([2607:f8b0:4864:39::11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xCQHk-0002DD-56 for qemu-devel@nongnu.org; Thu, 01 Oct 2026 19:33:57 -0400 Received: by mail-pj2-x11.google.com with SMTP id d9443c01a7336-2db425c8ff1so5334085ad.0 for ; Thu, 01 Oct 2026 16:33:55 -0700 (PDT) Received: from lima-default.tail89d63.ts.net ([159.196.41.205]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e49f6aea97sm1851855ad.45.2026.10.01.16.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 16:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1790897635; x=1791502435; 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=ruvoRhnnsi30rjj0KB8ImDUhrr8e0NpGQKtL3X4JwoE=; b=HbSIDwCA/uU7iRMLlJEBeRhav19zoppbxwxJUbQRjaxo9KbPb3rBMQGxYi0c/dXFUG l2sfqBX6AYBvYv9eIZloCdKLHddBfZ8BWRKaLZMs4nG0kalKR3J4HAAR7avSWH9P/Ccy 3X1XAvtQc8dVa/jtMwWNOI+LDaBI5P+eBGcIWlZDcbjX6lEYqcuC6ZaHBN3opNk97jx3 m5tIliVXYGy9GIuVWyk5w/y6Od0hPwbEYjaNPweMJH80CyoQwTfktchrX+AMi6CROYpG jdxOtUkZmKiCREwG5nY4d7jtQL31RCaiJ/ceIcnXJ3DQyCS8UpuaJWog87KycyLN8CBW 55Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790897635; x=1791502435; 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=ruvoRhnnsi30rjj0KB8ImDUhrr8e0NpGQKtL3X4JwoE=; b=FUjnEEyZd+5XK7X7YIS9JwHsl6KWObt04eoyoFtJU1ZXi+b2Cg/mQNhm2KeckFMoOy o/pZDN9CfnQ0VqEL82esAG2jAH+BhrknPLaziI+pchzv9UGdzE4yROXnUZ37S9aNwnuW dN4JjJESFkp9uYZM53EIEhjVyTxAc6GkQifdusuLgXKVsrVVJAIx4iVDCXlxy/IdAv8d FIT19Ma0iAZgQJP5gtylGWKRvKRBbjJyFc+xj9ZxgvLOuEnBH0kNSrtAIyVnEB9NGLBk VUKwrpA2EMxcSH1Nyk+lIkE3dQKw9KtCoBLYv4bogUF53N8oVPQwenGVp1r+vlt2TjS9 x0JA== X-Gm-Message-State: AFq9FYLIgrKT0smQEh1XQ+XFT2EK1HJyTmIT+04TnKliseyYiXKPTDvl ilHzOvzV/nqq6M7SIqkJNqTjgl44IfUeQmalIOgN/yU9YVTwtEBVtIX1llL5gjbIJU7RyngqMY4 sZXLpu3o= X-Gm-Gg: AYBFou0KKUiDsiD0gxNZ/PG1VTszrn2mpITDAwC2JfI5UywOLNZZuYFDbMxUlcAoK+0 mM+5dk9OWukaHaO22meOEk/bL8BbVG/OkufnvtfDd+cnA92Cy7V2mT7VdONlbNtSIQKK5rOt86f 1RvNMy96Xjcg1xxI457A3nX6QApabnacAryJE0LBKmJTgUJNHXAX/dwghw/Hnv1IyJ03iJHkxXQ UFVhe2ixuVdWctqOQgRYhee2ADNtdznJvGbBV3F/PDrzrCdhikK37RewmM9IuNKDd5Q1yc+D494 IvN4ws1BbtoQlvg42FPM7Cd/Mv3E5SPJnvl8OHZePVp4zNUgsFT5iu+lxdwgwY6sW2T7XOiJfBJ qtTUUbNWXgmI7/9+Ks74p5ZD2mDQeWQl6YjUB+JcjQUslO0pGp/xFGmNkp0j7jt5bPfdGkkvorQ CqQ12xTf2nR3UQU23FbeiWwW9p9LPdqp9ELMK/T3x24vq1cjIDd/dNuRe7lGPki9XB1a9w2eXUF E2hwy6mT5lm2LS9PpsPgOtsatQFBTqHgxtildaNG1fteX5/GZ2wAC5CPA== X-Received: by 2002:a17:902:e802:b0:2e2:dbfe:8623 with SMTP id d9443c01a7336-2e49a20e27fmr15178565ad.1.1790897634777; Thu, 01 Oct 2026 16:33:54 -0700 (PDT) From: Portia Stephens To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Anirudh Srinivasan , Daniel Henrique Barboza , Weiwei Li , Palmer Dabbelt , Nicholas Piggin , Alistair Francis , Michael Ellerman , Portia Stephens , Chao Liu , qemu-riscv@nongnu.org, Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Liu Zhiwei , Joel Stanley Subject: [PATCH v3 4/4] docs/atlantis: Update Atlantis UART documentation Date: Fri, 2 Oct 2026 09:33:24 +1000 Message-ID: <20261001233324.2636629-5-portias@oss.tenstorrent.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261001233324.2636629-1-portias@oss.tenstorrent.com> References: <20261001233324.2636629-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:39::11; envelope-from=portias@tenstorrent.com; helo=mail-pj2-x11.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: 1790897686669158500 Content-Type: text/plain; charset="utf-8" Add documentation describing how to use the console machine property to control the console. Signed-off-by: Portia Stephens Reviewed-by: Daniel Henrique Barboza --- docs/system/riscv/tt_atlantis.rst | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/system/riscv/tt_atlantis.rst b/docs/system/riscv/tt_atlan= tis.rst index 1f2880d617..0bfa82eb77 100644 --- a/docs/system/riscv/tt_atlantis.rst +++ b/docs/system/riscv/tt_atlantis.rst @@ -13,7 +13,21 @@ 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 + +Boot options +---------------- + + * ``console`` to change the UART which is on the first serial interface. + Most users will be interested in the Ascalon boot console ``UART1`` but + Ascalon has 5 UARTs and this may not always be the case. The RCPU conso= le + is on ``UART0``. + +To change the serial console and use device ``UART3`` + +.. code-block:: bash + + -M tt-atlantis,console=3D3 =20 Known limitations ----------------- @@ -24,9 +38,6 @@ 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. =20 Supported software ------------------ --=20 2.43.0