From patchwork Wed Mar 15 11:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 70166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2279227wrd; Wed, 15 Mar 2023 04:48:42 -0700 (PDT) X-Google-Smtp-Source: AK7set84CJq3/VNV4O8sGVA325NKP5HI5Km5paJFXMpUReVk7zsHHPoJFwkYi1dh1NX5hqrgy8Dw X-Received: by 2002:a17:90b:38c7:b0:234:b03:5a70 with SMTP id nn7-20020a17090b38c700b002340b035a70mr42483857pjb.35.1678880922369; Wed, 15 Mar 2023 04:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678880922; cv=none; d=google.com; s=arc-20160816; b=KdCDfoJXi5Lb8Z/smTx8DmEsu3U40mXqMDoLMDxpBR67EQXbCjrsykc/55OBeumwTp DvaonfqEafhiodwfs58dwuaFRBjVX3Ao3VQneb1vND+6MeGhdyoEZqgRrMeMOAYtfMGo wVwPpVkeXA3BRh9tWOYaPbClciqtxgCa502vMGrm56KeY2ulTx9iLXQ/S18tCETjwFTn T2/WqwrrpOLcECNqJ5OseZLjiq0Vmer2Tw1L7x2hHfy2L272vvtk3Un12bJVBM0ec/j6 /0RX2zxHvqFsOAPgQGXNuiPzTEnw/uGIM2JT5SN2Uuy5A0St/oTP1tsensrG0x0pftuA b/kw== 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=uJIPBS8b/IYdR4MkxApb1rcmpblReO8/5hZw+mD6UJE=; b=D4wHXrBnE/2+zcTogL/tp6AkH8a5sCvoHfQfvS1+WsmzqngJZF9pKEE2K+lIzOyXJP VGKXLL2Wh9FopsAZif94C1ONz10fSdSQYtlZCzBoLVXEcv7bkxmQcKwl8OG9dmPw65kK I/8x0N0/bqC8QDlQdYLLLSNMOUOuQVXzW+KvROodMbZU7rmpmJEl6eo9rdkG4GoFarQC JxBuntuKbnTZIjYNU5vIkRZIJvK5YjhCWdO8jW+fcWA3ccHeVoXKhQqKq73S2u6gBIt6 RSv5pr15TiaUSSOK6XRPUJC3XdAgsJQeYnSBeI68s8P+Hm4uZvuHYVMV2z1qoTI0Fl7s TGZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X9LPWl7P; 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 p5-20020a17090a348500b0023c1f976f2dsi1551616pjb.85.2023.03.15.04.48.29; Wed, 15 Mar 2023 04:48:42 -0700 (PDT) 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=X9LPWl7P; 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 S231952AbjCOLd0 (ORCPT + 99 others); Wed, 15 Mar 2023 07:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbjCOLdG (ORCPT ); Wed, 15 Mar 2023 07:33:06 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98758664D0 for ; Wed, 15 Mar 2023 04:32:10 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id cy23so74033903edb.12 for ; Wed, 15 Mar 2023 04:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678879926; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uJIPBS8b/IYdR4MkxApb1rcmpblReO8/5hZw+mD6UJE=; b=X9LPWl7Pb9C642Yw4iaoa1AZ5rYTdPMk6OA9tgeICQR7HthDyZgJxaUjxTyu/tKLmW DzNloFI2QUJ46vblYORd8i4VOpYMBefgjd19+YWrOIBbBFIjj0I9xqntS/2uSAEaqd+z 53NP4K1F7y6hERBCcILUTncdCsSB/saafrlYSTIWMhNSF+yi52SUQ5b31KAHWQwLABQ+ 4a+ES+yNiqJ/1QPc+6KNIZp3Df1HNdDIgZEu7fd3lXxVmaVAaekAYolwp9igQgVP/Kl0 ITeHhMQv6gIajMMRRbsVMNkMRbFLz01ROk/QrPT5MMRml6bsbm5HgtFzCMksnBQeOni4 Pk5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678879926; 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=uJIPBS8b/IYdR4MkxApb1rcmpblReO8/5hZw+mD6UJE=; b=IuTsHVuPOMfdvyYU1OVTP5OQfHI8ovxH9a+hzAicFZc4lFsARJO7MOgLQflasZDwPV v/TlqUE6372C+zNKfBCykXMInfnDV2v9ndj5hn0WijObntQBa+U23Rx//Z+JmtbXANBh Eo4EQHS30642Rgg0O4Kr5mKhLR2C/zU5+DFEo2GMx9PiL0eIUAUbhxxJSg2Xu0SI7xqZ Q2C+q/1yVV8suuJ0uAWA8155MWYcGhGoYJbnjPnSdLdpVykbg1r8A6YOVvh2iU2QuVX0 N/A/czzpEB9/VknqYfsgvKAYO38fiUMVgiX9NIgm3kgCximErekdncvRaK5Qk7K09IcB OGnw== X-Gm-Message-State: AO0yUKWCEHlI3riq3mTQg8Dpg9VndFjgoAPp36bRWDO7cwGILZjFMu5c EpMmBn+jHPZdiIuuLtAxn7QpTMo7jmJFEM0xCzo= X-Received: by 2002:aa7:dc17:0:b0:4fd:2363:16f2 with SMTP id b23-20020aa7dc17000000b004fd236316f2mr2051972edu.37.1678879926592; Wed, 15 Mar 2023 04:32:06 -0700 (PDT) Received: from lmecxl1178.lme.st.com ([2a04:cec0:1008:2d39:4d4b:ab19:bc3b:a0cd]) by smtp.gmail.com with ESMTPSA id 1-20020a508e41000000b004fb95f51f54sm2264151edx.12.2023.03.15.04.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 04:32:06 -0700 (PDT) From: Etienne Carriere To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Etienne Carriere , Jens Wiklander , Krzysztof Kozlowski , Marc Zyngier , Rob Herring , Sumit Garg , Pascal Paillet Subject: [PATCH v3 1/3] dt-bindings: arm: optee: add interrupt controller properties Date: Wed, 15 Mar 2023 12:31:59 +0100 Message-Id: <20230315113201.1343781-1-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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,URIBL_BLOCKED autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760434241972601689?= X-GMAIL-MSGID: =?utf-8?q?1760434241972601689?= Adds an optional interrupt controller property to optee firmware node in the DT bindings. Optee driver may embeds an irqchip exposing OP-TEE interrupt events 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. The identifiers and meaning of the interrupt line number are specific to the platform and shall be found in the OP-TEE platform documentation. In the example shown in optee DT binding documentation, the platform SCMI device controlled by Linux scmi driver uses optee interrupt irq 5 as signal to trigger processing of an asynchronous incoming SCMI message in the scope of a CPU DVFS control. A platform can have several SCMI channels driven this way. Optee irqs also permit 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 Cc: Krzysztof Kozlowski Cc: Marc Zyngier Cc: Rob Herring Cc: Sumit Garg Co-developed-by: Pascal Paillet Signed-off-by: Pascal Paillet Signed-off-by: Etienne Carriere --- Changes since v2: - Added a sentence on optee irq line number values and meaning, in DT binding doc and commit message. - Updated example in DT binding doc from comment, fixed misplaced interrupt-parent property and removed gic and sram shm nodes. 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. --- .../arm/firmware/linaro,optee-tz.yaml | 38 +++++++++++++++++++ 1 file changed, 38 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..ff7e1292c803 100644 --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml @@ -40,6 +40,16 @@ 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. + Line number identifiers and their meaning shall be found in the OP-TEE + firmware platform documentation. + required: - compatible - method @@ -64,3 +74,31 @@ examples: method = "hvc"; }; }; + + - | + #include + firmware { + optee: optee { + compatible = "linaro,optee-tz"; + method = "smc"; + interrupt-parent = <&gic>; + interrupts = ; + interrupt-controller; + #interrupt-cells = <1>; + }; + + 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>; + }; + }; + };