From patchwork Fri May 13 13:13:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 572084 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:66c4:0:0:0:0 with SMTP id x4csp456061mal; Fri, 13 May 2022 06:14:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVsajEJ86+eFIKxQhV5O4eVVlHSLG1P1q+6h0PG6QV/I2hcMOCARwmhszH/e68drFSiOQM X-Received: by 2002:a05:622a:1ba2:b0:2f3:b76a:a048 with SMTP id bp34-20020a05622a1ba200b002f3b76aa048mr4387392qtb.79.1652447685231; Fri, 13 May 2022 06:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652447685; cv=none; d=google.com; s=arc-20160816; b=aBCrEnVPbDI3KBHnDQNTcAVuuXHiTnyGZWOJs2Y31Kso5OZaIrB7DWkq2zzQoH1/Yl NGE5Pl8YtQDOJhtDZd/xm1MDJgWNM01VHdaiY1jGeMM5NjMlKVDHmmrgO1SKRMBdzGgq NYmzSyP/xQz1b4qbfuU+lp6Jp0k2wlgwTd47R3H5G7aa3t8o/KyagGUNxVaA6B28gzEw 5wkw5Mj6C34u7PAo9OU1zSYg8D8j/T2YODwkbGfoiQkUSdO3nr5vOzljV7ImR4pBlMC6 KZ8SjQd6FMk+KhHwIs6A6ZY7Bv8dyRtRl11rz9iG9PB++uj9QaKADuXSgMp9CQVCvN5r psJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ZOTl4ibDRdtOyEL212041ezVq+53TlvBxM0zJ1ux+kM=; b=oTMS0S26Jpua468Vkl0b22BHIDxxN6dngRiT3jY+++tpbzBxtXWHzpdajN7mOpHUNv v+um/w8moLE3LwxBHvTDMJ37opLfyrKbjGPZdcubOsOGg36JURmCQe1BwCgtgiUYdiPM Qwb5G9gB1hMCyLyLQLaptaNRPpIi3aLHM2OlEsxMMxxvmbYn2DunahTiUkdabs+sXEgu bYuqeMImW/RI357ufCG1KhVGrpl6aBH+Ps9Zc3sLNPlCpQNxlTOW34keNwuPztMb6szN y+XcbbAx+RfLTXNKIX9V6xE6zUCmpY9DgHHxEem7x3poA6oBDPhykMsTSBcL8AUEEvn0 nq6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zbOJocrG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 12-20020a0562140d6c00b004464c6924b4si1709990qvs.89.2022.05.13.06.14.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 May 2022 06:14:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zbOJocrG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npV80-0006Xc-Ru for patch@linaro.org; Fri, 13 May 2022 09:14:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npV6l-0005hz-5b for qemu-devel@nongnu.org; Fri, 13 May 2022 09:13:28 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:52884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npV6g-0007d9-Rh for qemu-devel@nongnu.org; Fri, 13 May 2022 09:13:25 -0400 Received: by mail-wm1-x32f.google.com with SMTP id k126so4789040wme.2 for ; Fri, 13 May 2022 06:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ZOTl4ibDRdtOyEL212041ezVq+53TlvBxM0zJ1ux+kM=; b=zbOJocrG6BoZUx45clliWjLnWHF+QpDqgDWPeUQI4+JaPxD9eW8YbXBq3dikraLoh1 TzoXvXSZPndFQDO85hKRu4HRhXV0FRVnwfXR545FU26S1xz5Ta97urawbiDMKt7AihJo OjcVe7xKeXsDQVAsc9H7KXCuK9OLy8dKdl7ELSnSBwPN7hiW+ing2JdKUSSSy3T3msxh tmGgvfVHVnbIRu6DDy8W9JkkWKoaNYid8QhpDzQ5SxfhXyd8NSGGLGfoGO2L7NTDslrd d4nk1aJPnmJju8CaDDWTyj1z6Pe0xbxQCLPArcDLg2sdXkW8YlTje7ultWCvZ0DIsr26 u7FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZOTl4ibDRdtOyEL212041ezVq+53TlvBxM0zJ1ux+kM=; b=YKh/xFtkSOShEpl24u/Thm1MLgFhG3p+s5nIpBBypN4HCM0NEYQ/dEWCjM3z1SNE9W 2uyWY3f0ctHNBI8g27jpjucBYTHSOBtrn66KnFwlQfzAxiAulgaQ0tCpLkHA2MoW5hS+ JHR2lWeyGOtIBgLksY+6bJhfGU3F0gPIlvgcbNBjrXHtkQaabu02JNTeTRhcB5A/FeRk qNyb1EEk/Sm/wt1xJLotC1lFYlyhNINUTg+sav0xDAyuRO6l6jE/+3E3K8c1lTha+O4O tYaU6FYl3EjyOhv4NFSTDBapkd/1bvxqnTH3C1ZYU4dGvcUydxPwEc+pt5v/EhJUN+YT Q0jg== X-Gm-Message-State: AOAM530DPi+HAZV74Sss5AjeiGHMXrQn1W0xbsJWXyY3rrkOsuUQvQIN +ESCgY091NsaRxTnUKgy3Gn0jQ== X-Received: by 2002:a05:600c:1986:b0:394:867f:984c with SMTP id t6-20020a05600c198600b00394867f984cmr15019881wmq.20.1652447599770; Fri, 13 May 2022 06:13:19 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id z23-20020a1c4c17000000b0039456fb80b3sm5214887wmf.43.2022.05.13.06.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 06:13:19 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name Date: Fri, 13 May 2022 14:13:15 +0100 Message-Id: <20220513131316.4081539-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220513131316.4081539-1-peter.maydell@linaro.org> References: <20220513131316.4081539-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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=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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In the virt board with secure=on we put two nodes in the dtb for flash devices: one for the secure-only flash, and one for the non-secure flash. We get the reg properties for these correct, but in the DT node name, which by convention includes the base address of devices, we used the wrong address. Fix it. Spotted by dtc, which will complain Warning (unique_unit_address): /flash@0: duplicate unit-address (also used in node /secflash@0) if you dump the dtb from QEMU with -machine dumpdtb=file.dtb and then decompile it with dtc. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1a45f44435e..587e885a98c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1195,7 +1195,7 @@ static void virt_flash_fdt(VirtMachineState *vms, qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); g_free(nodename); - nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); + nodename = g_strdup_printf("/flash@%" PRIx64, flashbase + flashsize); qemu_fdt_add_subnode(ms->fdt, nodename); qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", From patchwork Fri May 13 13:13:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 572083 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:66c4:0:0:0:0 with SMTP id x4csp455869mal; Fri, 13 May 2022 06:14:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQMXGiQdOvm0tyXlBLqdjN108hE7utjj7S7MwyEq555oW9LPBdlDTytO1sG46fZFLyEUsQ X-Received: by 2002:ac8:5946:0:b0:2f3:b8c9:ece2 with SMTP id 6-20020ac85946000000b002f3b8c9ece2mr4419857qtz.269.1652447672311; Fri, 13 May 2022 06:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652447672; cv=none; d=google.com; s=arc-20160816; b=PIzPsDmEtkYOjDe/iw7XohzPot60CGAP4cMlv5a14DwfxZq9xSm4K5EwrjxtGDyCx6 O+KuaUC2hrTw56mIUZap0Lb68JtgoqgiRVOBhbqHFzCcezRnXvHNXemjKoxCsU7bzXNB 1h3HQl0qnEAnSpjM4UQo9S9sboVIHtLr8echoB9jR9JiDNaisEnjzvHUXimhnyOQyRuK ugLQw/Hc9bjrFURQHB15yy5iXdWpJkWsCW5IWBGDYjVQcWGrtC3hv42qnAPnmPo3srx7 JTBChMTC232kYBw1KOtwaFqUbBUdG6RbPevqYhdgF1nLPkw0lIcX3JOnjND9i8hpIpDZ VFUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9NZM93kg05o9Nk5CELPlexfXMMevgoe6mPGgO2E6Ams=; b=Ss487uCXEKeDpgyo5mIse6YhpZX+GYjETB/jDKrVudpWXZD1Am/9E63b6exZ49wtFi 0etm20JhQdt4PvgnEwiIxodqbHxA4NScepYJFE4gljLcJ9uROvrv5+T5hlrkhajve4kT cUaVIw5BvOwthMASinB3c03PPl8bBdZPd8I5z9wkqC20zU4czdJW08jWIWksw4UlN1M+ +eionqPN6Qf1rN+jW4fEZayZgtYN+aRVqn+tCFtYYTub45/hWBuv1itifJSzND7MJ/gl i+jO2aZIdviUoCiYwbsVx7CxS2rtCVC/qMvM1KsHlEjgTuQPcypq+CECz6IGBPVOR2Pv vXSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DQtXM3cw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b9-20020a0cfe69000000b0045812880679si1056866qvv.185.2022.05.13.06.14.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 May 2022 06:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DQtXM3cw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npV7n-0005k2-U7 for patch@linaro.org; Fri, 13 May 2022 09:14:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npV6l-0005hx-5M for qemu-devel@nongnu.org; Fri, 13 May 2022 09:13:28 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:55879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npV6g-0007dS-Rm for qemu-devel@nongnu.org; Fri, 13 May 2022 09:13:25 -0400 Received: by mail-wm1-x335.google.com with SMTP id m62so4770397wme.5 for ; Fri, 13 May 2022 06:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=9NZM93kg05o9Nk5CELPlexfXMMevgoe6mPGgO2E6Ams=; b=DQtXM3cwrs9emfA++5dJN629bY98Z1NTtRpI6MwxR0O6UFjCduav88KiXZXbxKBhKA CSBWK6oJU7Npc6umHZaqB9g6bxp/js9UJcoEfDY4GK/0w4uhjLhmO2D3SKJz884leD7D G8NYEwFuMCRZgaST8xDAzC+wkMdaijefy8mxVspdHrwGq2QPcYFj73DbCm+tzDSvpoX7 mesy9/mRykCg12RiMfg3GH+aT3Hx/MAfNt+k20v6FWaJBrCNg6AfndyiaJfdRfMsro5s 6PozlSlm+cLa00ci1yjxf4gcdvomSoyEsPrMeYWoIz/MmRLmxrcOrEqWenBNi0gn7fhL iPjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9NZM93kg05o9Nk5CELPlexfXMMevgoe6mPGgO2E6Ams=; b=C4P488CCXjLqhFuvoNVQyAH5BnvkgsL8XtGXBIh3ecyz1x9AGwxsi42G10gVZSmZqv pG8fdnLrLAdqDJbkyXa7wNLzqijbuF0R2Qz/OYHwtG0q1aloRaHS0NeJCqdyJexpgvL4 zE8wjJY+oV31V7alOzOhG5+L9KxUn7naS6vSg05hIiCs99tkykV2f+WdH+R0I8R6hNWq ursUurLRft1cK+THcn2AwaBgRXklb+yZtiIi/l0+T2S+0ZCjQ8ANw+1Qgia658wQLQJ/ rIqEvltKUQMN2cMLXLCanP2Cy/yufy/uqOPckxCHjk30pKzV+hDpSkmSRDT425S+YTrT oeSg== X-Gm-Message-State: AOAM530QZBdFfV4DZqV0UQCTDW0XZ8MtaXU1DCyihSa4UUViY+VGtP8L ziN5yCMOKcsACtWv02zN2ovV6HczfpbzSg== X-Received: by 2002:a05:600c:2315:b0:394:1f6:f663 with SMTP id 21-20020a05600c231500b0039401f6f663mr14815742wmo.115.1652447600695; Fri, 13 May 2022 06:13:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id z23-20020a1c4c17000000b0039456fb80b3sm5214887wmf.43.2022.05.13.06.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 06:13:20 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node Date: Fri, 13 May 2022 14:13:16 +0100 Message-Id: <20220513131316.4081539-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220513131316.4081539-1-peter.maydell@linaro.org> References: <20220513131316.4081539-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The virt board generates a gpio-keys node in the dtb, but it incorrectly gives this node #size-cells and #address-cells properties. If you dump the dtb with 'machine dumpdtb=file.dtb' and run it through dtc, dtc will warn about this: Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Remove the bogus properties. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/arm/virt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 587e885a98c..097238faa7a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -925,8 +925,6 @@ static void create_gpio_keys(char *fdt, DeviceState *pl061_dev, qemu_fdt_add_subnode(fdt, "/gpio-keys"); qemu_fdt_setprop_string(fdt, "/gpio-keys", "compatible", "gpio-keys"); - qemu_fdt_setprop_cell(fdt, "/gpio-keys", "#size-cells", 0); - qemu_fdt_setprop_cell(fdt, "/gpio-keys", "#address-cells", 1); qemu_fdt_add_subnode(fdt, "/gpio-keys/poweroff"); qemu_fdt_setprop_string(fdt, "/gpio-keys/poweroff",