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: 12937525 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 95417C00140 for ; Fri, 5 Aug 2022 16:09:29 +0000 (UTC) Received: from localhost ([::1]:53252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJztA-0001v9-FA for qemu-devel@archiver.kernel.org; Fri, 05 Aug 2022 12:09:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJzeX-0007Vj-Nj for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:21 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:44593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJzeV-0004nZ-U3 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:21 -0400 Received: by mail-wr1-x42d.google.com with SMTP id q30so3671769wra.11 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=K8SjwK9QUQfhOYgdRbyWctAnj12ww7uofPPCmeLCtdTB19wNcqftt4bCn1pVGidwUc aD3WfCvIjf9yOsOU4eLrMj098R1D4ldo3mBDkssW9gQ8aFOAIdAK4gSYZuB7FMfkP7U8 oA+wtS/xT4DtoJD8OVthbwJKSOx1XabWgRaIwIq0WmvST9Ndrs1ygfJEB65FU1OJ0jXF 0Zo4SWSl/RDr7vu76ad+QPiNtFdJgwk0Wawzuji+LzUU9pev6NMWN0IN33dO9+LT0Obw RpsH5HW+RiP04RHuoLapYB2hGGFo38J3y26KDmqRDL7CQJ3mBDXIFLVcmqj/uLG3Y4WD V/oA== X-Gm-Message-State: ACgBeo0hbnR39twCep7bYmypqSJbNaq0d7UhSjKvKQhVnfQm9ECa86vy hmse/2RmpS1d68Be2ZznvvliiQ== 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 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=mail@conchuod.ie; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 05 Aug 2022 12:00:40 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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: 12937514 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 12B62C00140 for ; Fri, 5 Aug 2022 16:05:31 +0000 (UTC) Received: from localhost ([::1]:45196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJzpJ-0004ed-ER for qemu-devel@archiver.kernel.org; Fri, 05 Aug 2022 12:05:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJzeZ-0007ZD-Td for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:23 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:37737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJzeW-0004nk-HZ for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:23 -0400 Received: by mail-wr1-x430.google.com with SMTP id z17so3718936wrq.4 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=0gGja1vv8rQBEKHFpxMhfLvQEDHMtHVPajxPdAcolCmztD9bJYeVnbaQXnnRTDw0Kr Fs8JkdjK6hG+Wspnl/guk0CDD/7jFSVXiGAGvvhWrgFYfkQghHkpzBNEByWo9he0fMXv Jwr9IXEff/Nz6JAYk4WONeLzUOGGM9+5fzIw4bEkB9G+pM138rboOTohYDkXIhodKnf/ an5VqFLQq2otJ7+0sU3UmuizDHSEY6rRCkTg4OYKP8cIRUWCAuvG24PhHf0r02N42cs/ ANL89+ENe6kP8nie8DZuyIlakyjLAs64zpTDmp9k7fsDuchj2dgmpZkmsrxyaz6SdfRk 6ZaQ== X-Gm-Message-State: ACgBeo1K6n6DytvRC4tPokZi8snFjoddlZqJc4hHzKH027BTYSyPDXw6 KFnLSwgVj7k/48rs68c7S1oykA== 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 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=mail@conchuod.ie; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 05 Aug 2022 12:00:41 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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: 12937527 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 48A64C00140 for ; Fri, 5 Aug 2022 16:12:44 +0000 (UTC) Received: from localhost ([::1]:58846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJzwJ-0005ol-CM for qemu-devel@archiver.kernel.org; Fri, 05 Aug 2022 12:12:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJzee-0007o3-W4 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:29 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:42545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJzeX-0004nr-E9 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:28 -0400 Received: by mail-wr1-x436.google.com with SMTP id z12so3687532wrs.9 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=AP/ZhaCH5esqrpqdSuNSt41ylTrXDmhNdZ/V6kde071cvvVb5pvyGDTdtzKQcVRtM1 nq3/QanrK/uMFhUmkdpiKQKteOo7ViD9+kBcjzIVlF6xZs7GKfWbWGJnomcq0adGvFyK PRNE1PsIeQb7A7UJKKfdN8H5QdW2tC6FuxZranK5nQGQHqHiTmGgQ+jYS7KAvf+bzsLi Sd4FBMdVqSGqxDNqWRTgJGyFD0TyiKlGexYMukfPheZc05xmDJ8MnyyX+hbKaUd8D3OF 3d+yXlC39dN4DHsI0pirH0ZWe3Y++3773U6ny9efXhb1njuRV+bo7vcIBFB8AdaSKA7G mLWA== X-Gm-Message-State: ACgBeo29W6qjeyvrrsGruBRJ89zyvs/0PivTSicJT5Eo6rGn8b3dsedf 7eFbRY07yP8XDD8GEGoq44MwQA== 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 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=mail@conchuod.ie; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 05 Aug 2022 12:00:43 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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: 12937526 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 C2D80C00140 for ; Fri, 5 Aug 2022 16:11:08 +0000 (UTC) Received: from localhost ([::1]:56676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJzul-0004FY-Lc for qemu-devel@archiver.kernel.org; Fri, 05 Aug 2022 12:11:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJzeb-0007cp-4w for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:25 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:42535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJzeY-0004o3-5d for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:24 -0400 Received: by mail-wr1-x42b.google.com with SMTP id z12so3687561wrs.9 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=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=qSfm2cb71KvG2NIxQ1AW71IY7wng//BBBn3PkSnpfofKINpQgFBeS6kgdGcmHEx6Ga a7OkwYDzikMtZYYlbVaNEVbZ2SJiOyzo7tjshVAQl7K5lspMxXkEAQDdPJHHpJ/4MO0c KghjDXRI93HQEfJZ7IN9nrI/kpShlBylFQOkUmBKXntVx0h6dLFtlphwuZA0wDnfjqWf sa7r0Nvpw8s/X19d4OnPTIf9HnnIA+Za6d384WKZtEKIQeYZQiuLd+bnaxvJe6RAWz1Z Q1awlsVt8tPVvjDml1e7RPEnCGLyUKPvohQkz+Myy+QXUBgWpQYjBw2G5wiRHG6t/iz2 dsnQ== X-Gm-Message-State: ACgBeo0cck5S+0L44aLUQZrnYBou1K18+ia99Bc9pzSNQeJ1NDsUE4Z1 YqomrwdoV2AB+DOF5fXFYKhJng== 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 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=mail@conchuod.ie; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 05 Aug 2022 12:00:41 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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: 12937516 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 00EE4C25B08 for ; Fri, 5 Aug 2022 16:06:01 +0000 (UTC) Received: from localhost ([::1]:45778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJzpp-000542-0f for qemu-devel@archiver.kernel.org; Fri, 05 Aug 2022 12:06:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJzeb-0007d8-73 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:25 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:41826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJzeY-0004oS-TF for qemu-devel@nongnu.org; Fri, 05 Aug 2022 11:54:24 -0400 Received: by mail-wr1-x42a.google.com with SMTP id p10so3691266wru.8 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=ztMocy1kHr5i9f2vTymRyt6Wb9SYIz+kfINPbk3S4VVHZJmQmLXWBZfvRYP25p+l4m RVkalWNusrK7vs3cnl+u6eZEZsW8UwS9lK/DomASwF1JQ7x4m944eL+WqlFbzk3wwxO5 RyNTZUOoujhQbEHLMZfMetnlBn+gF/Q2HFxeDw2bPlRyjuVON+fyh0aurdjEBumgNi4w Zf1H891Ad7BS23PQ51UKcjIKdKe/uNZb2U2cdALSXRqURieo1K18X7nxpzpNZcOUUm91 YBl3NSDV8DZgQ5giKKHN+u6ulbKIwV048O2AsWS5nWVFe7yyCKmIUdqCZoJnMbtpUfDf kvCg== X-Gm-Message-State: ACgBeo1v27bgMDLDAq2eqAXvPxz84m8GBE0yLyz4rm9I7Q8qAl3K89lO H6glWoinMzMDCjs3fQW1Qt7Jjg== 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 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=mail@conchuod.ie; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 05 Aug 2022 12:00:43 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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);