From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754142AbdJPPcK (ORCPT ); Mon, 16 Oct 2017 11:32:10 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:37238 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477AbdJPPcJ (ORCPT ); Mon, 16 Oct 2017 11:32:09 -0400 Subject: Re: [PATCH v5 2/2] memory: ti-emif-sram: introduce relocatable suspend/resume handlers To: Russell King Cc: Dave Gerlach , Tony Lindgren , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Keerthy J , Johan Hovold References: <20171013205915.9652-1-d-gerlach@ti.com> <20171013205915.9652-3-d-gerlach@ti.com> From: Santosh Shilimkar Organization: Oracle Corporation Message-ID: <19256977-40e1-a972-4de8-838a8da863cc@oracle.com> Date: Mon, 16 Oct 2017 08:31:59 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171013205915.9652-3-d-gerlach@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Russell, On 10/13/2017 1:59 PM, Dave Gerlach wrote: > Certain SoCs like Texas Instruments AM335x and AM437x require parts > of the EMIF PM code to run late in the suspend sequence from SRAM, > such as saving and restoring the EMIF context and placing the memory > into self-refresh. > > One requirement for these SoCs to suspend and enter its lowest power > mode, called DeepSleep0, is that the PER power domain must be shut off. > Because the EMIF (DDR Controller) resides within this power domain, it > will lose context during a suspend operation, so we must save it so we > can restore once we resume. However, we cannot execute this code from > external memory, as it is not available at this point, so the code must > be executed late in the suspend path from SRAM. > > This patch introduces a ti-emif-sram driver that includes several > functions written in ARM ASM that are relocatable so the PM SRAM > code can use them. It also allocates a region of writable SRAM to > be used by the code running in the executable region of SRAM to save > and restore the EMIF context. It can export a table containing the > absolute addresses of the available PM functions so that other SRAM > code can branch to them. This code is required for suspend/resume on > AM335x and AM437x to work. > > In addition to this, to be able to share data structures between C and > the ti-emif-sram-pm assembly code, we can automatically generate all of > the C struct member offsets and sizes as macros by processing > emif-asm-offsets.c into assembly code and then extracting the relevant > data as is done for the generated platform asm-offsets.h files. > > Signed-off-by: Dave Gerlach > --- > v4->v5: > * Simplify Makefile to generate include/generated/ti-emif-asm-offsets.h > If you are happy with this version from Dave, can I get your ack please? I can add this to the driver-soc then. Regards, Santosh