From patchwork Thu Dec 19 20:02:12 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: 13915728 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 432D7E77184 for ; Thu, 19 Dec 2024 20:12:21 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P7TbOAl0J1+553i2D7Hvckux88gOuL0DZy0CmTdqsmc=; b=lBV3Rasstwhwy+ZoaZxi6jT5bS 38ZovqhtNxs8BsnE6F2kvwMoZ+Ts/JF1fpVBe/4EAMuUbt6dF4AncvRWvQLiGqKNJlALfETtHUFZf 0wkhKpz6M2LXOYP6pkt4dgW4e2LKBDeCMV6QFwa7+qXSjxOsKTOQinSCVp5ey7ZJ7boG9t47nxsNb aa8muvk42ZD/cCoMGGqF/RMVOmWH5BklZzU15lvX9v8dCAzctCuVZE9nXa/EHV0Gwj7x1zVhtMHfA UrCuk3i6EirR0XVhkPP/nQb+fpWYCCsscOhpCIcocyCrvA9pJtwoNUkGA7HmvC3bppF5kdLlR0Lc4 1l91zpew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMsT-00000002zBJ-3TnH; Thu, 19 Dec 2024 20:12:09 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMkM-00000002xZH-3xL0 for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 20:03:48 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aa66ead88b3so217779666b.0 for ; Thu, 19 Dec 2024 12:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638625; x=1735243425; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=P7TbOAl0J1+553i2D7Hvckux88gOuL0DZy0CmTdqsmc=; b=zSeecQ/wKMbmOx+0+9ioc1nTJ/uyN6HCZrC4e1AHJq1Bybj3spowk9Eqbu1+TyzqZO Cij80u9uAc9LZpMtKGgxnaz+TxyqTNbtF7NsW1GEJmzbqkkINTMplObjX0X3W5DlOAgn frrx4kcRYgjdxuFwjA/xzXCV03rlVlW2PQhrJmmuwn0iIf+IWNRgKomSM99n/6WVzZLa A0GGbZUF3DgzHELVIdmXPYKttm6BU6KrmeCWQ3sHo3ljKRl+FY2I6HahEgUYx53UlUZ4 4eO3TC8MbE6Y+2y5Mi1Hb/UwMj8TROYsn+B+rhdgib6q7+QJF0mb6bMVKbjcSWXwtMM4 f6qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638625; x=1735243425; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P7TbOAl0J1+553i2D7Hvckux88gOuL0DZy0CmTdqsmc=; b=OhWKkzHxaysSTgF3ar2RWsauRwr755o0dQigU0S+IP4H7cDmpr2Ep6iJ1wk67Rjc0R Su9xiZsvnskdxyA94SdaNIlV0iOyivCdN1oco/JSYb4+P36PjqATEGcpprM1Kg6ruwCu t8cvpVJHx8kHpEDH4j/nOLTqhJWkuBYZ3DVKpNyw7HkkG/zf8OpBYgAWQV2q9rE//iQV 4A7p7uaIfvdpOy3L3IWhndI5BDASIrDGdRQ5A717UPQBkrwSC5d9JTmLgKDhz1S+caSW XROS4K8SwoIUVi61iwi3ErorXrz8usLF5t3MYKKFX/z7klIwAzx76B3eVoexXgTJnLX0 As/w== X-Gm-Message-State: AOJu0YzHcMiApA7uCXuPIfTwpq8soVxe9uht5x8RKyMJ1tt661QgS/eG bEx6SkVYGguLygiDvFaqyG9z3UhQvDFFP6mDFUgy7428OTh0NH+QxpaXA6QkN8Y= X-Gm-Gg: ASbGncvvQIW+lLnFgfxd5m+YTSxhKiQ5KfCvWq0WOFS+vUkWBI/z7z/M32UPZddwpb7 TxzFpArGsrfC+tfVHzLtMxLYvVR2GWgsPXNqOoQfPqB9UUullSnF+MbJ6RDl4YaDSdDXHMmYbYg v6EHzUqzWtUH+jOeS1L5zq+hCEMxfOIerWqmmCYqiTNrWaSTiGZR/8yTrVIQYuEABnxPCYrAB4B UpXwZWTfXugh7F51xt2xJInSKnqRQ+w7aOu0WKFdqT8fr9sTg== X-Google-Smtp-Source: AGHT+IGUjzXtWgTATIKd5bQdVHnA1/eo1JxNSwRoyL3yoIMsS7bxhfApz1VdWzX+tRETXv44jWlE+Q== X-Received: by 2002:a17:907:3e8c:b0:aa6:abe2:5cb8 with SMTP id a640c23a62f3a-aac3366f16emr5355966b.60.1734638624897; Thu, 19 Dec 2024 12:03:44 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e8954adsm99935266b.64.2024.12.19.12.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 12:03:44 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 21:02:12 +0100 Subject: [PATCH v4 1/4] firmware: ti_sci: Support transfers without response MIME-Version: 1.0 Message-Id: <20241219-topic-am62-partialio-v6-12-b4-v4-1-1cb8eabd407e@baylibre.com> References: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> In-Reply-To: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Anand Gadiyar Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=msp@baylibre.com; h=from:subject:message-id; bh=r5ZUm8egrlEYPDoShASduxwkqRTGU1fuNRSx+4vY6C0=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTarj39TIrHVuh58/m8JBRxrr1qJ5uREmCxJxbSsaiq ZwXu7Z0lLIwiHEwyIopstz9sPBdndz1BRHrHjnCzGFlAhnCwMUpABP5tJ6RYZPROX8WkaCDr54v ar7xNHraOY+HXUInGqX2H0xJm9e4Upfhn+otye2fkkWaw2PnSnS2aloe7Hv+uyqESeRU+tFuzap 8BgA= X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241219_120346_983845_88946465 X-CRM114-Status: GOOD ( 14.53 ) 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 Check the header flags if an response is expected or not. If it is not expected skip the receive part of ti_sci_do_xfer(). This prepares the driver for one-way messages as prepare_sleep for Partial-IO. Signed-off-by: Markus Schneider-Pargmann --- drivers/firmware/ti_sci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 806a975fff22ae00ecb88587b2c47ba172120bc2..ec0c54935ac0d667323d98b86ac9d288b73be6aa 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -398,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) @@ -409,6 +412,9 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info, ret = 0; + if (!response_expected) + goto no_response; + if (system_state <= SYSTEM_RUNNING) { /* And we wait for the response. */ timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); @@ -429,6 +435,7 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info, dev_err(dev, "Mbox timedout in resp(caller: %pS)\n", (void *)_RET_IP_); +no_response: /* * NOTE: we might prefer not to need the mailbox ticker to manage the * transfer queueing since the protocol layer queues things by itself. From patchwork Thu Dec 19 20:02:13 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: 13915729 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 2CEE8E77184 for ; Thu, 19 Dec 2024 20:13:27 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uFRZT6aUXjKTbCGojpalElYCZdqSqNPmKq/izywmlN4=; b=Hwf/luEgXNUGC6PF0F2JsaqGBi 0BA5o0S55mYZlKz858IRt6IXXmW0XEqVxCSddBfuXBHC36grWn3auDuXu1exUPHpnbGvrHl8FFaa9 uSAlwou/5gz2ON+NLy1s5RTOwQU19EhI0CITTGYsvrgRnqqACCaLAGvDGvXOv8TGdYZNOMF5zKojl 1VAIxQaRUopzyP1v4NmJbt//e+Bn451ZonqtDRAWpk8032r5XbbsLYwYzQNmsPCZu5smQcRQwHO0w Y1C0fGikYjNSR5gxGMFt/KVaz8IEPS7jZHHZFTZGEtw1C0is/9n7DmyhakRZ+Q/2IhiYdG7ctE4kF HRPksiRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMtZ-00000002zVD-1z7G; Thu, 19 Dec 2024 20:13:17 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMkO-00000002xZb-0oaT for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 20:03:49 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-aabbb507998so223877366b.2 for ; Thu, 19 Dec 2024 12:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638626; x=1735243426; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uFRZT6aUXjKTbCGojpalElYCZdqSqNPmKq/izywmlN4=; b=HgdBeE1n/P1laHk+W9uaCVMvGtJ2v6o/C0P9f0K8VyfdPAnJK+F4zXr+ltHRzuscFv 5wwsscDLJw57sSdxQO4zd4BpKFriRUx3U0e5Tmdx2xqwCKDopjUvaCNeIa4HHqK0dTO/ g/ld3sfKeJ/D30svWxP0OfX5mXOdBWGs6xQ5g4E/WdyOjgcYXx8Z1JoDxRN9jPbX7obZ atB6GQ76vHyj++KZAzjYpd5E100LrQ5t+m5YX3QwCzk4/XhJyLJz0ZrFdh2lUovWDTnE OITjcXZrZWoVF8eaKhrED+PH1e8lNon+a3h/Q2Q7Ofo3cgdDzQBKGxNpX4rDEQaMtmc8 3I3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638626; x=1735243426; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uFRZT6aUXjKTbCGojpalElYCZdqSqNPmKq/izywmlN4=; b=Au3vTeFy1VPA2/pe4SgTnc7frCyh0/fHjJ2Btp7wy8QlSidXuPES+xl/tfIFBeLGUU e719zyRNFfNKpRQh6KyCOYSMhP8gdOife1vHuDUjfV1kFkhQMH9fj/RPOu0dX6rNvEzW VreCBCbkUlbIl/4SzPxPhrpVMYoOJA8iwL9T8YzDRg7jGSpSRWIFAu8UZ1lwTOYqJ6jV YSk6lU/G07ltkdX5u+Y9A2fh6Om4Meaz87S34J7MX1GmjGiUi0SX8T84rTDL0UCV5EU4 nU2oM/Ox6RqEFF021pBkjwysIYDj8WpSsFCWnpVyupSvd8DDtRbcdfRtOjFaCATpNa2u jHdw== X-Gm-Message-State: AOJu0Yz6ldocwQdP+2oE+JImNeTJXWBubBLCOQY0SwIulDtoq3Loex+d QEjwR8GviQ+oUvdIhC5olvv7CP3E9GlhuokqStP6G3Gh8dmcFQrwfxxpX4Oa8Cg= X-Gm-Gg: ASbGncuHmZR1I7utwQP7PQXZCbcjasxZLLj0CVgD0MD2NHlyp4Uyg34a7rIG8h9vxa+ eoL+ZH6QJ0efzhU1wNRNul8uGdecnWC4H2x8bPBYRk59p6RvIZcWfwYchvaEWtnx3IGnxMo8Kia er+vNrSFUbxIbJJUGhuWV828oaWiHTvdVI0qYF2suCYvLX6+l3pNKuQcf34UUVRzHjGOKFlTmJ0 3jYbPFtCEok/3o5MgO8WrsuymFCPLHo314jXxOcW8Dcd0Wy7A== X-Google-Smtp-Source: AGHT+IEUHdNFbmAQ3AycKsc1OqVii/2jmmJDssrKygmG3svwpvJf2fJe2z0LuAZH9swXToIpEPPk/w== X-Received: by 2002:a17:907:3d8a:b0:aab:9842:71f9 with SMTP id a640c23a62f3a-aac2ad8c58dmr5033166b.22.1734638626100; Thu, 19 Dec 2024 12:03:46 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f066130sm98016366b.183.2024.12.19.12.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 12:03:45 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 21:02:13 +0100 Subject: [PATCH v4 2/4] firmware: ti_sci: Partial-IO support MIME-Version: 1.0 Message-Id: <20241219-topic-am62-partialio-v6-12-b4-v4-2-1cb8eabd407e@baylibre.com> References: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> In-Reply-To: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Anand Gadiyar Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6234; i=msp@baylibre.com; h=from:subject:message-id; bh=rrxkM9wENQkQ5BRvp3GV3Fgk68SnQpzcLBWyU5asn80=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTavhLGkUXvH4w9/vuA289jCQ/sJ2Szn3/On7dpYsBP kVvqmfLdZSyMIhxMMiKKbLc/bDwXZ3c9QUR6x45wsxhZQIZwsDFKQATOTeB4b/D7DXBOyd2G66e lTqxX/OJ36E96avWPr6x1P2PuMkULt3nDP+Uvuq99HbiuvmpKHCn8kOe038VGSSETe6edjm+Skx hzhpOAA== X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241219_120348_242428_EEFCB273 X-CRM114-Status: GOOD ( 26.25 ) 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 hardware units can generate system wakeups while DDR memory is not powered resulting in a fresh boot of the system. These hardware units in the SoC are always powered so that some logic can detect pin activity. If the system supports Partial-IO as described in the fw capabilities, a sys_off handler is added. This sys_off handler decides if the poweroff is executed by entering normal poweroff or Partial-IO instead. The decision is made by checking if wakeup is enabled on all devices that may wake up the SoC from Partial-IO. The possible wakeup devices are found by checking which devices have the "poweroff" in the list of wakeup-source power states. Only devices that are actually enabled by the user will be considered as an active wakeup source. If none of the wakeup sources is 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 wait for 5s and do an emergency_restart afterwards if Partial-IO wasn't entered at that point. 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 | 115 +++++++++++++++++++++++++++++++++++++++++++++- drivers/firmware/ti_sci.h | 5 ++ 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index ec0c54935ac0d667323d98b86ac9d288b73be6aa..693ac816f8ba3941a9156bd39524099ca476d712 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3746,6 +3746,100 @@ static const struct dev_pm_ops ti_sci_pm_ops = { #endif }; +/* + * 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; + + dev_info(dev, "Entering Partial-IO because a powered wakeup-enabled device was found.\n"); + + 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 bool tisci_canuart_wakeup_enabled(struct ti_sci_info *info) +{ + struct device_node *wakeup_node = NULL; + + for (wakeup_node = of_find_node_with_property(NULL, "wakeup-source"); + wakeup_node; + wakeup_node = of_find_node_with_property(wakeup_node, "wakeup-source")) { + struct platform_device *pdev; + int index; + + index = of_property_match_string(wakeup_node, "wakeup-source", "poweroff"); + if (index < 0) + continue; + + pdev = of_find_device_by_node(wakeup_node); + if (!pdev) + break; + + if (device_may_wakeup(&pdev->dev)) { + dev_dbg(info->dev, "%pOF identified as wakeup source for Partial-IO\n", + wakeup_node); + put_device(&pdev->dev); + of_node_put(wakeup_node); + return true; + } + } + + return false; +} + +static int tisci_sys_off_handler(struct sys_off_data *data) +{ + struct ti_sci_info *info = data->cb_data; + bool enter_partial_io = tisci_canuart_wakeup_enabled(info); + int ret; + + 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(); + } + + mdelay(5000); + emergency_restart(); + + return NOTIFY_DONE; +} + /* Description for K2G */ static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = { .default_host_id = 2, @@ -3889,6 +3983,19 @@ static int ti_sci_probe(struct platform_device *pdev) goto out; } + if (info->fw_caps & MSG_FLAG_CAPS_LPM_PARTIAL_IO) { + 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, @@ -3898,7 +4005,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 053387d7baa064498e6a208daa7f70040ef87281..dec9e20cbe5da8f6d9393d56bb9a1e73cb083a42 100644 --- a/drivers/firmware/ti_sci.h +++ b/drivers/firmware/ti_sci.h @@ -592,6 +592,11 @@ struct ti_sci_msg_resp_get_clock_freq { struct ti_sci_msg_req_prepare_sleep { struct ti_sci_msg_hdr hdr; +/* + * 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 0x03 #define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd u8 mode; u32 ctx_lo; From patchwork Thu Dec 19 20:02:14 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: 13915731 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 5A182E77184 for ; Thu, 19 Dec 2024 20:14:38 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ULCkiQ8VoXo6ciE6Elqk4HCN1p6ytUWA5waL2W1UArY=; b=esc+M/ljiSU95Yu5CbcMahsiGh 9jDfZsgBdqvpgNxXtMcJjIsd5EAQwLeyjn/8o/DwGx3iF/w1PvXwryfBrGVZTVejav15+uza0ICZv aqO9tZFovZjA3ACJVqYneCL+6wZGLjBPFpnxc3+fEzE7WczfMS6VBUdIjRUdMmbvU1FldM/XArgWN r+QQT18NxuDMnckMCByzasa2AjzkAFdaMHpJbAukqaQH027NWGt5hEcZtDpWhNhigu0iUnicfXX0t cBOuOhGu2VAltSIAtWrZBzHrnJ7ynExUjlIVDyYSixxjeDZxX7HBXkG2pjZpbp7Q7d2aKzx1MQEgt oDVB6/WQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMuf-00000002zkV-0OBX; Thu, 19 Dec 2024 20:14:25 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMkO-00000002xa4-2v2D for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 20:03:50 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d0ac27b412so1486723a12.1 for ; Thu, 19 Dec 2024 12:03:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638627; x=1735243427; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ULCkiQ8VoXo6ciE6Elqk4HCN1p6ytUWA5waL2W1UArY=; b=BLFDDxForMYWJPzLDtbsmVIkrHE+B1hw/Hg4Cs1ZdVDF1D8pcVjJYJVHv4ZhrvDPqi 2yojZRGezt1z9bL5NJBFXjFHHSXxfXXIzcUWzsN0aqwt1lw63cElep9RLqGUJeFMPuts 1Vi4nT5ntzy9jeLyTEJWIQ8R16ewVIHCqcWrqam8q4NwQ10wInC5Zm+sH9taSpihErcH 0enAIIkz7luUJjwK4k04nl9nlwt9MRDs8sAORdkWQVjTWyOVeEjRJPip9cbFhMkZtOOa jIn6mq1gf+vnTjewC9OEIlEXDo2y/GR42JAsKEKp9DV1qv7AWkQSJW87CEPfAnLaDnLa fLxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638627; x=1735243427; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ULCkiQ8VoXo6ciE6Elqk4HCN1p6ytUWA5waL2W1UArY=; b=F9IxY7e/s8VGl+/j6s/wgeT57OO8auOTzTs+c/aPVAt1tx4+3BrLJCXPPXsVE7fuNN Mdl23pRCr4EYRJkCCU+tzkC8yP9l83EytwEi0jIYiAuDIgBlv+G/kFrQi/eyiqCT/vs1 4V1BVCdMTyapVlTWWDJXQcgSjFrvnM6FKj8I4nSyLtqwe4qLK9KBm9xZdhtapdpHXFUx 91ByccoE2yy7RqOJ5A0yo9kHoWemEvSlF1DEHvy/f1JSssQuDDHx/GHPXNpztVJl953X qiQTvWnpDr+Uz2lOr2hajf/MT2Krx4pyE/emmtM6m67PtwVd/ytM/Wq4/Urm9AOtASWh 9iZQ== X-Gm-Message-State: AOJu0Yy7GdXHcuYSr2DcZYkpyyJveZ+Gyr3ZvXk1SSeakFGzkcyfKrzz 6TMdoK/6sC1T/LzIvix20nHyB68xnL5WNriQ7g3vfVi/kSiM0u6Oz6un3nVy9hA= X-Gm-Gg: ASbGnctWNYOz/YNEK6/TVPOGtwYzLGnB3/Jku1ManWKF8ZhW9zqJpiFkKvfvFsNrg9N pWTyIdoB8bTtzUD+btGjB2pHI/fANrYWI6ljwo5PsUyVc1osA163goM8d62qTZkbpqfBe8QO0EA cpqVtgODp1/o2Yqv10xMK7zER5YabLTJYE3xHFQpWeHAI6tuMu72u9MJUjmc+X3hPTbp5cMg1hY 1OGD1lHO4laI/e6eYbdxCkY6zr3RZaqI01TSSsWX0rjt0Jy3Q== X-Google-Smtp-Source: AGHT+IELH0oCu4fjW7oZX27SBjII/M71jzzcfKoxPHZ++4GSGWA7IXgMSzFoeG+SeCLv2JVdSNynlA== X-Received: by 2002:a17:907:944d:b0:aa6:c266:97cc with SMTP id a640c23a62f3a-aac2ad8e1c2mr8332966b.23.1734638627209; Thu, 19 Dec 2024 12:03:47 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e830ae6sm99991566b.22.2024.12.19.12.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 12:03:46 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 21:02:14 +0100 Subject: [PATCH v4 3/4] arm64: dts: ti: k3-pinctrl: Add WKUP_EN flag MIME-Version: 1.0 Message-Id: <20241219-topic-am62-partialio-v6-12-b4-v4-3-1cb8eabd407e@baylibre.com> References: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> In-Reply-To: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Anand Gadiyar Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1051; i=msp@baylibre.com; h=from:subject:message-id; bh=raNMV7XctJIbSEmg1aR+IsRod9wfbi2q0jEtotc1h3A=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTakRWuOsJ1L8p1NALuSEx9UrfAfFqxypZpe5/mybfe H/3tVpVRykLgxgHg6yYIsvdDwvf1cldXxCx7pEjzBxWJpAhDFycAjCRJx8ZGZ4Lvit/aTfVSXaL VsTXWYmMm7yWfTJzz9u4c8fr0kU90q8Z/ucWZ+evvDdrgfvTgAOrgmccv9IhqL1uqa/1R4ak+wn RqWwA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241219_120348_735774_6DE3009E 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 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 22b8d73cfd3264735ddf91874e60a0c5fc7ade5b..dd4d53e8420a1d671e04a70d4af8b0ea1b75b2b2 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 Thu Dec 19 20:02:15 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: 13915732 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 4C4D7E7718B for ; Thu, 19 Dec 2024 20:15: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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NpSkCESXzD33ldEw8LvJ7rj1ygUxBpHnL7ohb5Ul8P4=; b=rOTprgtZwMSJBoBmaid1vP49WW 8H777uWeu4N6RYe+JsLQ7iYcQvUPA6L1DOAvxRzvzKimrTPBVCNRawaZXeJz8hKCgnCZRjeSk34PD rx+3HsaXQDp+UxCs4uJ80wRGfagmg5sNsmU60NWML8nGI2wLFl20MJOU6tR91qTNC9j6H8rqxUgwU nEJxmVDdIF1rKOkircAVrt0n5Vn1Iu6GAH3goG2VXnvbHiguF2Ma8T6+9oCaIKNLRmF0kE66xwmq8 8Uhfmtq0564tI73yH3S7lwy2o8SdkPdGOLCzaEvr+Nnp49qaqZ+iuZvBPo/O+h2btWQ66A7t/S2aJ Ja3TRSmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOMvk-0000000301J-3Boo; Thu, 19 Dec 2024 20:15:32 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOMkQ-00000002xbJ-2Bxi for linux-arm-kernel@lists.infradead.org; Thu, 19 Dec 2024 20:03:51 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d3e6f6cf69so1706383a12.1 for ; Thu, 19 Dec 2024 12:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1734638629; x=1735243429; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NpSkCESXzD33ldEw8LvJ7rj1ygUxBpHnL7ohb5Ul8P4=; b=ZrvnabzVTBVsR73QP6udv8nFWwIAK2o61G3ghVrFgmLPHO8J16KOnkYupsQjiMo+Vm dVpQeHEdt1hsXOuSQ4nnEO5kdKVD3Bhcit7ywbHl7yCBhDUUZGtDhb6TJK/qWmyjiB7r TbfKBT5MN7YfnZKtkGqbRfrBxtT4tl3uK2V/Mj++O9Xh5E1qO3P/0KMZLHQ7HCql3zxb NocTnWNSKiQqMKIMac+VUeUg++zcorucLthvjv85GF1uDtSiFUfAiOG3evQZCYwRjMvZ C8qFcvaI3a6tEkkdFjacS+hkthO8b8CQ87VQnOusdhUF1mawT7+loeSmkct3Luv6Oelr jXbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734638629; x=1735243429; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NpSkCESXzD33ldEw8LvJ7rj1ygUxBpHnL7ohb5Ul8P4=; b=V6W4o/OfwFhFazttq17rjVp6+83YgEK6Dk++y1pwhOWbDpd2Gz1UWI9jryGXtzAk2M bvvH/ma4JfjRxHg+c6ihdICsLTRWP4K+xDqQq0CKPgGEr+P26Yxtsm7DWCRnj9C8p08F NZok6+niFGNwvggiqiBOfb0V6mINJFoNlwMvsSXL4p8xcNfciv6FcNGzJHBIwpyMKpKN ijGWQJhaCsPwOLtXlLm03m5MnVRk2kjhovylyctQF6vt3x2xU0ksRq5JaOY7l3iEPkAD CUo8XwDu40ULECZMfRR4YxtELjHEvzUav5IIFwLRYJh48uy9aHlBjjDBydL1Wpp5s7DI xCQQ== X-Gm-Message-State: AOJu0Yxb1vyxSxmMm7aDsL4tVA/wYeAeXESMTnUKek86JpBublfSLXtl 2XKXnqapISaXZG7Z7iS1otaR2aW9YiIAdhIyYA80Ts7vVJ9VPzGJBhqA647xvg0= X-Gm-Gg: ASbGncvVgYp9nXedoxQMtOs8LEYohYVZqCHBlpHbVDGYWS2poUW1V+Dm2QqFVxha/eO HzmZy5mly69+YFdPuVL7eGGwYbm2ZPK7nT8QJc/PyBF9figC8Bm5pCmUPCFP9oMklcnttueqapm bIIUqUsoZB08whJ1pBCDJOgO6TEuCcSBCFvlNNKL/gJOwQDxv8nEKG70flnG0ItCxtez+QDxQJ5 E+uQTcKCUG4JYHhBV5APu8DPomW+eij4cynWzQ3ADmOrRvqKQ== X-Google-Smtp-Source: AGHT+IF82S/mlq+e2He9tjy3cysnJj4+yC4VHjyyy2VTYMe7y13y6XuWTxuoxho0NH4K7vaCcomgtA== X-Received: by 2002:a17:907:9621:b0:aab:f8e8:53b9 with SMTP id a640c23a62f3a-aac345f427dmr6210066b.58.1734638628989; Thu, 19 Dec 2024 12:03:48 -0800 (PST) Received: from localhost ([2001:4090:a244:82f5:6854:cb:184:5d19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f011f87sm98415366b.142.2024.12.19.12.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 12:03:48 -0800 (PST) From: Markus Schneider-Pargmann Date: Thu, 19 Dec 2024 21:02:15 +0100 Subject: [PATCH v4 4/4] arm64: dts: ti: am62-lp-sk: Add wakeup mcu_mcan0/1 pinctrl MIME-Version: 1.0 Message-Id: <20241219-topic-am62-partialio-v6-12-b4-v4-4-1cb8eabd407e@baylibre.com> References: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> In-Reply-To: <20241219-topic-am62-partialio-v6-12-b4-v4-0-1cb8eabd407e@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Anand Gadiyar Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2255; i=msp@baylibre.com; h=from:subject:message-id; bh=IOefNd31nyYbDmidXJO9wxo5hzXqvpD8mI8ntPvadk0=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNJTaiTq6r7J5Zyv2RT7eklD9UodC2fLU5s+uYeHt1SnP 9PUn87cUcrCIMbBICumyHL3w8J3dXLXF0Sse+QIM4eVCWQIAxenAEykn4GRYedvBcGnond2OHxo eJH+Oyfg9YPrq2X+MP90NW7zP1Mw6zzD/yILA+GjCyQ+1Rc+V3g8y+/aMydGsXqHw3u1I+7xTFn yngkA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241219_120350_565324_BB8C79C3 X-CRM114-Status: GOOD ( 10.86 ) 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 pincontrol definitions for mcu_mcan0 and mcu_mcan1 for wakeup from Partial-IO. Add these as wakeup pinctrl entries for both devices. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts index 8e9fc00a6b3c7459a360f9e1d6bbb60e68c460ab..22695715239644b1bfe209ba4f1c42fae4c59f70 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts @@ -232,3 +232,55 @@ &tlv320aic3106 { &gpmc0 { ranges = <0 0 0x00 0x51000000 0x01000000>; /* CS0 space. Min partition = 16MB */ }; + +&mcu_mcan0 { + pinctrl-names = "default", "wakeup"; + pinctrl-0 = <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_default>; + pinctrl-1 = <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_wakeup>; + status = "okay"; +}; + +&mcu_mcan1 { + pinctrl-names = "default", "wakeup"; + pinctrl-0 = <&mcu_mcan1_tx_pins_default>, <&mcu_mcan1_rx_pins_default>; + pinctrl-1 = <&mcu_mcan1_tx_pins_default>, <&mcu_mcan1_rx_pins_wakeup>; + status = "okay"; +}; + +&mcu_pmx0 { + mcu_mcan0_tx_pins_default: mcu-mcan0-tx-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */ + >; + }; + + mcu_mcan0_rx_pins_default: mcu-mcan0-rx-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */ + >; + }; + + mcu_mcan0_rx_pins_wakeup: mcu-mcan0-rx-wakeup-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x038, PIN_INPUT | WKUP_EN, 0) /* (B3) MCU_MCAN0_RX */ + >; + }; + + mcu_mcan1_tx_pins_default: mcu-mcan1-tx-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x03c, PIN_OUTPUT, 0) /* (E5) MCU_MCAN1_TX */ + >; + }; + + mcu_mcan1_rx_pins_default: mcu-mcan1-rx-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x040, PIN_INPUT, 0) /* (D4) MCU_MCAN1_RX */ + >; + }; + + mcu_mcan1_rx_pins_wakeup: mcu-mcan1-rx-wakeup-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x040, PIN_INPUT | WKUP_EN, 0) /* (D4) MCU_MCAN1_RX */ + >; + }; +};