From patchwork Mon Feb 10 21:13:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Wanner X-Patchwork-Id: 864324 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A2D72512E7; Mon, 10 Feb 2025 21:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739222060; cv=none; b=qwHRAux0ckjHePmm0T4ihg6YmUWAoGjjaAb08IsB7ehlrLY18DKp8sdlvFVQZAN5zI9Tyf1Lo63nBvZe93RWCQ2za5p4SMzLBsNJp6McOoSslxdYbbI4uEZA4JX0K7fJPcXU2hFMPtppvy4k1bUtHpymG+w0xBGp9GnNxJDk6xk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739222060; c=relaxed/simple; bh=Av1ib6CM5UFki6Z+KJ2dFNdTFpzluX5rZ5YX+kc6uD8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jYXFrYLfPTW8hPpDkq5ew1r7AZuGLPX9IFlxt88JeftEglFF82B+BNzk0idiHh5Kbcaej+S62Vqx0D/UuPWV5xG6tqdbVkIvzVaZaiL9N+4/4ANhD4A1nN4RcdZD7eH4suHoQ1MNaeHoObnMZBhGAQPxWL5h9AU2DzslX4IArYw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=nZ3S2BaT; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="nZ3S2BaT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1739222058; x=1770758058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Av1ib6CM5UFki6Z+KJ2dFNdTFpzluX5rZ5YX+kc6uD8=; b=nZ3S2BaTUmxtTC1ZwuYtWXEyCn1yFBQ2i2BBRknHdnXKnnuT3Rl90yqW Bzmq7praeqHfR6mDemF7SzGsUB2aY75TDq08wgrvrjo8f64G7YvWJVmfv rVy9ovjU8x+NmKhP9Qcor4gbrn+PSbchBfpJyN7SgfDT1tRx1BoHvGoiS DIyCV1Dv+57Q9gwPlMIipFVfmbG7PyUbr1S87sWT0EdqH3b6UIufFBAD9 08zEDw/GwfTTQbWs1luoZ/kKOyuUzgz+92oXhaOSPbG3oKvT8z8DxTX5M IOFQA7HQBWfAdtnWY6q1wfo0+On60IABe4iaLihuuzpYPdVVHu+mgfSHE g==; X-CSE-ConnectionGUID: AYqW9AG9RbOJ2Xf8Pt97Yw== X-CSE-MsgGUID: xh/FP1YVRZiE3cTC268PGg== X-IronPort-AV: E=Sophos;i="6.13,275,1732604400"; d="scan'208";a="205027988" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 10 Feb 2025 14:14:06 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 10 Feb 2025 14:13:47 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 10 Feb 2025 14:13:47 -0700 From: To: , , , , , , , , CC: , , , , , , "Ryan Wanner" Subject: [PATCH v2 11/15] ARM: at91: PM: Add Backup mode for SAMA7D65 Date: Mon, 10 Feb 2025 14:13:11 -0700 Message-ID: <76a89f1ae5e9c4d337c2a28e4b1d0e5cef63e5fe.1739221064.git.Ryan.Wanner@microchip.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ryan Wanner Add config check that enables Backup mode for SAMA7D65 SoC. Add SHDWC_SR read to clear the status bits once finished exiting low power modes. This is only for SAMA7D65 SoCs. Signed-off-by: Ryan Wanner --- arch/arm/mach-at91/pm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 1eec68e92f8d8..55cab31ce1ecb 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -707,6 +707,9 @@ static int at91_pm_enter(suspend_state_t state) static void at91_pm_end(void) { at91_pm_config_ws(soc_pm.data.mode, false); + + if (IS_ENABLED(CONFIG_SOC_SAMA7D65)) + readl(soc_pm.data.shdwc + 0x08); } @@ -1065,7 +1068,8 @@ static int __init at91_pm_backup_init(void) int ret = -ENODEV, located = 0; if (!IS_ENABLED(CONFIG_SOC_SAMA5D2) && - !IS_ENABLED(CONFIG_SOC_SAMA7G5)) + !IS_ENABLED(CONFIG_SOC_SAMA7G5) && + !IS_ENABLED(CONFIG_SOC_SAMA7D65)) return -EPERM; if (!at91_is_pm_mode_active(AT91_PM_BACKUP))