From patchwork Thu Dec 30 12:35:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 12701443 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 0E003C433F5 for ; Thu, 30 Dec 2021 13:01:35 +0000 (UTC) Received: from localhost ([::1]:45920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2v3m-0007YM-T7 for qemu-devel@archiver.kernel.org; Thu, 30 Dec 2021 08:01:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2ufo-0003ao-Ee for qemu-devel@nongnu.org; Thu, 30 Dec 2021 07:36:48 -0500 Received: from [2607:f8b0:4864:20::42a] (port=39455 helo=mail-pf1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2ufm-0003SH-9b for qemu-devel@nongnu.org; Thu, 30 Dec 2021 07:36:47 -0500 Received: by mail-pf1-x42a.google.com with SMTP id s15so21300337pfk.6 for ; Thu, 30 Dec 2021 04:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6KNcxB0lI+145naSOKpjow3XUCsQJZAnp5v4CWe5LiQ=; b=i/XLEi9gvP9RnOOUcndn4eoQFfHb7Lp2xSMNLauICR5/FWFTqT6q8dfVGDnWSg2j9x EkJUekUiK0coZ5hUvPcVwdavwZUcr2mAMl036in9LjFUMYM0+R7biWBbVmK0ImdYV++Z +Xm8OOW0++8J3O1d2RbfxSKDBoFz4wqPyJ3vshHGVtWEo0AIvNZu2+SHRWfhDwjdWRMI 4hub/BVIKyXA3u14GTQCLP+cDXnu2smPPs+GjIqZUJv8ZfZHBUSt5KRW7xuQiYydSG1w +QSrGtfg9Wqi+uRb4265/zJaOyVTPQtWGGULBCNTiMcST6evW+L0opF13JPYSuTB07gj Jy1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6KNcxB0lI+145naSOKpjow3XUCsQJZAnp5v4CWe5LiQ=; b=X9VL46+6TTDqeCbWvUgRpD6g064Ibpn0tCR/s6UjvqO2z3ODMazDcQZ3y/uX65WMsZ SIHFbFBSSEus2KP4lcMGj1T2gcZP3xQC29bu0+vOA//3pRuobNOEKgFsAShx34XEwA1K +2iDHc+g21DaQ6PHBhMdp1KiUVdpgMgHufpRId8unzPPg8ccJnLTx/7NjSbjBkW5vOFI I/NROPJXJlYNvNg7vV3hbF+2m7915EZ2heAbsKvCFvm0XpUwjIiWLDzQie6IysQRWAlw Y42YCJiEVKAFC0VWfkOQGRl9+zdJJwcPKhgun0F18ojf5P62e9DIAGCVQSn1EDmB5TvL tsmw== X-Gm-Message-State: AOAM532Wa9FHIlY/THP6uG69LpxfD28jLWBAGlbK9ot9AnDp2wCMQ/dG NKn2rOq0zUThGhanrJVEavVDaA== X-Google-Smtp-Source: ABdhPJzJwf3dkh3dhpoIpux70bsHIbxkE9En0c7Q4BEhtUqeAIMh05POl2dYt5TVhrO4aCSJ5l9gvg== X-Received: by 2002:aa7:868d:0:b0:4ba:e919:b2f1 with SMTP id d13-20020aa7868d000000b004bae919b2f1mr31130673pfo.31.1640867805001; Thu, 30 Dec 2021 04:36:45 -0800 (PST) Received: from localhost.localdomain ([171.61.71.9]) by smtp.gmail.com with ESMTPSA id a3sm28588348pfv.47.2021.12.30.04.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 04:36:44 -0800 (PST) From: Anup Patel To: Peter Maydell , Palmer Dabbelt , Alistair Francis , Sagar Karandikar Subject: [PATCH v6 16/23] hw/riscv: virt: Use AIA INTC compatible string when available Date: Thu, 30 Dec 2021 18:05:32 +0530 Message-Id: <20211230123539.52786-17-anup@brainfault.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211230123539.52786-1-anup@brainfault.org> References: <20211230123539.52786-1-anup@brainfault.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42a (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::42a; envelope-from=anup@brainfault.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no 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: , Cc: qemu-riscv@nongnu.org, Anup Patel , qemu-devel@nongnu.org, Alistair Francis , Atish Patra , Bin Meng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Anup Patel We should use the AIA INTC compatible string in the CPU INTC DT nodes when the CPUs support AIA feature. This will allow Linux INTC driver to use AIA local interrupt CSRs. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Alistair Francis Reviewed-by: Frank Chang --- hw/riscv/virt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 3af074148e..720641b1dd 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -211,8 +211,17 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int socket, qemu_fdt_add_subnode(mc->fdt, intc_name); qemu_fdt_setprop_cell(mc->fdt, intc_name, "phandle", intc_phandles[cpu]); - qemu_fdt_setprop_string(mc->fdt, intc_name, "compatible", - "riscv,cpu-intc"); + if (riscv_feature(&s->soc[socket].harts[cpu].env, + RISCV_FEATURE_AIA)) { + static const char * const compat[2] = { + "riscv,cpu-intc-aia", "riscv,cpu-intc" + }; + qemu_fdt_setprop_string_array(mc->fdt, intc_name, "compatible", + (char **)&compat, ARRAY_SIZE(compat)); + } else { + qemu_fdt_setprop_string(mc->fdt, intc_name, "compatible", + "riscv,cpu-intc"); + } qemu_fdt_setprop(mc->fdt, intc_name, "interrupt-controller", NULL, 0); qemu_fdt_setprop_cell(mc->fdt, intc_name, "#interrupt-cells", 1);