aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorHemant Pedanekar <hemantp@ti.com>2011-12-13 13:46:44 -0500
committerTony Lindgren <tony@atomide.com>2011-12-13 13:46:44 -0500
commita920360f038e976e7a86b002e209402da20e9147 (patch)
treea48a1b7a2c7efaab8e585cafdf0268a468858cb3 /arch/arm/mach-omap2
parentec023e46f7e86acb04fef5bdd1e9465f5fc39894 (diff)
ARM: OMAP: TI81XX: Prepare for addition of TI814X support
This patch updates existing macros, functions used for TI816X, to enable addition of other SoCs belonging to TI81XX family (e.g., TI814X). The approach taken is to use TI81XX/ti81xx for code/data going to be common across all TI81XX devices. cpu_is_ti81xx() is introduced to handle code common across TI81XX devices. In addition, ti8168_evm_map_io() is now replaced with ti81xx_map_io() and moved in mach-omap2/common.c as same will be used for TI814X and is not board specific. Signed-off-by: Hemant Pedanekar <hemantp@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig6
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c11
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/common.c29
-rw-r--r--arch/arm/mach-omap2/common.h13
-rw-r--r--arch/arm/mach-omap2/control.h8
-rw-r--r--arch/arm/mach-omap2/id.c8
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S12
-rw-r--r--arch/arm/mach-omap2/io.c14
-rw-r--r--arch/arm/mach-omap2/irq.c2
-rw-r--r--arch/arm/mach-omap2/serial.c6
11 files changed, 56 insertions, 55 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ccdd442ca124..f475954c3b98 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -76,8 +76,8 @@ config SOC_OMAP3430
76 default y 76 default y
77 select ARCH_OMAP_OTG 77 select ARCH_OMAP_OTG
78 78
79config SOC_OMAPTI816X 79config SOC_OMAPTI81XX
80 bool "TI816X support" 80 bool "TI81XX support"
81 depends on ARCH_OMAP3 81 depends on ARCH_OMAP3
82 default y 82 default y
83 83
@@ -319,7 +319,7 @@ config MACH_OMAP_3630SDP
319 319
320config MACH_TI8168EVM 320config MACH_TI8168EVM
321 bool "TI8168 Evaluation Module" 321 bool "TI8168 Evaluation Module"
322 depends on SOC_OMAPTI816X 322 depends on SOC_OMAPTI81XX
323 default y 323 default y
324 324
325config MACH_OMAP_4430SDP 325config MACH_OMAP_4430SDP
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index 8402b39b2840..b236fcc023ac 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -35,17 +35,12 @@ static void __init ti8168_evm_init(void)
35 omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); 35 omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
36} 36}
37 37
38static void __init ti8168_evm_map_io(void)
39{
40 omapti816x_map_common_io();
41}
42
43MACHINE_START(TI8168EVM, "ti8168evm") 38MACHINE_START(TI8168EVM, "ti8168evm")
44 /* Maintainer: Texas Instruments */ 39 /* Maintainer: Texas Instruments */
45 .atag_offset = 0x100, 40 .atag_offset = 0x100,
46 .map_io = ti8168_evm_map_io, 41 .map_io = ti81xx_map_io,
47 .init_early = ti816x_init_early, 42 .init_early = ti81xx_init_early,
48 .init_irq = ti816x_init_irq, 43 .init_irq = ti81xx_init_irq,
49 .timer = &omap3_timer, 44 .timer = &omap3_timer,
50 .init_machine = ti8168_evm_init, 45 .init_machine = ti8168_evm_init,
51MACHINE_END 46MACHINE_END
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 3d56d8a2b86e..be0fa34e5506 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3602,7 +3602,7 @@ int __init omap3xxx_clk_init(void)
3602 * Lock DPLL5 -- here only until other device init code can 3602 * Lock DPLL5 -- here only until other device init code can
3603 * handle this 3603 * handle this
3604 */ 3604 */
3605 if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0)) 3605 if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
3606 omap3_clk_lock_dpll5(); 3606 omap3_clk_lock_dpll5();
3607 3607
3608 /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */ 3608 /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index c900dcb6f1fd..aaf421178c91 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -110,27 +110,32 @@ void __init omap3_map_io(void)
110 110
111/* 111/*
112 * Adjust TAP register base such that omap3_check_revision accesses the correct 112 * Adjust TAP register base such that omap3_check_revision accesses the correct
113 * TI816X register for checking device ID (it adds 0x204 to tap base while 113 * TI81XX register for checking device ID (it adds 0x204 to tap base while
114 * TI816X DEVICE ID register is at offset 0x600 from control base). 114 * TI81XX DEVICE ID register is at offset 0x600 from control base).
115 */ 115 */
116#define TI816X_TAP_BASE (TI816X_CTRL_BASE + \ 116#define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \
117 TI816X_CONTROL_DEVICE_ID - 0x204) 117 TI81XX_CONTROL_DEVICE_ID - 0x204)
118 118
119static struct omap_globals ti816x_globals = { 119static struct omap_globals ti81xx_globals = {
120 .class = OMAP343X_CLASS, 120 .class = OMAP343X_CLASS,
121 .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE), 121 .tap = OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE),
122 .ctrl = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE), 122 .ctrl = OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
123 .prm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE), 123 .prm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
124 .cm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE), 124 .cm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
125}; 125};
126 126
127void __init omap2_set_globals_ti816x(void) 127void __init omap2_set_globals_ti81xx(void)
128{ 128{
129 __omap2_set_globals(&ti816x_globals); 129 __omap2_set_globals(&ti81xx_globals);
130}
131
132void __init ti81xx_map_io(void)
133{
134 omapti81xx_map_common_io();
130} 135}
131 136
132#define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \ 137#define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \
133 TI816X_CONTROL_DEVICE_ID - 0x204) 138 TI81XX_CONTROL_DEVICE_ID - 0x204)
134 139
135static struct omap_globals am33xx_globals = { 140static struct omap_globals am33xx_globals = {
136 .class = AM335X_CLASS, 141 .class = AM335X_CLASS,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 9b733e343bf5..4b2b416fafe1 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -52,10 +52,10 @@ static inline void omap34xx_map_common_io(void)
52} 52}
53#endif 53#endif
54 54
55#ifdef CONFIG_SOC_OMAPTI816X 55#ifdef CONFIG_SOC_OMAPTI81XX
56extern void omapti816x_map_common_io(void); 56extern void omapti81xx_map_common_io(void);
57#else 57#else
58static inline void omapti816x_map_common_io(void) 58static inline void omapti81xx_map_common_io(void)
59{ 59{
60} 60}
61#endif 61#endif
@@ -90,7 +90,7 @@ void omap35xx_init_early(void);
90void omap3630_init_early(void); 90void omap3630_init_early(void);
91void omap3_init_early(void); /* Do not use this one */ 91void omap3_init_early(void); /* Do not use this one */
92void am35xx_init_early(void); 92void am35xx_init_early(void);
93void ti816x_init_early(void); 93void ti81xx_init_early(void);
94void omap4430_init_early(void); 94void omap4430_init_early(void);
95 95
96/* 96/*
@@ -114,7 +114,7 @@ void omap2_set_globals_242x(void);
114void omap2_set_globals_243x(void); 114void omap2_set_globals_243x(void);
115void omap2_set_globals_3xxx(void); 115void omap2_set_globals_3xxx(void);
116void omap2_set_globals_443x(void); 116void omap2_set_globals_443x(void);
117void omap2_set_globals_ti816x(void); 117void omap2_set_globals_ti81xx(void);
118void omap2_set_globals_am33xx(void); 118void omap2_set_globals_am33xx(void);
119 119
120/* These get called from omap2_set_globals_xxxx(), do not call these */ 120/* These get called from omap2_set_globals_xxxx(), do not call these */
@@ -128,6 +128,7 @@ void omap243x_map_io(void);
128void omap3_map_io(void); 128void omap3_map_io(void);
129void am33xx_map_io(void); 129void am33xx_map_io(void);
130void omap4_map_io(void); 130void omap4_map_io(void);
131void ti81xx_map_io(void);
131 132
132/** 133/**
133 * omap_test_timeout - busy-loop, testing a condition 134 * omap_test_timeout - busy-loop, testing a condition
@@ -156,7 +157,7 @@ extern struct device *omap4_get_dsp_device(void);
156 157
157void omap2_init_irq(void); 158void omap2_init_irq(void);
158void omap3_init_irq(void); 159void omap3_init_irq(void);
159void ti816x_init_irq(void); 160void ti81xx_init_irq(void);
160extern int omap_irq_pending(void); 161extern int omap_irq_pending(void);
161void omap_intc_save_context(void); 162void omap_intc_save_context(void);
162void omap_intc_restore_context(void); 163void omap_intc_restore_context(void);
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index d4ef75d5a382..0ba68d3764bc 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,8 +52,8 @@
52#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00 52#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60 53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
54 54
55/* TI816X spefic control submodules */ 55/* TI81XX spefic control submodules */
56#define TI816X_CONTROL_DEVCONF 0x600 56#define TI81XX_CONTROL_DEVCONF 0x600
57 57
58/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */ 58/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
59 59
@@ -244,8 +244,8 @@
244#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 244#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
245#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 245#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
246 246
247/* TI816X CONTROL_DEVCONF register offsets */ 247/* TI81XX CONTROL_DEVCONF register offsets */
248#define TI816X_CONTROL_DEVICE_ID (TI816X_CONTROL_DEVCONF + 0x000) 248#define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000)
249 249
250/* 250/*
251 * REVISIT: This list of registers is not comprehensive - there are more 251 * REVISIT: This list of registers is not comprehensive - there are more
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 439afe7acdca..1dc68e64d7e2 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -226,7 +226,7 @@ static void __init omap4_check_features(void)
226 } 226 }
227} 227}
228 228
229static void __init ti816x_check_features(void) 229static void __init ti81xx_check_features(void)
230{ 230{
231 omap_features = OMAP3_HAS_NEON; 231 omap_features = OMAP3_HAS_NEON;
232} 232}
@@ -489,11 +489,11 @@ void __init omap2_check_revision(void)
489 } else if (cpu_is_omap34xx()) { 489 } else if (cpu_is_omap34xx()) {
490 omap3_check_revision(&cpu_rev); 490 omap3_check_revision(&cpu_rev);
491 491
492 /* TI816X doesn't have feature register */ 492 /* TI81XX doesn't have feature register */
493 if (!cpu_is_ti816x()) 493 if (!cpu_is_ti81xx())
494 omap3_check_features(); 494 omap3_check_features();
495 else 495 else
496 ti816x_check_features(); 496 ti81xx_check_features();
497 497
498 omap3_cpuinfo(cpu_rev); 498 omap3_cpuinfo(cpu_rev);
499 return; 499 return;
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 13f98e59cfef..cdfc2a1f0e75 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -66,11 +66,11 @@ omap_uart_lsr: .word 0
66 beq 34f @ configure OMAP3UART4 66 beq 34f @ configure OMAP3UART4
67 cmp \rp, #OMAP4UART4 @ only on 44xx 67 cmp \rp, #OMAP4UART4 @ only on 44xx
68 beq 44f @ configure OMAP4UART4 68 beq 44f @ configure OMAP4UART4
69 cmp \rp, #TI816XUART1 @ ti816x UART offsets different 69 cmp \rp, #TI81XXUART1 @ ti81Xx UART offsets different
70 beq 81f @ configure UART1 70 beq 81f @ configure UART1
71 cmp \rp, #TI816XUART2 @ ti816x UART offsets different 71 cmp \rp, #TI81XXUART2 @ ti81Xx UART offsets different
72 beq 82f @ configure UART2 72 beq 82f @ configure UART2
73 cmp \rp, #TI816XUART3 @ ti816x UART offsets different 73 cmp \rp, #TI81XXUART3 @ ti81Xx UART offsets different
74 beq 83f @ configure UART3 74 beq 83f @ configure UART3
75 cmp \rp, #ZOOM_UART @ only on zoom2/3 75 cmp \rp, #ZOOM_UART @ only on zoom2/3
76 beq 95f @ configure ZOOM_UART 76 beq 95f @ configure ZOOM_UART
@@ -94,11 +94,11 @@ omap_uart_lsr: .word 0
94 b 98f 94 b 98f
9544: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) 9544: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
96 b 98f 96 b 98f
9781: mov \rp, #UART_OFFSET(TI816X_UART1_BASE) 9781: mov \rp, #UART_OFFSET(TI81XX_UART1_BASE)
98 b 98f 98 b 98f
9982: mov \rp, #UART_OFFSET(TI816X_UART2_BASE) 9982: mov \rp, #UART_OFFSET(TI81XX_UART2_BASE)
100 b 98f 100 b 98f
10183: mov \rp, #UART_OFFSET(TI816X_UART3_BASE) 10183: mov \rp, #UART_OFFSET(TI81XX_UART3_BASE)
102 b 98f 102 b 98f
103 103
10495: ldr \rp, =ZOOM_UART_BASE 10495: ldr \rp, =ZOOM_UART_BASE
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 088d2ba60eff..73d617f0dc4a 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -176,8 +176,8 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
176}; 176};
177#endif 177#endif
178 178
179#ifdef CONFIG_SOC_OMAPTI816X 179#ifdef CONFIG_SOC_OMAPTI81XX
180static struct map_desc omapti816x_io_desc[] __initdata = { 180static struct map_desc omapti81xx_io_desc[] __initdata = {
181 { 181 {
182 .virtual = L4_34XX_VIRT, 182 .virtual = L4_34XX_VIRT,
183 .pfn = __phys_to_pfn(L4_34XX_PHYS), 183 .pfn = __phys_to_pfn(L4_34XX_PHYS),
@@ -280,10 +280,10 @@ void __init omap34xx_map_common_io(void)
280} 280}
281#endif 281#endif
282 282
283#ifdef CONFIG_SOC_OMAPTI816X 283#ifdef CONFIG_SOC_OMAPTI81XX
284void __init omapti816x_map_common_io(void) 284void __init omapti81xx_map_common_io(void)
285{ 285{
286 iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc)); 286 iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
287} 287}
288#endif 288#endif
289 289
@@ -442,9 +442,9 @@ void __init am35xx_init_early(void)
442 omap3_init_early(); 442 omap3_init_early();
443} 443}
444 444
445void __init ti816x_init_early(void) 445void __init ti81xx_init_early(void)
446{ 446{
447 omap2_set_globals_ti816x(); 447 omap2_set_globals_ti81xx();
448 omap_common_init_early(); 448 omap_common_init_early();
449 omap3xxx_voltagedomains_init(); 449 omap3xxx_voltagedomains_init();
450 omap3xxx_powerdomains_init(); 450 omap3xxx_powerdomains_init();
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 42b1d6591912..1fef061f7927 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -193,7 +193,7 @@ void __init omap3_init_irq(void)
193 omap_init_irq(OMAP34XX_IC_BASE, 96); 193 omap_init_irq(OMAP34XX_IC_BASE, 96);
194} 194}
195 195
196void __init ti816x_init_irq(void) 196void __init ti81xx_init_irq(void)
197{ 197{
198 omap_init_irq(OMAP34XX_IC_BASE, 128); 198 omap_init_irq(OMAP34XX_IC_BASE, 128);
199} 199}
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 9770c7624aa0..d0f009cbfb50 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -464,7 +464,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
464 mod_timer(&uart->timer, jiffies + uart->timeout); 464 mod_timer(&uart->timer, jiffies + uart->timeout);
465 omap_uart_smart_idle_enable(uart, 0); 465 omap_uart_smart_idle_enable(uart, 0);
466 466
467 if (cpu_is_omap34xx() && !(cpu_is_ti816x() || cpu_is_am33xx())) { 467 if (cpu_is_omap34xx() && !(cpu_is_ti81xx() || cpu_is_am33xx())) {
468 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; 468 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
469 u32 wk_mask = 0; 469 u32 wk_mask = 0;
470 u32 padconf = 0; 470 u32 padconf = 0;
@@ -746,7 +746,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
746 */ 746 */
747 uart->regshift = p->regshift; 747 uart->regshift = p->regshift;
748 uart->membase = p->membase; 748 uart->membase = p->membase;
749 if (cpu_is_omap44xx() || cpu_is_ti816x()) 749 if (cpu_is_omap44xx() || cpu_is_ti81xx())
750 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; 750 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
751 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF) 751 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
752 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) 752 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
@@ -828,7 +828,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
828 } 828 }
829 829
830 /* Enable the MDR1 errata for OMAP3 */ 830 /* Enable the MDR1 errata for OMAP3 */
831 if (cpu_is_omap34xx() && !(cpu_is_ti816x() || cpu_is_am33xx())) 831 if (cpu_is_omap34xx() && !(cpu_is_ti81xx() || cpu_is_am33xx()))
832 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; 832 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS;
833} 833}
834 834