Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp430897lqp; Wed, 22 May 2024 08:39:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJuvudhmqMDknjhhz5DfhnRm4+SRhfqW3IvEdur12UpO6eobR5X1V5/R3hLUvyeAvH2p6xGc+s20LRe9N9nlF3+zg/9QGVEi/+i0yTFg== X-Google-Smtp-Source: AGHT+IF2AIrBkwXSyffz7iyHpbadAZRGkr+jiTQs90UDpVQvvWTAj/O5HrjJfPN2qOn2ZcuzvfxF X-Received: by 2002:a05:6a20:dd82:b0:1af:59b9:e3ed with SMTP id adf61e73a8af0-1b1f8847822mr2129235637.5.1716392376199; Wed, 22 May 2024 08:39:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716392376; cv=pass; d=google.com; s=arc-20160816; b=OhAS5d9VqRH+SQ2h4cli61n5+zxMcyrpNXUz2p7e9t54PUfSYCRc432bzC4+ZpRbIH kP0hsMi2521uZBTGY1CCY4nlCH/LtraQ2y5S34cfnCW4hMs0XfzZsEU+NiG6BIItKhGj l12ttdckfrhIN6cQJiGviZoq1Yz8ZAPzt0CLrvfIdWBgEUfenCyQEtIjAXuZD66PnS2Y uGhgz0UC5F2qwv5UFYTwIRLTXSyJQHGV09tvXeRRYwo9MdfaYlFtKGwctCLMeHTnMIgO H62TcFnrUrvNoGU43acDeNnSla1rhsAMHJ233ssF3Ki9QoE5QqaTLB5S+KPCaV8jHrPW eNww== ARC-Message-Signature: i=2; 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=4hOXQ/41pPcOGvj8BDEvVxZO6mfZsuadhgYq8hgiByM=; fh=RQxXgueo2Nhg3TeJ+ib8ECXJcxyq5wG8qt1ZHxVORJA=; b=h6b7Fg84ThT5r6PQga39Non0iwMEasz2FAM66F1ZfiEBi89RoTqtobWfQeHIAH3XQ2 gnAyFF8unFbjS33Z/i7RojwACInLH+mKym/y8xlWBt5V3MwhLn/mWdyvvLDWkeRnb/KF I6TOAJ9Dr9QOpz+mwJpan1QIdAS7mTI8PH2U0/8YIf+s+bfdFyRmbnMkskHjKzqXVxh3 f7kB7lCPhasSS2jjqnClGdX90eJAeCYY033Z/FfvEYaOHQjWWULaAi7FbqC6rKreShmy DLTPUnmTCpU7u5+dnH+v4tDINzwLItCl/xXI6pYKuu9mZ9sxzUEZqINTgcUr/lUvkXxi 5ljw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XzMcyeof; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-186443-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186443-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-671b10b2ddesi3432499a12.716.2024.05.22.08.39.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 08:39:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186443-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XzMcyeof; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-186443-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186443-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 641ACB20D4F for ; Wed, 22 May 2024 15:39:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BBB181734; Wed, 22 May 2024 15:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XzMcyeof" Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 0FDFE7D08D; Wed, 22 May 2024 15:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716392365; cv=none; b=oWrOnTukd86i1QLVmTWrFCKFhBolUcOaJqstH1Y4aCS3xQDr1+qZjRubu14lGo519W24UvazJt1qMRM57m0g8X4UVcHcNovU2ZULJ+onhh77tRcBR9NOrM7pdikPoGf9962+JZyHaq8hPU9rKFaUbZdQ4ycPQryCMo2V/pKaBfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716392365; c=relaxed/simple; bh=bIvGx4SIxZhN89NK9LT/bYYBJgV8m+XnDF86R5TkYqA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c4VF0hm0yXWuhugXmZplPUuWO5tUoJfk4XHEt4F/1TRV2/MnLNgfBOjXI3H8TuOM+E7ySXmK9aqlMuWoy7G6E+ps9yGJsIsmPuvtJ5SGAWKh55JY0uGZ3yZ70YyrZweXx7BALJqExbGTOsMRoqR3ZEVjSMTbQzWKLQisDik4iXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XzMcyeof; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2ba0cb1ea68so1313967a91.0; Wed, 22 May 2024 08:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716392363; x=1716997163; 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=4hOXQ/41pPcOGvj8BDEvVxZO6mfZsuadhgYq8hgiByM=; b=XzMcyeofhtaIUT9mf44FzBms3AtEHG6CRsvspHBmL8Q05kcaBYhShHlq0RxyU5gFZU W1FJ3xz3v4rDctHUcGPTO8UR/38hsM5JScQ9uW+jWS0snXTjpFL6VsUo+/vyPVihu74O myPIoBRQcuPT+XjGCDvtC8dWPUScdP9Qy24bGhSbwIhtUaL4y1BabwVQZOEnVhYtOVcm Wq3O1MjM0qwhL5g0uTg1KYQzlf6HrdO26iMHXVjuInaeOfPgmVlwzN8m18WTWUEG+ok2 clC/dtwRG6I01mzOQKLtI7sY/AX/baaaBdjuiKFkm5LCRvPw5JyoTw4c39WhbndSf3ix MtTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716392363; x=1716997163; 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=4hOXQ/41pPcOGvj8BDEvVxZO6mfZsuadhgYq8hgiByM=; b=roXPEL2g9zgj3yOG6Gl1JOvRpT/cC0DlXNA6eZD6lBw+V1h3VnUMNuK2qhk4z68Z/O TJ4bv3kt4YuE7iVaOXHhkN7jtLxu9IDN3PnJpKcAVrUY4MB4sPq19bPJPws3byjomdl6 okVQnZs/OhbSvs9jDK08wQ9E0EQp/qGuiAwhYKThnAqJmB5CAIzSJZS0/GWhcLRn/AUV eQ5wJ8qSecoTQOD1BesLekLrxxOfOh3hHS6StCeUUkqQF9HqUMkQGpIJFRDMCd6fNgMq qEwLgTHArSYeQo5HivnY/W/Uya9vLUeRODsnfG+7G/+BNpm+JdBRHVtCTP5QFOlDzXse w5Mg== X-Forwarded-Encrypted: i=1; AJvYcCV/RRmPbw2Cv/wGT8e2RfMtE/5WezZIXFmiUZ7KVoz8TAuEpoiB4RzZK2owGJuIxYMR1GHFnJdr0loTakjUnhOFkcrF/T2hNwi2V01D4kSjc3arS7NgUB4oEZN9rO2ZIdorK5mvourBJA== X-Gm-Message-State: AOJu0YwUZ6mlLzu8rBvqS35RYu/pM5Tf5WENQm+rgPRQa+2krd1bhqq0 qTf3ra8MgPBG7taWqdBgY3XS0PySUhloWdB4Ftdvd4sGW50rTVME X-Received: by 2002:a17:90a:2dcb:b0:2ae:78cd:59fe with SMTP id 98e67ed59e1d1-2bd9f5a1821mr2571771a91.31.1716392363083; Wed, 22 May 2024 08:39:23 -0700 (PDT) Received: from localhost.localdomain ([223.178.84.74]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2b628ea59absm25574077a91.47.2024.05.22.08.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 08:39:22 -0700 (PDT) From: Kanak Shilledar X-Google-Original-From: Kanak Shilledar To: Cc: Kanak Shilledar , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Samuel Holland , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: riscv,cpu-intc: convert to dtschema Date: Wed, 22 May 2024 21:08:36 +0530 Message-Id: <20240522153835.22712-2-kanakshilledar111@protonmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240522153835.22712-1-kanakshilledar111@protonmail.com> References: <20240522153835.22712-1-kanakshilledar111@protonmail.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 Convert the RISC-V Hart-Level Interrupt Controller (HLIC) to newer DT schema, Created DT schema based on the .txt file which had `compatible`, `#interrupt-cells` and `interrupt-controller` as required properties. Changes made with respect to original file: - Changed the example to just use interrupt-controller instead of using the whole cpu block - Changed the example compatible string. Signed-off-by: Kanak Shilledar --- Changes in v3: - Remove reference to `interrupt-controller` in `riscv/cpus.yaml`. --- Changes in v2: - Update the maintainers list. - Add reference to `interrupt-controller` in `riscv/cpus.yaml`. - Update compatible property with the reference in `cpus.yaml`. - Include description for '#interrupt-cells' property. - Change '#interrupt-cells' property to have `const: 1` as per the text binding. - Fixed the warning thrown by `/renesas/r9a07g043f01-smarc.dtb`. --- .../interrupt-controller/riscv,cpu-intc.txt | 52 ------------- .../interrupt-controller/riscv,cpu-intc.yaml | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 52 deletions(-) delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt deleted file mode 100644 index 265b223cd978..000000000000 --- a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt +++ /dev/null @@ -1,52 +0,0 @@ -RISC-V Hart-Level Interrupt Controller (HLIC) ---------------------------------------------- - -RISC-V cores include Control Status Registers (CSRs) which are local to each -CPU core (HART in RISC-V terminology) and can be read or written by software. -Some of these CSRs are used to control local interrupts connected to the core. -Every interrupt is ultimately routed through a hart's HLIC before it -interrupts that hart. - -The RISC-V supervisor ISA manual specifies three interrupt sources that are -attached to every HLIC: software interrupts, the timer interrupt, and external -interrupts. Software interrupts are used to send IPIs between cores. The -timer interrupt comes from an architecturally mandated real-time timer that is -controlled via Supervisor Binary Interface (SBI) calls and CSR reads. External -interrupts connect all other device interrupts to the HLIC, which are routed -via the platform-level interrupt controller (PLIC). - -All RISC-V systems that conform to the supervisor ISA specification are -required to have a HLIC with these three interrupt sources present. Since the -interrupt map is defined by the ISA it's not listed in the HLIC's device tree -entry, though external interrupt controllers (like the PLIC, for example) will -need to define how their interrupts map to the relevant HLICs. This means -a PLIC interrupt property will typically list the HLICs for all present HARTs -in the system. - -Required properties: -- compatible : "riscv,cpu-intc" -- #interrupt-cells : should be <1>. The interrupt sources are defined by the - RISC-V supervisor ISA manual, with only the following three interrupts being - defined for supervisor mode: - - Source 1 is the supervisor software interrupt, which can be sent by an SBI - call and is reserved for use by software. - - Source 5 is the supervisor timer interrupt, which can be configured by - SBI calls and implements a one-shot timer. - - Source 9 is the supervisor external interrupt, which chains to all other - device interrupts. -- interrupt-controller : Identifies the node as an interrupt controller - -Furthermore, this interrupt-controller MUST be embedded inside the cpu -definition of the hart whose CSRs control these local interrupts. - -An example device tree entry for a HLIC is show below. - - cpu1: cpu@1 { - compatible = "riscv"; - ... - cpu1-intc: interrupt-controller { - #interrupt-cells = <1>; - compatible = "sifive,fu540-c000-cpu-intc", "riscv,cpu-intc"; - interrupt-controller; - }; - }; diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml new file mode 100644 index 000000000000..c9c79e0870ff --- /dev/null +++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/riscv,cpu-intc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V Hart-Level Interrupt Controller (HLIC) + +description: + RISC-V cores include Control Status Registers (CSRs) which are local to + each CPU core (HART in RISC-V terminology) and can be read or written by + software. Some of these CSRs are used to control local interrupts connected + to the core. Every interrupt is ultimately routed through a hart's HLIC + before it interrupts that hart. + + The RISC-V supervisor ISA manual specifies three interrupt sources that are + attached to every HLIC namely software interrupts, the timer interrupt, and + external interrupts. Software interrupts are used to send IPIs between + cores. The timer interrupt comes from an architecturally mandated real- + time timer that is controlled via Supervisor Binary Interface (SBI) calls + and CSR reads. External interrupts connect all other device interrupts to + the HLIC, which are routed via the platform-level interrupt controller + (PLIC). + + All RISC-V systems that conform to the supervisor ISA specification are + required to have a HLIC with these three interrupt sources present. Since + the interrupt map is defined by the ISA it's not listed in the HLIC's device + tree entry, though external interrupt controllers (like the PLIC, for + example) will need to define how their interrupts map to the relevant HLICs. + This means a PLIC interrupt property will typically list the HLICs for all + present HARTs in the system. + +maintainers: + - Palmer Dabbelt + - Paul Walmsley + +properties: + compatible: + oneOf: + - items: + - const: andestech,cpu-intc + - const: riscv,cpu-intc + - const: riscv,cpu-intc + + interrupt-controller: true + + '#interrupt-cells': + const: 1 + description: | + The interrupt sources are defined by the RISC-V supervisor ISA manual, + with only the following three interrupts being defined for + supervisor mode: + - Source 1 is the supervisor software interrupt, which can be sent by + an SBI call and is reserved for use by software. + - Source 5 is the supervisor timer interrupt, which can be configured + by SBI calls and implements a one-shot timer. + - Source 9 is the supervisor external interrupt, which chains to all + other device interrupts. + +required: + - compatible + - '#interrupt-cells' + - interrupt-controller + +additionalProperties: false + +examples: + - | + interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; -- 2.34.1