1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
From 5d166e052acd9a859906f0cb53cf3e349e1f4926 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Thu, 13 Dec 2012 17:30:44 +0100
Subject: [PATCH] ARM omap: Use SoC specific defines for gpmc and timer base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
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 <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 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 <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 ca73753..7def8b1 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);
|