From patchwork Sat Dec 18 15:44:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 418241 X-Patchwork-Delegate: paul@pwsan.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBIFowIG004889 for ; Sat, 18 Dec 2010 15:50:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756749Ab0LRPun (ORCPT ); Sat, 18 Dec 2010 10:50:43 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:39400 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756716Ab0LRPum (ORCPT ); Sat, 18 Dec 2010 10:50:42 -0500 Received: by wyb28 with SMTP id 28so1613957wyb.19 for ; Sat, 18 Dec 2010 07:50:41 -0800 (PST) Received: by 10.216.56.79 with SMTP id l57mr8757wec.86.1292687103071; Sat, 18 Dec 2010 07:45:03 -0800 (PST) Received: from localhost.localdomain (223.78-245-81.adsl-dyn.isp.belgacom.be [81.245.78.223]) by mx.google.com with ESMTPS id t11sm250385wes.41.2010.12.18.07.45.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 18 Dec 2010 07:45:02 -0800 (PST) From: jean.pihet@newoldbits.com To: linux-omap@vger.kernel.org Cc: khilman@deeprootsystems.com, linux-arm-kernel@lists.infradead.org, Jean Pihet Subject: [PATCH 2/7] OMAP2+: use global values for the SRAM PA addresses Date: Sat, 18 Dec 2010 16:44:42 +0100 Message-Id: <1292687087-22983-3-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1292687087-22983-1-git-send-email-j-pihet@ti.com> References: <1292687087-22983-1-git-send-email-j-pihet@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 18 Dec 2010 15:50:59 +0000 (UTC) different places, i.e. SRAM management code and idle sleep code. The macros are now defined at a centralized place, for easier maintenance. Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet Acked-by: Santosh Shilimkar Tested-by: Nishanth Menon --- arch/arm/mach-omap2/sdrc.h | 1 - arch/arm/mach-omap2/sleep34xx.S | 1 + arch/arm/plat-omap/include/plat/sram.h | 11 +++++++++++ arch/arm/plat-omap/sram.c | 7 ++----- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h index 68f57bb..b3f8379 100644 --- a/arch/arm/mach-omap2/sdrc.h +++ b/arch/arm/mach-omap2/sdrc.h @@ -74,5 +74,4 @@ static inline u32 sms_read_reg(u16 reg) */ #define SDRC_MPURATE_LOOPS 96 - #endif diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 2191576..406cd2a 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -26,6 +26,7 @@ */ #include #include +#include #include #include "cm.h" diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h index 5905100..9967d5e 100644 --- a/arch/arm/plat-omap/include/plat/sram.h +++ b/arch/arm/plat-omap/include/plat/sram.h @@ -11,6 +11,7 @@ #ifndef __ARCH_ARM_OMAP_SRAM_H #define __ARCH_ARM_OMAP_SRAM_H +#ifndef __ASSEMBLY__ extern void * omap_sram_push(void * start, unsigned long size); extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); @@ -74,4 +75,14 @@ extern void omap_push_sram_idle(void); static inline void omap_push_sram_idle(void) {} #endif /* CONFIG_PM */ +#endif /* __ASSEMBLY__ */ + +/* + * OMAP2+: define the SRAM PA addresses. + * Used by the SRAM management code and the idle sleep code. + */ +#define OMAP2_SRAM_PA 0x40200000 +#define OMAP3_SRAM_PA 0x40200000 +#define OMAP4_SRAM_PA 0x40300000 + #endif diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 819ea0c..1a686c8 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c @@ -41,15 +41,12 @@ #define OMAP1_SRAM_PA 0x20000000 #define OMAP1_SRAM_VA VMALLOC_END -#define OMAP2_SRAM_PA 0x40200000 -#define OMAP2_SRAM_PUB_PA 0x4020f800 +#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800) #define OMAP2_SRAM_VA 0xfe400000 #define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800) -#define OMAP3_SRAM_PA 0x40200000 #define OMAP3_SRAM_VA 0xfe400000 -#define OMAP3_SRAM_PUB_PA 0x40208000 +#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000) #define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000) -#define OMAP4_SRAM_PA 0x40300000 #define OMAP4_SRAM_VA 0xfe400000 #define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000) #define OMAP4_SRAM_PUB_VA (OMAP4_SRAM_VA + 0x4000)