Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2639837rwo; Thu, 3 Aug 2023 12:27:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHMOsbmuwFer+lnPnlEcXYux4ldPRCaMw9gZrMPYmn/XG1l5u1bqtJHr6T6WwpnlXFLEOnM X-Received: by 2002:a05:6a00:15d3:b0:67e:bf65:ae61 with SMTP id o19-20020a056a0015d300b0067ebf65ae61mr22562885pfu.28.1691090851756; Thu, 03 Aug 2023 12:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691090851; cv=none; d=google.com; s=arc-20160816; b=M0wqtgti1NSVqjp10e6No5TSAevTFkkFIsbcHjJ/mEnVs7gXtyL8D9hztNu5IpLgG/ z57bN/JsW0BfstEAYnzkBm4UVCCxdEA4v8L4wTLiDWPIvW9F7gtF7ESMhrmaapOsZ5xT iBgzevkLOA5H1tFPVjarzyl70eUzSHA0waGnqMRjDGel8WBTbbECD4eHafpVbHNx/DeT edTsFXcOtCUQWF0G0rBU2JHt2yGM2iiXQ8Wsy6xoto5fxeaTQKbviRdG/T5khFE1s0r4 FKfyH1qpLpfMzYsDgkxOvf68ubIj8BcrKLpVAb/Q5V+Dw01J2usRDkbah32vTFpMLsV7 aPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9aQz/o5NvlReZUl/stpeRs4o5FY0c8qnUYDCfHqNmJI=; fh=dzn7FZXuyjRD/SsADoLVmv8ajN6bypv0shpvYBNDmUc=; b=MRBUyIEKpsDBQ/iEwSLOWLnRQQ14e64LqAfIGif2fkxO5exToRE7cpo3xoDZQeQwp6 ZUWQOUN/hVKZ/OI81AdF0CY/G6G1cJ0Ue1YvIGwkTYVRgXvIe/6oKJzD1cX5Y1OQq11e YO0P0EhbVjLwd8pSg4w1gsXGkSWzL2Naf0cYcIjMVrZPA6ZP1dbxiGhXnZDSM2gMaJUK Zdu2Q7wosWM04fsQtKK119UkeYoGS/Y0/daQHgmgetU75Z2EPdO5VQnJ26sSWpn92pn9 Ye57xLdYk1nMC+prg4E/ITYOb2DrWK1eDiMr7j08omyZLx9KppLqxx80JWzZXw8cksvb Pwjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Yv3oRH7T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cd10-20020a056a00420a00b0068739763d1fsi400361pfb.373.2023.08.03.12.27.11; Thu, 03 Aug 2023 12:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Yv3oRH7T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbjHCSDR (ORCPT + 99 others); Thu, 3 Aug 2023 14:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235256AbjHCSCV (ORCPT ); Thu, 3 Aug 2023 14:02:21 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1ECA420C for ; Thu, 3 Aug 2023 11:01:29 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-686e0213c0bso897541b3a.1 for ; Thu, 03 Aug 2023 11:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1691085686; x=1691690486; 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=9aQz/o5NvlReZUl/stpeRs4o5FY0c8qnUYDCfHqNmJI=; b=Yv3oRH7T1TZNQw/AeEOc/wdAwvfBHh5qCQDTqqhRRIWLN2RT7duj6j3Mlz5B+tyUjx DwzXxTjoAWH+iw6CkKfwMxF9xCniQjo3B09L5BaQ+m3yDEsvvlfRGxAUpVXc7dZmfqkz PN5+8DYtk9mthHfXcWzvd40WNmLxpaQLT+X3GYJHhIU0xy+P4PfNU1GlwdTTN0c2vXWS N5M/tFDrDNAY9aGtxjAy1r+U43wKUASBkf3zWtuZ0PK/OlWurnWRvhkcieTUH/K57kZ9 QHExlMok+1N1kt3iHzoySeHMoWERDl2+R1ayM9E29ohmdQ7YVT4UT939xn3e7d7QWGc0 3iwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691085686; x=1691690486; 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=9aQz/o5NvlReZUl/stpeRs4o5FY0c8qnUYDCfHqNmJI=; b=TT2135MH/mxu6k6XwnC3noIZW4kL1nKjWSGBwvY/xZFgQHvQCTx94tXl50/6l0Cvr+ vgox/nxdcHz7BYuO1Qb96yK6Mm4espQvU02k7kqofnzEGOKdvSlEWTnoEIosbF0f8I9k M6460pB4aO7omhUHHDx0Fx3tsLEqRj/lI5Bno+NEKuLv0HbhjFF6/5Z4OB1ac+7ovhWH oLLnWYgKlyKm8NHMKUrI7sdjVzddPZdUkIcQpS33YqehJ6jRywNukI+UD8Lwe7J26WEB znAe7CuxXECRM8NxLmL/AITRyyl3cVT+IftaIOg2CIZYfUd7RfM1Q6Z/0r6uBSwxCzLH HXaQ== X-Gm-Message-State: ABy/qLbq3jVC5LqFM9hHWYho7ZnAbI3Y53XNzENKWHzSlIBKrTDhAIHX 2iFQX4LajUSxVq+DtlQ94lWveA== X-Received: by 2002:a05:6a20:3d91:b0:132:c07c:f042 with SMTP id s17-20020a056a203d9100b00132c07cf042mr22166693pzi.15.1691085686344; Thu, 03 Aug 2023 11:01:26 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.190.143]) by smtp.gmail.com with ESMTPSA id s8-20020aa78d48000000b0065a1b05193asm134952pfe.185.2023.08.03.11.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 11:01:26 -0700 (PDT) From: Sunil V L To: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , Daniel Lezcano , Thomas Gleixner , Anup Patel , Marc Zyngier , Bjorn Helgaas , Robert Moore , Haibo Xu , Andrew Jones , Conor Dooley , Atish Kumar Patra , Sunil V L Subject: [RFC PATCH v1 15/21] ACPI: RISC-V: Create IMSIC platform device Date: Thu, 3 Aug 2023 23:29:10 +0530 Message-Id: <20230803175916.3174453-16-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230803175916.3174453-1-sunilvl@ventanamicro.com> References: <20230803175916.3174453-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MSI controller functionality of the RISC-V IMSIC is probed as a platform device by the driver. So, create the IMSIC platform device if the IMSIC was discovered in MADT during early IMSIC driver probe. Signed-off-by: Sunil V L --- drivers/acpi/riscv/init.c | 2 ++ drivers/acpi/riscv/init.h | 4 ++++ drivers/acpi/riscv/irqchip.c | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 drivers/acpi/riscv/init.h diff --git a/drivers/acpi/riscv/init.c b/drivers/acpi/riscv/init.c index b5807bbdb171..be61c08ea385 100644 --- a/drivers/acpi/riscv/init.c +++ b/drivers/acpi/riscv/init.c @@ -6,7 +6,9 @@ */ #include +#include "init.h" void __init acpi_riscv_init(void) { + riscv_acpi_imsic_platform_init(); } diff --git a/drivers/acpi/riscv/init.h b/drivers/acpi/riscv/init.h new file mode 100644 index 000000000000..a2f72bb294d3 --- /dev/null +++ b/drivers/acpi/riscv/init.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#include + +void __init riscv_acpi_imsic_platform_init(void); diff --git a/drivers/acpi/riscv/irqchip.c b/drivers/acpi/riscv/irqchip.c index 6e15d45cb229..ca96bf109cf7 100644 --- a/drivers/acpi/riscv/irqchip.c +++ b/drivers/acpi/riscv/irqchip.c @@ -9,7 +9,10 @@ #include #include #include +#include +#include #include +#include "../../../drivers/pci/pci.h" struct riscv_irqchip_list { struct fwnode_handle *fwnode; @@ -101,3 +104,23 @@ struct fwnode_handle *acpi_riscv_get_msi_fwnode(struct device *dev) { return imsic_acpi_fwnode; } + +void __init riscv_acpi_imsic_platform_init(void) +{ + struct platform_device *pdev; + int ret; + + if (!acpi_riscv_get_msi_fwnode(NULL)) { + pci_no_msi(); + return; + } + + pdev = platform_device_alloc("riscv-imsic", 0); + if (!pdev) + return; + + pdev->dev.fwnode = acpi_riscv_get_msi_fwnode(NULL); + ret = platform_device_add(pdev); + if (ret) + platform_device_put(pdev); +} -- 2.39.2