Message ID | 20230124105643.1737250-1-etienne.carriere@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2084876wrn; Tue, 24 Jan 2023 03:04:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXubTDwfnCwPvS0n8A5BLyihCWO4iHCZlLW/qdxmpOPlYHTMb5/9I6VSrcX1R4crAMNOYNVO X-Received: by 2002:a17:906:dfda:b0:871:e9a0:ebaa with SMTP id jt26-20020a170906dfda00b00871e9a0ebaamr31581797ejc.31.1674558274578; Tue, 24 Jan 2023 03:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674558274; cv=none; d=google.com; s=arc-20160816; b=X/JGqUC4JgfkD6Blyj7f+xxWwzxHVRvFCAVDoltqa1vrDy6A9GyexrvagpAVrXtuei AFoJ3amTLc7kDWPhcHkIxSm/V+I4bzdFXqYndnniOKNsS4PN9qik6cPENhTCbWCjwjHS p5Glbp9KrywrnFTLyXa6UU6+Dfwx4x5ZGESNQcIx/TtjluHpLLAlAZCguRVPmlRhQN84 EdllOn+vrJ/7XW9HMkZHjIdoB1bV4YFMOeV99i1mQlDyqOuoarZVP2Gm2fhui7AFiB6o bshFDexelAiYz/IH9bSPOR0F6cM4d88rAXfFTVXnUdcVHDSYgzoGo4D0cJef0QZNznd/ syQw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=m7zN4CDUViF3PTZLyM/3kFec4UidZAgrawq/W4v1dbE=; b=Mwe3VR/8ITSg2oLhmtQ/BOWHwemxruwqhedJEU3lUmM2e5iI0Pa6OwcNLqoQ9POqMC S3FuspGd9FprTDkdKlnhOs7IpBI3o5SQsX9NSnzRm/pEz1VP+nxr3x6VM36kiVzMUt6N BKehngi3lMjLMEbLbnd/zW3V92j8JYpa+x3fzrkq3jEJvDT3MyDaIfGxVvVTRyR5UfcR BVcbbeLKM4iGaVsh5dSl4fhGMFUxUJnf1FFHw2Pd5KTdT3F7hFtUoQ6b0rlmzopPwL7m 9GBZ2/jRgNi7kjeztP7L0yNzvjHmexegIP5T/l6Pm12etopRqib/oSJuDZ2XAUcKbqdz kFlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SVJXlXmb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 22-20020a170906015600b0078d20d71475si2238789ejh.413.2023.01.24.03.04.10; Tue, 24 Jan 2023 03:04:34 -0800 (PST) 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=@linaro.org header.s=google header.b=SVJXlXmb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233193AbjAXK45 (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Tue, 24 Jan 2023 05:56:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232744AbjAXK44 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 24 Jan 2023 05:56:56 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFE2DEC45 for <linux-kernel@vger.kernel.org>; Tue, 24 Jan 2023 02:56:54 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id e3so13442842wru.13 for <linux-kernel@vger.kernel.org>; Tue, 24 Jan 2023 02:56:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=m7zN4CDUViF3PTZLyM/3kFec4UidZAgrawq/W4v1dbE=; b=SVJXlXmbWCgWfJoKLOELiV3fZM7TPGBX7/4aB4cChDFmAvaO9yCbZCWDpOcBZqJxaR KjIFa5J7OWQxCCSQRDc4f1OIGR1hBaWUF078zeJ8y/lM05hTyPeezt5abkzBoaOKnmlu jTa3bmaeBNjpSZvnrIm15snup4RRtZNHZRf+yM0ZEJLZ1KaCqFHbkBDp5ZjlGQzmCH8A q0EIoCrh1pgKipIQ3BjEfUn5cTeCRq4Y6O/7IbwYqJtXjpKZzSO132hhx609ae1/jmmp vYKvjj1A9a3WC4y57svKbk834PKkeoAJShWJsTjeUzT3yCJWhS2HJpTGcAeo11cyvoMc sAzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m7zN4CDUViF3PTZLyM/3kFec4UidZAgrawq/W4v1dbE=; b=YIDcqv4eeqsph6yY5qxIha0YHm/LUWrXyO6AWK+KDDCRoA31lLcZnVPyyF1sHvY5CH hulx1nwL7S8Kalm4UhQZQIRNYi1ihP/SawIQHMtOvByU86B7RQo3W8VGImibIm4h+UFx YQxHVH+j5tcjqiP+LlxiCE8KOc6564xUZcfNWdTrrbm7y8mb5YD4RajQ94b97nSDUMHC 5pYO6XQNe/as+tXjFbLrE2WnD9iW9fiBUKfHdBv92jR9gB6GutwjWYSkKkh4uxK5BkfL hm+Swm4r4MabsLP9s5cFrJCAx/3Ypz+hSe5PgT+aVNP1Yy6QGm/lgn4nuCUM/g+VEX0g xAIA== X-Gm-Message-State: AFqh2kqa3HYNk0oWCTMcYE8hbfGI539Cj+H1jWVvauv1XZNdK6aiPAjh jCmo188KHdQydDokczUVwP/IhFtKYR1pRKoJ X-Received: by 2002:adf:e587:0:b0:2be:54a7:2b8b with SMTP id l7-20020adfe587000000b002be54a72b8bmr14573243wrm.21.1674557813173; Tue, 24 Jan 2023 02:56:53 -0800 (PST) Received: from lmecxl1178.lme.st.com ([80.215.43.103]) by smtp.gmail.com with ESMTPSA id m18-20020adfe952000000b00286ad197346sm1599336wrn.70.2023.01.24.02.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 02:56:52 -0800 (PST) From: Etienne Carriere <etienne.carriere@linaro.org> To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Etienne Carriere <etienne.carriere@linaro.org>, devicetree@vger.kernel.org, Jens Wiklander <jens.wiklander@linaro.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>, Sumit Garg <sumit.garg@linaro.org>, Pascal Paillet <p.paillet@foss.st.com> Subject: [PATCH v2 1/3] dt-bindings: arm: optee: add interrupt controller properties Date: Tue, 24 Jan 2023 11:56:41 +0100 Message-Id: <20230124105643.1737250-1-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.25.1 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_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755901617131933274?= X-GMAIL-MSGID: =?utf-8?q?1755901617131933274?= |
Series |
[v2,1/3] dt-bindings: arm: optee: add interrupt controller properties
|
|
Commit Message
Etienne Carriere
Jan. 24, 2023, 10:56 a.m. UTC
Adds an optional interrupt controller property to optee firmware node in the DT bindings. Optee driver may embeds an irqchip exposing interrupts notified by the TEE world. Optee registers up to 1 interrupt controller and identifies each line with a line number from 0 to UINT16_MAX. In the example, the platform SCMI device uses optee interrupt irq 5 as async signal to trigger processing of an async incoming SCMI message, in the scope of a CPU DVFS control. A platform can have several SCMI channels driven this way. Optee irqs also permits small embedded devices to share e.g. a gpio expander, a group of wakeup sources, etc... between OP-TEE world (for sensitive services) and Linux world (for non-sensitive services). The physical controller is driven from the TEE which exposes some controls to Linux kernel. Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: Marc Zyngier <maz@kernel.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Sumit Garg <sumit.garg@linaro.org> Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> --- Changes since v1: - Added a description to #interrupt-cells property. - Changed of example. Linux wakeup event was subject to discussion and i don't know much about input events in Linux. So move to SCMI. In the example, an SCMI server in OP-TEE world raises optee irq 5 so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming SCMI message in the scmi device for liekly later processing in threaded context. The example includes all parties: optee, scmi, sram, gic. - Obviously rephrased the commit message. - Added Cc: tags --- .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+)
Comments
+Sudeep On Tue, Jan 24, 2023 at 11:56:41AM +0100, Etienne Carriere wrote: > Adds an optional interrupt controller property to optee firmware node > in the DT bindings. Optee driver may embeds an irqchip exposing > interrupts notified by the TEE world. Optee registers up to 1 interrupt > controller and identifies each line with a line number from 0 to > UINT16_MAX. > > In the example, the platform SCMI device uses optee interrupt irq 5 > as async signal to trigger processing of an async incoming SCMI message, > in the scope of a CPU DVFS control. A platform can have several SCMI > channels driven this way. Optee irqs also permits small embedded devices > to share e.g. a gpio expander, a group of wakeup sources, etc... between > OP-TEE world (for sensitive services) and Linux world (for non-sensitive > services). The physical controller is driven from the TEE which exposes > some controls to Linux kernel. > > Cc: Jens Wiklander <jens.wiklander@linaro.org> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > Cc: Marc Zyngier <maz@kernel.org> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Sumit Garg <sumit.garg@linaro.org> > > Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> > --- > Changes since v1: > - Added a description to #interrupt-cells property. > - Changed of example. Linux wakeup event was subject to discussion and > i don't know much about input events in Linux. So move to SCMI. > In the example, an SCMI server in OP-TEE world raises optee irq 5 > so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming > SCMI message in the scmi device for liekly later processing in threaded > context. The example includes all parties: optee, scmi, sram, gic. > - Obviously rephrased the commit message. > - Added Cc: tags > --- > .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ > 1 file changed, 67 insertions(+) > > diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > index d4dc0749f9fd..9c00c27f8b2c 100644 > --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > @@ -40,6 +40,14 @@ properties: > HVC #0, register assignments > register assignments are specified in drivers/tee/optee/optee_smc.h > > + interrupt-controller: true > + > + "#interrupt-cells": > + const: 1 > + description: | > + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each > + irq is assigned a single line number identifier used as first argument. > + > required: > - compatible > - method > @@ -64,3 +72,62 @@ examples: > method = "hvc"; > }; > }; > + > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + firmware { > + optee: optee { > + compatible = "linaro,optee-tz"; > + method = "smc"; > + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; > + interrupt-controller; > + #interrupt-cells = <1>; > + }; > + > + scmi { > + compatible = "linaro,scmi-optee"; > + linaro,optee-channel-id = <0>; > + interrupt-parent = <&gic>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + scmi_cpu_dvfs: protocol@13 { > + reg = <0x13>; > + linaro,optee-channel-id = <1>; > + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; > + interrupts-extended = <&optee 5>; > + interrupt-names = "a2p"; These properties aren't documented. Soon there will be a warning[1]. > + #clock-cells = <1>; > + }; > + }; > + }; > + > + gic: interrupt-controller@a0021000 { > + compatible = "arm,cortex-a7-gic"; > + reg = <0xa0021000 0x1000>, <0xa0022000 0x2000>; > + interrupt-controller; > + #interrupt-cells = <3>; > + }; > + > + soc { > + #address-cells = <1>; > + #size-cells = <1>; > + > + sram@2ffff000 { > + compatible = "mmio-sram"; > + reg = <0x2ffff000 0x1000>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0 0x2ffff000 0x1000>; > + > + scmi_shm_tx: scmi-sram@0 { > + compatible = "arm,scmi-shmem"; > + reg = <0 0x80>; > + }; > + > + scmi_shm_rx: scmi-sram@100 { > + compatible = "arm,scmi-shmem"; > + reg = <0x100 0x80>; > + }; There's no need to show providers in examples (unless the example is for the provider). Rob
On Wed, 25 Jan 2023 at 21:22, Rob Herring <robh@kernel.org> wrote: > > +Sudeep > > On Tue, Jan 24, 2023 at 11:56:41AM +0100, Etienne Carriere wrote: > > Adds an optional interrupt controller property to optee firmware node > > in the DT bindings. Optee driver may embeds an irqchip exposing > > interrupts notified by the TEE world. Optee registers up to 1 interrupt > > controller and identifies each line with a line number from 0 to > > UINT16_MAX. > > > > In the example, the platform SCMI device uses optee interrupt irq 5 > > as async signal to trigger processing of an async incoming SCMI message, > > in the scope of a CPU DVFS control. A platform can have several SCMI > > channels driven this way. Optee irqs also permits small embedded devices > > to share e.g. a gpio expander, a group of wakeup sources, etc... between > > OP-TEE world (for sensitive services) and Linux world (for non-sensitive > > services). The physical controller is driven from the TEE which exposes > > some controls to Linux kernel. > > > > Cc: Jens Wiklander <jens.wiklander@linaro.org> > > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > > Cc: Marc Zyngier <maz@kernel.org> > > Cc: Rob Herring <robh+dt@kernel.org> > > Cc: Sumit Garg <sumit.garg@linaro.org> > > > > Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> > > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> > > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> > > --- > > Changes since v1: > > - Added a description to #interrupt-cells property. > > - Changed of example. Linux wakeup event was subject to discussion and > > i don't know much about input events in Linux. So move to SCMI. > > In the example, an SCMI server in OP-TEE world raises optee irq 5 > > so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming > > SCMI message in the scmi device for liekly later processing in threaded > > context. The example includes all parties: optee, scmi, sram, gic. > > - Obviously rephrased the commit message. > > - Added Cc: tags > > --- > > .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ > > 1 file changed, 67 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > index d4dc0749f9fd..9c00c27f8b2c 100644 > > --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > @@ -40,6 +40,14 @@ properties: > > HVC #0, register assignments > > register assignments are specified in drivers/tee/optee/optee_smc.h > > > > + interrupt-controller: true > > + > > + "#interrupt-cells": > > + const: 1 > > + description: | > > + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each > > + irq is assigned a single line number identifier used as first argument. > > + > > required: > > - compatible > > - method > > @@ -64,3 +72,62 @@ examples: > > method = "hvc"; > > }; > > }; > > + > > + - | > > + #include <dt-bindings/interrupt-controller/arm-gic.h> > > + firmware { > > + optee: optee { > > + compatible = "linaro,optee-tz"; > > + method = "smc"; > > + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; > > + interrupt-controller; > > + #interrupt-cells = <1>; > > + }; > > + > > + scmi { > > + compatible = "linaro,scmi-optee"; > > + linaro,optee-channel-id = <0>; > > + interrupt-parent = <&gic>; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + scmi_cpu_dvfs: protocol@13 { > > + reg = <0x13>; > > + linaro,optee-channel-id = <1>; > > + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; > > + interrupts-extended = <&optee 5>; > > + interrupt-names = "a2p"; > > These properties aren't documented. Soon there will be a warning[1]. They are. https://github.com/torvalds/linux/blob/v6.1/Documentation/devicetree/bindings/firmware/arm%2Cscmi.yaml#L45-L53 In arm,scmi.yaml, interrupts optional property stands for interrupts and interrupts-extended, no? > > > + #clock-cells = <1>; > > + }; > > + }; > > + }; > > + > > + gic: interrupt-controller@a0021000 { > > + compatible = "arm,cortex-a7-gic"; > > + reg = <0xa0021000 0x1000>, <0xa0022000 0x2000>; > > + interrupt-controller; > > + #interrupt-cells = <3>; > > + }; > > + > > + soc { > > + #address-cells = <1>; > > + #size-cells = <1>; > > + > > + sram@2ffff000 { > > + compatible = "mmio-sram"; > > + reg = <0x2ffff000 0x1000>; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges = <0 0x2ffff000 0x1000>; > > + > > + scmi_shm_tx: scmi-sram@0 { > > + compatible = "arm,scmi-shmem"; > > + reg = <0 0x80>; > > + }; > > + > > + scmi_shm_rx: scmi-sram@100 { > > + compatible = "arm,scmi-shmem"; > > + reg = <0x100 0x80>; > > + }; > > There's no need to show providers in examples (unless the example is for > the provider). Ok, i'll simplify the example Thanks, Etienne > > Rob
On Wed, Jan 25, 2023 at 3:00 PM Etienne Carriere <etienne.carriere@linaro.org> wrote: > > On Wed, 25 Jan 2023 at 21:22, Rob Herring <robh@kernel.org> wrote: > > > > +Sudeep > > > > On Tue, Jan 24, 2023 at 11:56:41AM +0100, Etienne Carriere wrote: > > > Adds an optional interrupt controller property to optee firmware node > > > in the DT bindings. Optee driver may embeds an irqchip exposing > > > interrupts notified by the TEE world. Optee registers up to 1 interrupt > > > controller and identifies each line with a line number from 0 to > > > UINT16_MAX. > > > > > > In the example, the platform SCMI device uses optee interrupt irq 5 > > > as async signal to trigger processing of an async incoming SCMI message, > > > in the scope of a CPU DVFS control. A platform can have several SCMI > > > channels driven this way. Optee irqs also permits small embedded devices > > > to share e.g. a gpio expander, a group of wakeup sources, etc... between > > > OP-TEE world (for sensitive services) and Linux world (for non-sensitive > > > services). The physical controller is driven from the TEE which exposes > > > some controls to Linux kernel. > > > > > > Cc: Jens Wiklander <jens.wiklander@linaro.org> > > > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > > > Cc: Marc Zyngier <maz@kernel.org> > > > Cc: Rob Herring <robh+dt@kernel.org> > > > Cc: Sumit Garg <sumit.garg@linaro.org> > > > > > > Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> > > > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> > > > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> > > > --- > > > Changes since v1: > > > - Added a description to #interrupt-cells property. > > > - Changed of example. Linux wakeup event was subject to discussion and > > > i don't know much about input events in Linux. So move to SCMI. > > > In the example, an SCMI server in OP-TEE world raises optee irq 5 > > > so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming > > > SCMI message in the scmi device for liekly later processing in threaded > > > context. The example includes all parties: optee, scmi, sram, gic. > > > - Obviously rephrased the commit message. > > > - Added Cc: tags > > > --- > > > .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ > > > 1 file changed, 67 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > > index d4dc0749f9fd..9c00c27f8b2c 100644 > > > --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > > @@ -40,6 +40,14 @@ properties: > > > HVC #0, register assignments > > > register assignments are specified in drivers/tee/optee/optee_smc.h > > > > > > + interrupt-controller: true > > > + > > > + "#interrupt-cells": > > > + const: 1 > > > + description: | > > > + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each > > > + irq is assigned a single line number identifier used as first argument. > > > + > > > required: > > > - compatible > > > - method > > > @@ -64,3 +72,62 @@ examples: > > > method = "hvc"; > > > }; > > > }; > > > + > > > + - | > > > + #include <dt-bindings/interrupt-controller/arm-gic.h> > > > + firmware { > > > + optee: optee { > > > + compatible = "linaro,optee-tz"; > > > + method = "smc"; > > > + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; > > > + interrupt-controller; > > > + #interrupt-cells = <1>; > > > + }; > > > + > > > + scmi { > > > + compatible = "linaro,scmi-optee"; > > > + linaro,optee-channel-id = <0>; > > > + interrupt-parent = <&gic>; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + scmi_cpu_dvfs: protocol@13 { > > > + reg = <0x13>; > > > + linaro,optee-channel-id = <1>; > > > + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; > > > + interrupts-extended = <&optee 5>; > > > + interrupt-names = "a2p"; > > > > These properties aren't documented. Soon there will be a warning[1]. > > They are. > https://github.com/torvalds/linux/blob/v6.1/Documentation/devicetree/bindings/firmware/arm%2Cscmi.yaml#L45-L53 They are not. That's the scmi node, not a protocol node. > In arm,scmi.yaml, interrupts optional property stands for interrupts > and interrupts-extended, no? Yes. Rob
On Thu, 26 Jan 2023 at 15:00, Rob Herring <robh@kernel.org> wrote: > > On Wed, Jan 25, 2023 at 3:00 PM Etienne Carriere > <etienne.carriere@linaro.org> wrote: > > > > On Wed, 25 Jan 2023 at 21:22, Rob Herring <robh@kernel.org> wrote: > > > > > > +Sudeep > > > > > > On Tue, Jan 24, 2023 at 11:56:41AM +0100, Etienne Carriere wrote: > > > > Adds an optional interrupt controller property to optee firmware node > > > > in the DT bindings. Optee driver may embeds an irqchip exposing > > > > interrupts notified by the TEE world. Optee registers up to 1 interrupt > > > > controller and identifies each line with a line number from 0 to > > > > UINT16_MAX. > > > > > > > > In the example, the platform SCMI device uses optee interrupt irq 5 > > > > as async signal to trigger processing of an async incoming SCMI message, > > > > in the scope of a CPU DVFS control. A platform can have several SCMI > > > > channels driven this way. Optee irqs also permits small embedded devices > > > > to share e.g. a gpio expander, a group of wakeup sources, etc... between > > > > OP-TEE world (for sensitive services) and Linux world (for non-sensitive > > > > services). The physical controller is driven from the TEE which exposes > > > > some controls to Linux kernel. > > > > > > > > Cc: Jens Wiklander <jens.wiklander@linaro.org> > > > > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > > > > Cc: Marc Zyngier <maz@kernel.org> > > > > Cc: Rob Herring <robh+dt@kernel.org> > > > > Cc: Sumit Garg <sumit.garg@linaro.org> > > > > > > > > Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> > > > > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> > > > > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> > > > > --- > > > > Changes since v1: > > > > - Added a description to #interrupt-cells property. > > > > - Changed of example. Linux wakeup event was subject to discussion and > > > > i don't know much about input events in Linux. So move to SCMI. > > > > In the example, an SCMI server in OP-TEE world raises optee irq 5 > > > > so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming > > > > SCMI message in the scmi device for liekly later processing in threaded > > > > context. The example includes all parties: optee, scmi, sram, gic. > > > > - Obviously rephrased the commit message. > > > > - Added Cc: tags > > > > --- > > > > .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ > > > > 1 file changed, 67 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > > > index d4dc0749f9fd..9c00c27f8b2c 100644 > > > > --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > > > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > > > @@ -40,6 +40,14 @@ properties: > > > > HVC #0, register assignments > > > > register assignments are specified in drivers/tee/optee/optee_smc.h > > > > > > > > + interrupt-controller: true > > > > + > > > > + "#interrupt-cells": > > > > + const: 1 > > > > + description: | > > > > + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each > > > > + irq is assigned a single line number identifier used as first argument. > > > > + > > > > required: > > > > - compatible > > > > - method > > > > @@ -64,3 +72,62 @@ examples: > > > > method = "hvc"; > > > > }; > > > > }; > > > > + > > > > + - | > > > > + #include <dt-bindings/interrupt-controller/arm-gic.h> > > > > + firmware { > > > > + optee: optee { > > > > + compatible = "linaro,optee-tz"; > > > > + method = "smc"; > > > > + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; > > > > + interrupt-controller; > > > > + #interrupt-cells = <1>; > > > > + }; > > > > + > > > > + scmi { > > > > + compatible = "linaro,scmi-optee"; > > > > + linaro,optee-channel-id = <0>; > > > > + interrupt-parent = <&gic>; > > > > + #address-cells = <1>; > > > > + #size-cells = <0>; > > > > + > > > > + scmi_cpu_dvfs: protocol@13 { > > > > + reg = <0x13>; > > > > + linaro,optee-channel-id = <1>; > > > > + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; > > > > + interrupts-extended = <&optee 5>; > > > > + interrupt-names = "a2p"; > > > > > > These properties aren't documented. Soon there will be a warning[1]. > > > > They are. > > https://github.com/torvalds/linux/blob/v6.1/Documentation/devicetree/bindings/firmware/arm%2Cscmi.yaml#L45-L53 > > They are not. That's the scmi node, not a protocol node. Ok,i should have written it this way then: + scmi { + compatible = "linaro,scmi-optee"; + linaro,optee-channel-id = <0>; + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; + interrupts-extended = <&optee 5>; + interrupt-names = "a2p"; + #address-cells = <1>; + #size-cells = <0>; + + scmi_cpu_dvfs: protocol@13 { + reg = <0x13>; + #clock-cells = <1>; + }; + }; > > > In arm,scmi.yaml, interrupts optional property stands for interrupts > > and interrupts-extended, no? > > Yes. > > Rob
On Tue, Jan 24, 2023 at 11:56:41AM +0100, Etienne Carriere wrote: > Adds an optional interrupt controller property to optee firmware node > in the DT bindings. Optee driver may embeds an irqchip exposing > interrupts notified by the TEE world. Optee registers up to 1 interrupt > controller and identifies each line with a line number from 0 to > UINT16_MAX. > > In the example, the platform SCMI device uses optee interrupt irq 5 > as async signal to trigger processing of an async incoming SCMI message, > in the scope of a CPU DVFS control. A platform can have several SCMI > channels driven this way. Optee irqs also permits small embedded devices > to share e.g. a gpio expander, a group of wakeup sources, etc... between > OP-TEE world (for sensitive services) and Linux world (for non-sensitive > services). The physical controller is driven from the TEE which exposes > some controls to Linux kernel. > > Cc: Jens Wiklander <jens.wiklander@linaro.org> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > Cc: Marc Zyngier <maz@kernel.org> > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Sumit Garg <sumit.garg@linaro.org> > > Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> > --- > Changes since v1: > - Added a description to #interrupt-cells property. > - Changed of example. Linux wakeup event was subject to discussion and > i don't know much about input events in Linux. So move to SCMI. > In the example, an SCMI server in OP-TEE world raises optee irq 5 > so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming > SCMI message in the scmi device for liekly later processing in threaded > context. The example includes all parties: optee, scmi, sram, gic. > - Obviously rephrased the commit message. > - Added Cc: tags > --- > .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ > 1 file changed, 67 insertions(+) > > diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > index d4dc0749f9fd..9c00c27f8b2c 100644 > --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > @@ -40,6 +40,14 @@ properties: > HVC #0, register assignments > register assignments are specified in drivers/tee/optee/optee_smc.h > > + interrupt-controller: true > + > + "#interrupt-cells": > + const: 1 > + description: | > + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each > + irq is assigned a single line number identifier used as first argument. > + > required: > - compatible > - method > @@ -64,3 +72,62 @@ examples: > method = "hvc"; > }; > }; > + > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + firmware { > + optee: optee { > + compatible = "linaro,optee-tz"; > + method = "smc"; > + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; > + interrupt-controller; > + #interrupt-cells = <1>; > + }; > + > + scmi { > + compatible = "linaro,scmi-optee"; > + linaro,optee-channel-id = <0>; > + interrupt-parent = <&gic>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + scmi_cpu_dvfs: protocol@13 { > + reg = <0x13>; > + linaro,optee-channel-id = <1>; > + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; > + interrupts-extended = <&optee 5>; Just curious if this can discovered by some communication within OPTEE. You know you are using optee-channel-id 0 for all SCMI and 1 for DVFS. Is it not possible to get the information from OPTEE dynamically like you do for shmem. It is offset within the notification bitmap IIUC, so the question is can be get that from the firmware on the fly. It also gives the firmware to reshuffle things around if needed and don't have to worry about compatibility with DT ?
Hi Sudeep, On Thu, 26 Jan 2023 at 15:53, Sudeep Holla <sudeep.holla@arm.com> wrote: > > On Tue, Jan 24, 2023 at 11:56:41AM +0100, Etienne Carriere wrote: > > Adds an optional interrupt controller property to optee firmware node > > in the DT bindings. Optee driver may embeds an irqchip exposing > > interrupts notified by the TEE world. Optee registers up to 1 interrupt > > controller and identifies each line with a line number from 0 to > > UINT16_MAX. > > > > In the example, the platform SCMI device uses optee interrupt irq 5 > > as async signal to trigger processing of an async incoming SCMI message, > > in the scope of a CPU DVFS control. A platform can have several SCMI > > channels driven this way. Optee irqs also permits small embedded devices > > to share e.g. a gpio expander, a group of wakeup sources, etc... between > > OP-TEE world (for sensitive services) and Linux world (for non-sensitive > > services). The physical controller is driven from the TEE which exposes > > some controls to Linux kernel. > > > > Cc: Jens Wiklander <jens.wiklander@linaro.org> > > Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > > Cc: Marc Zyngier <maz@kernel.org> > > Cc: Rob Herring <robh+dt@kernel.org> > > Cc: Sumit Garg <sumit.garg@linaro.org> > > > > Co-developed-by: Pascal Paillet <p.paillet@foss.st.com> > > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com> > > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> > > --- > > Changes since v1: > > - Added a description to #interrupt-cells property. > > - Changed of example. Linux wakeup event was subject to discussion and > > i don't know much about input events in Linux. So move to SCMI. > > In the example, an SCMI server in OP-TEE world raises optee irq 5 > > so that Linux scmi optee channel &scmi_cpu_dvfs pushed in the incoming > > SCMI message in the scmi device for liekly later processing in threaded > > context. The example includes all parties: optee, scmi, sram, gic. > > - Obviously rephrased the commit message. > > - Added Cc: tags > > --- > > .../arm/firmware/linaro,optee-tz.yaml | 67 +++++++++++++++++++ > > 1 file changed, 67 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > index d4dc0749f9fd..9c00c27f8b2c 100644 > > --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml > > @@ -40,6 +40,14 @@ properties: > > HVC #0, register assignments > > register assignments are specified in drivers/tee/optee/optee_smc.h > > > > + interrupt-controller: true > > + > > + "#interrupt-cells": > > + const: 1 > > + description: | > > + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each > > + irq is assigned a single line number identifier used as first argument. > > + > > required: > > - compatible > > - method > > @@ -64,3 +72,62 @@ examples: > > method = "hvc"; > > }; > > }; > > + > > + - | > > + #include <dt-bindings/interrupt-controller/arm-gic.h> > > + firmware { > > + optee: optee { > > + compatible = "linaro,optee-tz"; > > + method = "smc"; > > + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; > > + interrupt-controller; > > + #interrupt-cells = <1>; > > + }; > > + > > + scmi { > > + compatible = "linaro,scmi-optee"; > > + linaro,optee-channel-id = <0>; > > + interrupt-parent = <&gic>; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + scmi_cpu_dvfs: protocol@13 { > > + reg = <0x13>; > > + linaro,optee-channel-id = <1>; > > + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; > > + interrupts-extended = <&optee 5>; > > Just curious if this can discovered by some communication within OPTEE. > You know you are using optee-channel-id 0 for all SCMI and 1 for DVFS. > Is it not possible to get the information from OPTEE dynamically like > you do for shmem. It is offset within the notification bitmap IIUC, so > the question is can be get that from the firmware on the fly. It also > gives the firmware to reshuffle things around if needed and don't have to > worry about compatibility with DT ? There is not specific discussions with OP-TEE to know which Yet, assuming we have that scmi channel notif ID from optee, how does scmi/optee driver relates to optee device irqchip? With DT, we get both the optee irqchip ref (phandle) and our channel notif irq line number (phandle arg #1). Without DT, we still need to reference optee's irqchip. Best regards, etienne > > -- > Regards, > Sudeep
diff --git a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml index d4dc0749f9fd..9c00c27f8b2c 100644 --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml @@ -40,6 +40,14 @@ properties: HVC #0, register assignments register assignments are specified in drivers/tee/optee/optee_smc.h + interrupt-controller: true + + "#interrupt-cells": + const: 1 + description: | + OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each + irq is assigned a single line number identifier used as first argument. + required: - compatible - method @@ -64,3 +72,62 @@ examples: method = "hvc"; }; }; + + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + firmware { + optee: optee { + compatible = "linaro,optee-tz"; + method = "smc"; + interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + scmi { + compatible = "linaro,scmi-optee"; + linaro,optee-channel-id = <0>; + interrupt-parent = <&gic>; + #address-cells = <1>; + #size-cells = <0>; + + scmi_cpu_dvfs: protocol@13 { + reg = <0x13>; + linaro,optee-channel-id = <1>; + shmem = <&scmi_shm_tx>, <&scmi_shm_rx>; + interrupts-extended = <&optee 5>; + interrupt-names = "a2p"; + #clock-cells = <1>; + }; + }; + }; + + gic: interrupt-controller@a0021000 { + compatible = "arm,cortex-a7-gic"; + reg = <0xa0021000 0x1000>, <0xa0022000 0x2000>; + interrupt-controller; + #interrupt-cells = <3>; + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + + sram@2ffff000 { + compatible = "mmio-sram"; + reg = <0x2ffff000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x2ffff000 0x1000>; + + scmi_shm_tx: scmi-sram@0 { + compatible = "arm,scmi-shmem"; + reg = <0 0x80>; + }; + + scmi_shm_rx: scmi-sram@100 { + compatible = "arm,scmi-shmem"; + reg = <0x100 0x80>; + }; + }; + };