Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4667023rdh; Wed, 29 Nov 2023 07:31:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYsioqh4JAJdfj690Kvh+H1WwKFfIy6NpzNukWNzbdYvLWKlapzz79s2UlOXHI0hheoHAs X-Received: by 2002:a05:6a21:a59f:b0:18b:558e:9ec7 with SMTP id gd31-20020a056a21a59f00b0018b558e9ec7mr19684002pzc.11.1701271916205; Wed, 29 Nov 2023 07:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701271916; cv=none; d=google.com; s=arc-20160816; b=FCGFLR7ZG1LE9fa8PcN56lTZX7tsEX6USL7CX+AoqB0yyxqjCtdiDVU29VwoLsFpCl n2umcjlAaOKetH9P8y/pMQPuIWMa80Z8L8V92vePmvRNg/B+C0bvL+1iyU6/LOg9ntMW Y2j8UuXpBOPf84qbLbYnjnseSKwhBf+qhmZ2q4jeSPZCTVP0DtmzJqmQpsZdBiGf14f9 0CJ9lZ/NZUpV1q+WNFeqB2Wca2Hq0eYdEPUbjJTHIlK8c9+xvnnSpv8/L6i6yOiwEKlX FdjVF8cs8Y2fKHs0MpM6by7kpsb9RVAnptNT8pYOoF1vZn2V+z4hPO+c3TZLu/4ak60Y ihsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=WerIBZOnq6P8oT/o/o5rlHVAMWDVtIsPC8yaH6UlHFk=; fh=qiuiZXOuSBoCezToil2F5RBR95PkXWcuBaEpicqga+E=; b=Bk91KVDms5gAWv5BYI9BWlqd9LpkIzy+rIkK7uEadTrCFU39Ky1IXQ1RsBW9bi6XpG UcpKvzTqSO3WFrQLumFJbwWeXpyf63gShlNhZbZ+C6scGOY5gSrWr+K9i8CIVgxiS5Uk XHacDREj3pzUfmHDtSqYR/sEShUM0/SfHM4an08aAHUaCiHk0ibwLFKdguQX3VRJ0GHi FEfRARlyN8FLVy2SOzdw21w5OpGIjn3YnST8du9Bf1HUeBi3wLyUPtBFkyxB+9Xts5/N QKodioLbejzPL1XecoUmkC6B4LoTOMdbED34+QpLM5xlkwdcWOr0ZRMbqGlqn78UikBH DfBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="efx3Mr/Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b9-20020a631b49000000b005acb88d8c15si14653497pgm.386.2023.11.29.07.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 07:31:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="efx3Mr/Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B7C03804B02E; Wed, 29 Nov 2023 07:31:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234931AbjK2PbX (ORCPT + 99 others); Wed, 29 Nov 2023 10:31:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234391AbjK2PbT (ORCPT ); Wed, 29 Nov 2023 10:31:19 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DEF1D47; Wed, 29 Nov 2023 07:31:24 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 01BDEE0003; Wed, 29 Nov 2023 15:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701271883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WerIBZOnq6P8oT/o/o5rlHVAMWDVtIsPC8yaH6UlHFk=; b=efx3Mr/Y1F3Vc6GzFGkw0FVPYoq7B9HKnvqdqyWwV8nFwAyiIX3kJmYw1EuZ7xRaZ6ULbR LtwaDlm41FYNS3cR9BvWcouPCKe3Ldj6lCeEwO8De0ozO1ZrIZutYOUxSbEsBmVXm/wqdQ 7DgjL1vF7jVApL1d67dRJuAXcD2FUeAsyDoGriMrjbvN9VQo+87XUHdMaVNyJlBr4THvAw fKhCAsTsX2l+chewhEBuh9OJqnIn5z8H9JOL7TBIpTX140ZfCQMDxOHbuxk4kPGi1RfYx4 C6szAcd+XgdaCcuxNfG1mcfRbSw0t059X+Hb9SQyvct1KgYCvE9SKZE/5+iG2Q== From: Thomas Richard Subject: [PATCH 0/5] Add suspend/resume support in ti_sci driver for j7200 Date: Wed, 29 Nov 2023 16:31:16 +0100 Message-Id: <20231129-j7200-tisci-s2r-v1-0-c1d5964ed574@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAERZZ2UC/x2N0QrCMAxFf2Xk2UCb6qT+ivjQxegiWCUZQxj7d 7s9Hs493AVcTMXh0i1gMqvrpzaIhw54LPUpqPfGQIFSjJTxdaYQcFJnRSfDPjPFzCkdTz20aig uOFipPG7du/gkti/ntPmvyUN/++P1tq5/s4uniYEAAAA= To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vignesh Raghavendra Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 07:31:37 -0800 (PST) During suspend, some devices free their irqs and request them at resume. But there are some devices which don't do it, and assume that it's done by the resource allocator. On j7200, during suspend to ram the SoC is powered-off, so the allocated irqs are lost. With this series, ti_sci has an internal list of allocated irqs. It will restore these irqs during its resume_noirq. Moreover, ti_sci checks that there is at least a reserved memory region for lpm. These regions are used by TF-A and R5 SPL during suspend and resume. We need to reserve some memory from the linux point of view to avoid any memory corruption. A new compatible (ti,j7200-sci) was created for this specific behavior. Signed-off-by: Thomas Richard --- Thomas Richard (5): dt-bindings: arm: keystone: add ti,j7200-sci compatible firmware: ti_sci: add suspend/resume support for irqs arm64: dts: ti: k3-j7200: use ti,j7200-sci compatible firmware: ti-sci: for j7200 before suspend check the reserved memory for lpm arm64: dts: ti: k3-j7200: add reserved memory regions for lpm .../devicetree/bindings/arm/keystone/ti,sci.yaml | 2 + arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 2 +- arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi | 10 ++ drivers/firmware/ti_sci.c | 191 ++++++++++++++++++++- 4 files changed, 196 insertions(+), 9 deletions(-) --- base-commit: 2041413d851e6dccd5c91321498e1d159ea432f2 change-id: 20231129-j7200-tisci-s2r-69c219c33456 Best regards, -- Thomas Richard