summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-12-18 15:22:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-12-19 21:51:49 +0100
commit37ad50049bc4da475f7daa194f956c476c4c8d07 (patch)
tree5b7dd0396f0cc8190f6c1bd703a7a3461eecfbdb /arch
parentfa96d920a5bff464d6b37aedb009b304f46f6b70 (diff)
downloadbarebox-37ad50049bc4da475f7daa194f956c476c4c8d07.tar.gz
barebox-37ad50049bc4da475f7daa194f956c476c4c8d07.tar.xz
ARM omap: Use SoC specific defines for gpmc and timer base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap/gpmc.c11
-rw-r--r--arch/arm/mach-omap/include/mach/omap3-silicon.h4
-rw-r--r--arch/arm/mach-omap/include/mach/omap4-silicon.h4
-rw-r--r--arch/arm/mach-omap/omap3_clock.c2
-rw-r--r--arch/arm/mach-omap/s32k_clksource.c10
5 files changed, 22 insertions, 9 deletions
diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c
index d2b70247f7..4f54a10617 100644
--- a/arch/arm/mach-omap/gpmc.c
+++ b/arch/arm/mach-omap/gpmc.c
@@ -24,7 +24,8 @@
#include <init.h>
#include <io.h>
#include <errno.h>
-#include <mach/silicon.h>
+#include <mach/omap3-silicon.h>
+#include <mach/omap4-silicon.h>
#include <mach/gpmc.h>
#include <mach/sys_info.h>
#include <mach/syslib.h>
@@ -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 19219236fd..584302759e 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 0f0d88d504..5755856e24 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 2a5e6f293c..11f511771d 100644
--- a/arch/arm/mach-omap/omap3_clock.c
+++ b/arch/arm/mach-omap/omap3_clock.c
@@ -39,7 +39,7 @@
#include <mach/sys_info.h>
#include <mach/syslib.h>
-#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 ca73753797..7def8b1807 100644
--- a/arch/arm/mach-omap/s32k_clksource.c
+++ b/arch/arm/mach-omap/s32k_clksource.c
@@ -25,7 +25,8 @@
#include <clock.h>
#include <init.h>
#include <io.h>
-#include <mach/silicon.h>
+#include <mach/omap3-silicon.h>
+#include <mach/omap4-silicon.h>
#include <mach/clocks.h>
#include <mach/timers.h>
#include <mach/sys_info.h>
@@ -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);