From patchwork Mon Jul 29 08:00:55 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: 13744515 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 5945FC3DA61 for ; Mon, 29 Jul 2024 08:01:56 +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: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:In-Reply-To:References:List-Owner; bh=jLO+jXA3M7oEf5JfEDBMAtggCBs7km6BzLtZrlx73qM=; b=dGB66C+ivKDrNG9AnhpPcikjmM h/mv5aKd+fCE2bbqlWdM+RETW7/AQC4312qKqtgq2Pgv5t3QX4n94xXog51rysYI3Mj+naHpEz6cE VohH3CbKug19fat9DV5I85fYRBHzNrzcPe1oXPTCNLuTO0paM0wd6A0xxQDcbeLKckh8DPxmk87bR Mvu5575i/yjw2FQfUMMVuf+nuN/yAlIPQ07UqcZqjtdZXm1eYf91G0jutljVMmOZ3Tha+Gcm8mz1Z Fpa3TQc/T6ykm9tJ25M1WSXTn1IQ4GjzwtO5WtFBYlSb8JROJVx5Z1Zrh4mpYvmd2cMDUzY6I1I11 ZxCr5Ipg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLKA-0000000ASOg-3aov; Mon, 29 Jul 2024 08:01:43 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYLJi-0000000ASEb-1xC6 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 08:01:16 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42816ca782dso11750845e9.2 for ; Mon, 29 Jul 2024 01:01:13 -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:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jLO+jXA3M7oEf5JfEDBMAtggCBs7km6BzLtZrlx73qM=; b=LDAIpOSS+DAoDi8zb6wcg4rJm66UCh8IyV0ML9BmWkDcnL85aXe3kD8kBO0UjmBFN3 1V/8qpeO7mvc+nz6Rk1jWVPMBzBusGNiCKrldijc69mRt8J6FMQiD/rrf/GcM/ZVFzop xKyjRYVPS/SAsv1T3s7MwFYf/pwbYNeOOMXz9j1B0KhDetIR2UmYQo5lxNdjz/BOdpDj seXGzY9jhCzyA32UcJv4cJN+Q3Ix3cfl5v3XjoZMt9OqN5dZYUnsXqBwsGQ4lybIo7SA mtMnJkHQ9H9FIYHsqN4WiaPcbPVTFQ1wGPLAJqtZCjhzgrSBoTzXa5VCS08Dp6U/w5Ty 3WRg== 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:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jLO+jXA3M7oEf5JfEDBMAtggCBs7km6BzLtZrlx73qM=; b=kNr8ceEMMGdiFK32FdWff/baGLKcvBiqQqqeHursbQS6KXlIQpY8VZf1KyENahB0W7 slXQf5xPvGjzMkzhgNl/SOchEpma1zi83a8AQ9bXtPUGA5GMKW2YyU3t49RM2xCzxeOp AG5++GWRCedwmmA563w0rw3ZBQvKQ5Ta9ocvELgpR5ptU1QriD4qpDJiPykyTgHxZ9Gt trMCGZ6bKu7n/LyZ6NqRmTpyXOZG3W95RAyv8Yp9BSam9+KWQVXmQRsVwj2LjrMHm5ZX H42LHYliSoMEcmbPP+sG5Nr1Y+6o4w5NgVWLhjPAl3ixKcSmjrdcaF/9GUrf+bAnEmnY 8JMA== X-Forwarded-Encrypted: i=1; AJvYcCXks1Cvb55Wl6lWCv2uHefYSbN6PloNekK+jM9v4lnAkex+b3vf+XEew+ck3HKSL3BljZwSl5oMw2gPAloKtE6jfkeq046h6eHyFJJIfbGNxadmswY= X-Gm-Message-State: AOJu0Yz20JiKORwjJ8v8jAWtMeuDMnkPPHHueyF3UKqV260guqgPmBxK skps/P1TDmpCwsOYGLdkVayLg56QnRZcHniTrLkRHOsMcrqzRvNfqd6LGGX+0kc= X-Google-Smtp-Source: AGHT+IGwDbx71v3X0g5AThC0OfXjuZ5crp6ajq9RjiMpyHii0qoF+GSo7T4l/t/6SWct2QxntireeA== X-Received: by 2002:a05:600c:4f0c:b0:426:629f:154e with SMTP id 5b1f17b1804b1-42811dd10d7mr38054595e9.30.1722240072500; Mon, 29 Jul 2024 01:01:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 01:01:12 -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 0/6] firmware: ti_sci: Partial-IO support Date: Mon, 29 Jul 2024 10:00:55 +0200 Message-ID: <20240729080101.3859701-1-msp@baylibre.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_010114_616847_2C39EABF X-CRM114-Status: GOOD ( 19.01 ) 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 Hi, v2 --- In v2 I fixed the comments on the first version of this series and rebased to v6.11-rc1. See below for a more detailed list. I also dropped the omap serial series for Partial-IO as it can't be tested with Partial-IO at the moment. The code was tested with other low power modes but they will be upstreamed later on. Series ------ Partial-IO is a poweroff SoC state with a few pingroups active for wakeup. This state can be entered by sending a TI_SCI PREPARE_SLEEP message. The message is sent on poweroff if one of the potential wakeup sources for this power state are wakeup enabled. A list of potential wakeup sources for the specific SoC is described in the devicetree. The wakeup sources can be individually enabled/disabled by the user in the running system. The series is based on v6.11-rc1. Partial-IO ---------- This series is part of a bigger topic to support Partial-IO on am62, am62a and am62p. Partial-IO is a poweroff state in which some pins are able to wakeup the SoC. In detail MCU m_can and two serial port pins can trigger the wakeup. A documentation can also be found in section 6.2.4 in the TRM: https://www.ti.com/lit/pdf/spruiv7 This other series is relevant for the support of Partial-IO: - can: m_can: Add am62 wakeup support https://lore.kernel.org/lkml/20240729074135.3850634-1-msp@baylibre.com/ https://gitlab.baylibre.com/msp8/linux/-/tree/topic/mcan-wakeup-source/v6.11?ref_type=heads Testing ------- A test branch is available here that includes all patches required to test Partial-IO: https://gitlab.baylibre.com/msp8/linux/-/tree/integration/am62-lp-sk-partialio/v6.11?ref_type=heads After enabling Wake-on-LAN the system can be powered off and will enter the Partial-IO state in which it can be woken up by activity on the specific pins: ethtool -s can0 wol p ethtool -s can1 wol p poweroff I tested these patches on am62-lp-sk. Best, Markus Previous versions: v1: https://lore.kernel.org/lkml/20240523080225.1288617-1-msp@baylibre.com/ Changes in v2: - Rebase to v6.11-rc1 - dt-binding: - Update commit message - Add more verbose description of the new binding for a better explanation. - ti_sci driver: - Combine ti_sci_do_send() into ti_sci_do_xfer and only wait on a response if a flag is set. - On failure to enter Partial-IO, do emergency_restart() - Add comments - Fix small things Markus Schneider-Pargmann (5): dt-bindings: ti, sci: Add property for partial-io-wakeup-sources firmware: ti_sci: Partial-IO support arm64: dts: ti: k3-pinctrl: Add WKUP_EN flag arm64: dts: ti: k3-am62: Add partial-io wakeup sources arm64: dts: ti: k3-am62a: Add partial-io wakeup sources Vibhore Vardhan (1): arm64: dts: ti: k3-am62p: Add partial-io wakeup sources .../bindings/arm/keystone/ti,sci.yaml | 13 ++ arch/arm64/boot/dts/ti/k3-am62.dtsi | 4 + arch/arm64/boot/dts/ti/k3-am62a.dtsi | 4 + arch/arm64/boot/dts/ti/k3-am62p.dtsi | 4 + arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 + drivers/firmware/ti_sci.c | 160 +++++++++++++++--- drivers/firmware/ti_sci.h | 34 ++++ 7 files changed, 203 insertions(+), 19 deletions(-)