Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp80668rdb; Tue, 19 Dec 2023 09:54:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8ZRwfspCue6qP/TjzIR1aMyKrfX/LNziJDmmzRPataJ4XPQPAH+nhzJA2ZL15z0q3g2Wn X-Received: by 2002:a05:6870:2386:b0:203:55f0:ca9f with SMTP id e6-20020a056870238600b0020355f0ca9fmr5028824oap.50.1703008461002; Tue, 19 Dec 2023 09:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703008460; cv=none; d=google.com; s=arc-20160816; b=NLKUVz22exOJMNXPMINsmCMyd2wxrq+l4dg2yc4odX3GHsVU2r1Qz3iOjgODISVgfn cIiSZKZiW/gqul9GALYEK6fIHSDQLhLzUA0wXz4opMEDUq6ZJyLx5wc+/IdGaUGyEd7X QPXcg0hlILQW/EpG+ntJhDfU2O5j2WQxPEBoPZqqrHJYEEQCVsl8drkRoLw9SwQ2EIBh wxOQ82hNk8R7vzvMGPT8Z7TNQFxlDNEMlGuK0UwpAPnmE9O7tgrGOOKwhGqNTQZf7yzB XUaBs6ce/7Gg961jv5kBXW7zrfbgatJQt+ZhNCeVbZr5Yu0QqNBnoZ8W/EOXe6oQonY7 lRDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XaVzwwT2ecLOtMDBM5TdFJiJ9XdFZ6MUpboDwIj/4ug=; fh=G3MkS2cP7FkeH+7kxy0LRzNpJgfwnUWZciURRBohxGI=; b=Jus72TlpnbEJh9JzhJgMlQDBIYGbT3fLW1Ybirq3lObBlX0lhAfOrA46RYZQL1xSya 5qT0RkJj7P+FocUG5kFxObeDxJE95h0agg/r7apADryU9LS307Xvr5c/qsdkcHg4Wciw t7a5TKeNaGmVBx7p0xLMpiVNbvDW54aAn3g3JizkFtNt+6pFd7jCfYrqG2xioENOwq1g ShZh+5oGjJuXh/2+A+SHDLgChOOtHMANYdfcLjsR4bUGQpRuYUUuurP67tFIDIp0AMIM q1CBHGAnnbvFGqQGohTLtoIRxhDZDv3dRPu8jWJ5F9aSip9byZFnN9k5aFkS5xu39THj ZahA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OwdMO+Dy; spf=pass (google.com: domain of linux-kernel+bounces-5728-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5728-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u5-20020a634705000000b005cd7dd81164si6301099pga.222.2023.12.19.09.54.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:54:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5728-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OwdMO+Dy; spf=pass (google.com: domain of linux-kernel+bounces-5728-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5728-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4D9AAB2389C for ; Tue, 19 Dec 2023 17:52:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD1C941209; Tue, 19 Dec 2023 17:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="OwdMO+Dy" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D067541212 for ; Tue, 19 Dec 2023 17:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d3aa0321b5so25338965ad.2 for ; Tue, 19 Dec 2023 09:47:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1703008025; x=1703612825; darn=vger.kernel.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=XaVzwwT2ecLOtMDBM5TdFJiJ9XdFZ6MUpboDwIj/4ug=; b=OwdMO+DyVotX9tmk1xRIsraAElYFlr5ThzaBzSh7oPVDYa8hsVFFb6066ici19XRHg Y6WBeMXC2BPYDoydWlpIfBi4CgE/GG5YE9CDZHsxTlXlACfJQ8IEDxBwvrcc6hDl+gpP +eNPO7GMP+ddTzRoRXZqfLmhnFBJN6IOVi+mCM4crUVLjXyCkuEi38cW/8eHyEfZaVe5 wCsfexqpWND6NugDDnaHgMaw5FZnfswZAnCRygZ64HnkwiNNvktxEmB5D59MlXtx4g4M XI1VbKpv1GGbtTG1FwOusSamDObMBU90lQ4FW/j218mKBgCFCfWDlO0yYAiUworYFrBj xmXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703008025; x=1703612825; 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=XaVzwwT2ecLOtMDBM5TdFJiJ9XdFZ6MUpboDwIj/4ug=; b=GkQ+KrfMgD8BiycVO8PvZyF/7TZq3QiHjqsQGryOPJyCcuZudn4PnN7fyCiKWkB0mZ tc82XSg/nqkTuMLEDvwFXnhcfw1QifIZrGgxXi07pYuFokNHzRyHRYe5mF9DdXA9HUcN tSsZM9N2GtJeUUkSQfexPvOI7Au4mjRR+9NPmANQcDaTLouU7wQYM8IYyfHfIZc2LcP0 lM7itPgW+cOu1JzYJa8lQ0r4DMfjZBTXgFeGnIA01I/0eMmHeso2CFqgOsg+y1Xqfco3 JRAL+OkT+bULNwCs0upAN474OzcWhLk2qgbkVV3UhenLkO/xYwggQRyj0dVADgsCb+xc VCpw== X-Gm-Message-State: AOJu0YzpnSUSZD1YXWQOEJI17NZHHkxClP5yqz9QXVxjgmV8l2y2Qtz6 PIcF9VOFSZ6rltt6JbIL5kTQPMafTSFsJEh6REM= X-Received: by 2002:a17:903:2347:b0:1d3:c730:f0a2 with SMTP id c7-20020a170903234700b001d3c730f0a2mr3728002plh.118.1703008025154; Tue, 19 Dec 2023 09:47:05 -0800 (PST) Received: from sunil-pc.Dlink ([106.51.188.200]) by smtp.gmail.com with ESMTPSA id n16-20020a170903111000b001d3320f6143sm14453015plh.269.2023.12.19.09.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:47:04 -0800 (PST) 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 Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Anup Patel , Thomas Gleixner , Bjorn Helgaas , Haibo Xu , Conor Dooley , Andrew Jones , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Marc Zyngier , Sunil V L Subject: [RFC PATCH v3 16/17] ACPI: RISC-V: Create PLIC platform device Date: Tue, 19 Dec 2023 23:15:25 +0530 Message-Id: <20231219174526.2235150-17-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231219174526.2235150-1-sunilvl@ventanamicro.com> References: <20231219174526.2235150-1-sunilvl@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 | 19 +++++++++++++++++++ 3 files changed, 21 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 d08a851ab6dc..f14ea43b0178 100644 --- a/drivers/acpi/riscv/irq.c +++ b/drivers/acpi/riscv/irq.c @@ -148,3 +148,22 @@ 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, + plic->gsi_base, + plic->num_irqs, + header); +} + +void __init riscv_acpi_plic_platform_init(void) +{ + acpi_table_parse_madt(ACPI_MADT_TYPE_PLIC, plic_parse_madt, 0); +} -- 2.39.2