Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp233295pxb; Thu, 21 Apr 2022 22:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwQfGVIbfUHYpJlLf2fCNzXh6D78jk0hVMEO1kJfrp0fgSA/mFZ+6WMNY1hqlK9eHIOVIA X-Received: by 2002:a63:cf41:0:b0:399:3e74:d249 with SMTP id b1-20020a63cf41000000b003993e74d249mr2519055pgj.475.1650605882474; Thu, 21 Apr 2022 22:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650605882; cv=none; d=google.com; s=arc-20160816; b=u2uNWnaNwS9/UdjrAHLunaz0g2mwKC6nfj4eIId9lkOMPoQuf44hMgSuPRYR6R9qBw h/Fb8864zRL8rqm/U4HFb62l2NMW+auvD+gNJJI5lOETzMnzbM7SSRsMdiJ/DsR2B6i2 QE7EfcT1sEH6FXbfBYDA6tYHD1PrHTa4ZOW/kG7+IAXSFrDjZ9Qb43KsYrdDAiR563mW cIJazwULwgcuo/WTT9HK/3XB0aCxdDFZ7XdwYK/m5br7A2f0j5brJdJKylpFD9fjXVan 38pcU3pOVhGk9M5CHFxp40EMWLD3re6VG0k7OsrOt2vUdus0tonbKK+oYm3GxaBPS0HK DbRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fiIGiZ2hCyION5BKmzCgCDBVNqXIdGRylYKYLQZ5tjg=; b=OQ1oTystxdUs3ROkPkCENMusATf5uub6FyLU6fl3frL2VUB/KbQEyzKnf4ms2M0i0b oEdKvGae3AWxbDESExmL1sV3G0anjD1p94pZmdmoIutVTZwfcWMXoc30iSZmXV4QuIWV lVDoivT6r2sWKY8GseDpsjwK9aLBIfGO02t4NPfRB2XBS1QcqPCZ/wryL8XEhVNe0kNg VjJc4TLMmkCQ3Kig5Kqy6fsUjlBDOl5srCBOaUeuXyRyovvgCw1zhZi4xaM79+oOAuQ6 Eayz9iaaE3AR6gUsdpPSiT4AUR3fuQ5ZVMm+KAGNbEECa6NtEiksM2om77Wg6zmI28sC kCMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tdQQwhBM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a633603000000b003aad0a4480fsi66272pga.86.2022.04.21.22.37.43; Thu, 21 Apr 2022 22:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tdQQwhBM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392496AbiDUUlE (ORCPT + 99 others); Thu, 21 Apr 2022 16:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392464AbiDUUkv (ORCPT ); Thu, 21 Apr 2022 16:40:51 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A076F4DF7B; Thu, 21 Apr 2022 13:37:58 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 23LKbl9D086295; Thu, 21 Apr 2022 15:37:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1650573467; bh=fiIGiZ2hCyION5BKmzCgCDBVNqXIdGRylYKYLQZ5tjg=; h=From:To:CC:Subject:Date; b=tdQQwhBMXubbrpNpRi5aup6zXYw77wXf43qAwE1c62V00dPpRsZoww+ETAF8FRRXZ c0z5iNuW9a1W3molTOqcKvFn/h4F3w8O8+rOdNuIFa1iSqmoc57zctuXDGPZv0IMqO tR2PeBYSfDtYkGZdX0n2a9zRaxiEc5UtqC2gisU8= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 23LKblZC003126 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 21 Apr 2022 15:37:47 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Apr 2022 15:37:46 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 21 Apr 2022 15:37:46 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 23LKbka2012875; Thu, 21 Apr 2022 15:37:46 -0500 From: Dave Gerlach To: Rob Herring , Santosh Shilimkar , Krzysztof Kozlowski , Tero Kristo , Nishanth Menon CC: , , , Vignesh Raghavendra , Dave Gerlach Subject: [PATCH 0/6] firmware: ti_sci: Introduce system suspend support Date: Thu, 21 Apr 2022 15:36:53 -0500 Message-ID: <20220421203659.27853-1-d-gerlach@ti.com> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This series introduces necessary ti_sci driver functionality in preparation of supporting DeepSleep mode for suspend to mem on TI K3 AM62 [1]. This series applies on top of [2], which is also required for proper system suspend operation. Deep Sleep mode is described in section "5.2.4.4 DeepSleep" of the AM62 Technical Reference Manual: https://www.ti.com/lit/pdf/spruiv7 The kernel triggers entry to Deep Sleep mode through the mem suspend transition with the following: * Use a TF-A binary that supports PSCI_SYSTEM_SUSPEND call, which is enabled by the pending patches here [3]. This causes system to use PSCI system suspend as last step of mem sleep. * The firmware requires that the OS sends a TISCI_MSG_PREPARE_SLEEP message in order to provide details about suspend, so we must add the ability to send this message. (Patch 3) * A memory carveout address must be provided to the firmware using the above message, which is passed through device tree to the driver. (Patches 1 and 4) * System must load firmware to a specific location before Deep Sleep is entered, and this is accomplished using an lpm memory region in device tree to indicate where this firmware should be loaded, and also a "ti,lpm-firmware-name" property to indicate the name of the firmware to load. The ti_sci driver checks in its suspend handler to see if the firmware has been loaded and if not, loads it. (Patches 2 and 5) * Finally, the ti_sci driver must actually send TISCI_MSG_PREPARE_SLEEP 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. (Patch 6) This is tested on am625-sk using a ramdisk with all devices disabled apart from cpu0, main_uart0, dmsc, and secure_proxy_main. Regards, Dave [1] https://lore.kernel.org/lkml/20220225120239.1303821-1-vigneshr@ti.com/ [2] https://lore.kernel.org/lkml/20220412192138.31189-1-d-gerlach@ti.com/ [3] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/14714/3 Dave Gerlach (6): dt-bindings: ti,sci: Add ti,ctx-memory-region property dt-bindings: ti,sci: Add lpm region and ti,lpm-firmware-name firmware: ti_sci: Introduce Power Management Ops firmware: ti_sci: Introduce ti,ctx-memory-region for reserved LPM memory firmware: ti_sci: Use dt provided fw name and address to load at suspend time firmware: ti_sci: Introduce prepare system suspend call .../bindings/arm/keystone/ti,sci.yaml | 30 ++- drivers/firmware/ti_sci.c | 207 +++++++++++++++++- drivers/firmware/ti_sci.h | 32 ++- include/linux/soc/ti/ti_sci_protocol.h | 6 + 4 files changed, 269 insertions(+), 6 deletions(-) -- 2.35.0