From patchwork Wed Oct 25 20:23:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 13436751 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 73BFCC07545 for ; Wed, 25 Oct 2023 20:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zs94pR/iRq0ywlarH4qNxom7wJZtcw+ZvVa6EStH3ts=; b=gcL8WzV9padjAE Ciejozg9xoNFyZIq1LsK6quEbkt10hJLxvHGmJjp2Vz44MMNQ/vtmO1ST4QQTby0fY2NFNXCgCTUS JFmIZPi6MiTKXZPB67OmWa4eoNbW3GtTA8A/KPcYI3esMF09KXVDsiUpdIUluhNyT3wBPyKKKXxru kgEw/ci6bECfkKPRJqLDBAEGjZ7uM3fczsM0/9PodHZ0TCevYcOADCBE4/iakAq37+VXzO5u/kFqs djglkWuuLA/Odp2v7D2hEm2RpcTy080hUfYMcq6Bmzq8ZP1XIpBWZ76OVseeiqCdz+/hAmz9WhHO8 jd0uxD21trfZDhIpTB+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvkTG-00D4qv-1W; Wed, 25 Oct 2023 20:27:18 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvkSB-00D3uT-2V for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2023 20:26:17 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b1e46ca282so131658b3a.2 for ; Wed, 25 Oct 2023 13:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698265570; x=1698870370; darn=lists.infradead.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=j0XhMD4JA6OaCaDrqm344212wQ/hTWt0yHku4ySQPd8=; b=QxjVKR0Nhbd7x7s9D0Y3jeyfKPB/6mEwv/WGUvzQ3GaOvMOeCnT6/FH1xQTG3EUflb tYUxKW49qAt+CmarwvPaKhrMjfe3uT+ZNBR9GHEVq6Ca0gYqysZQzymUy+yfhvnvY3dF 4g2lJbHrSqyd/AkSQzEeVzB0qPI5ViSTx4AhoTJVDDnMK1AxXkduVpcywMAbz9KNRpHC sfR6FGclxQwhLBfC2YA3X1dgGJFlLxGODomGKFA+c57ZcHWtpsM75xlE1BJKFb21m/oc 2J9Vgk1dDB4Uf5SQLlrqMMXi40mhjLGeyQ9Nx2tpQtREr3kcUPyxCeKP5WmbTHQUquRt NmlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698265571; x=1698870371; 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=j0XhMD4JA6OaCaDrqm344212wQ/hTWt0yHku4ySQPd8=; b=mYn+qTVLRjFFUqz3MmoLSNbOAn1Ns3Iq4f5//z1UDJ31AkLLwXuCr8+jF6nrfORNjq sbHJawUb6Wic+laIzx3pgES3ncQr/gzwZ/a7aoAnOPWIiyrXKv8n1N7jhgRroS0SCBoO ht7JvUO0DH4Ss2lCjtDHvUCftgAimHHqI/OSjaNRHLTztQkdo6v0jYRYghHdiMPlNOdi 7kPCn/FPXHBp79CMF9I2f3XRAmZVYklVaHaHjPWE9JtuiTt3SSHdsWVIRf1Go99dAVEd ABQLxTDgDfiCln4xpoL5NWU6IX7vydXZIzyJxOtITsxHGbTYpBSgUGwzFxDr4aN2hAJ1 Im3g== X-Gm-Message-State: AOJu0YzCLQpa8iQPo+gtW+48XLXZKLGF719U3xQ2hbVlM94C7t73yL3R xmd3rJX0OlRf0s15IIUKCLPLE4e4fauV4lc5LZfwHg== X-Google-Smtp-Source: AGHT+IFjlmAHmkBC51cPzJaQWPRY6g5oe+6V9CmrTCMV9Y5zgvaJjhr+jA6O8yL6wxa5uTMIhaBuRw== X-Received: by 2002:a05:6a00:15cf:b0:6b1:b5c4:a8b0 with SMTP id o15-20020a056a0015cf00b006b1b5c4a8b0mr19858459pfu.23.1698265570741; Wed, 25 Oct 2023 13:26:10 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id y3-20020aa79423000000b006b84ed9371esm10079590pfo.177.2023.10.25.13.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:26:10 -0700 (PDT) From: Sunil V L To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Conor Dooley , Andrew Jones , Atish Kumar Patra , Haibo Xu , Sunil V L Subject: [RFC PATCH v2 21/21] ACPI: RISC-V: Create PLIC platform device Date: Thu, 26 Oct 2023 01:53:44 +0530 Message-Id: <20231025202344.581132-22-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231025202344.581132-1-sunilvl@ventanamicro.com> References: <20231025202344.581132-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231025_132611_830834_65889462 X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since PLIC needs to be a platform device, probe the MADT and create platform devices for each PLIC in the system. Signed-off-by: Sunil V L --- drivers/acpi/riscv/init.c | 1 + drivers/acpi/riscv/init.h | 1 + drivers/acpi/riscv/irq.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/drivers/acpi/riscv/init.c b/drivers/acpi/riscv/init.c index e7eff7ab1474..c6fd4097e8ae 100644 --- a/drivers/acpi/riscv/init.c +++ b/drivers/acpi/riscv/init.c @@ -11,4 +11,5 @@ void __init acpi_riscv_init(void) { riscv_acpi_aplic_platform_init(); + riscv_acpi_plic_platform_init(); } diff --git a/drivers/acpi/riscv/init.h b/drivers/acpi/riscv/init.h index 17bcf0baaadb..b4b305d83b3a 100644 --- a/drivers/acpi/riscv/init.h +++ b/drivers/acpi/riscv/init.h @@ -3,3 +3,4 @@ void __init riscv_acpi_imsic_platform_init(void); void __init riscv_acpi_aplic_platform_init(void); +void __init riscv_acpi_plic_platform_init(void); diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c index fbccecdcbf8b..90b0738e2b9f 100644 --- a/drivers/acpi/riscv/irq.c +++ b/drivers/acpi/riscv/irq.c @@ -104,3 +104,17 @@ void __init riscv_acpi_aplic_platform_init(void) { acpi_table_parse_madt(ACPI_MADT_TYPE_APLIC, aplic_parse_madt, 0); } + +static int __init plic_parse_madt(union acpi_subtable_headers *header, + const unsigned long end) +{ + struct acpi_madt_plic *plic = (struct acpi_madt_plic *)header; + + return irqchip_add_platform_device("riscv-plic", plic->id, plic->base_addr, + plic->size, header); +} + +void __init riscv_acpi_plic_platform_init(void) +{ + acpi_table_parse_madt(ACPI_MADT_TYPE_PLIC, plic_parse_madt, 0); +}