From nobody Wed Feb 11 11:32:10 2026 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XzMcyeof" 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-Google-Smtp-Source: AGHT+IEdG/YJtyj4V/iHZoT6nPh92OTkLumJkQga+1EKiYtW1m9PNOuKN/IZvV+kazbpVt6rlj0rOg== 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Conor Dooley --- 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,c= pu-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 ea= ch -CPU core (HART in RISC-V terminology) and can be read or written by softwa= re. -Some of these CSRs are used to control local interrupts connected to the c= ore. -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 exte= rnal -interrupts. Software interrupts are used to send IPIs between cores. The -timer interrupt comes from an architecturally mandated real-time timer tha= t is -controlled via Supervisor Binary Interface (SBI) calls and CSR reads. Ext= ernal -interrupts connect all other device interrupts to the HLIC, which are rout= ed -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 t= ree -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 HA= RTs -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 b= eing - 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 o= ther - 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 =3D "riscv"; - ... - cpu1-intc: interrupt-controller { - #interrupt-cells =3D <1>; - compatible =3D "sifive,fu540-c000-cpu-intc", "riscv,cpu-intc"; - interrupt-controller; - }; - }; diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,c= pu-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.yam= l# +$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 connec= ted + 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. Sin= ce + the interrupt map is defined by the ISA it's not listed in the HLIC's de= vice + tree entry, though external interrupt controllers (like the PLIC, for + example) will need to define how their interrupts map to the relevant HL= ICs. + This means a PLIC interrupt property will typically list the HLICs for a= ll + 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 manua= l, + 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 configu= red + by SBI calls and implements a one-shot timer. + - Source 9 is the supervisor external interrupt, which chains to a= ll + other device interrupts. + +required: + - compatible + - '#interrupt-cells' + - interrupt-controller + +additionalProperties: false + +examples: + - | + interrupt-controller { + #interrupt-cells =3D <1>; + compatible =3D "riscv,cpu-intc"; + interrupt-controller; + }; --=20 2.34.1 From nobody Wed Feb 11 11:32:10 2026 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 4CA667D08F; Wed, 22 May 2024 15:39:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716392375; cv=none; b=t48NA8R2jteZU0FnSzyTMgJ6TbR+Mwb8L9CE00IHSmWWimR9H/xPwtQBLDp2hsAeMTIualpfRwRnW3UMT/2Mw/6PNTnQ6MXJe5Qvr+0GKTi3r2HNXwE6EdV6877jvItgKaBDpb7r6zuRHpH/MR633mMrA+vyiqvahsNV+OcX5fM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716392375; c=relaxed/simple; bh=llwxsV6MdWU8g+0kKVxnq7Bbcc5fXyWJzVTZ0a6TsQw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=k1cIWSDVmFR5q3OOaPH+acx4+oXIjjk/i94uo0CnvjL+O5n8HkymznGjPW3WQ53jZ90VGxpIBhkzICeEmu80mfGB0+QGPP+R+onz8qWk2DE/VUODdPN5xE1BaOq/l1k3iQAaWKZznm/yj9krar3YODb8HZJFI5i91jAp2LGqaRI= 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=M25bdmuK; arc=none smtp.client-ip=209.85.214.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M25bdmuK" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1ee954e0aa6so12055675ad.3; Wed, 22 May 2024 08:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716392373; x=1716997173; 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=Yvxfqkh+gSZbJyfshoQXFXdD3Y8gaC/pv6t5Ay+4a2U=; b=M25bdmuKGmFhR51zJJZCEkO/BPJv1aS65JvpCAwyTW2PG31Ryh+Y7toiLndH3ASWI6 AQDDATvjUiVtLPfRHKZeUVFhWE52A4X0sn96sN90aqohnO5j/Q/OEcP9vLkB6by12mVM Tw/RRbQU6pZrljX5PA/MuaFUXjwD9Ur49OTKohVS57j9iYLjEMDkCu2BUSO6eR4jbOMT PGfMm7vZ2mIoRUMGEsXU2dSeTm0CNuNr+6o7xMIbLKgixIvxgog2/ORF+Ing/j/ezHgT bErRkk/o2KOKiigIkibaj65H0GDJtBZeC7v5xnYgLU0V4r+zQ8/mGI/Rmd+nPOew88Iv VBag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716392373; x=1716997173; 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=Yvxfqkh+gSZbJyfshoQXFXdD3Y8gaC/pv6t5Ay+4a2U=; b=e9GQ4UqgQ3EpMLu+lyfIhUnWhoH9qrE7k5IGFmhtkwdt346N2B8idgn3KBgbvyRlZ/ sIG/Bxu+rMqUZQiiVpULYzKWhz1jRL8yzAhvOrfD/AIogzlHQ1auM38dXmfbiKXK6cA7 QyWIKneARhn8OSj1MtpcLAPtK103ga5c4Kwca9NXhHbLIV15Na5zA/Ft0tKqh2Cegko5 M1tBysnMCl0wU35Q+sdmJo8UK1tnJx9BOdh+hOorVB62glaw4VBEkX+WxLlmdc5sMyJm siDOO3AR5DSNKDEnrA9JkdbMaXroyqAujx15atnqhOL6caUwzKLpZOXd83ah8KgK64/A AEaQ== X-Forwarded-Encrypted: i=1; AJvYcCWTyoycdZ1OgUlG7sSxMm29NEwSCFP6uUqqIhMp0rD44IiVxfhdQ5FOq9KdTlk3jYFRKPy3yAite1p6EPBo0/lJBCB3032oav2NY+/BD6+gX7/nw8urYFg/admHjrHOnepyq/Or9He5qw== X-Gm-Message-State: AOJu0YyTxuAaujEnR2XqZIROGFjAObcEH7vhrVtXxfdcAGJJCeeMhVj7 AIgcqVMNSKmgEpQi9J6unqhcH/rSQ145ZFkkVASDNocu5n+fNteS X-Google-Smtp-Source: AGHT+IEvl2jl89Ll5aU5bNVUfIG87vrt2cUkmGN76Ttw5yLV7y7OkQZbEcTGoE9Ry6NS8Vd6Ho5icQ== X-Received: by 2002:a17:90a:5982:b0:2bd:8aed:740a with SMTP id 98e67ed59e1d1-2bd9f483e65mr2313191a91.23.1716392373545; Wed, 22 May 2024 08:39:33 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 08:39:33 -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 v2 2/2] dt-bindings: riscv: cpus: add ref to interrupt-controller Date: Wed, 22 May 2024 21:08:38 +0530 Message-Id: <20240522153835.22712-3-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: quoted-printable Content-Type: text/plain; charset="utf-8" removed the redundant properties for interrupt-controller and provide reference to the riscv,cpu-intc.yaml which defines the interrupt-controller. making the properties for riscv interrupt-controller at a central place. Signed-off-by: Kanak Shilledar Reviewed-by: Conor Dooley --- Changes in v2: - Fix warning of `type` is a required property during `make dt_bindings_check`. --- .../devicetree/bindings/riscv/cpus.yaml | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentat= ion/devicetree/bindings/riscv/cpus.yaml index d87dd50f1a4b..f1241e5e8753 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -102,26 +102,7 @@ properties: =20 interrupt-controller: type: object - additionalProperties: false - description: Describes the CPU's local interrupt controller - - properties: - '#interrupt-cells': - const: 1 - - compatible: - oneOf: - - items: - - const: andestech,cpu-intc - - const: riscv,cpu-intc - - const: riscv,cpu-intc - - interrupt-controller: true - - required: - - '#interrupt-cells' - - compatible - - interrupt-controller + $ref: /schemas/interrupt-controller/riscv,cpu-intc.yaml# =20 cpu-idle-states: $ref: /schemas/types.yaml#/definitions/phandle-array --=20 2.34.1