From mboxrd@z Thu Jan 1 00:00:00 1970 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 90D86C52D7C for ; Mon, 12 Aug 2024 05:44: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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:CC:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=14BB/GnX764UF0lLsGKNlUlwXAwTjTCuAxhCG1KLL/I=; b=MhkOcsGnElX64Dri/gcmCRiHTU p7GBpaGV5uTl08TUd48MRRxfP67tmTyiRCCOtm8fQQVpBvcC4/RnEkhCatc/LrLb0GJfeyGvdvpS/ xZLOIlh9QUGv9Ka03WuRArW+AC2m9ZC5HLBvh39+kFm/+xOOxvu814e4JxlHYIJ2A2u1et1QAeclZ ChYLlJkG5k+zf3j9zpB0zXrvLiQgfyHzHQmzY5tZCFlfdY3pGiNXW6kGah53KN49dQXbo64AvAdht F+tJg4QqRqCnn30Pk/dmEn9B2xvc7gbR2tob9HsE5f8dv6+EZSX6XK+kkafC9AKSqXa3oehbSrvvh Y3A6AzMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdNr3-0000000Gwcc-34gM; Mon, 12 Aug 2024 05:44:29 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdNqS-0000000GwXu-01IJ for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 05:43:53 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47C5hcwa040969; Mon, 12 Aug 2024 00:43:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1723441418; bh=14BB/GnX764UF0lLsGKNlUlwXAwTjTCuAxhCG1KLL/I=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=Bzt6Q3Ft2/Lim85dfYADl8SjsBWh86NzFzuRhx10ISC6DM/qdjX9t3M4Of/d5PiUQ RyRH6XS0X9eyNnrey3Rek+2WgkN7vrjVQWD3DckbvcBZLUw/bz+ioMP3z+MIjNNqFG +2EE5fffL3uLisc1pxLeu3b2TNXVUhEOcOMJyQrY= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47C5hbcC007558 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 12 Aug 2024 00:43:37 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 12 Aug 2024 00:43:37 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 12 Aug 2024 00:43:37 -0500 Received: from localhost (lcpd911.dhcp.ti.com [172.24.227.68]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47C5ha38089430; Mon, 12 Aug 2024 00:43:37 -0500 Date: Mon, 12 Aug 2024 11:13:36 +0530 From: Dhruva Gole To: Markus Schneider-Pargmann CC: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vibhore Vardhan , Kevin Hilman , , Subject: Re: [PATCH v9 0/4] firmware: ti_sci: Introduce system suspend support Message-ID: <20240812054336.db36hcp7faz23fdl@lcpd911> References: <20240809135347.2112634-1-msp@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240809135347.2112634-1-msp@baylibre.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240811_224352_157895_37FC1A5F X-CRM114-Status: GOOD ( 33.00 ) 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 On Aug 09, 2024 at 15:53:43 +0200, Markus Schneider-Pargmann wrote: > Abstract > ******** > > This series introduces necessary ti_sci driver functionality to support > various Suspend-to-RAM modes on TI AM62 family of devices. These Low > Power Modes include Deep Sleep and MCU Only as described in section > "6.2.4 Power Modes" of the AM62x Technical Reference Manual [0]. Since this code is common across AM62x, AM62A, AM62P, I think a more suitable TRM link to give would be the AM62P TRM: https://www.ti.com/lit/pdf/SPRUJ83 Reason: It covers more modes than the AM62x > > Summary > ******* > > This series is a restructuring and rebase of the patch series by > Dave Gerlach [1] and Dhruva Gole [2]. It applies on top of Linux > 6.11-rc1. > > The kernel triggers entry to Low Power Mode through the mem suspend > transition with the following: > > * At the bootloader stage, one is expected to package the TIFS stub > which then gets pulled into the Tightly coupled memory of the Device Mgr > (DM) R5 when it starts up. If using U-Boot, then it requires tispl.bin > to contain the TIFS stub. Refer to ti-u-boot patch [3] for further Everything is now in upstream U-Boot, hence I prefer to share upstream ie. non-vendor tree links at this point. Documentation: https://source.denx.de/u-boot/u-boot/-/commit/962f60abca82bb11501bc0c627abacda15bed076 Sample TIFS Stub packaging patch: https://source.denx.de/u-boot/u-boot/-/commit/93458ba599f753dcc5b6fea661cf71a50e8c5bd2 Patches that introduced the base support: https://source.denx.de/u-boot/u-boot/-/commit/4a0067c8575c7c3b98f3fc0a689f53dc80700393 https://source.denx.de/u-boot/u-boot/-/commit/128f81290b7d4f20a11c7754798b1896575b7a29 > details. The supported firmware version is from TI Processor SDK > >= 10.00 ie. tag 10.00.04 from ti-linux-firmware [4]. > > * Use a TF-A binary that supports PSCI_SYSTEM_SUSPEND call. This causes > system to use PSCI system suspend as last step of mem sleep. > > * We add support for the TISCI_MSG_QUERY_FW_CAPS message, used to retrieve > the firmware capabilities of the currently running system firmware [6]. > Sysfw version >= 10.00.04 support LPM_DM_MANAGED capability, where > Device Mgr firmware now manages which low power mode is chosen. Going > forward, this is the default configuration supported for TI AM62 family > of devices. The state chosen by the DM can be influenced by sending > constraints using the new LPM constraint APIs. (Patch 1) > > * The firmware requires that the OS sends a TISCI_MSG_PREPARE_SLEEP > message in order to provide details about suspend. The ti_sci driver > must send this message to firmware with the above information > included, which it does during the driver suspend handler when > PM_MEM_SUSPEND is the determined state being entered. The mode being > sent depends on whether firmware capabilities have support for > LPM_DM_MANAGED feature. Legacy firmware or those supporting other > modes can extend the mode selection logic as needed. (Patch 2) > > * We also add the remaining TISCI Low Power Mode messages required for > inquiring wake reason and managing LPM constraints as part of a new PM > ops. These messages are part of the TISCI PM Low Power Mode API [5]. > (Patch 3) > > * Finally if any CPUs have PM QoS resume latency constraints set, we > aggregate these and set the TISCI system-wide latency constraint. > (Patch 4) > > Testing > ******* > > This series can for example be tested with a am62a-lp-sk board. > > For am62a-lp-sk all usb nodes have to be disabled at the moment (usbss0, > usb0, usbss1 and usb1). There is currently an issue with USB Link Power > Management and turning off the USB device which is being worked on. > > Once booted suspend/resume can be tested with rtcwake: > $ rtcwake -m mem -s 10 -d /dev/rtc0 > > Make sure /dev/rtc0 corresponds to rtc-ti-k3: > $ dmesg | grep rtc-ti-k3 > rtc-ti-k3 2b1f0000.rtc: registered as rtc0 > [...] Do we need to add an alias here for this? https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/+/refs/heads/master/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts#19 > > References: > *********** > > [0] https://www.ti.com/lit/pdf/spruiv7 > [1] https://lore.kernel.org/lkml/20220421203659.27853-1-d-gerlach@ti.com > [2] https://lore.kernel.org/lkml/20230804115037.754994-1-d-gole@ti.com > [3] https://git.ti.com/cgit/ti-u-boot/ti-u-boot/commit/?h=ti-u-boot-2023.04&id=91886b68025c7ad121e62d1fc1fa4601eeb736cd > [4] https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/commit/?h=10.00.06&id=193f7d7570583a41ddc50a221e37c32be6be583e > [5] https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html > [6] https://downloads.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html#tisci-msg-query-fw-caps > > Dave Gerlach (1): > firmware: ti_sci: Introduce Power Management Ops > > Georgi Vlaev (1): > firmware: ti_sci: Add support for querying the firmware caps > > Kevin Hilman (1): > firmware: ti_sci: add CPU latency constraint management > > Vibhore Vardhan (1): > firmware: ti_sci: Add system suspend and resume call > > drivers/firmware/ti_sci.c | 452 ++++++++++++++++++++++++- > drivers/firmware/ti_sci.h | 137 +++++++- > include/linux/soc/ti/ti_sci_protocol.h | 46 +++ > 3 files changed, 633 insertions(+), 2 deletions(-) -- Best regards, Dhruva Gole