From patchwork Mon Jul 29 08:00:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2C47C3DA61 for ; Mon, 29 Jul 2024 08:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aOjLun6texcSlkqDtHFasKp/m6UQbRYZsxtm1Omsgik=; b=tjisb071S9bt+9d/aDzBFh0CNK BxSj9LucjqT1FuttUvWQB3+0mcWYA3oqnxD4oIxB/ZSQ8eYmBHJ1Gnktazx7+/1LPEWnFyR2lUyI+ xIS464aoZi3EpIiSdUTqZxzKEFTCe06wP84+7rvZnkczIZzHkiBoQP9o2IsfyiggY+tXauko1xG6B MzzJcPkIkvt5xa0OZmeYw/aLULJkfVRnirY3vTyGdivAv4nLvG2+kDr/h3TEzJQbLYyjdL3J25Yol sTR9+yKZTZRTVGCRqCD5ygc5c+Agbs1AmjdQTkbhRjpx+ei4dIwjPiLrCYdz7y2YH7NHUdpwaQ/Ua mZf5TUDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLKY-0000000ASXc-3JLM; Mon, 29 Jul 2024 08:02:06 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJj-0000000ASEl-2Ynv for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:17 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3686b285969so1076432f8f.0 for ; Mon, 29 Jul 2024 01:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722240073; x=1722844873; darn=lists.infradead.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=aOjLun6texcSlkqDtHFasKp/m6UQbRYZsxtm1Omsgik=; b=o6XN2WLCStbjYgrgmRJ9oTeRYesdRw0NspUIjUExwDq/TK/Ouk8y6L1x8EPUqxikFA 4+9xQFZRK2+iA4NDZdZdJI8IByynrtqaYsywh8vkna/Tvss8OQ58ySWzxYiDVKz6eY4y 4fkorC/bXSYoURCZlVc7F4/qZLLjbLO1F/REpp6BwPZo8avvACs57E54W1t/HzwqWZLO l+DH4TqN6jYO91F6zua+tadxcLB0nuKc3FGufsec4MngjdkMJc3Xfs3JCinyYy4fNvCd RqbaFKylbZpLFZCo/E7pwX4XlWnTLd/nP0HVeUMdTm8faPjAIWcW9DljsM9sz3f2fvmN mAWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240073; x=1722844873; 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=aOjLun6texcSlkqDtHFasKp/m6UQbRYZsxtm1Omsgik=; b=DyeK1jskQ5p5tCa/CH3vbxV7fTepn7uJE9fUPYJ7gjcuob4JIQ91Yb1mUfT9ei7cnK OC9YH0ZeD8ypeWJMlfplkdNSUn1WnG2x0LNHWxhrwvRFTXz8SblOOLWXnC1ydBo1Q3n6 Zy8TrZ7Y4W63wtgv3f0h7gSorMGMA++dgJLxmhF1anqjSPZr/ERFwA8aRfkwIQktjeGN mb2rJkLspifFPBWWK40TmQGuiIbZ0ZAkjO68PUZ1eGHvk/PjusMLQo4OzI1McZydLcoo ci/2dwCgHLNoe82B1hTMaM/hYOQ9VdOd4mNUMZ6UCqHBRiCRiQ96lM+DRQWDD1xcKtfT x7Kg== X-Forwarded-Encrypted: i=1; AJvYcCVgIGafvCr2wvKFGjh72WRMU/mfXRWcez5xLRveUmHOjbzkN8g8EdFFwrND8WX1ncAa9nLqB5URuUzVZB7fc6iAlOAAgRTZmv3sBTPDhtvtcIboUvY= X-Gm-Message-State: AOJu0Yxr+RypZi7PkXz8VspVyv56XJPjKGDD9cHZ7RVE3syczo3Kw7js UTjfL0AJv6Qpk8EVM8i9FKLJUZI5XgC8S0G48SbuVOMpI4msPZ9BFWViRXLXR0w= X-Google-Smtp-Source: AGHT+IFMgwC69DMoi/qdpS3geBrRwusfaLDyoAizRfL/peuUo/6VpfZyOT7ZJpMKpugEbj3UCV3eBQ== X-Received: by 2002:a05:6000:1fac:b0:368:714e:5a59 with SMTP id ffacd0b85a97d-36b5cecf2a0mr6494090f8f.11.1722240073526; Mon, 29 Jul 2024 01:01:13 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42819d9a007sm45452635e9.1.2024.07.29.01.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:13 -0700 (PDT) From: Markus Schneider-Pargmann To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 1/6] dt-bindings: ti, sci: Add property for partial-io-wakeup-sources Date: Mon, 29 Jul 2024 10:00:56 +0200 Message-ID: <20240729080101.3859701-2-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729080101.3859701-1-msp@baylibre.com> References: <20240729080101.3859701-1-msp@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010115_680189_6B10D1DA X-CRM114-Status: GOOD ( 13.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Partial-IO is a very low power mode in which nearly everything is powered off. Only pins of a few hardware units are kept sensitive and are capable to wakeup the SoC. The device nodes are marked as 'wakeup-source' but so are a lot of other device nodes as well that are not able to do a wakeup from Partial-IO. This creates the need to describe the device nodes that are capable of wakeup from Partial-IO. This patch adds a property with a list of these nodes defining which devices can be used as wakeup sources in Partial-IO. Signed-off-by: Markus Schneider-Pargmann --- .../devicetree/bindings/arm/keystone/ti,sci.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml b/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml index 25a2b42105e5..7d6152710573 100644 --- a/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml +++ b/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml @@ -61,6 +61,19 @@ properties: mboxes: minItems: 2 + ti,partial-io-wakeup-sources: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: | + Partial-IO is a low power mode in which nearly everything is powered + off. Only pins associated with a few hardware units are capable to + wakeup the system from this mode. It is a very small subset of all + device nodes that have the 'wakeup-source' property. + ti,partial-io-wakeup-sources is the list of device nodes that can + wakeup the system from Partial-IO. + + This low power mode depends on the capabilities of the SoC and + the firmware. + ti,host-id: $ref: /schemas/types.yaml#/definitions/uint32 description: | From patchwork Mon Jul 29 08:00:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFBE8C3DA61 for ; Mon, 29 Jul 2024 08:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XaL7q+hiN8Znt9KwWlJ8p8DadxVN8fjOTmOOEp7Y4Nk=; b=W94Cud5VtPqc/oJ1DwS6b0wVeK 1P54/yC0jgeQUqBoPf0y0sKbwn8tF41TpvhXheTCi5q8KaofrjbqwSEkc9mC0WUTrlzPfCcCLNu4L pYSPbQeh7tuY9XS8Rz+l5TcXmVAiaPSQsfOU7/PjzrsD/yDAlAV3pBLGHPTWH+Jz6NiKuA0gXuc8N Z/anqm9hQhOeBT0x7qcb1QL8I/7FaoqW/bq2fNunpuNHWHOWRHvz70OcfjOYxDEnJQ6Ul+hGOfPyh BN1/uvOfDeaSuoi/PBPUb+DqCZM0gCmKlMr/GEYxg4NK3k9Y8Q9VuvdoPBY9ZUFaoi9sm43qGgcIc PQ1pnPNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLKw-0000000ASff-13jb; Mon, 29 Jul 2024 08:02:30 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJk-0000000ASF6-46sE for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:18 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2f0dfdc9e16so36028291fa.2 for ; Mon, 29 Jul 2024 01:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722240075; x=1722844875; darn=lists.infradead.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=XaL7q+hiN8Znt9KwWlJ8p8DadxVN8fjOTmOOEp7Y4Nk=; b=L+7rlOfFdtrgx+gXGBYBy6mjIUMDzlIhMUfzxEmNFUDdgpvenuZO4Y1YFnPBoVxCdN M41SMXyepHdiPwJFXHKvMq2hSMSgKVxf71tRLJkf6y/bw0VlLxEETr4RjXMuH1MHijk/ Jh2sL33duulwCWK2/AcloD+/jx4J5/qM8ft0aaFMvDnjutIJaAgIxWKgmTluJnrJoA+d XIXeRb8zpUSVJP7DGxchIWpqvSOtaDM+tCrZuYK4dLF34nJVuLDMTUcCpADajnl7peOC y1GLD28Cc5HTQEyElpZpYm2LpyR5/0xsXC8kGyp1+8/a/t3nmxGO+QXjHIUBc0y/9002 ITNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240075; x=1722844875; 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=XaL7q+hiN8Znt9KwWlJ8p8DadxVN8fjOTmOOEp7Y4Nk=; b=ed3ibewGhcU963uhH4qp+uAXT9EQBg5vh47rG413NRotKribTiu4l26ph44zk8R0hz bvMYl8YgJ8CIqhKtiaQlio3CvyzqCUHUNAZiIk7j3jJG7IKlApC+Rw9OqFSz5IwDvt22 BIkOZttzuEoBtzO2y4fhcju8t2iGt1ulXvz42SLmAI3Q8g0p8bz9NCfqw/DQ9tcJdG/Y Lw1IWpFzKRp/mMGkln2wQhpGdAU+tWLuhzrRn227wo0KUFa78xD/4GHbeeWMQqOdoH/e RHYpjZYsxW+WMNA/b5YjhNEdidwfjHjv4Tgb+llHWerhW1rCaNLo0xkgDTZxO4L83JyG JKzg== X-Forwarded-Encrypted: i=1; AJvYcCVOPhLyAEe8EvheYPrwiR94aNEjzc8XGPjSPQ5mL9MoMztL3WJq442GdyH9jvL7+HwTxK/H+DyHBCsJ1Hw5F2JLYSoZL+GFGhZ1MfPSotXKpl0UHNI= X-Gm-Message-State: AOJu0Yx6cxtRWx/zHrrzEC4kQV6sRIonA++Es0riVU1ww24X+Yq0Nw+5 ud9u6Q5l9JleWkZbSaZy3GiU7gReBrPy/H3idVRj53tr8JLVMQlABzx696in71A= X-Google-Smtp-Source: AGHT+IGtANNWAtpJ37DU4Kxw1e1nJWCUhsfVu/g/dZDrwXEI/bbW1ovATxt7o4e1cFRfgvw2yE0d6w== X-Received: by 2002:a2e:7c07:0:b0:2ec:5c94:3d99 with SMTP id 38308e7fff4ca-2f12edf8009mr44140081fa.2.1722240074606; Mon, 29 Jul 2024 01:01:14 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42819d9a007sm45452635e9.1.2024.07.29.01.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:14 -0700 (PDT) From: Markus Schneider-Pargmann To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 2/6] firmware: ti_sci: Partial-IO support Date: Mon, 29 Jul 2024 10:00:57 +0200 Message-ID: <20240729080101.3859701-3-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729080101.3859701-1-msp@baylibre.com> References: <20240729080101.3859701-1-msp@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010117_057168_C27D2717 X-CRM114-Status: GOOD ( 31.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for Partial-IO poweroff. In Partial-IO pins of a few modules can generate system wakeups while DDR memory is not powered resulting in a fresh boot of the system. The modules that can be wakeup sources are defined by the devicetree. Only wakeup sources that are actually enabled by the user will be considered as a an active wakeup source. If none of the wakeup sources are enabled the system will do a normal poweroff. If at least one wakeup source is enabled it will instead send a TI_SCI_MSG_PREPARE_SLEEP message from the sys_off handler. Sending this message will result in an immediate shutdown of the system. No execution is expected after this point. The code will enter an infinite loop. The wakeup source device nodes are gathered during probe. But they are only resolved to the actual devices in the sys_off handler, if they exist. If they do not exist, they are ignored. A short documentation about Partial-IO can be found in section 6.2.4.5 of the TRM at https://www.ti.com/lit/pdf/spruiv7 Signed-off-by: Markus Schneider-Pargmann --- drivers/firmware/ti_sci.c | 160 +++++++++++++++++++++++++++++++++----- drivers/firmware/ti_sci.h | 34 ++++++++ 2 files changed, 175 insertions(+), 19 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 160968301b1f..ba2e56da0215 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -99,6 +99,9 @@ struct ti_sci_desc { * @node: list head * @host_id: Host ID * @users: Number of users of this instance + * @nr_wakeup_sources: Number of device nodes in wakeup_source_nodes + * @wakeup_source_nodes: Array of all device_nodes listed as wakeup sources in + * the devicetree */ struct ti_sci_info { struct device *dev; @@ -116,6 +119,9 @@ struct ti_sci_info { u8 host_id; /* protected by ti_sci_list_mutex */ int users; + + int nr_wakeup_sources; + struct device_node **wakeup_source_nodes; }; #define cl_to_ti_sci_info(c) container_of(c, struct ti_sci_info, cl) @@ -392,10 +398,13 @@ static void ti_sci_put_one_xfer(struct ti_sci_xfers_info *minfo, static inline int ti_sci_do_xfer(struct ti_sci_info *info, struct ti_sci_xfer *xfer) { + struct ti_sci_msg_hdr *hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; int ret; int timeout; struct device *dev = info->dev; bool done_state = true; + bool response_expected = !!(hdr->flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCESSED | + TI_SCI_FLAG_REQ_ACK_ON_RECEIVED)); ret = mbox_send_message(info->chan_tx, &xfer->tx_message); if (ret < 0) @@ -403,25 +412,27 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info, ret = 0; - if (system_state <= SYSTEM_RUNNING) { - /* And we wait for the response. */ - timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); - if (!wait_for_completion_timeout(&xfer->done, timeout)) - ret = -ETIMEDOUT; - } else { - /* - * If we are !running, we cannot use wait_for_completion_timeout - * during noirq phase, so we must manually poll the completion. - */ - ret = read_poll_timeout_atomic(try_wait_for_completion, done_state, - done_state, 1, - info->desc->max_rx_timeout_ms * 1000, - false, &xfer->done); - } + if (response_expected) { + if (system_state <= SYSTEM_RUNNING) { + /* And we wait for the response. */ + timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); + if (!wait_for_completion_timeout(&xfer->done, timeout)) + ret = -ETIMEDOUT; + } else { + /* + * If we are !running, we cannot use wait_for_completion_timeout + * during noirq phase, so we must manually poll the completion. + */ + ret = read_poll_timeout_atomic(try_wait_for_completion, done_state, + done_state, 1, + info->desc->max_rx_timeout_ms * 1000, + false, &xfer->done); + } - if (ret == -ETIMEDOUT) - dev_err(dev, "Mbox timedout in resp(caller: %pS)\n", - (void *)_RET_IP_); + if (ret == -ETIMEDOUT) + dev_err(dev, "Mbox timedout in resp(caller: %pS)\n", + (void *)_RET_IP_); + } /* * NOTE: we might prefer not to need the mailbox ticker to manage the @@ -3262,6 +3273,82 @@ static int tisci_reboot_handler(struct sys_off_data *data) return NOTIFY_BAD; } +/* + * Enter Partial-IO, which disables everything including DDR with only a small + * logic being active for wakeup. + */ +static int tisci_enter_partial_io(struct ti_sci_info *info) +{ + struct ti_sci_msg_req_prepare_sleep *req; + struct ti_sci_xfer *xfer; + struct device *dev = info->dev; + int ret = 0; + + xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_PREPARE_SLEEP, + TI_SCI_FLAG_REQ_GENERIC_NORESPONSE, + sizeof(*req), sizeof(struct ti_sci_msg_hdr)); + if (IS_ERR(xfer)) { + ret = PTR_ERR(xfer); + dev_err(dev, "Message alloc failed(%d)\n", ret); + return ret; + } + + req = (struct ti_sci_msg_req_prepare_sleep *)xfer->xfer_buf; + req->mode = TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO; + req->ctx_lo = 0; + req->ctx_hi = 0; + req->debug_flags = 0; + + ret = ti_sci_do_xfer(info, xfer); + if (ret) { + dev_err(dev, "Mbox send fail %d\n", ret); + goto fail; + } + +fail: + ti_sci_put_one_xfer(&info->minfo, xfer); + + return ret; +} + +static int tisci_sys_off_handler(struct sys_off_data *data) +{ + struct ti_sci_info *info = data->cb_data; + int i; + int ret; + bool enter_partial_io = false; + + for (i = 0; i != info->nr_wakeup_sources; ++i) { + struct platform_device *pdev = + of_find_device_by_node(info->wakeup_source_nodes[i]); + + if (!pdev) + continue; + + if (device_may_wakeup(&pdev->dev)) { + dev_dbg(info->dev, "%pOFp identified as wakeup source\n", + info->wakeup_source_nodes[i]); + enter_partial_io = true; + } + } + + if (!enter_partial_io) + return NOTIFY_DONE; + + ret = tisci_enter_partial_io(info); + + if (ret) { + dev_err(info->dev, + "Failed to enter Partial-IO %pe, trying to do an emergency restart\n", + ERR_PTR(ret)); + emergency_restart(); + } + + while (1); + + return NOTIFY_DONE; +} + /* Description for K2G */ static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = { .default_host_id = 2, @@ -3398,6 +3485,35 @@ static int ti_sci_probe(struct platform_device *pdev) goto out; } + if (of_property_read_bool(dev->of_node, "ti,partial-io-wakeup-sources")) { + info->nr_wakeup_sources = + of_count_phandle_with_args(dev->of_node, + "ti,partial-io-wakeup-sources", + NULL); + info->wakeup_source_nodes = + devm_kzalloc(dev, sizeof(*info->wakeup_source_nodes), + GFP_KERNEL); + + for (i = 0; i != info->nr_wakeup_sources; ++i) { + struct device_node *devnode = + of_parse_phandle(dev->of_node, + "ti,partial-io-wakeup-sources", + i); + info->wakeup_source_nodes[i] = devnode; + } + + ret = devm_register_sys_off_handler(dev, + SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_FIRMWARE, + tisci_sys_off_handler, + info); + if (ret) { + dev_err(dev, "Failed to register sys_off_handler %pe\n", + ERR_PTR(ret)); + goto out; + } + } + dev_info(dev, "ABI: %d.%d (firmware rev 0x%04x '%s')\n", info->handle.version.abi_major, info->handle.version.abi_minor, info->handle.version.firmware_revision, @@ -3407,7 +3523,13 @@ static int ti_sci_probe(struct platform_device *pdev) list_add_tail(&info->node, &ti_sci_list); mutex_unlock(&ti_sci_list_mutex); - return of_platform_populate(dev->of_node, NULL, NULL, dev); + ret = of_platform_populate(dev->of_node, NULL, NULL, dev); + if (ret) { + dev_err(dev, "platform_populate failed %pe\n", ERR_PTR(ret)); + goto out; + } + return 0; + out: if (!IS_ERR(info->chan_tx)) mbox_free_channel(info->chan_tx); diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h index 5846c60220f5..ec8e6bb1791a 100644 --- a/drivers/firmware/ti_sci.h +++ b/drivers/firmware/ti_sci.h @@ -35,6 +35,9 @@ #define TI_SCI_MSG_QUERY_CLOCK_FREQ 0x010d #define TI_SCI_MSG_GET_CLOCK_FREQ 0x010e +/* Low Power Mode Requests */ +#define TI_SCI_MSG_PREPARE_SLEEP 0x0300 + /* Resource Management Requests */ #define TI_SCI_MSG_GET_RESOURCE_RANGE 0x1500 @@ -545,6 +548,37 @@ struct ti_sci_msg_resp_get_clock_freq { u64 freq_hz; } __packed; +#define TISCI_MSG_VALUE_SLEEP_MODE_DEEP_SLEEP 0x0 +#define TISCI_MSG_VALUE_SLEEP_MODE_MCU_ONLY 0x1 +#define TISCI_MSG_VALUE_SLEEP_MODE_STANDBY 0x2 +/* + * When sending perpare_sleep with MODE_PARTIAL_IO no response will be sent, + * no further steps are required. */ +#define TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO 0x3 + +/** + * struct tisci_msg_req_prepare_sleep - Request for TISCI_MSG_PREPARE_SLEEP. + * + * @hdr TISCI header to provide ACK/NAK flags to the host. + * @mode Low power mode to enter. + * @ctx_lo Low 32-bits of physical pointer to address to use for context save. + * @ctx_hi High 32-bits of physical pointer to address to use for context save. + * @debug_flags Flags that can be set to halt the sequence during suspend or + * resume to allow JTAG connection and debug. + * + * This message is used as the first step of entering a low power mode. It + * allows configurable information, including which state to enter to be + * easily shared from the application, as this is a non-secure message and + * therefore can be sent by anyone. + */ +struct ti_sci_msg_req_prepare_sleep { + struct ti_sci_msg_hdr hdr; + u8 mode; + u32 ctx_lo; + u32 ctx_hi; + u32 debug_flags; +} __packed; + #define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff /** From patchwork Mon Jul 29 08:00:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 180E1C3DA4A for ; Mon, 29 Jul 2024 08:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Qwj4fJ5PcTIVxTcnKoK6Sn5Sy7ClPbtzG5l0PUGLdrw=; b=K1wQUuV4gYsx/IpUvyhuevj0OX nYtD8qJ/yVfXLv8dmnKcwMK/9fFRZqMeIDcS30ZeG8pPbeE23/AZl2r6tRcbUTmctYwBC7yxGvAuZ 6OD/BjU4bEJeaJ1OmwVUcXF1D5jqgxT5ptuWli5u24vSj4whaUf0tRtTyKABhxkXye+JJnMXx07t8 2fxopknCnNOfO0LIApG+zlscFEj9ns0RZKIAohaSJpo81wCZw8xNL9ZMSQHaunzkLNLRUPZelzWbC qkoSgqHzu7771mhXp8kzUQvAPyIg0ZMY/FkB9GBEaAIQgWfpv0QUc6lReyERu5tuTAJeJndGOztT0 4oDGb5+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLLK-0000000ASsv-2PO8; Mon, 29 Jul 2024 08:02:54 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJl-0000000ASFM-3e8x for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:19 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2f0271b0ae9so40593111fa.1 for ; Mon, 29 Jul 2024 01:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722240076; x=1722844876; darn=lists.infradead.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=Qwj4fJ5PcTIVxTcnKoK6Sn5Sy7ClPbtzG5l0PUGLdrw=; b=bq6ITsHqkBr/+t/MiGvEqJdN8w0xuHIOe19x+H8Qur0scFssIdFC+J+BVtck+Q2zj9 YixGoiaUwndZqSgTzX5FLK1+XNQ9tJEH2hgrPs6g4VuhqeXYQE34jCtUGNuHPxWEnHVi 9X+v6v16MiaKL/JII+Bp/YRgxZexp7dpPfxDjEspUIp1T1ZkPdLklZ4fqOkncmJ+7ACg OBnz3R4W8Opm83ORQv3ftGR1ndNSam+7D3M4ZRwkkS+yOdn4MdqqBUSS+K+zI69OvEi5 gwB7o3+yOJ1SFyNS6Yxem8ZeER10tY0XL62VJVRrypqraThZKMqJOUwisDFEY33pVo/P lHxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240076; x=1722844876; 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=Qwj4fJ5PcTIVxTcnKoK6Sn5Sy7ClPbtzG5l0PUGLdrw=; b=Nr13i5RthD5onk4+3jI12NNWKceEE6rmfNWhtic2y1o0732Bdgj83MDYJMljdZff1+ Cy/bsQIPlaf/grmugNr7KUPmeA1bFMMIma70o2E/Nhnos9ewdP32FCNi8TTwb0seOFtJ DpBR/SHUyQfDCFtO2xk/tfu8/RwrModIrcs7heSliTOehVvHyUWxs9btnj+l3N7lwJ5e huWJ98IUXxJhmzSYyEzRkjt0/AZTAllV4+ClHbaZPI3pEYZFlwfL2fkY5hU9LlotUFh7 wJHoiDNJtz3yVhRsybp3Ad0DtqMLhyeFOkJeE5ykfkXNh1C6CPzWsBtHFPyyfzVnAdgG wthQ== X-Forwarded-Encrypted: i=1; AJvYcCVLYSe4/U3+UmR9NJapnl0QbgfuFLt05tBAxCDzFEixXW2DB3kefkpvnMLt5J9radHnHNwjBCqh+Rr+kdwJhGUglRBuo6g26eqw6ZFIxSPDlFxpryg= X-Gm-Message-State: AOJu0YwmXr+sm0uafLE+LbJ8s52x4sdnl0iFHC3pi1arMbXnJLWqTh9i oriSTTBj+4MH8azeSkACyukDQDpBmpaxx6e01N7Oi3Hy/pQryjqb5Ok5UyYXJNo= X-Google-Smtp-Source: AGHT+IGk+Ma28FqZivTy+Lwf3ij5OpU/7rZpCibyXnynu0+yv9j7Y81EKKbkk1ve4///COt/muKc4Q== X-Received: by 2002:a05:651c:102a:b0:2ef:2d58:2de5 with SMTP id 38308e7fff4ca-2f12ecd1b89mr39762381fa.11.1722240075632; Mon, 29 Jul 2024 01:01:15 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42819d9a007sm45452635e9.1.2024.07.29.01.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:15 -0700 (PDT) From: Markus Schneider-Pargmann To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 3/6] arm64: dts: ti: k3-pinctrl: Add WKUP_EN flag Date: Mon, 29 Jul 2024 10:00:58 +0200 Message-ID: <20240729080101.3859701-4-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729080101.3859701-1-msp@baylibre.com> References: <20240729080101.3859701-1-msp@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010117_930892_D60D4CEE X-CRM114-Status: GOOD ( 10.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org WKUP_EN is a flag to enable pin wakeup. Any activity will wakeup the SoC in that case. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h index 22b8d73cfd32..dd4d53e8420a 100644 --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h @@ -12,6 +12,7 @@ #define PULLTYPESEL_SHIFT (17) #define RXACTIVE_SHIFT (18) #define DEBOUNCE_SHIFT (11) +#define WKUP_EN_SHIFT (29) #define PULL_DISABLE (1 << PULLUDEN_SHIFT) #define PULL_ENABLE (0 << PULLUDEN_SHIFT) @@ -38,6 +39,8 @@ #define PIN_DEBOUNCE_CONF5 (5 << DEBOUNCE_SHIFT) #define PIN_DEBOUNCE_CONF6 (6 << DEBOUNCE_SHIFT) +#define WKUP_EN (1 << WKUP_EN_SHIFT) + /* Default mux configuration for gpio-ranges to use with pinctrl */ #define PIN_GPIO_RANGE_IOPAD (PIN_INPUT | 7) From patchwork Mon Jul 29 08:00:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744520 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7293DC3DA4A for ; Mon, 29 Jul 2024 08:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lznQr0jMS1hTSLYpt3zZD9a+rnGG0mWFLbB4ZWDI+Vo=; b=DdRcBmDRoIrUtpfOAHAQLLw7EY C/xC0RwFlrBFzCUFhYYFN1f4eqOhEX2Ulq9Z1V8xiJT/PHAHSTFR5OKsMuSS5KAgla1dOelDEa9wM 5PciBpR56/O4WWOiXv+nIY2xfQQsTS7r0Z+G9OnstTNW5wg85sv4TCZWBm8Ucxk9eMdwzX1Gb2PGJ kXKGgXcj/3rnr6l4+8yl8/srgOH9MrCzXoRG21UR4aiQZg9oW8iG+/x48gRbpbqyY++4YONkg6/hG 3Z2jG8Y7ce379VyrF/wZdXdDOw/mMK00456rJcISL0VH9aWim5oYVgwJY1F5BMeNK1nXddpmxOdbY qv1jDxSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLLj-0000000AT2h-3lX2; Mon, 29 Jul 2024 08:03:19 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJm-0000000ASFo-1yjx for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:19 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-368313809a4so896967f8f.0 for ; Mon, 29 Jul 2024 01:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722240076; x=1722844876; darn=lists.infradead.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=lznQr0jMS1hTSLYpt3zZD9a+rnGG0mWFLbB4ZWDI+Vo=; b=JyXxupvB9ukGWPh7uBHrh34wwb9Gulw6Zeav5A5dPidGeq8pYlcEQykowpJXUUUUtF erw5+JSD9jKE3mFF0NUJ2Tj+0+VbOlN7jzafZdqWj06jl1eyDG+Wiag1GT4PWP3IOXop P9uKpXPVnrDUinqUDYUr6p40UyofPUpuuzHBdllRF7IMIlAKJxJDSndzmtck9X2AlI9a uVKhshNgZi1E6tu0o+VFftiK5imO6YpU+lyYoMpI/N4ltD5loRI7FDv4RV4XiD7ZDkOG wiPn33bks9AuJjTnjU7k9IyMusAA0l4UADoqGi2E+jMGoFsPfR0OtQoh20DuQsjwYOw9 xxjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240076; x=1722844876; 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=lznQr0jMS1hTSLYpt3zZD9a+rnGG0mWFLbB4ZWDI+Vo=; b=K8fGu9MHrW0neMrPyDgyU9QkOGn9LOWoSZLYMaXbbHAKA7KHAi7nEjuFRoRspSLfD6 RO4cORQ7cBuNLuPWk4tr1RjVQyFBo402b6Ueqg5NTkPdwI3eHBdLmkl96XGk148inUQu eyvZqQDmCjdt2R8cjE2qfb8PVwh5vGEoY9oqL4p9Sqi/XZzE9sYDscZsPVFXQrzyNJwU j83oYx2LaOuDeQ4TG26l0YraTZpw1D0hBXVeSWBqtzocBoeScRVlyviCJgx5DpNnJR8D FUebeJcReFunh2kjjrmL03pBnTwZvGxqy1q2Fa37EwOFuuPO2wFLSxaJJBMkqY/dS0pX hjSw== X-Forwarded-Encrypted: i=1; AJvYcCVyghIjyPaGo5e4B6aBqJBgSy3evyjMmZ5G3Z24oAo8wlD0e1BcZhdy3sxpxvx3qDQC/MJ8W1P93pReb6auad8l3YsUPOgy739qwWHtR556+ZwJ/PE= X-Gm-Message-State: AOJu0Yy1Q2+FgNVI3hF9bh9bQPCCGTJarTFu1QJgyJzHbN8myk7943PO bw7QIWKLxAAwIf5pOxWDqWfnIBtfbNqN9MHyAcK67Wt5WyAYoey24SrzOeWbpo0= X-Google-Smtp-Source: AGHT+IH/sKkBGs22dutys1BjvCqtKuAkAgjEZni/gmQywUyTEpKEfEuJOGjetR+NjIPAma/Q1+SuTA== X-Received: by 2002:a05:6000:1101:b0:361:e909:60c3 with SMTP id ffacd0b85a97d-36b5d7c4bfamr3707368f8f.9.1722240076629; Mon, 29 Jul 2024 01:01:16 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42819d9a007sm45452635e9.1.2024.07.29.01.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:16 -0700 (PDT) From: Markus Schneider-Pargmann To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 4/6] arm64: dts: ti: k3-am62: Add partial-io wakeup sources Date: Mon, 29 Jul 2024 10:00:59 +0200 Message-ID: <20240729080101.3859701-5-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729080101.3859701-1-msp@baylibre.com> References: <20240729080101.3859701-1-msp@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010118_539085_DD1DDC2D X-CRM114-Status: GOOD ( 10.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In Partial-IO mode there are a number of possible wakeup sources. Add the list of phandles to these wakeup sources. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi index bfb55ca11323..2bae8550c900 100644 --- a/arch/arm64/boot/dts/ti/k3-am62.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi @@ -122,3 +122,7 @@ dss_vp1_clk: clock-divider-oldi { #include "k3-am62-main.dtsi" #include "k3-am62-mcu.dtsi" #include "k3-am62-wakeup.dtsi" + +&dmsc { + ti,partial-io-wakeup-sources = <&mcu_mcan0>, <&mcu_mcan1>, <&mcu_uart0>, <&wkup_uart0>; +}; From patchwork Mon Jul 29 08:01:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744521 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB126C3DA4A for ; Mon, 29 Jul 2024 08:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JU8YPDGhfgyNA8aWOgCS08s+SEmwnZ36/MbZAdv9Jy0=; b=wR3CX7P5aA82tMSIVaEuRpI9t9 EIulsV0A0wZqRkI9zyDOl+HuBBuyJkDHqxsf0e8zoUY4VyUCixnl3HhRoAbOET3KHX5zGTjntfIP3 c8yyz7Gnfx/8iF71FPJbiDlzXqSJVACp+UjPKaDp2VWOLThXN7Hto7XTvGo7kqU0MvKhyikVrKQoa A8e/tsTccZesCxiUVM1VS2v5Ocwejuop5DjcZUvLBrohDiEGY7mR234WrVP3R+wcU3o7g7IWxAK+I RA58EUSPZ7PTau61rFSnhTASZJl1POnYPzCyPhjDgKM2VaVBmvv/qc3Zee/agfT2wXElgbzKKNdUH 5wL6jvPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLM7-0000000ATAb-1iUA; Mon, 29 Jul 2024 08:03:43 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJn-0000000ASG7-0n88 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:20 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4280ca0791bso12581585e9.1 for ; Mon, 29 Jul 2024 01:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722240077; x=1722844877; darn=lists.infradead.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=JU8YPDGhfgyNA8aWOgCS08s+SEmwnZ36/MbZAdv9Jy0=; b=tMfldmZ+tP06X3CsXrUbC/XtYeT3OiMtTR840kJZksk6aqQbi/+A3P2Va152sfOdut DoN3ONoOQ/xaxWAuyXT3Bt9+XmS5byItH/2LJ7UKjs6m2YsK+ePuYuFPaV19zuVgsxik cFcxuIe0UYO4pXJWwG/DwvHvXBSji3GBug/k8xLb6xa1m86sswhbzFydhCCg7elVq7IA kSU+HHQmjTIQRecr9khIPOHmHcfHCcF1JTP2fOWV12KA/Lo90/8y0axwaTeDnNG1X6Vy BcDdxZjL86Rd5G3CdYctCdQx4XWOJ16KxG+uYUKr43Va/EO2HbgVUy6kfqvfXqchr8xz h2HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240077; x=1722844877; 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=JU8YPDGhfgyNA8aWOgCS08s+SEmwnZ36/MbZAdv9Jy0=; b=wMU9CK+Qekx5o9MwfeuRqDlrKjWv5LQKbojy7x7OZhSIfiLr7dHBSoGVtun9FI3GX1 4VqqSRZq9Ami10tDkJQ4ia3pnT2OTFllxc74ilKrMfZB22Y/mKiNWuu2X8btQX0EV6lQ ngHv3MoWIePMhbtlTWYYa3x1rSysMmf5FCaPpHKfOUsylWdqeLVtnexS5KkUZuyuu7aD poFzvicQ8MxGgNptA0J2AQuZk59PAqr1NQ4z5xHU1N1qZPVZUJY5S5NUnfdxtAlNDSPr CTJQo8u1FEiuvokwwn1irp3QSZyQVwEycE8yJ2uj2ME4ceVhqHWIXV7AaB5P5r0mUcJ0 ZCMA== X-Forwarded-Encrypted: i=1; AJvYcCVT6sXvEXcaZ8QMXaHD8Xycd/TukAEG+z6lW+so/K0+wA0N/TUpr+mGsFj20yD7L/1nW4o+xvKZ1aE1WlExGbObn1ttNlKcpPlr73yzeLqsy/6aWsQ= X-Gm-Message-State: AOJu0YyUaCxU9+BuYSUN0GPzO8TpMDc/xhNqynmBV39WPML58wIJV5an eqFl7ZHTi9uBOwlXYyCAjfnudKsC+sAezJw1qsanB8TAoBzG2SrKIZA5sEeu+Fk= X-Google-Smtp-Source: AGHT+IEzvxgrlq2sVwdVFU/d76RGHkKf/FL9gxRWixH14NbnUpqsy79WU0duVX8v51Y9Flhr4p4u/w== X-Received: by 2002:a05:600c:3c95:b0:426:5dde:627a with SMTP id 5b1f17b1804b1-42811dd48f9mr43960815e9.23.1722240077554; Mon, 29 Jul 2024 01:01:17 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42819d9a007sm45452635e9.1.2024.07.29.01.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:17 -0700 (PDT) From: Markus Schneider-Pargmann To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 5/6] arm64: dts: ti: k3-am62a: Add partial-io wakeup sources Date: Mon, 29 Jul 2024 10:01:00 +0200 Message-ID: <20240729080101.3859701-6-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729080101.3859701-1-msp@baylibre.com> References: <20240729080101.3859701-1-msp@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010119_249978_8F46A9BD X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In Partial-IO mode there are a number of possible wakeup sources. Add the list of phandles to these wakeup sources. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62a.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62a.dtsi b/arch/arm64/boot/dts/ti/k3-am62a.dtsi index b1b884600293..5c13851c29ec 100644 --- a/arch/arm64/boot/dts/ti/k3-am62a.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62a.dtsi @@ -123,3 +123,7 @@ cbass_wakeup: bus@b00000 { #include "k3-am62a-main.dtsi" #include "k3-am62a-mcu.dtsi" #include "k3-am62a-wakeup.dtsi" + +&dmsc { + ti,partial-io-wakeup-sources = <&mcu_mcan0>, <&mcu_mcan1>, <&mcu_uart0>, <&wkup_uart0>; +}; From patchwork Mon Jul 29 08:01:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13744522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95ABDC3DA4A for ; Mon, 29 Jul 2024 08:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=29uxXeDOeLQP1GMl3yPmsnZHtmazUFEQgig3ecXgCqg=; b=sQa888AMwJ4v+IIRxGBIVDQHy1 QbrMVHUiD4Fducrj3KfC4be6/XidPsd6Pw5fVC2hzTugzY06OiWS/VyY5mFzbu68VSllU4n+l3nn5 4EuVG5FrUJKUPJPr54ltu4D+rcB//yCzotxO0BGSZucbpIIqvSWi7KJppx2r9EDsReRaoatm3sSok L5HgDPw9LZr0AI4mlf4DIqSkqTEXykHUPJtaXxXCJeiWYL8GuM22SjSy5Qi2zTF3tDpeI52J3e9qI ZsmboYHVAqLHZOB7B/Y3Ldqf7L4ql1lvDEC+iXHgAMtxpJ7RAvyWQC1tbYjARXqZgrGNrANfX+z+L F0UUgCLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLMV-0000000ATFH-2VtG; Mon, 29 Jul 2024 08:04:07 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJo-0000000ASGZ-1Bzu for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:21 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-428163f7635so12418005e9.2 for ; Mon, 29 Jul 2024 01:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1722240078; x=1722844878; darn=lists.infradead.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=29uxXeDOeLQP1GMl3yPmsnZHtmazUFEQgig3ecXgCqg=; b=Nz6HEz7rikjyWn2hf5Va1ZmA55IIggfwuq0gDvrdm3CQCrx8b6OsYDS21xd0j2hkYE 8C+VoDJZm8P+iQUWzecXi0ygAY0LhtEYjh/r7O9fTvSDPVn0+x2BMtQCD8G7m1+DJv/0 mzKVbvHdtLfanBPERBhaR2WK+HDiPlGytGCV18RYk/B1j5UPjmhyeGeqSRCniqAetGHV 6qz6Jz79OXqBzJB/ZlgjPNNU0vP76zvFA9tEZwHV9EbL5cs7UDkimnCw65joKNMRarRu X9iuITA2AgI03gYw06rCyXIng7SPTDpCEpMnKLql9Uq2Qvq6N4fSm/wrgg4NiH4R+dvo zb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240078; x=1722844878; 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=29uxXeDOeLQP1GMl3yPmsnZHtmazUFEQgig3ecXgCqg=; b=l1wVjSZw2rYbe5wCu6lRHrEy3iy/5uXnGKGNxvddYu/fndD00d533vJAUsmuTkWtjx pRqlnIfJVhD8e1B0teNXwZFXFGXSO8lD1XClXfZweolUF808o93VlQu0qpgUSFZ5kDj7 0USdjFoNG5GQqU7lFfYgRDLxUs6C4pC+WU3HvhTV1QITzbCQAmnaBLe1GU3WXKwtOKhe IwJpmLJZFggCpp8j4SnWjv6U2VlPkH9Q5B9CA2AV+1IYADgNm/Ea2yfshh0IBRAiQyUO IolsVLj29vkCvjj5XuBR377rf5zn5k/4VPmQRE5lpEh+NBr+/KKJkDFYj6t27valbXpW SjbQ== X-Forwarded-Encrypted: i=1; AJvYcCUDX1gv7Xt8bw/6ZcccZIXQdQBeFcVXkC5I4uypnC5AO9KU4hnH3IM8QDOZM9ixQXTMSVIG8j1Xc5smVFuvAvjYrh2EXN5QuDZXL6L+JwFpg2i4+wo= X-Gm-Message-State: AOJu0YwN+1EQPT32k0tw6YAMBWaD0Q+FEd+AMZ9vZFDuq8ARR33ZmOJ8 W60+4fg2RCGKxvtPj+BOGrJMf5M9Pvz+nyceeu6M3CSB5Wrx7wf5y2tGUDqBlok= X-Google-Smtp-Source: AGHT+IE8Yiz/LWA3dIxdU0iaNYEV0D8RMGb+YexRP1/S+Yunh4kjB0gxOiHKJnPBRA9BZEvGWGKF4Q== X-Received: by 2002:a05:600c:4447:b0:426:5c34:b19b with SMTP id 5b1f17b1804b1-42811d9af49mr44304765e9.20.1722240078644; Mon, 29 Jul 2024 01:01:18 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4091:a245:8609:c1c4:a4f8:94c8:31f2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42819d9a007sm45452635e9.1.2024.07.29.01.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:18 -0700 (PDT) From: Markus Schneider-Pargmann To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: Vibhore Vardhan , Kevin Hilman , Dhruva Gole , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 6/6] arm64: dts: ti: k3-am62p: Add partial-io wakeup sources Date: Mon, 29 Jul 2024 10:01:01 +0200 Message-ID: <20240729080101.3859701-7-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729080101.3859701-1-msp@baylibre.com> References: <20240729080101.3859701-1-msp@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010120_357062_CF6BAFBE X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Vibhore Vardhan In Partial-IO mode there are a number of possible wakeup sources. Add the list of phandles to these wakeup sources. Based on the patch for AM62a. Signed-off-by: Vibhore Vardhan Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62p.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62p.dtsi b/arch/arm64/boot/dts/ti/k3-am62p.dtsi index 75a15c368c11..cd81f6d173f4 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p.dtsi @@ -126,3 +126,7 @@ cbass_wakeup: bus@b00000 { /* Include AM62P specific peripherals */ #include "k3-am62p-main.dtsi" + +&dmsc { + ti,partial-io-wakeup-sources = <&mcu_mcan0>, <&mcu_mcan1>, <&mcu_uart0>, <&wkup_uart0>; +};