Received: by 10.192.165.156 with SMTP id m28csp1486493imm; Wed, 11 Apr 2018 21:00:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+g1CZGiTLn3yqcSnPjrWFxeZ7QtA/fPpKdzmpzSqn9ohhx9LVjjl+ZU5TAOCeYaBgcn4An X-Received: by 2002:a17:902:5242:: with SMTP id z60-v6mr7847852plh.223.1523505613926; Wed, 11 Apr 2018 21:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523505613; cv=none; d=google.com; s=arc-20160816; b=syso9a6LR2mwX70CMgxisQTlQ2llPwchH30F2h8iQCN+ZN8wlfRBU+DWfrd++YYNK3 imV0WdsYROb5Gr8Dhl/x1Ai5t+b4q9TfRLZe8UCUW/TDVAEH+IOV1vC2fMfEd+UzIGCL tuFvkku+z3YDoPD2JdKNESzU1/xAntapeXXSmxq81YQFWNtfdycnkJ65mvWU6C5aJyYC r9dx+49t2XpYuvOcZemNPsCjoRhQcGnq8oKu35ZlcZ/fCA3l6YMoS/cAXbKJHQSJ66Gp +HnBh2zOXt6tF+v5o3GTgOXBqGuQtbzpSDKaJ4+pXStZKY2oykuVXDdjjRXvec3aH87E Nbgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ZEN2noms4xQnfq2+N8sfcyTZwRc37/1uCaNUA8PU+Xc=; b=ipQcOAccl++CfrLtHXhIKzjg4Gk+Fprj80XlZdSQDHLtZo0l741Q11osxJZUUbjBmi mEcr1Mw+s9LgP/W7e5W6nZIX2qIaWVLZCJzUD6uM1RAzPn+ZGEJZ8zE8CHrQPLgA5lX4 EFLpLtgf6gFBpOB0ZEFxrtStYQj3nsm0MwAzITA3aPkSjOlHQTgEiCvZtmWaZfY9ML3H P09wiCQ0bmum0WhW064WqfJRvVSewPJurpBzvuJZ3C4MfvHvznw2NBTk3KwnGFAcwEG8 zv9N6v5NCNp6gWBmcyHWcaLwydNPbStkqDQUeue8c7uEFWlZ9ZiIVn3E46bZj/JCGLNH vcig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GCa92jSh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si1886694pff.125.2018.04.11.20.59.37; Wed, 11 Apr 2018 21:00:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GCa92jSh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1753091AbeDLD4G (ORCPT + 99 others); Wed, 11 Apr 2018 23:56:06 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:65157 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753019AbeDLDzt (ORCPT ); Wed, 11 Apr 2018 23:55:49 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3C3tMfc012162; Wed, 11 Apr 2018 22:55:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523505322; bh=IbHnx2wKTu0HKm1lE/977Mco2c3dtov/h8ZPhoi6gAQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GCa92jSh9F6y+2RG//aeKbodtkamIC90dMiNxCtQjgqifzVFhb+Azzb1If1pbzY4+ A1R/uneCgnU8NC0k3EfTAJJLi/LWHq+cNBm8qX+DyHot7Krq5sjZOW5F0kWNM/W8w1 euBnUz3s4bEh/12/4XsPDLf5DTkOVPZv+xnlUHYE= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3C3tMxp008597; Wed, 11 Apr 2018 22:55:22 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 11 Apr 2018 22:55:21 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 11 Apr 2018 22:55:21 -0500 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3C3sQpv010150; Wed, 11 Apr 2018 22:55:18 -0500 From: Keerthy To: , , CC: , , , , , , , , Subject: [PATCH 14/14] ARM: OMAP2+: prm44xx: Introduce context save/restore for am43 PRCM IO Date: Thu, 12 Apr 2018 09:23:59 +0530 Message-ID: <1523505239-16229-15-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Gerlach There are two registers on am43x needed for IO daisy chain wake to work properly, however currently after an RTC+DDR cycle they are lost. We must take care to save and restore these before and after entering RTC mode otherwise IO daisy chain wake will stop working from DeepSleep after resuming. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy --- arch/arm/mach-omap2/prm.h | 2 ++ arch/arm/mach-omap2/prm44xx.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index f0fb508..32e275f 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h @@ -179,6 +179,8 @@ int omap_prm_deassert_hardreset(u8 shift, u8 st_shift, u8 part, s16 prm_mod, u32 omap_prm_vp_check_txdone(u8 vp_id); void omap_prm_vp_clear_txdone(u8 vp_id); +void am43xx_prm_save_context(void); +void am43xx_prm_restore_context(void); #endif diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index 47b657c..0d1111e 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c @@ -57,6 +57,13 @@ .reconfigure_io_chain = &omap44xx_prm_reconfigure_io_chain, }; +struct omap_prm_irq_context { + unsigned long irq_enable; + unsigned long pm_ctrl; +}; + +static struct omap_prm_irq_context omap_prm_context; + /* * omap44xx_prm_reset_src_map - map from bits in the PRM_RSTST * hardware register (which are specific to OMAP44xx SoCs) to reset @@ -739,6 +746,28 @@ struct pwrdm_ops omap4_pwrdm_operations = { static int omap44xx_prm_late_init(void); +void am43xx_prm_save_context(void) +{ + omap_prm_context.irq_enable = + omap4_prm_read_inst_reg(AM43XX_PRM_OCP_SOCKET_INST, + omap4_prcm_irq_setup.mask); + + omap_prm_context.pm_ctrl = + omap4_prm_read_inst_reg(AM43XX_PRM_DEVICE_INST, + omap4_prcm_irq_setup.pm_ctrl); +} + +void am43xx_prm_restore_context(void) +{ + omap4_prm_write_inst_reg(omap_prm_context.irq_enable, + OMAP4430_PRM_OCP_SOCKET_INST, + omap4_prcm_irq_setup.mask); + + omap4_prm_write_inst_reg(omap_prm_context.pm_ctrl, + AM43XX_PRM_DEVICE_INST, + omap4_prcm_irq_setup.pm_ctrl); +} + /* * XXX document */ -- 1.9.1