From nobody Mon Nov 25 07:44:22 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1717187452; cv=none; d=zohomail.com; s=zohoarc; b=kpFSX4iqDz54D5RdYdU0l4BFLAhvxWTViEOzWaEIU2drbHdzGD8SAnJmCEQMYHllauI/OUpNDO6G+Q+rAEJein/Sf7ERT8f6t8XRZrRz85aspHvpjyzaMsY4BbcvaOtMHOwOPxW3PkDPnIptSA7dgT67RWn3y0NidChRTj0lyN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717187452; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EuGNiLoanyDO7mD97RqI1BTp6/0+i7R30n1y2I4bdsk=; b=IbXmXTjgdjlu97Yz3w2ck0UJKVjBNN7uH0J4GIvqKUY44gzmXu+6eJ/1l+IUUIEbTbz4U4OdDti1Z5ZGzxaeymE4wf+XbYrj8oiurBgbiOrQqdEOqZLQoV1PrdtQbLkcHR4E9c39a9KL+QtcPeHjOmwWzxgBUpeCDVsPk/17mW4= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717187452356312.3085362546675; Fri, 31 May 2024 13:30:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sD8rO-0002pk-Ku; Fri, 31 May 2024 16:28:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sD8rM-0002oy-BQ for qemu-devel@nongnu.org; Fri, 31 May 2024 16:28:20 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sD8rG-0000n8-7g for qemu-devel@nongnu.org; Fri, 31 May 2024 16:28:19 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-702555eb23bso74856b3a.1 for ; Fri, 31 May 2024 13:28:13 -0700 (PDT) Received: from grind.dc1.ventanamicro.com (189-69-160-78.dial-up.telesp.net.br. [189.69.160.78]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b09133sm1819691b3a.178.2024.05.31.13.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1717187292; x=1717792092; 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; bh=EuGNiLoanyDO7mD97RqI1BTp6/0+i7R30n1y2I4bdsk=; b=Rqgg/NjFkQ2c3/GYZSoHQp1obITT3LvPlzqhl2176Bsz5OnaXIPBK/MiD7KIBRS3XY BLpjApV9JhlenIy1fWF9p6fczSQl2dpn0gZ+o3Nchkm4mzG3l5c2ulvKRSFeuZFrWpD3 n0eYhDdT+FvFCg+A3u3NfZOHh2Rz3N3hHJ0C00ww2cIvBUcNNoVUVTtnmQu46ZjSnzi9 ULDDdpeNMvnQSBcBVh318HHDJtFmaY/7hhuRh+x58a9qC+4qxB32Z8tT8qMK9ZCb92oG zIiiaDcHByh+fF0VJ8dKY6lTxQ30PulWNEbZATyNByGoLEGYKgqLROGre+A23FwHF5Pl EkJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717187292; x=1717792092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EuGNiLoanyDO7mD97RqI1BTp6/0+i7R30n1y2I4bdsk=; b=lql5nAp6DqUi5idQIoOIeHfwua73Plax7zZd3MijWo8weU5v4BR0PYY53Pb1nMHryD 1dyUZtAeh/IgfNJpdKgNzYRR9NPtKo7I4CPXc8efRmOTXGLek9bEMNc4WWS7GovbMRwd wndDwyCoTqXmqiaFPgeivpIg8CejmtmYrSeEWQo946pMXl1qaE0pRbq7FawOY3XqoOJm 3AQH5dqqhwNZosvzezdtgPzhJvCzTeQmX5mCxKR7fGi7+Uragsj+p3Lq4Tjgchwsa9WC 6XkrnU7touEZhKtVTgl/bgwDfbT8Mj0Eia1QxV1hFix6FfRH4Bm6jkj+h3n1N8QVSoyk gj8Q== X-Gm-Message-State: AOJu0Yy4OF4PyPhIFpFOSsgxj2jZQRlTrJO3wMvvMD/sAPZhVMd7tbq7 y78WX0mx1b2U/hqcS5ZrCtkguOEzdhIGn/m9Yj+bgaFTbNa5jqYFDmmc2Zdw6nV7NhwbYozLS8f g X-Google-Smtp-Source: AGHT+IEmW2poHiw7iUCvfD/PL0YJbRQCHPcLTvCRoZAEWaBidsgbxL9BDLPkn8LQoMKfNAhzPRLZnw== X-Received: by 2002:a05:6a00:130c:b0:6ed:6b11:4076 with SMTP id d2e1a72fcca58-702477e4893mr2232988b3a.12.1717187292266; Fri, 31 May 2024 13:28:12 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, apatel@ventanamicro.com, ajones@ventanamicro.com, conor@kernel.org, Daniel Henrique Barboza Subject: [PATCH v2 1/8] hw/riscv/virt.c: add address-cells in create_fdt_one_aplic() Date: Fri, 31 May 2024 17:27:52 -0300 Message-ID: <20240531202759.911601-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240531202759.911601-1-dbarboza@ventanamicro.com> References: <20240531202759.911601-1-dbarboza@ventanamicro.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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=dbarboza@ventanamicro.com; helo=mail-pf1-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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1717187454466100003 Content-Type: text/plain; charset="utf-8" We need #address-cells properties in all interrupt controllers that are referred by an interrupt-map [1]. For the RISC-V machine, both PLIC and APLIC controllers must have this property. PLIC already sets it in create_fdt_socket_plic(). Set the property for APLIC in create_fdt_one_aplic(). [1] https://lore.kernel.org/linux-arm-kernel/CAL_JsqJE15D-xXxmELsmuD+JQHZzx= GzdXvikChn6KFWqk6NzPw@mail.gmail.com/ Suggested-by: Anup Patel Fixes: e6faee65855b ("hw/riscv: virt: Add optional AIA APLIC support to vir= t machine") Signed-off-by: Daniel Henrique Barboza 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 4fdb660525..1a7e1e73c5 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -609,6 +609,8 @@ static void create_fdt_one_aplic(RISCVVirtState *s, int= socket, aplic_name =3D g_strdup_printf("/soc/aplic@%lx", aplic_addr); qemu_fdt_add_subnode(ms->fdt, aplic_name); qemu_fdt_setprop_string(ms->fdt, aplic_name, "compatible", "riscv,apli= c"); + qemu_fdt_setprop_cell(ms->fdt, aplic_name, "#address-cells", + FDT_APLIC_ADDR_CELLS); qemu_fdt_setprop_cell(ms->fdt, aplic_name, "#interrupt-cells", FDT_APLIC_INT_CELLS); qemu_fdt_setprop(ms->fdt, aplic_name, "interrupt-controller", NULL, 0); diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 3db839160f..c0dc41ff9a 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -118,6 +118,7 @@ enum { #define FDT_PLIC_ADDR_CELLS 0 #define FDT_PLIC_INT_CELLS 1 #define FDT_APLIC_INT_CELLS 2 +#define FDT_APLIC_ADDR_CELLS 0 #define FDT_IMSIC_INT_CELLS 0 #define FDT_MAX_INT_CELLS 2 #define FDT_MAX_INT_MAP_WIDTH (FDT_PCI_ADDR_CELLS + FDT_PCI_INT_CELLS + \ --=20 2.45.1