From patchwork Fri Aug 5 15:54:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12937510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80C8BC00140 for ; Fri, 5 Aug 2022 16:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6yl4tQKItSkb/EsauVkoyOasLZeyvzhSsRkfivUBDCs=; b=mY3XQvwz4Ux0qd zFbMZTWNWDRsMmN5saThyUK5i/HCO8u6KQFJzOUneT09xTXkNOgQg+NyZ1UdAFjSG+SnyjEVzCZAH Butwlg3K3KqpUuDqg5uDRdPOP2nwkCW1nMP3IT3e7alrxjltlqLUmPqkGZbC0WgbIZQ3/jNXlBKsW Y/Me1uf0aHbr7HUui5aWxykUAKY1lvE95hcOnhdogmnFC+muWP8FZ/04IlUo6SNWAairiE6kADekG KxkHe2dgP6hWSQIcI0i5UBYPFavks3gUg6C6otVRdWqcuZDnQstUD2dq2gowT48rUkIgT3vqaXOHm 12jbCgfk6oi17YAPLmEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzkk-00GXLX-MW; Fri, 05 Aug 2022 16:00:47 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzeV-00GTaY-Mh for linux-riscv@lists.infradead.org; Fri, 05 Aug 2022 15:54:21 +0000 Received: by mail-wr1-x42d.google.com with SMTP id p10so3691138wru.8 for ; Fri, 05 Aug 2022 08:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=k/xzRy6n6kryMDsLlFXQYpE8ENmkU+xTgBLizNQ4axM=; b=VCbM1SuFksRv50tsWgQAocIb7lLKRe0Rj05acF8vAjax+hZAQAC0dCxxbSbo4/6sUv yC4oOt5UVo6+aJfUxNf3FCHmCQ+Q5OhB9kD8AidTvpVLbInR1vDplRStniKhs8BviImS V+bNyZw02DfIDSAIPRC4/D8PN/GPZtl5acTv2Mwj1xul8/yJpG386+zQAUryEyGT3eFv P4su4iW4iyaXbhMY7iDADPBN51dTgzTHuqFCLBvWuHarR9fuMGv/ZWcSUGJx7L4fHkA9 RsdAS11TIVgqBEwM+uQL26fSu22xkR12FZanVZPrqiXmg7JnYKTrYd5AVjR9yvd2Ksqs N4Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=k/xzRy6n6kryMDsLlFXQYpE8ENmkU+xTgBLizNQ4axM=; b=Su2z9PLWsY7MOcudTGGpLUTgo9BImh4EArBcTjwqFif6af136ZrgAATWb/EW+Ht0ys tQepXqj1n4AAn1XM23arD4KkEWja+fth28KrPxLbZdEjZ0HCzuElo+fzDe0FSX6oXqkB QOnRuWHLuzjGaoYM4ZxGMuoDQb29rU9353HC3IxWm+Ko4XFVg/xToNa7tnxJnUwEn+7p wnIg1skeSmzN50ekqcNMRQbbVn8Rvuryy8DAKxeve3cNbo0KGBTu2m82JfZm0OQvZ4hL jdTOjurAvwVAmEjesPg81hPVIcWVZgo11q1Ow51elL38AGQOe5vawH7ViQrHt93JySoR iIOg== X-Gm-Message-State: ACgBeo3VDRzBahFtyFcOd3+4AgPqs/UDuR5IpfWOUavKNyjbtsfFdWwQ dnDNn7Kcc9uZBvxxxdOuYnHQew== X-Google-Smtp-Source: AA6agR5mcr2sQ/sALCUIzgWdKT5088DtbcOo38FdmnmtJqGqH8Fzuys8fOyttlA0Op+TFIdqvZxLOg== X-Received: by 2002:a05:6000:693:b0:221:7a12:8d6a with SMTP id bo19-20020a056000069300b002217a128d6amr1570978wrb.290.1659714858342; Fri, 05 Aug 2022 08:54:18 -0700 (PDT) Received: from henark71.. ([93.107.66.220]) by smtp.gmail.com with ESMTPSA id t10-20020a5d49ca000000b0021d6dad334bsm4133543wrs.4.2022.08.05.08.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 08:54:17 -0700 (PDT) From: Conor Dooley To: Palmer Dabbelt , Alistair Francis , Bin Meng Cc: Rob Herring , Conor Dooley , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, linux-riscv@lists.infradead.org, Palmer Dabbelt Subject: [PATCH 1/5] target/riscv: Ignore the S and U letters when formatting ISA strings Date: Fri, 5 Aug 2022 16:54:01 +0100 Message-Id: <20220805155405.1504081-2-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805155405.1504081-1-mail@conchuod.ie> References: <20220805155405.1504081-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_085419_781938_4272319C X-CRM114-Status: GOOD ( 12.90 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Palmer Dabbelt The ISA strings we're providing from QEMU aren't actually legal RISC-V ISA strings, as both S and U cannot exist as single-letter extensions and must instead be multi-letter strings. We're still using the ISA strings inside QEMU to track the availiable extensions, so just strip out the S and U extensions when formatting ISA strings. Signed-off-by: Palmer Dabbelt [Conor: rebased on 7.1.0-rc1 & slightly tweaked the commit message] Signed-off-by: Conor Dooley --- target/riscv/cpu.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ac6f82ebd0..95fdc03b3d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1122,7 +1122,23 @@ char *riscv_isa_string(RISCVCPU *cpu) char *p = isa_str + snprintf(isa_str, maxlen, "rv%d", TARGET_LONG_BITS); for (i = 0; i < sizeof(riscv_single_letter_exts) - 1; i++) { if (cpu->env.misa_ext & RV(riscv_single_letter_exts[i])) { - *p++ = qemu_tolower(riscv_single_letter_exts[i]); + char lower = qemu_tolower(riscv_single_letter_exts[i]); + switch (lower) { + case 's': + case 'u': + /* + * The 's' and 'u' letters shouldn't show up in ISA strings as + * they're not extensions, but they should show up in MISA. + * Since we use these letters interally as a pseudo ISA string + * to set MISA it's easier to just strip them out when + * formatting the ISA string. + */ + break; + + default: + *p++ = lower; + break; + } } } *p = '\0'; From patchwork Fri Aug 5 15:54:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12937511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C2BDC00140 for ; Fri, 5 Aug 2022 16:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KQN/0gCZKReCLIlHkViObHqV+F/F3EzqhUXqetdRxlk=; b=iU9L32A9/FMisG J+rdVE3DFxh6Bp8l3Bn6+XzaUlNkpqalqKRYrtKDZGVQuUWuzp/Yr+lMTlYKgra2t2nfo5hEpxgX+ mMAyWRVXqOM23UFMAzjJQyxBuBJiiwUtAfqg9wITwjuuXpQQkFhF8ts3oxPbMhJihmMi4mIf5ssZI q8LCM2DoHeAcHy54eWSof/01x7bjCwiDtsvsKux1Fe02+ygKYz3dca8XfJVag5C7pgBT4r8loVfQU LCtCdJNSdHIDX4RZtAZNamhJD9kzeKimezoP5uruWF3k61yUkwocDBgZl4v170x5H8GYqaCiP1IKG B4rhhoW4uclmXY4+X9Ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzkz-00GXSg-Dj; Fri, 05 Aug 2022 16:01:01 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzeW-00GTaw-U3 for linux-riscv@lists.infradead.org; Fri, 05 Aug 2022 15:54:22 +0000 Received: by mail-wr1-x42b.google.com with SMTP id l22so3708932wrz.7 for ; Fri, 05 Aug 2022 08:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Oh6dm/6O3Dvyl0Eg7I+pxcL/xv9k+9dvQbu4oYzTsCM=; b=Ae0oAEXkVYED9VuonJLUUDST+CEXSzWteDmRMtes0Qri+D1vqZUBn8ZtShZMBRbPEO ixuMl4x4pr3P4pgLbGagBFjl3rouF+CLLbhFiwyf+T2k+QAiHYdPkWhPpYLsy67D/IyP mCxjqUqxCwGIplkzWboM7khvjE18NyApn5hSSChH4A+C/sddlAKwDoOelcL/WVAx+Ltr M5m+tMtxvZRvkcdC/1tNvCl1UASPi0pz6tFKT+X9zuYg1O3yfkyDerRzrrUQcXLOAdnN gmhMGQWWK1SyLvB/CILQxrMMhcaJrvwjX6PJ+ilRYR7qwjZizhePOflcgXTRI05FNUBY p7mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Oh6dm/6O3Dvyl0Eg7I+pxcL/xv9k+9dvQbu4oYzTsCM=; b=BCoab71wlgfPLqVbOVoWULGamZs/8drcjftVAqwM+3gdz0M8sw4UZ+Z/G+aJeAsPOr gANXF1d0kHRdUf5btkztp+hUgJzbTB507Qk8ivvEW/NuvDKh6rFprNBV99cVbrO5JlB1 rLjdZR15NCv/Qddd3/0N31rI2fkY1pRpWqcHiP6ifvev5nQgoiBe+8GafZX5XAX0hdUk pkCkC2cQDhvmA1HpfQBKKHTmMJCgiAdvc+CUdtSCR0HOwAitQV964bcN5gm6CoYvM4Z2 J9hqhzUkInVaS+GWHTZ8jEQ+cGzYJUhLc3u/sIC+DQ+Tw+vcskiQI7nfAgwh0HcDIL5N dRoA== X-Gm-Message-State: ACgBeo0f69QtgcpShaSftDvK2li4WFEL8BvU4jSGpmAa0nljgBfesv+K 9t/FqtURUfEjwKmlTwH1GkdpXIQ/RGWMwKcW X-Google-Smtp-Source: AA6agR5kJBunV0x+i6qOrg5xPhytUuJZAw8O/LeDbbx0DL8bRSa6qQTVWnnI+mVilWhlvy3wGBD+oQ== X-Received: by 2002:a5d:518d:0:b0:220:688d:4443 with SMTP id k13-20020a5d518d000000b00220688d4443mr4577769wrv.677.1659714859293; Fri, 05 Aug 2022 08:54:19 -0700 (PDT) Received: from henark71.. ([93.107.66.220]) by smtp.gmail.com with ESMTPSA id t10-20020a5d49ca000000b0021d6dad334bsm4133543wrs.4.2022.08.05.08.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 08:54:18 -0700 (PDT) From: Conor Dooley To: Palmer Dabbelt , Alistair Francis , Bin Meng Cc: Rob Herring , Conor Dooley , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, linux-riscv@lists.infradead.org Subject: [PATCH 2/5] hw/riscv: virt: fix uart node name Date: Fri, 5 Aug 2022 16:54:02 +0100 Message-Id: <20220805155405.1504081-3-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805155405.1504081-1-mail@conchuod.ie> References: <20220805155405.1504081-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_085421_009250_D2BCD5B4 X-CRM114-Status: GOOD ( 10.23 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley "uart" is not a node name that complies with the dt-schema. Change the node name to "serial" to ix warnings seen during dt-validate on a dtbdump of the virt machine such as: /stuff/qemu/qemu.dtb: uart@10000000: $nodename:0: 'uart@10000000' does not match '^serial(@.*)?$' From schema: /stuff/linux/Documentation/devicetree/bindings/serial/8250.yaml Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Fixes: 04331d0b56 ("RISC-V VirtIO Machine") Signed-off-by: Conor Dooley Reviewed-by: Alistair Francis --- hw/riscv/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index bc424dd2f5..6c61a406c4 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -917,7 +917,7 @@ static void create_fdt_uart(RISCVVirtState *s, const MemMapEntry *memmap, char *name; MachineState *mc = MACHINE(s); - name = g_strdup_printf("/soc/uart@%lx", (long)memmap[VIRT_UART0].base); + name = g_strdup_printf("/soc/serial@%lx", (long)memmap[VIRT_UART0].base); qemu_fdt_add_subnode(mc->fdt, name); qemu_fdt_setprop_string(mc->fdt, name, "compatible", "ns16550a"); qemu_fdt_setprop_cells(mc->fdt, name, "reg", From patchwork Fri Aug 5 15:54:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12937512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4743C25B08 for ; Fri, 5 Aug 2022 16:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SPMwigOJmUuYe0BJdpheE/gmmnooUBfHuZbFkSJxLXI=; b=mLfJOHgS0RSdSL uqnOvxdgTVJgelc67H4Yrsxi+2cpWFvPHvJPR6scKn3p2nF4tL5KVF60Pp0e/rAIXH7yI9szWrlhj vFshBrcCprnwRjMrSJOdr2iyIEv2MrRGLy/ckopkQVbZYxoxNpLiTuciS64wnB7ahAIxpOL85QcBS dg34AZXChck6iGiVeTB+UygWPb9WjMLj67zi0vx3kh9ANn9yl7O5h/WClwLN4HgxGItHibafTAWO+ sT5fLEOn5nFz9Y39AHYe/BF/vgMCpcFBr9NeuUbxhbrz80RKI/2Qv8YZNzZRj6aeDkColgkrNG/4/ 9yKtTiq9X9J2IzwKSZvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzl7-00GXWb-3M; Fri, 05 Aug 2022 16:01:09 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzeX-00GTbX-OJ for linux-riscv@lists.infradead.org; Fri, 05 Aug 2022 15:54:23 +0000 Received: by mail-wr1-x430.google.com with SMTP id j15so3726327wrr.2 for ; Fri, 05 Aug 2022 08:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Eq72lhYwpcj2Y9+DftRcCgBYVb7rhM8mwuz/pv5YLJM=; b=df02Xw2L5M+frsgdBTHZhAB+RpXKmP47teE/tjHduOX5y9wo3GaKeXdV4xT2ToFUU7 4PQzHwai241o9INpIDbGQxiJDcEBqL442po0XSgX//1aT712qM2uholsa9UDqeBBYqEV c1ZgWhWK79TYtP306g3O7vwcd2y+p8VzSx0FZ0IBIsZadWp9YnBP3dqT4eLVyyHX6zcm wgK8P2DB9htiONcb0h8+MaYNmFhF1S5OJm+QPHw+ICYA1QhATFphfMpdoarSaZKxBf6g bV73Dav0P1c9jReYFwbSsPZLZjw9kh1OAFUQuilGc2dAhtfMCng0C5YZWTo4qt5ic7p2 p7Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Eq72lhYwpcj2Y9+DftRcCgBYVb7rhM8mwuz/pv5YLJM=; b=sxa67jfc7eILACP+EV18z28mBN7MvFqljxLmrgsHJ8UX1WOz4/1sAd876xyFVakGS3 NoA+aKJWMDuInx0jjGYx7WZK0fmJOqDqHLRSlpLnEaTB8eX1W9qjOCl/dYe/UwCBzhOO jqGzxK7IXUKaGqIlcppEx184IB/9/wTvgdAd8NFC0uQ2NT+9rN6wEhsKmUhA4FZZqMqU +klKV7ZpXbmnG4r8LQ6AEstXlTjdGP53wtOZDmYLK0NUJpp+LeuqBh9vg+KVeC8olybO z4wDObOJeJAP2Ed/pnzMLQXgxTMlZmXvfzULMLhfUa8Zgzyn9UmKuhOhTjTC67+KQ1AW CdRg== X-Gm-Message-State: ACgBeo0AgOTrfijHCNEI/6xxCd+fQGW+t7TobC7BqToptQ+tQzjwj+4x TR38xeVbV0iwz8GUF0kyHva8v6IeSZsJKtv2 X-Google-Smtp-Source: AA6agR7miAqKtaiHBM5V5kg4ARTL8teYh/JTGjpAcnh9MVfvzICJUWVCq3N9ZPJld7V9cI9+X61IQg== X-Received: by 2002:a05:6000:1102:b0:220:5c10:5cbe with SMTP id z2-20020a056000110200b002205c105cbemr4922998wrw.359.1659714860091; Fri, 05 Aug 2022 08:54:20 -0700 (PDT) Received: from henark71.. ([93.107.66.220]) by smtp.gmail.com with ESMTPSA id t10-20020a5d49ca000000b0021d6dad334bsm4133543wrs.4.2022.08.05.08.54.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 08:54:19 -0700 (PDT) From: Conor Dooley To: Palmer Dabbelt , Alistair Francis , Bin Meng Cc: Rob Herring , Conor Dooley , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, linux-riscv@lists.infradead.org Subject: [PATCH 3/5] hw/riscv: virt: Fix the plic's address cells Date: Fri, 5 Aug 2022 16:54:03 +0100 Message-Id: <20220805155405.1504081-4-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805155405.1504081-1-mail@conchuod.ie> References: <20220805155405.1504081-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_085421_822677_9D0705C3 X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley When optional AIA PLIC support was added the to the virt machine, the address cells property was removed leading the issues with dt-validate on a dump from the virt machine: /stuff/qemu/qemu.dtb: plic@c000000: '#address-cells' is a required property From schema: /stuff/linux/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml Add back the property to suppress the warning. Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Fixes: e6faee6585 ("hw/riscv: virt: Add optional AIA APLIC support to virt machine") Signed-off-by: Conor Dooley Reviewed-by: Alistair Francis --- hw/riscv/virt.c | 2 ++ include/hw/riscv/virt.h | 1 + 2 files changed, 3 insertions(+) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 6c61a406c4..8b2978076e 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -465,6 +465,8 @@ static void create_fdt_socket_plic(RISCVVirtState *s, qemu_fdt_add_subnode(mc->fdt, plic_name); qemu_fdt_setprop_cell(mc->fdt, plic_name, "#interrupt-cells", FDT_PLIC_INT_CELLS); + qemu_fdt_setprop_cell(mc->fdt, plic_name, + "#address-cells", FDT_PLIC_ADDR_CELLS); qemu_fdt_setprop_string_array(mc->fdt, plic_name, "compatible", (char **)&plic_compat, ARRAY_SIZE(plic_compat)); diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 984e55c77f..be4ab8fe7f 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -111,6 +111,7 @@ enum { #define FDT_PCI_ADDR_CELLS 3 #define FDT_PCI_INT_CELLS 1 +#define FDT_PLIC_ADDR_CELLS 0 #define FDT_PLIC_INT_CELLS 1 #define FDT_APLIC_INT_CELLS 2 #define FDT_IMSIC_INT_CELLS 0 From patchwork Fri Aug 5 15:54:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12937513 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94C55C25B08 for ; Fri, 5 Aug 2022 16:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eG+Nm9SBk84c0bpyxJEd4UoUwHJ6r+uceHksnrRgTcI=; b=vPU4lVzjo4HBlw JP+ZJ5COs0D4/FjgyWJjOzDH0LmeHfnoynpj6jqXMAmLXit/l04cQuoJGMOiXspyvy9oR8QfbUWnW GG0FZUD5g62DT7DxVz+KeEPMtWWCLMMPYA7+ImTosO/q78ow/MpPAZWeifUtQXaGdtuZEGLSwB+XQ 0BFuZ6RKal0DT+RXScIKF8WN3M1bjWiN+ZqqudpqFz27RFJ45s8SPCSou9BpO7JMpGOMXb/WUX8xN QUumPfp6csgVZI8fFxUALZNikeQBTtKMvk3Z677nfyjbA0jRVHOAwwEvOqOWTc7gZE4x4RWR46U4v KaSn6S+aSAF8ukIF9frQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzlO-00GXgX-UE; Fri, 05 Aug 2022 16:01:27 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzeY-00GTc6-HG for linux-riscv@lists.infradead.org; Fri, 05 Aug 2022 15:54:24 +0000 Received: by mail-wr1-x434.google.com with SMTP id q30so3671871wra.11 for ; Fri, 05 Aug 2022 08:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=O6y0NlSqnXVJ4lrjU7vrgT2qdp78DF3F9tEIqiy3GoU=; b=RnJNQynZy/A06iwT22HM4tecWfO4iuM7Nhctff7HuBsLlnR8ZCg8REs8I5nrGuvWzd +87NlGx21/Dud8dJCt8z2gUgZvj/3nPueCStmbL1pdu0tnO6s2V73f7lvtnVghRyfrki 0sa+3AEpjYfgT/ZPknm5dmy2WXvmprpgowCRtSo9Olw4fY4T9xoXXYhAG26AeYsgQDlj wNFarxk9iq4vb2BkAQ61sSwpGfGouPFBjhteD4GatJQKX29e1BspvbjJPpfDD1YK67mQ 9UL5nUKbJbGX+W8xEh0D/fo3BzV0Qu3b9mzg6+Zb9K1dsTbk3oG9MiWq+yyZT8y2fOlq DfsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=O6y0NlSqnXVJ4lrjU7vrgT2qdp78DF3F9tEIqiy3GoU=; b=fh22cp3HtqWGNGflzrdQWwBZs4gI8pbWq4pZ8TB4OUteszlzpM5PZT1r1+plj4q737 sheT1dzE24E1UfHZpVfSvKtouZDt6RD9mJYh4klclo62p8jO2Nvdqd9ypERKc23rLbzx pRBvFezY2KyVKLFUkSfc/cNaspggtNpjskz+CY2KfNW/ukgV3aiWDgQaNBegzF31Jh1L GgyU4LdWdaMmTtYHvdst46BnOfdGYVh+2+42qWOFdxvFfDEZv/YrotkdiYAtnjk9GNUk g3Azwqxxj7UnO0J99fJk4ICzAs/R5b0J0wNmAlFskl/CLVnDw5rt+/QPYzsVsqXM+6zk g8nQ== X-Gm-Message-State: ACgBeo33ksTH4CzisHiCY3PbPGcZrcciPeagA105N4f4VFUdu4aKUpit LKiduCOhx0XYqpHtZzyU86mWVg== X-Google-Smtp-Source: AA6agR5rYULNQ86qE7XGB5LfgnZor9j132PHMA9QXxeVKpnEoAwIGilzQFeArkbVp3gWr/p8Hqes4A== X-Received: by 2002:a05:6000:144f:b0:21d:a3cc:a6fa with SMTP id v15-20020a056000144f00b0021da3cca6famr4684061wrx.191.1659714860908; Fri, 05 Aug 2022 08:54:20 -0700 (PDT) Received: from henark71.. ([93.107.66.220]) by smtp.gmail.com with ESMTPSA id t10-20020a5d49ca000000b0021d6dad334bsm4133543wrs.4.2022.08.05.08.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 08:54:20 -0700 (PDT) From: Conor Dooley To: Palmer Dabbelt , Alistair Francis , Bin Meng Cc: Rob Herring , Conor Dooley , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, linux-riscv@lists.infradead.org Subject: [PATCH 4/5] hw/riscv: virt: fix syscon subnode paths Date: Fri, 5 Aug 2022 16:54:04 +0100 Message-Id: <20220805155405.1504081-5-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805155405.1504081-1-mail@conchuod.ie> References: <20220805155405.1504081-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_085422_620397_27CC7851 X-CRM114-Status: GOOD ( 10.23 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley The subnodes of the syscon have been added to the incorrect paths. Rather than add them as subnodes, they were originally added to "/foo" and a later patch moved them to "/soc/foo". Both are incorrect & they should have been added as "/soc/test@###/foo" as "/soc/test" is the syscon node. Fix both the reboot and poweroff subnodes to avoid errors such as: /stuff/qemu/qemu.dtb: soc: poweroff: {'value': [[21845]], 'offset': [[0]], 'regmap': [[4]], 'compatible': ['syscon-poweroff']} should not be valid under {'type': 'object'} From schema: /home/conor/.local/lib/python3.9/site-packages/dtschema/schemas/simple-bus.yaml /stuff/qemu/qemu.dtb: soc: reboot: {'value': [[30583]], 'offset': [[0]], 'regmap': [[4]], 'compatible': ['syscon-reboot']} should not be valid under {'type': 'object'} From schema: /home/conor/.local/lib/python3.9/site-packages/dtschema/schemas/simple-bus.yaml Reported-by: Rob Herring Link: https://lore.kernel.org/linux-riscv/20220803170552.GA2250266-robh@kernel.org/ Fixes: 18df0b4695 ("hw/riscv: virt: Allow creating multiple NUMA sockets") Fixes: 0e404da007 ("riscv/virt: Add syscon reboot and poweroff DT nodes") Signed-off-by: Conor Dooley Reviewed-by: Alistair Francis --- hw/riscv/virt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 8b2978076e..a98b054545 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -896,7 +896,8 @@ static void create_fdt_reset(RISCVVirtState *s, const MemMapEntry *memmap, test_phandle = qemu_fdt_get_phandle(mc->fdt, name); g_free(name); - name = g_strdup_printf("/soc/reboot"); + name = g_strdup_printf("/soc/test@%lx/reboot", + (long)memmap[VIRT_TEST].base); qemu_fdt_add_subnode(mc->fdt, name); qemu_fdt_setprop_string(mc->fdt, name, "compatible", "syscon-reboot"); qemu_fdt_setprop_cell(mc->fdt, name, "regmap", test_phandle); @@ -904,7 +905,8 @@ static void create_fdt_reset(RISCVVirtState *s, const MemMapEntry *memmap, qemu_fdt_setprop_cell(mc->fdt, name, "value", FINISHER_RESET); g_free(name); - name = g_strdup_printf("/soc/poweroff"); + name = g_strdup_printf("/soc/test@%lx/poweroff", + (long)memmap[VIRT_TEST].base); qemu_fdt_add_subnode(mc->fdt, name); qemu_fdt_setprop_string(mc->fdt, name, "compatible", "syscon-poweroff"); qemu_fdt_setprop_cell(mc->fdt, name, "regmap", test_phandle); From patchwork Fri Aug 5 15:54:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12937517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36D42C00140 for ; Fri, 5 Aug 2022 16:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UMew6/XRSK7rRVM51ydUbWh+RBXk5tPC89DDHcMmckw=; b=Uq41STZyCjWqfY DHt6hEkpBjI7fDbA7lvENmAWtqy2EKcq5wjz9K1s0XcGB9a97NQvPvzTRoGyoF4qlNlPr6AoT/i6g nBPJvnozXXRS1tD3RcVqBgifGz//H7TwTmq/VKys+27vFABQyHBywNnbk+iXS7KQHARf7jM+FaTn2 86pAbCzjHkF7cUzLzJf8XdESp3IDdNMI1p8YuB70/4HJkKJloUxd0YwcwkjQa9IA0DDJw9sFKLq2F v6af4T0HK6C2uF+I0nzxSQuGL0QzvCUIP6vUPbw7trBx8L0lG/yRhS+rbLRxz7K4DjXWaYAgr376V 0DXlSEMP6JKZfS9YFhng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzli-00GXrJ-4C; Fri, 05 Aug 2022 16:01:46 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzeZ-00GTcn-9q for linux-riscv@lists.infradead.org; Fri, 05 Aug 2022 15:54:24 +0000 Received: by mail-wr1-x433.google.com with SMTP id j15so3726398wrr.2 for ; Fri, 05 Aug 2022 08:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=rfrHuYofA2jTHYlyVlxL0WVJKLrnjdxClG3/+p9uXxc=; b=UMt/6ONZE4d7i8r+HjDr+1yRMzmeymuO+74l1T3asAl+Tl1RGNT+DTxE7u2wx5lcQB 8kdbMDr6ilHFhkffCtYlmJZTQlaFyhFDxN8nF2W97cny4OYrqhMLGrAiMsdRULSy/7pS Ry++das2y4F8gvuTPoYUUZva0cfQexZ8IxJznRnFl2x+stO1m7DnEC8Xln+9sUJfM+tG LlObm12rMHaIGOqD3qyZqHqpEcOQ0KMMuKNmdUq7aRo97GZW87rtelf1TT5j8L4fgAz4 VuK8DOuGSusEzjtf6L0KVKTOXviQjmY1hFGmZHklZfi6jFCW/Pa0TqQRkvenxZ3C2PhJ u8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=rfrHuYofA2jTHYlyVlxL0WVJKLrnjdxClG3/+p9uXxc=; b=gDSa6nvcU6s03uqxrgxCj0zHkhR0uVal1mcYKbDoFPTPcsgC+vcIMMJco8Ed8vBndx TvRTdAaKq4TvMaxIklQheQTiqyG073uGwr0E9HVJD/UWKVeavpI6E15j5Q3g4hsq28tH 31cKZFQ+BlnPghIOFRG05iSpCCFarHL7yiO0Lx66cUrRbocqc6pCzEAr6g3jHzoolRBt VNGFTBlHifAkVupt9o3prR+Mi4VVO5+Mc8156o7bGdMyVV6i0277KVHkyqLQG8BXixdy qYzlU3bL7UjyI20wilZh4m+YU8s7iEQbFpOwGvPUDvv0lr1whAOw+qIYzdmI1iACLqYQ hvXg== X-Gm-Message-State: ACgBeo3y2hzxnBwVWcbKqOokki9JXOeMGbbWVrMs117EbQyIJ4S1qlsx hMb2+lmjz/bQ5Qmsz7jN3Mvayg== X-Google-Smtp-Source: AA6agR7rwBoF/VmMijr0QsVwMVUZd/R8yy5zn2l6NKz7JXNM0HX+pRHkPvA4FpOzuoDDk3ygtfN69g== X-Received: by 2002:a05:6000:1564:b0:221:7cbd:df6b with SMTP id 4-20020a056000156400b002217cbddf6bmr943177wrz.511.1659714861666; Fri, 05 Aug 2022 08:54:21 -0700 (PDT) Received: from henark71.. ([93.107.66.220]) by smtp.gmail.com with ESMTPSA id t10-20020a5d49ca000000b0021d6dad334bsm4133543wrs.4.2022.08.05.08.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 08:54:21 -0700 (PDT) From: Conor Dooley To: Palmer Dabbelt , Alistair Francis , Bin Meng Cc: Rob Herring , Conor Dooley , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, linux-riscv@lists.infradead.org Subject: [PATCH 5/5] hw/core: fix platform bus node name Date: Fri, 5 Aug 2022 16:54:05 +0100 Message-Id: <20220805155405.1504081-6-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805155405.1504081-1-mail@conchuod.ie> References: <20220805155405.1504081-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_085423_370966_2275E794 X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley "platform" is not a valid name for a bus node in dt-schema, so warnings can be see in dt-validate on a dump of the riscv virt dtb: /stuff/qemu/qemu.dtb: platform@4000000: $nodename:0: 'platform@4000000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' From schema: /home/conor/.local/lib/python3.9/site-packages/dtschema/schemas/simple-bus.yaml "platform-bus" is a valid name, so use that instead. CC: Rob Herring Fixes: 11d306b9df ("hw/arm/sysbus-fdt: helpers for platform bus nodes addition") Signed-off-by: Conor Dooley Reviewed-by: Alistair Francis --- hw/core/sysbus-fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/sysbus-fdt.c b/hw/core/sysbus-fdt.c index 19d22cbe73..edb0c49b19 100644 --- a/hw/core/sysbus-fdt.c +++ b/hw/core/sysbus-fdt.c @@ -539,7 +539,7 @@ void platform_bus_add_all_fdt_nodes(void *fdt, const char *intc, hwaddr addr, assert(fdt); - node = g_strdup_printf("/platform@%"PRIx64, addr); + node = g_strdup_printf("/platform-bus@%"PRIx64, addr); /* Create a /platform node that we can put all devices into */ qemu_fdt_add_subnode(fdt, node);