From patchwork Sat May 6 07:32:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1777961 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=BBERDjmC; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4QCzps2rndz1ydV for ; Sat, 6 May 2023 17:35:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbjEFHe7 (ORCPT ); Sat, 6 May 2023 03:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231878AbjEFHet (ORCPT ); Sat, 6 May 2023 03:34:49 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B61D511626 for ; Sat, 6 May 2023 00:34:23 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3062db220a3so1733761f8f.0 for ; Sat, 06 May 2023 00:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683358440; x=1685950440; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nzc7fEYymsV81rQJGMHPbBkx6cBbwGrwRZfcN8X9Dqo=; b=BBERDjmCiHS4ibFtbHwl2xgsmEiM83TXAd6B55JV6ns3WJbxJvUGj4UXwTaCTjQRhN U4v7d5bB9+yYg9pPUUs6Qm57V5aBtqpp01ofFVF1JPUZyTkUtBLEh/F+xyt5m+WOnsoj kPHNYgacd67i/f2oE98VKK+FOvzJvsETXlkAuUeCJbYiwXfeW9CqP2n90OqK8RWWEIfk iyV1ZE0ljXeiJc1aXgL23CiNOFzAGwemMUT69yuKlhaLj3XPWyB0tAFytIthG5ep4jAW s6g4akEhYbsfzASdesHUa7yiKvROer3fCdVX0tq3FrF7h3QmB4K5q79lQZzwnd+ufMPN dqig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683358440; x=1685950440; 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=nzc7fEYymsV81rQJGMHPbBkx6cBbwGrwRZfcN8X9Dqo=; b=L5+U/ol6u4raZYyQsGYSymdZj6YUcDc5hygL8yNOaZZeGRLY/2EVNHDeZCLaLjovWV ucXIxdYfpNjVP3XbUs2mYd+9yhacrDntWDFrkRxOgKjZG8deVmclrkGOPyWmUVJKwbEe AeVbkoKrwu8tH7M0WrTzCVEEpB+Bwr+CGG6jWeJnZ/gFjFmmLuz9X6NbBm4t3s511Gcl k5sP1iBrru08pAotrPOswisvb/2oRWhwYp7HzRi4zIgS3w22JAN1a8lrRDcbJ+RPThDX 18gyN7mI9HwFgSTpHAJF+Aap0264qN+N3N+3005lxQ3iUjvNwQqim/EJZFLlggqZ9YAu uUrw== X-Gm-Message-State: AC+VfDzG2ghJrKnaZxRF5VwQFHXvKYjfr1yct+4h7ENpb7yqe1OY/Kys SwJdz82prOZPTWNTiHr8mU/QgA== X-Google-Smtp-Source: ACHHUZ7HW+XvdPuxaNma9oy8YluJNS9JWOJYQVPF5Aa69QDk5VMh0R0ZLxtPOFQZlbjk8JzEzY9J6w== X-Received: by 2002:a05:6000:12d0:b0:304:b1da:77d with SMTP id l16-20020a05600012d000b00304b1da077dmr2763936wrx.52.1683358440354; Sat, 06 May 2023 00:34:00 -0700 (PDT) Received: from lmecxl1178.lme.st.com (lfbn-nan-1-1169-52.w86-212.abo.wanadoo.fr. [86.212.112.52]) by smtp.gmail.com with ESMTPSA id e9-20020a5d5009000000b003063430ad9bsm4506523wrt.88.2023.05.06.00.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 00:33:59 -0700 (PDT) From: Etienne Carriere To: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org, op-tee@lists.trustedfirmware.org, Alexandre Belloni , Ulf Hansson , Jonathan Cameron , Etienne Carriere , Jens Wiklander , Krzysztof Kozlowski , Marc Zyngier , Rob Herring , Sumit Garg , Pascal Paillet Subject: [PATCH v5 1/2] dt-bindings: arm: optee: add interrupt controller properties Date: Sat, 6 May 2023 09:32:34 +0200 Message-Id: <20230506073235.2770292-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,T_SCC_BODY_TEXT_LINE,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: devicetree@vger.kernel.org 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 v4: - Removed empty line between Cc: tags and S-o-b tags. No changes since v3 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 5d033570b57b..9d9a797a6b2f 100644 --- a/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml +++ b/Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml @@ -41,6 +41,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 @@ -65,3 +75,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>; + }; + }; + };