From nobody Wed Nov 27 04:44:51 2024 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E978186E2E for ; Sat, 12 Oct 2024 14:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744022; cv=none; b=BeD2dpZTBeI7VSQ4d0R7vC8sIg3E66kgAerH2foCMAGyJ2EhdH0pJC7fR3PEds3RoVVHGS6+YRegNQYpVKc2eI7W1wBtEJlXeEXMD8x9lq+X14lY3Wbo7QiQuaI0IaCGEaCTkxzyo4s3Gi2G0FkKgr4vm6qQnCbg5pmFds13u+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744022; c=relaxed/simple; bh=gzvHCEERIFSUE2/l9XVq++gH4WwGcviKuuBBdUnSMcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gYa/xnB0r/kizxSpf/J+MyOWZYgQ1ErgXRmpa9GH8LpdsKDiNUNtq0vK30iCNIAJfItGO9NOhgfU1T+nu4qCzHZfYSyKJ6ZByyFT6RS1efR0rZblLF0DlU70ErccHii+fLQJQ6WdDqF6Jo5krfe7534Sf7Nrlw4D3DJZEnv7Tdk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=xLNkyHLW; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="xLNkyHLW" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a998a5ca499so419898366b.0 for ; Sat, 12 Oct 2024 07:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744019; x=1729348819; darn=vger.kernel.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=+V4+PzZtNi7MIeIEF0+JVFMXtIpzK+7/ZpBXRsobCbY=; b=xLNkyHLWiMfYeNm093Pr27OqFaOVCUnVtu0RBZJk2qbLoW9Yluq8M37iiVIQ4iGcaz JokH4EdgSHJHmvBgGNNq3vzXJs9ow6ZV3GsVrsYFV/Rl4X4p6AsFMHwu/gOh59IHsTyO fYeckbUha91loUBgAfMztVF1vGB08vynZ7toY9O+U+muFijZDV3feqA58C1w8kfwi9Xi dif0IySjhMacyva5otbkNfYKtPf54cYXYOkDOD33yJtLdy7zQXF5Zu7nDsKKxckpyJSl X2o5fOGaq/3FuaJhlnrAkjAUM+O1kSXhNwmfgNVN3yxzAo4IjiS+w88NKqlhXpOPshEm CLAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744019; x=1729348819; 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=+V4+PzZtNi7MIeIEF0+JVFMXtIpzK+7/ZpBXRsobCbY=; b=fTA+11uf2EiAiNGeLi/Q5zWqHPvE3q7Qbwjc46vzisVSeIJOgkExR9u2/6RmYnKQRT XUH2If8tmdLsB/6dWytmvU2uSwkDKc41OypXjpg65HcqCP+6mGl5ItLrBl6ps8m+pXU6 KF49fAR4hrcz+DF6v5Q7pfPt+ea78o7CutH6kFs8os3OuUF/sOqIVk7Rhye/Ka2ZiuGx ow5tBX3t1IuqxXvbJ7dwJPLLqthjK21eVy7R4mU0uXQUX6xu2F6heEbsD+eHcqq/DqCH mrbxl2BWDHnoA35Dy6YL0Q/euvjjSF3Z6jz1tuk/tlZjqo4PlNTYfkRUyXHv1jD5yAPk IdzA== X-Forwarded-Encrypted: i=1; AJvYcCXIxkgQRWK803EkurtciQH0m5yFb2TDWTwX154DlGJ+iuPB1VcNZgBBtHRFFdThEAA3dMOTBwzarKJsGgA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6zxFMyYSE8K73mgcT9OOsl8uwJ+cOtjyUXFHiVE3nN/0/ycgl n22OUyIZ2VLMikHEus260j0fGiEwef5OjLVM4TuT8KREJJQdFQe7OMOYgfz00Jg= X-Google-Smtp-Source: AGHT+IED80b4AbvloJuTe1bZzV8uPZDsuxDtElUD5sao7Y4gzMTYG2NdJpeqQ+ZAJDYGrLU8wprhgw== X-Received: by 2002:a17:907:e2d0:b0:a7a:aa35:408c with SMTP id a640c23a62f3a-a99e39e4fbbmr281594166b.8.1728744018451; Sat, 12 Oct 2024 07:40:18 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99f752b7d5sm29972766b.217.2024.10.12.07.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:18 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:27 +0200 Subject: [PATCH v3 1/6] firmware: ti_sci: Support transfers without response Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-1-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@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=gzvHCEERIFSUE2/l9XVq++gH4WwGcviKuuBBdUnSMcI=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5uoxOfru8ZOs2+7jSxF3bFZmrF7YalPlJGrPc/hj3K aruoZdXRykLgxgHg6yYIsvdDwvf1cldXxCx7pEjzBxWJpAhDFycAjCRABeGfwZc5gofIxMDjolP CAkTkF7DXGznu2PHilClUKXtHx5Pes/wz3Bm4WNJbbE4JTuVbxUR5ctXbm0Q/7yAveK55dEnFXf ncgAA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 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 555e41cc08080c78b3991a8d6c06f5030a576d72..9ef86ea27a3c9ac6b9aa4a838a4= f5e9fc09a81a9 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_i= nfo *minfo, static inline int ti_sci_do_xfer(struct ti_sci_info *info, struct ti_sci_xfer *xfer) { + struct ti_sci_msg_hdr *hdr =3D (struct ti_sci_msg_hdr *)xfer->tx_message.= buf; int ret; int timeout; struct device *dev =3D info->dev; bool done_state =3D true; + bool response_expected =3D !!(hdr->flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCES= SED | + TI_SCI_FLAG_REQ_ACK_ON_RECEIVED)); =20 ret =3D 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 *in= fo, =20 ret =3D 0; =20 + if (!response_expected) + goto no_response; + if (system_state <=3D SYSTEM_RUNNING) { /* And we wait for the response. */ timeout =3D msecs_to_jiffies(info->desc->max_rx_timeout_ms); @@ -429,6 +435,7 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *in= fo, dev_err(dev, "Mbox timedout in resp(caller: %pS)\n", (void *)_RET_IP_); =20 +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. --=20 2.45.2 From nobody Wed Nov 27 04:44:51 2024 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DF851946CA for ; Sat, 12 Oct 2024 14:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744023; cv=none; b=XJTbgC7nwNYllnVFQHwvatjlWZXLHChgVW+0qBh1qDxEp6uIOc2gNku1vwrO7h+RI8vN3eX5L+u3nW+3JbTJvV0os0GFO+vQRAFIOmCkibq0g13Tyc6YbtJtIMFFp65W8CTf0oFMkP987idGNYlJFXS6JyT83Ijdsrry2BJKrOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744023; c=relaxed/simple; bh=1dNO0ykSJyMHj7nwRx/ZHojCDWMJLTC6mKghrMYyi6o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nfsfZoNu3B3PqjHVY+DaXRAnXEJ39/wiKuYQkxAxjSdHljBaWo0SDRZNmh1E58TvLAIModFpBPrf/UEfVfTmUX8wUICNcSrSPFaNTZozRyfYfcla3ymNhOoM6Eq071b/Hmsb5eIrLOsWU+V716osBthq4jtbg9SnJAhUVIybPww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=1Mttlvob; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="1Mttlvob" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a99f646ff1bso38529166b.2 for ; Sat, 12 Oct 2024 07:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744020; x=1729348820; darn=vger.kernel.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=C3sJ/BMf10VX9JK+mjIqHCa6w7KgT4r2r/Tz2Dc9YFM=; b=1MttlvobZWSP9BzP8lXsrsZeUBoh1C3yfLNx1a19csQGZb863p9+8xQ2AV0R0n4LtA 8zrUdVr7AealNOb4PkQUbNAdUkJGYucdKIHIf4BQfvNxktiY6fN+m/vcc9Wk9TY/kMp9 tK9/eb5Br76gYhr/MorhxSqXvklVOsCsHLwQXV8BOqQgEqY+2wg+AEoKKAFgPP3zhHC1 hzrysiM1stmNASBhfj+ombd9P7Whsq56PUUiJFnusPf5YEadXFtXaRGuZayglj4JhE7L /HWXVSEijd4MgxZ247Z5AMH9wRXvmv4jK/OABkUXbBzUQpI0OqYJQHAfPdPSR5YkHxOV pKLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744020; x=1729348820; 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=C3sJ/BMf10VX9JK+mjIqHCa6w7KgT4r2r/Tz2Dc9YFM=; b=d9wr1A5C9FCnc80heJVz6LPZX6Niy4pNSpjKO2j8RRGliXd5Oy9R7JJsMps3UIHiAE fn6Q9EAxDcrjZx3bivjkYVudCGcv5qKAwvL1+ALrlJbSBxMPC7Dl/SWbQPpbi1DSh94T vACxoWbmfgluS8D2YDa50Lrra1FKo+Pf1VPi3YdUE9SQj/VSPlZ76SUESUY0lzmtBC8P tXwrsWz9M4q3RxgaXe2TjYclM0hx4ri+LyyBovcYEjOceqHfi4elVsPonHRZSZWa8o3E VaRE4exE1Vv3zKtV59jQ5iW0dwQ8491yguWaoDcEbLXavp/wWCXiQVSgVzC0S3wiBOMO sjQQ== X-Forwarded-Encrypted: i=1; AJvYcCX4yejhOVEF8Z6wkKYPgPOI6J5IRRgJcn8LORdvMmj2zd7XhfJzdbxeBqe1wACNnAYIwN/dc6EksPWmq7s=@vger.kernel.org X-Gm-Message-State: AOJu0YxLyxkp73zq5LgOe1kNaSpt8xT8lKW8RQsQkjqwZSJAI2cuHgcD 63HYsf5JGgOFJfAUJvvucBCWFSfpo4R7D98C/EaW67i3m7pdIPhXbpFylkAEc34= X-Google-Smtp-Source: AGHT+IEfLMWPqMmZhJIeqfEsJCHMFdrk3bveUBzkKtDRVDwhafGQZqqAYTq9jyaDh5E24EX5ws+dvQ== X-Received: by 2002:a17:907:d01:b0:a99:403e:2578 with SMTP id a640c23a62f3a-a99b9313475mr575175866b.5.1728744019721; Sat, 12 Oct 2024 07:40:19 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99f3ed51e8sm49965666b.30.2024.10.12.07.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:19 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:28 +0200 Subject: [PATCH v3 2/6] firmware: ti_sci: Partial-IO support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-2-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@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=6763; i=msp@baylibre.com; h=from:subject:message-id; bh=1dNO0ykSJyMHj7nwRx/ZHojCDWMJLTC6mKghrMYyi6o=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5uiwOcTHJZmhaCMhl7y+3aAvmYNtyYa7Aga4d9xn3X VlrbGjZUcrCIMbBICumyHL3w8J3dXLXF0Sse+QIM4eVCWQIAxenAEzkShvDf6fHajMjZ8w5tprz a2xayv2/AR6xh1d94kw7+ueqz4G7U38wMixSutYpHPD32c0XOUUBYlNczLTL/ZfdUfmzSFb115V iXgYA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 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 are powered by the regulator supplying the "vddshv_canuart" line. These are considered possible wakeup sources. 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 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 | 130 ++++++++++++++++++++++++++++++++++++++++++= +++- drivers/firmware/ti_sci.h | 5 ++ 2 files changed, 134 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 9ef86ea27a3c9ac6b9aa4a838a4f5e9fc09a81a9..fe964e5e2b2a06ba2fb9754537d= 28661951a6b78 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3746,6 +3746,115 @@ static const struct dev_pm_ops ti_sci_pm_ops =3D { #endif }; =20 +/* + * Enter Partial-IO, which disables everything including DDR with only a s= mall + * 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 =3D info->dev; + int ret =3D 0; + + xfer =3D 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 =3D PTR_ERR(xfer); + dev_err(dev, "Message alloc failed(%d)\n", ret); + return ret; + } + + req =3D (struct ti_sci_msg_req_prepare_sleep *)xfer->xfer_buf; + req->mode =3D TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO; + req->ctx_lo =3D 0; + req->ctx_hi =3D 0; + req->debug_flags =3D 0; + + dev_info(dev, "Entering Partial-IO because a powered wakeup-enabled devic= e was found.\n"); + + ret =3D 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) +{ + static const char canuart_name[] =3D "vddshv_canuart"; + struct device_node *wakeup_node =3D NULL; + + for (wakeup_node =3D of_find_node_with_property(NULL, "vio-supply"); + wakeup_node; + wakeup_node =3D of_find_node_with_property(wakeup_node, "vio-supply"= )) { + struct device_node *supply_node; + const char *supply_name; + struct platform_device *pdev; + int ret; + + supply_node =3D of_parse_phandle(wakeup_node, "vio-supply", 0); + if (!supply_node) + continue; + + ret =3D of_property_read_string(supply_node, "regulator-name", &supply_n= ame); + of_node_put(supply_node); + if (ret) { + dev_warn(info->dev, "Failed to parse vio-supply phandle at %pOF %d\n", + wakeup_node, ret); + continue; + } + + if (strncmp(canuart_name, supply_name, strlen(canuart_name))) + continue; + + pdev =3D of_find_device_by_node(wakeup_node); + if (!pdev) + continue; + + 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; + } + put_device(&pdev->dev); + } + + return false; +} + +static int tisci_sys_off_handler(struct sys_off_data *data) +{ + struct ti_sci_info *info =3D data->cb_data; + bool enter_partial_io =3D tisci_canuart_wakeup_enabled(info); + int ret; + + if (!enter_partial_io) + return NOTIFY_DONE; + + ret =3D 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 =3D { .default_host_id =3D 2, @@ -3889,6 +3998,19 @@ static int ti_sci_probe(struct platform_device *pdev) goto out; } =20 + if (info->fw_caps & MSG_FLAG_CAPS_LPM_PARTIAL_IO) { + ret =3D 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 +4020,13 @@ static int ti_sci_probe(struct platform_device *pdev) list_add_tail(&info->node, &ti_sci_list); mutex_unlock(&ti_sci_list_mutex); =20 - return of_platform_populate(dev->of_node, NULL, NULL, dev); + ret =3D 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..dec9e20cbe5da8f6d9393d56bb9= a1e73cb083a42 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; =20 +/* + * When sending perpare_sleep with MODE_PARTIAL_IO no response will be sen= t, + * 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; --=20 2.45.2 From nobody Wed Nov 27 04:44:51 2024 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ABB5195F17 for ; Sat, 12 Oct 2024 14:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744024; cv=none; b=Nob56UrYb4Fx6MLR8npPRThD87CXG3a5HfJEMUapSCdVwnjOnG7dFtVN9loLMA0zgz2OkbBQVDN47hWXkH442Sn9+3R27FmI5Fb7+vq7s2xSUFh5H1JpJI/u7TbURKhIqBbE78HtkfxcRMtQg/Iu8PvX43Ig8or53kcZFCwtXAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744024; c=relaxed/simple; bh=raNMV7XctJIbSEmg1aR+IsRod9wfbi2q0jEtotc1h3A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Icup92td+SPoeKlFZ/u9UFdsGy71TRGzbv+YauI9d25Zy7MQ4kAsea62eNCtVDhc4lqk8JfHy4wB3CqJ+RnQnRd7eQ9M7SNQwUx9509Cdt8f5vHSvUBd0WjN7nMv2nwHOej6HmNiu/x/lhYjFJagV8GbLfcsbpaCr+7F0lgUKRQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=uHURsS6v; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="uHURsS6v" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so59743166b.0 for ; Sat, 12 Oct 2024 07:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744021; x=1729348821; darn=vger.kernel.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=uHURsS6v2tEGk+6UMqxWafuAshLNmmtAQevKrUrrSQ8uN/tztD6rK77VtEiuhmDI+P fZpyWj2skQjN0xS4AkEzkO22qffNt449sSXWSuBC3vUCSktSA7NSTSLsTCaKu0/biwwK zARWQIjeg53jIQkUeDHKwecPjKKw6Qx1+Rk1Aeg4zLDHSdnZVaCaiBe60wH//D0bmUOm zgMH7lZHZid97xBmFuC6II1eE6JSA80wlI3sZttNYnGJdkKzeO17SxsdMNIWX4wmc3q4 9CeQW/eIhVt2xpakzThVGHvk7mjrbYk70N8795m4jTqkBVk+X2tkPlMCQIAGue35Tpei jqrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744021; x=1729348821; 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=VqhnYlKEFv5JmcJWE300krzgRswRrYBpwKHaTJN0qb3ehffEwufAE91pCHSNKiXQs8 aeMizpWqhZk31uZ7tKdmwuRF0CZpTZVzkfp9nrwQxlmgtVQmzeihhjRPwYjZnKKIywhx Wo2SRZMnqdVgYVzo67Fac8RLn5UFQnwG7yK4VlmZlXz3D9n4RI9GeKkqoMTQU8dizz9E JudmUiR9/J9a6D80teqTPEANIzE2lwSm1lMeB5StYQgq8QT1wKZBH3Jf63yiW5sHgiFW aD/zz9L6vvBS7MpJ3CIbk65v+NBbGEcX0WYFWgfab2AeI2ohfyUZSoYzEiW94E8AmpZ9 JJlQ== X-Forwarded-Encrypted: i=1; AJvYcCUSwit8U4wQxgcOLO9Yr0W0t5np/dPd9cb9aG614VqSu9htEUGunMsN7neC+tIkK3x18+oyec1pyVqxCYw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3/UZ+d0VpiOhWH6l9VI7B2m3KxaUsIBQq4zXFbcd+Lzh9pC5B LgvzljGm3vwt0MRmZfr/iDq2a6SnazFqommajsYwsJrPKg3vuxVE0wtvsXinZhc= X-Google-Smtp-Source: AGHT+IGWlpkwYPvczR/HmMNrTZLwB3u77RjG+9e11crQIzq8pDrWM2fLtcRa72Csddc7F8rgokMxAA== X-Received: by 2002:a17:907:9489:b0:a99:e98f:e73d with SMTP id a640c23a62f3a-a99e9900010mr139675266b.37.1728744020855; Sat, 12 Oct 2024 07:40:20 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80dcd55sm332162666b.173.2024.10.12.07.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:20 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:29 +0200 Subject: [PATCH v3 3/6] arm64: dts: ti: k3-pinctrl: Add WKUP_EN flag Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-3-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@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=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5umxevT6yTL1ugqjsyZ/d/gXll499jDv17/NM91mRA g/81Q/v6ShlYRDjYJAVU2S5+2Hhuzq56wsi1j1yhJnDygQyhIGLUwAmciyI4b+Xjcjhd2Hbfn+Y YHWNQa/HelKKjP3cHhmW5P9ZJz6kbHvO8L+yxdmtIUVko07zn7THwmUHvl0PeBMcwM21vePLNi+ zw3wA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 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/k= 3-pinctrl.h index 22b8d73cfd3264735ddf91874e60a0c5fc7ade5b..dd4d53e8420a1d671e04a70d4af= 8b0ea1b75b2b2 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) =20 #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) =20 +#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) =20 --=20 2.45.2 From nobody Wed Nov 27 04:44:51 2024 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 422E8199FC1 for ; Sat, 12 Oct 2024 14:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744027; cv=none; b=cqaSmc6hsea/j+XIDdWgxPfonmhxqT/RtNlIFZEKlcF5EZQxYj+LPanfNfSY2k4SYvW2fUipTLv6dSA/KnoB/bF2vxYiOWaz0g9APqw4yUrl5An1/PlsolKE617pcqeDWy+WFAjmBCjIQjTictAFypq5VanDuoDq3JuV5yyzqlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744027; c=relaxed/simple; bh=XhzApypE5f+qCrdy/4fKvPPdyBST0xn9vF9MGvotmC4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hdhT69F+gj5Hf34dlFontiEgCC45TID+4c5+f0sv1hq4G/guJKYS5xzfZwJXiCdoJ2Bx4M+HPRM6zjoUmSn1qxq4n4Z4PN+4PrVwJwb5tDa8N8t7+Z6YH1/Lt6au2nrlMFf5sDmeE27eGzp4Uz8Xvmj7/9TsJUf7WVfHjzyd9Bc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ITYfrMzt; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ITYfrMzt" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5c928611371so4139841a12.0 for ; Sat, 12 Oct 2024 07:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744023; x=1729348823; darn=vger.kernel.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=9N1QRWG1+vGqch+tHQPBAnNZwJAl+Fys3rUYZOZKJwk=; b=ITYfrMztTNroca9k/qIOS2xCVyaMqOpdXPkAF0GwiMOHgLDFJVrEXC38aGuChA3DN0 Er0ILh2eZitIqp8zEtVkjXB6+bl65iv31r9OggfFW29lZYZv4Vs1TL+5KQNuwhT/4hLg Nj1zKiWkaCGY9rcFlgkFOu5GNfH6wVapVFDEutNs/fdS5hm54SawiyD/Xm/YUagrO1A/ AXnWRwHcKNevFGq6ICETyStnVYNAAFhV+U0oTB6wkh89YamyVgpoZEtmjyYnU2JxCzoq 6Bw6AA+Vd3+F2L1FNK5FFNufXonmulRvy+x1qRijrEcAzKjk4KSWOhLJ7n+QqPjcvIHk 9JnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744023; x=1729348823; 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=9N1QRWG1+vGqch+tHQPBAnNZwJAl+Fys3rUYZOZKJwk=; b=DH3vq3YXUoNDEOuhGyqjb5R2jOu4B6vEK2Y8kXfJP2KeBYY4yfeEQgn75Q5mgIaFkS g5W6wEi6NPnUb+jYcFaW8EB++bLwMi8g3ZY2gKhyxlfcCOcgaJ6dtK2mX/LzjTXm2ajr K5iHVH7WmSt2Ye/QJ72Tax4Ot+l0ios9lEDUcRQUcGfJfrSNFfJ9/brnIY8JaqZna32Z sF4Zpo4Tp/IrKTxr3GkBbMh/E8RXiLAVsmiZYVwdV1IfFD7EMlFqCL4eXDc83Jh0ksaP 1rv8gpF//+9PiGHSbEOmnfE65xVGmm3/TAdPe2oxexw4+epQxCs0vhZ55eFsvvQ25Whq BfWA== X-Forwarded-Encrypted: i=1; AJvYcCWrxvf6xe62ddF0riCN3WdiiOkiHsbhpVmaNd1xkpqFuXJPZjHIgKF9KlEjm5K7cKQm2DpPYwPStX1ZZ/E=@vger.kernel.org X-Gm-Message-State: AOJu0Yyrwvba/417d/jiUcIIZGevAsG2ifj6NGqPqzOyli4xfQ1PwpZI i3JHeHwuTR7vNZbS/8Mcl9HeTOBFAOJju4K7HRUeTc4rTPi9F7NDcLeSOi2B9rE= X-Google-Smtp-Source: AGHT+IFB/80TsoIFcqOP89wUuKPAaBM6QE7qOspyWm7HaILKW2tXt8EZeLi+xkFDPhSFFTfLKDwO9g== X-Received: by 2002:a05:6402:42d4:b0:5c9:4281:451e with SMTP id 4fb4d7f45d1cf-5c948c88378mr4204260a12.1.1728744023446; Sat, 12 Oct 2024 07:40:23 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c9370d22fesm2905032a12.19.2024.10.12.07.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:22 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:30 +0200 Subject: [PATCH v3 4/6] arm64: dts: ti: am62-lp-sk: Add vcc_3v3_sys regulator Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-4-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@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=1572; i=msp@baylibre.com; h=from:subject:message-id; bh=XhzApypE5f+qCrdy/4fKvPPdyBST0xn9vF9MGvotmC4=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5uhzdZY6nmczOe3lfMv7Imklsn4+8eJuk97Xwg2aR5 KbnfNrvO0pZGMQ4GGTFFFnuflj4rk7u+oKIdY8cYeawMoEMYeDiFICJvI5i+F+ce/demWLfp8UV m3Ywsyh0Cp9Yrr/qt1Yd4+JJghss799mZHiXGDxlHrf5ddeO2zYrr/M57Ohdx1pw77p58Z9PRz8 tOMgJAA== X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 vcc_3v3_main is currently modeled slightly wrong. vcc_3v3_main has a parent called vcc_3v3_sys which is currently not present. Add the regulator for vcc_3v3_sys to be able to describe other regulators in the next patch. Fixes: e6a51ffabfc1 ("arm64: ti: dts: Add support for AM62x LP SK") Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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..529360b5e6fe052dd99f04b74c1= 29193922f76ac 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts @@ -34,10 +34,10 @@ vcc_5v0: regulator-1 { regulator-boot-on; }; =20 - vcc_3v3_sys: regulator-2 { + vcc_3v3_main: regulator-2 { /* output of LM61460-Q1 */ compatible =3D "regulator-fixed"; - regulator-name =3D "vcc_3v3_sys"; + regulator-name =3D "vcc_3v3_main"; regulator-min-microvolt =3D <3300000>; regulator-max-microvolt =3D <3300000>; vin-supply =3D <&vmain_pd>; @@ -70,6 +70,16 @@ vddshv_sdio: regulator-4 { states =3D <1800000 0x0>, <3300000 0x1>; }; + + vcc_3v3_sys: regulator-5 { + compatible =3D "regulator-fixed"; + regulator-name =3D "vcc_3v3_sys"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + vin-supply =3D <&vcc_3v3_main>; + regulator-always-on; + regulator-boot-on; + }; }; =20 &main_pmx0 { --=20 2.45.2 From nobody Wed Nov 27 04:44:51 2024 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13B2119C548 for ; Sat, 12 Oct 2024 14:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744028; cv=none; b=WAbhodYcjjazXVJuzIqNYWBo49l+yvvKeU093VQg1RAo9mGYYPT6LRdaYSbTsBjtBXNoyL9cEQHfKBCm/stiY21HI++XUg8iRUZH5fhD3hxT23yhH4baheJqM6McnkqUW9boxYabJacgL4ZcdWLgbqH88VrPkaJwyeaHAwo2U04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744028; c=relaxed/simple; bh=B9BqpeoJguVWS7gI+XD6rHIo0W/hrym3/3+lBaC2IGI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f7x+mrCOYAhpRLTLbtSKqYlYTXeQvRpFMqpCSSkGLgZzWD4HTXSY2/PTV8XG9gRGGuFQow4ihP1aiWEjrn5+WxTSSp5anXZr3at+SxTj0iGXd0U4JF7W3WYXdVMMAUd3wRqUPtXZqyvZ+Yqf3yP66q0nfumUHeeooMYRawFQ+B0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=NX7zJbNO; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="NX7zJbNO" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a99ea294480so63761166b.2 for ; Sat, 12 Oct 2024 07:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744025; x=1729348825; darn=vger.kernel.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=gttVsMS4Fqvh3Tt7h6KmD5HQ1g1j9lzENne/NicL/Zs=; b=NX7zJbNOfbKf/KKnMOH3OzSOSHkRmtG/aoKuZtiCfTLcopL0ILWVOszScAvOnIEF/x 2FWkB8s21SINy/cVVwabh8yuLrO88ayke2aMwjjjNM/mfSzUGG0FQh85PMBIuwQ7yV0s n5M3DwkmHe5yW/NQSiT+pH2Y2H6XOHkPs3JTbxbhcg9HqS952H2vxMtYcfi74Skjx6dt ZgIgjkoyjxibJVoRWSM6PI4aCyi6FDeW/TF9KCP2psrtgeTpv8rJdDV5ecgF4gaseFUW cSohS1033Y28wr6884d40D1jS/o31qzQT3YFjhdssaKQC+k95aFCQ62Sme+fHQL0hCTh B4UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744025; x=1729348825; 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=gttVsMS4Fqvh3Tt7h6KmD5HQ1g1j9lzENne/NicL/Zs=; b=Tv6t7U1hd7LDXNaRmtITi1KpxRUmQ1p2tCgJgvOw3OCSEhjkdwwarXeGE9F/ND9Gim deWLdbUsrQ0QjPYlpXMfLjyUU+jHBvRwHQ1hxpn9mWinwsLa9mR4+BebIVmTC84XryZY biogrmGT9zHpuxLoRvTYLtYwpDuDFsohkxROGDBBaopT3Qucdftcgofa783us8T9TXHB dl0iVUyzDmVAw6/6yN28+EyyFy7T2kxhS9oEgZiK8A8xsswl+d5VOCj43RP7s0LQ+WZh hZOdQSruxNO9d01mAmF0ajhZRXCIGSmIkx5jMqpfnLdu1gDvV0IoilSv20a/jsTj1IIF Z35g== X-Forwarded-Encrypted: i=1; AJvYcCVR/Zm2SWh726xS3xuQHstEAXvE3KIV/XTNFwi1KkGqzLYyLwAn+/4fgNonNEKTEzxmVG4TP3IWpZvTe1E=@vger.kernel.org X-Gm-Message-State: AOJu0YxXgdjoKR5DoG/eEkkLYpe9B0kERZXYtIkA4fMl+n75ea40nc55 Ur0I/iewnoVsr0hQo3+uZHoiXusgv4Mi8UXiPVHEnDhJguQKjJH+LaWmgWE3K8M= X-Google-Smtp-Source: AGHT+IHt5b4bByB1WvcuC38k97IWVU58hfVMsjj5FiJWbVwYm1/FeLRBTfW/P+tmVBSwJRaQRUR0MQ== X-Received: by 2002:a05:6402:40c8:b0:5c9:34b4:69a8 with SMTP id 4fb4d7f45d1cf-5c95ac09860mr3965894a12.6.1728744025513; Sat, 12 Oct 2024 07:40:25 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a80cb013sm328446266b.131.2024.10.12.07.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:24 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:31 +0200 Subject: [PATCH v3 5/6] arm64: dts: ti: am62-lp-sk: Add vddshv_canuart regulator Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-5-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@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=1333; i=msp@baylibre.com; h=from:subject:message-id; bh=B9BqpeoJguVWS7gI+XD6rHIo0W/hrym3/3+lBaC2IGI=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5utxEp3dO6Us5KRkTecpIP3rpPckzfV6XN1V8ltM4O avp0X6xjlIWBjEOBlkxRZa7Hxa+q5O7viBi3SNHmDmsTCBDGLg4BWAiU08xMky9qLng0OL70vHO t45nefrmlZ6pfP1YZt2SqfxTfy8QO5LHyDB97YNZf1KYS0M+7/u57mBcRdhGgzOSMpyT3TR/8WR N72QBAA== X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 vddshv_canuart on am62-lp-sk is used to power a few units specific units of the SoC that remain active in a special low power mode. Model this relationship explicitly. Signed-off-by: Markus Schneider-Pargmann --- arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts | 19 +++++++++++++++++++ 1 file changed, 19 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 529360b5e6fe052dd99f04b74c129193922f76ac..783ad65e6165ea74010c3240069= fc6d99a0cd035 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts @@ -80,6 +80,17 @@ vcc_3v3_sys: regulator-5 { regulator-always-on; regulator-boot-on; }; + + vddshv_canuart: regulator-7 { + /* TPS22965DSGT */ + compatible =3D "regulator-fixed"; + regulator-name =3D "vddshv_canuart"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + vin-supply =3D <&vcc_3v3_main>; + regulator-always-on; + regulator-boot-on; + }; }; =20 &main_pmx0 { @@ -242,3 +253,11 @@ &tlv320aic3106 { &gpmc0 { ranges =3D <0 0 0x00 0x51000000 0x01000000>; /* CS0 space. Min partition = =3D 16MB */ }; + +&mcu_mcan0 { + vio-supply =3D <&vddshv_canuart>; +}; + +&mcu_mcan1 { + vio-supply =3D <&vddshv_canuart>; +}; --=20 2.45.2 From nobody Wed Nov 27 04:44:51 2024 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 656ED19CC0C for ; Sat, 12 Oct 2024 14:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744030; cv=none; b=dFPlRyWze8XvFOzDqDKWZZuqO6ugsKSInJ2umfSUlXQtZTfGSgEqlQAYzQuTOfFvaR/4IliMoEgS8XKftrpPpCUxyOwKBEVBGJRaEKtYys6bYk119Etq1RWV35SOTObBtZktP8s9Y+YueBjNRi8xx9jDN9kxA+0fq959U9+HlOI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728744030; c=relaxed/simple; bh=3rhP+Zbms4CJO3Z/gy2uQZJnt81xMUEEDV0P1R+LUzc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rex3wquh6LilsffNq93q/hqRTTqYRRoGOkQC8wyGSB0dHswq7cp74Poukz7P1mlnsv/toQITtNabFZfCYm8yyaXJuflqUzj9uHg0ttkJlvN4cT6Oo9Qll0FWpXGfxHxHtwEXtYzLzA/BjvfTRvXw5FjaKYotFaCa9h1A8pryIb0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=yXzgcKWY; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="yXzgcKWY" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a99fa009adcso12240766b.0 for ; Sat, 12 Oct 2024 07:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744027; x=1729348827; darn=vger.kernel.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=Y3xZ4a5awHPcdMjSyXUFYiKUuBlpPlAJT3mA8niN3dM=; b=yXzgcKWYO7D8xiztM+BrKd0ZNBHkso66Zmm21UNEQuHMx5AF/6rk+OdiptQ35aT8S5 cFrkLXT4lffQ2iZXpy8SPAD1W9J02Yk7SjpGANDgCcWDqfdZSHo7t5H0OVJQbuTKjvXk 26oIqn9/hLCZPSfGgSlUd9xcS/Pm4gl+n/ynIRSwexO+IpHBtIkW2Xwib0eqcQKDn5mq Vivf0EOcQOlPBhOyxs0jsbJh11CJtuJ+g2hwHj6gYx/03yoS4xZUcL3lEn23LldbXhW+ 6m7aPr4aoFHhgtfsy7tcZkc9PSgnuuMmdY5f1+7/ZMJl3BOb4BpHXAthwKLsf3Jz56UL koFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744027; x=1729348827; 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=Y3xZ4a5awHPcdMjSyXUFYiKUuBlpPlAJT3mA8niN3dM=; b=quA0rjOqksgX2k3MTSeo7/O7FivbMfeaIH2n+ZuTKJTpsNEqKCH024R5xYq14eRaO0 VW/Hv2TWZIOoTVoyBqxhSZlVAM/AiVoapt9oqklogu86d1AuOkckuQggjkARtPp4mlWK QKYsu1M58SYEimrTU/Z57wYWAfXc3BbN7iFcK0C3JQ6lZ6gjJl9ID1whj/47RA9y4/E+ ghyVfUr0rAUH0vS/PPVVV5pUoPJ9F6xm9b9r66MADFPZxADbzoZgNSQk7wG0nKFf5R6v gwX8KNxBTssxPN0qQOChGpYjHrw/H0bHR3kpDaixA7U8cbVJeXa5Pcl6QqPe+3VAGukl QlZQ== X-Forwarded-Encrypted: i=1; AJvYcCWDZ4U/Snn8biWXz93gKIAAhCN8I11QelnlvARM2NhPejk1I4KPZPCdr8KAbzBu+c9Oq7awFKivkgX/VoI=@vger.kernel.org X-Gm-Message-State: AOJu0YzcmzwrKP+47Um4ppV2b8NAUW5Nf4728Xt6qRLl0WlBdqx6Dwru 9ArzrkCVFDLXhZFJvt5TiEBWOvWsJQ86fktttxoWoCMA6bAMcz+VFGhykikeBSw= X-Google-Smtp-Source: AGHT+IG9ioLyyHl/HtWV0pbHTj1ySQ8SJ6REFjcmSOPMoXc68Zmr1Vs+Sj6fLUwZqHEWKbuYJDCdLw== X-Received: by 2002:a05:6402:8c3:b0:5c9:55aa:4285 with SMTP id 4fb4d7f45d1cf-5c95ac63c95mr3728863a12.34.1728744026673; Sat, 12 Oct 2024 07:40:26 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a7f5cea5sm328289766b.96.2024.10.12.07.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:26 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:32 +0200 Subject: [PATCH v3 6/6] arm64: dts: ti: am62-lp-sk: Add wakeup mcu_mcan0/1 pinctrl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-6-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@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=2222; i=msp@baylibre.com; h=from:subject:message-id; bh=3rhP+Zbms4CJO3Z/gy2uQZJnt81xMUEEDV0P1R+LUzc=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5uryjmTWWb2ScNI+J177mJLPVcVufx39rP8U8/ffy2 lFRF6WgjlIWBjEOBlkxRZa7Hxa+q5O7viBi3SNHmDmsTCBDGLg4BWAif5sZ/pmfLkpexfrk3hnz LCnZGC/jTpNLzfWrH/118Fl72pzTlZmR4bDFj0v5R2OuN/vczf5im75M4A3LhAWuHK7v1t1KVND V5AAA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 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 | 46 ++++++++++++++++++++++++++++= ++++ 1 file changed, 46 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 783ad65e6165ea74010c3240069fc6d99a0cd035..de3c9abe39ad35cbab9e480d76e= 7161bd46af46a 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts @@ -255,9 +255,55 @@ &gpmc0 { }; =20 &mcu_mcan0 { + pinctrl-names =3D "default", "wakeup"; + pinctrl-0 =3D <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_default>; + pinctrl-1 =3D <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_wakeup>; vio-supply =3D <&vddshv_canuart>; + status =3D "okay"; }; =20 &mcu_mcan1 { + pinctrl-names =3D "default", "wakeup"; + pinctrl-0 =3D <&mcu_mcan1_tx_pins_default>, <&mcu_mcan1_rx_pins_default>; + pinctrl-1 =3D <&mcu_mcan1_tx_pins_default>, <&mcu_mcan1_rx_pins_wakeup>; vio-supply =3D <&vddshv_canuart>; + status =3D "okay"; +}; + +&mcu_pmx0 { + mcu_mcan0_tx_pins_default: mcu-mcan0-tx-pins-default { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */ + >; + }; + + mcu_mcan0_rx_pins_default: mcu-mcan0-rx-pins-default { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */ + >; + }; + + mcu_mcan0_rx_pins_wakeup: mcu-mcan0-rx-pins-wakeup { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x038, PIN_INPUT | WKUP_EN, 0) /* (B3) MCU_MCAN0_RX */ + >; + }; + + mcu_mcan1_tx_pins_default: mcu-mcan1-tx-pins-default { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x03c, PIN_OUTPUT, 0) /* (E5) MCU_MCAN1_TX */ + >; + }; + + mcu_mcan1_rx_pins_default: mcu-mcan1-rx-pins-default { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x040, PIN_INPUT, 0) /* (D4) MCU_MCAN1_RX */ + >; + }; + + mcu_mcan1_rx_pins_wakeup: mcu-mcan1-rx-pins-wakeup { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x040, PIN_INPUT | WKUP_EN, 0) /* (D4) MCU_MCAN1_RX */ + >; + }; }; --=20 2.45.2