From patchwork Thu Feb 2 14:45:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 9552099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9817F604A7 for ; Thu, 2 Feb 2017 14:53:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C22E27DF9 for ; Thu, 2 Feb 2017 14:53:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79D4328477; Thu, 2 Feb 2017 14:53:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0593027DF9 for ; Thu, 2 Feb 2017 14:53:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZIlc-00061j-6H; Thu, 02 Feb 2017 14:53:44 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZIeJ-0000sB-GX for linux-arm-kernel@lists.infradead.org; Thu, 02 Feb 2017 14:46:27 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id D55C320DCE; Thu, 2 Feb 2017 15:45:26 +0100 (CET) Received: from localhost (unknown [88.191.26.124]) by mail.free-electrons.com (Postfix) with ESMTPSA id B315420C37; Thu, 2 Feb 2017 15:45:26 +0100 (CET) From: Alexandre Belloni To: Nicolas Ferre Subject: [PATCH 05/13] ARM: at91: pm: use struct members directly Date: Thu, 2 Feb 2017 15:45:15 +0100 Message-Id: <20170202144523.11706-6-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202144523.11706-1-alexandre.belloni@free-electrons.com> References: <20170202144523.11706-1-alexandre.belloni@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170202_064612_589360_1C31B00B X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Ludovic Desroches , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the pm_data struct members directly instead of caching them. This saves a few load and store operations. Signed-off-by: Alexandre Belloni --- arch/arm/mach-at91/pm_suspend.S | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S index ed317657e760..3ee282c051e0 100644 --- a/arch/arm/mach-at91/pm_suspend.S +++ b/arch/arm/mach-at91/pm_suspend.S @@ -22,6 +22,7 @@ pmc .req r0 tmp1 .req r4 tmp2 .req r5 +pm_data .req r9 /* * Wait until master clock is ready (after switching master clock source) @@ -87,26 +88,17 @@ ENTRY(at91_pm_suspend_in_sram) mov tmp1, #0 mcr p15, 0, tmp1, c7, c10, 4 - ldr tmp1, [r0, #PM_DATA_PMC] - str tmp1, .pmc_base - ldr tmp1, [r0, #PM_DATA_RAMC0] - str tmp1, .sramc_base - ldr tmp1, [r0, #PM_DATA_RAMC1] - str tmp1, .sramc1_base - ldr tmp1, [r0, #PM_DATA_MEMCTRL] - str tmp1, .memtype - ldr tmp1, [r0, #PM_DATA_MODE] - str tmp1, .pm_mode + mov pm_data, r0 /* Active the self-refresh mode */ mov r0, #SRAMC_SELF_FRESH_ACTIVE bl at91_sramc_self_refresh - ldr r0, .pm_mode + ldr r0, [pm_data, #PM_DATA_MODE] tst r0, #AT91_PM_SLOW_CLOCK beq skip_disable_main_clock - ldr pmc, .pmc_base + ldr pmc, [pm_data, #PM_DATA_PMC] /* Save Master clock setting */ ldr tmp1, [pmc, #AT91_PMC_MCKR] @@ -135,16 +127,16 @@ ENTRY(at91_pm_suspend_in_sram) str tmp1, [pmc, #AT91_CKGR_MOR] skip_disable_main_clock: - ldr pmc, .pmc_base + ldr pmc, [pm_data, #PM_DATA_PMC] /* Wait for interrupt */ at91_cpu_idle - ldr r0, .pm_mode + ldr r0, [pm_data, #PM_DATA_MODE] tst r0, #AT91_PM_SLOW_CLOCK beq skip_enable_main_clock - ldr pmc, .pmc_base + ldr pmc, [pm_data, #PM_DATA_PMC] /* Turn on the main oscillator */ ldr tmp1, [pmc, #AT91_CKGR_MOR] @@ -195,8 +187,8 @@ ENDPROC(at91_pm_suspend_in_sram) */ ENTRY(at91_sramc_self_refresh) - ldr r1, .memtype - ldr r2, .sramc_base + ldr r1, [pm_data, #PM_DATA_MEMCTRL] + ldr r2, [pm_data, #PM_DATA_RAMC0] cmp r1, #AT91_MEMCTRL_MC bne ddrc_sf @@ -245,7 +237,7 @@ ddrc_sf: str r3, [r2, #AT91_DDRSDRC_LPR] /* If using the 2nd ddr controller */ - ldr r2, .sramc1_base + ldr r2, [pm_data, #PM_DATA_RAMC1] cmp r2, #0 beq no_2nd_ddrc @@ -277,7 +269,7 @@ ddrc_exit_sf: str r3, [r2, #AT91_DDRSDRC_LPR] /* If using the 2nd ddr controller */ - ldr r2, .sramc1_base + ldr r2, [pm_data, #PM_DATA_RAMC1] cmp r2, #0 ldrne r3, .saved_sam9_mdr1 strne r3, [r2, #AT91_DDRSDRC_MDR] @@ -308,16 +300,6 @@ exit_sramc_sf: mov pc, lr ENDPROC(at91_sramc_self_refresh) -.pmc_base: - .word 0 -.sramc_base: - .word 0 -.sramc1_base: - .word 0 -.memtype: - .word 0 -.pm_mode: - .word 0 .saved_mckr: .word 0 .saved_pllar: