From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TjBgX-0004wF-HS for barebox@lists.infradead.org; Thu, 13 Dec 2012 16:31:05 +0000 From: Jan Luebbe Date: Thu, 13 Dec 2012 17:30:44 +0100 Message-Id: <1355416249-22364-10-git-send-email-jlu@pengutronix.de> In-Reply-To: <1355416249-22364-1-git-send-email-jlu@pengutronix.de> References: <1355416249-22364-1-git-send-email-jlu@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 09/14] ARM omap: Use SoC specific defines for gpmc and timer base To: barebox@lists.infradead.org From: Sascha Hauer Signed-off-by: Sascha Hauer --- arch/arm/mach-omap/gpmc.c | 11 +++++++++-- arch/arm/mach-omap/include/mach/omap3-silicon.h | 4 ++-- arch/arm/mach-omap/include/mach/omap4-silicon.h | 4 ++-- arch/arm/mach-omap/omap3_clock.c | 2 +- arch/arm/mach-omap/s32k_clksource.c | 10 ++++++++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c index d2b7024..4f54a10 100644 --- a/arch/arm/mach-omap/gpmc.c +++ b/arch/arm/mach-omap/gpmc.c @@ -24,7 +24,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -33,7 +34,13 @@ void __iomem *omap_gpmc_base; static int gpmc_init(void) { - omap_gpmc_base = (void *)OMAP_GPMC_BASE; +#if defined(CONFIG_ARCH_OMAP3) + omap_gpmc_base = (void *)OMAP3_GPMC_BASE; +#elif defined(CONFIG_ARCH_OMAP4) + omap_gpmc_base = (void *)OMAP44XX_GPMC_BASE; +#else +#error "Unknown ARCH" +#endif return 0; } diff --git a/arch/arm/mach-omap/include/mach/omap3-silicon.h b/arch/arm/mach-omap/include/mach/omap3-silicon.h index 1921923..5843027 100644 --- a/arch/arm/mach-omap/include/mach/omap3-silicon.h +++ b/arch/arm/mach-omap/include/mach/omap3-silicon.h @@ -44,7 +44,7 @@ #define OMAP_SMX_APE_BASE 0x68000000 #define OMAP_SMS_BASE 0x6C000000 #define OMAP_SDRC_BASE 0x6D000000 -#define OMAP_GPMC_BASE 0x6E000000 +#define OMAP3_GPMC_BASE 0x6E000000 /** Peripheral Base Addresses */ #define OMAP_CTRL_BASE (OMAP_L4_CORE_BASE + 0x02000) @@ -74,7 +74,7 @@ #define OMAP_WDTIMER2_BASE (OMAP_L4_WKUP_BASE + 0x14000) #define OMAP_WDTIMER3_BASE (OMAP_L4_PER_BASE + 0x30000) -#define OMAP_32KTIMER_BASE (OMAP_L4_WKUP_BASE + 0x20000) +#define OMAP3_32KTIMER_BASE (OMAP_L4_WKUP_BASE + 0x20000) #define OMAP_MMC1_BASE (OMAP_L4_CORE_BASE + 0x9C000) #define OMAP_MMC2_BASE (OMAP_L4_CORE_BASE + 0xB4000) diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h b/arch/arm/mach-omap/include/mach/omap4-silicon.h index 0f0d88d..5755856 100644 --- a/arch/arm/mach-omap/include/mach/omap4-silicon.h +++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h @@ -92,7 +92,7 @@ #define OMAP44XX_SCRM_AUXCLK3 (OMAP44XX_SCRM_BASE + 0x31c) /* 32KTIMER */ -#define OMAP_32KTIMER_BASE (OMAP44XX_L4_WKUP_BASE + 0x4000) +#define OMAP44XX_32KTIMER_BASE (OMAP44XX_L4_WKUP_BASE + 0x4000) /* MMC */ #define OMAP44XX_MMC1_BASE (OMAP44XX_L4_PER_BASE + 0x09C100) @@ -117,7 +117,7 @@ #define OMAP44XX_GPIO6_BASE (OMAP44XX_L4_PER_BASE + 0x5D100) /* GPMC */ -#define OMAP_GPMC_BASE 0x50000000 +#define OMAP44XX_GPMC_BASE 0x50000000 /* DMM */ #define OMAP44XX_DMM_BASE 0x4E000000 diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c index 2a5e6f2..11f5117 100644 --- a/arch/arm/mach-omap/omap3_clock.c +++ b/arch/arm/mach-omap/omap3_clock.c @@ -39,7 +39,7 @@ #include #include -#define S32K_CR (OMAP_32KTIMER_BASE + 0x10) +#define S32K_CR (OMAP3_32KTIMER_BASE + 0x10) /* Following functions are exported from omap3_clock_core.S */ /* Helper functions */ diff --git a/arch/arm/mach-omap/s32k_clksource.c b/arch/arm/mach-omap/s32k_clksource.c index ca73753..7def8b1 100644 --- a/arch/arm/mach-omap/s32k_clksource.c +++ b/arch/arm/mach-omap/s32k_clksource.c @@ -25,7 +25,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -68,7 +69,12 @@ static struct clocksource s32k_cs = { */ static int s32k_clocksource_init(void) { - timerbase = (void *)OMAP_32KTIMER_BASE; + if (IS_ENABLED(CONFIG_ARCH_OMAP3)) + timerbase = (void *)OMAP3_32KTIMER_BASE; + else if (IS_ENABLED(CONFIG_ARCH_OMAP4)) + timerbase = (void *)OMAP44XX_32KTIMER_BASE; + else + BUG(); s32k_cs.mult = clocksource_hz2mult(S32K_FREQUENCY, s32k_cs.shift); -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox