aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-12-21 22:01:20 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 22:01:20 -0500
commitdc0b3a701499bb7727314d7a9c764f7486db4802 (patch)
treed2daec5610919039b98909d1983e479df4bf1842
parent6e01478ae8a4322c9a2b2d6efed50196265ed5f2 (diff)
OMAP2+: clockdomains: move clockdomain static data to .c files
Static data should be declared in .c files, not .h files. It should be possible to #include .h files at any point without creating multiple copies of the same data. We converted the clock data to .c files some time ago. This patch does the same for the clockdomain data. Signed-off-by: Paul Walmsley <paul@pwsan.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Rajendra Nayak <rnayak@ti.com>
-rw-r--r--arch/arm/mach-omap2/Makefile10
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c (renamed from arch/arm/mach-omap2/clockdomains.h)58
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c (renamed from arch/arm/mach-omap2/clockdomains44xx.h)42
-rw-r--r--arch/arm/mach-omap2/io.c10
-rw-r--r--arch/arm/plat-omap/include/plat/clockdomain.h11
5 files changed, 66 insertions, 65 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4d6fa15f3b62..2006deef0183 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -10,8 +10,7 @@ omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o
10hwmod-common = omap_hwmod.o \ 10hwmod-common = omap_hwmod.o \
11 omap_hwmod_common_data.o 11 omap_hwmod_common_data.o
12clock-common = clock.o clock_common_data.o \ 12clock-common = clock.o clock_common_data.o \
13 clockdomain.o clkt_dpll.o \ 13 clkt_dpll.o clkt_clksel.o
14 clkt_clksel.o
15 14
16obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) 15obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
17obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) 16obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
@@ -91,6 +90,13 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
91 powerdomain44xx.o \ 90 powerdomain44xx.o \
92 powerdomains44xx_data.o 91 powerdomains44xx_data.o
93 92
93# PRCM clockdomain control
94obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
95 clockdomains2xxx_3xxx_data.o
96obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
97 clockdomains2xxx_3xxx_data.o
98obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
99 clockdomains44xx_data.o
94# Clock framework 100# Clock framework
95obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ 101obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
96 clkt2xxx_sys.o \ 102 clkt2xxx_sys.o \
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index 2a3b10a356d0..8dadf754ff11 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2008-2009 Texas Instruments, Inc. 4 * Copyright (C) 2008-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation 5 * Copyright (C) 2008-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley and Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
9 * This file contains clockdomains and clockdomain wakeup/sleep 9 * This file contains clockdomains and clockdomain wakeup/sleep
10 * dependencies for the OMAP2/3 chips. Some notes: 10 * dependencies for the OMAP2/3 chips. Some notes:
@@ -32,8 +32,8 @@
32 * from the Power domain framework 32 * from the Power domain framework
33 */ 33 */
34 34
35#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 35#include <linux/kernel.h>
36#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 36#include <linux/io.h>
37 37
38#include <plat/clockdomain.h> 38#include <plat/clockdomain.h>
39#include "cm.h" 39#include "cm.h"
@@ -89,8 +89,6 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = {
89 89
90/* 24XX-specific possible dependencies */ 90/* 24XX-specific possible dependencies */
91 91
92#ifdef CONFIG_ARCH_OMAP2
93
94/* Wakeup dependency source arrays */ 92/* Wakeup dependency source arrays */
95 93
96/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ 94/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
@@ -170,8 +168,6 @@ static struct clkdm_dep core_24xx_wkdeps[] = {
170 { NULL }, 168 { NULL },
171}; 169};
172 170
173#endif
174
175 171
176/* 2430-specific possible wakeup dependencies */ 172/* 2430-specific possible wakeup dependencies */
177 173
@@ -430,8 +426,6 @@ static struct clkdm_dep gfx_sgx_sleepdeps[] = {
430 * sys_clkout/sys_clkout2. 426 * sys_clkout/sys_clkout2.
431 */ 427 */
432 428
433#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
434
435/* This is an implicit clockdomain - it is never defined as such in TRM */ 429/* This is an implicit clockdomain - it is never defined as such in TRM */
436static struct clockdomain wkup_clkdm = { 430static struct clockdomain wkup_clkdm = {
437 .name = "wkup_clkdm", 431 .name = "wkup_clkdm",
@@ -452,8 +446,6 @@ static struct clockdomain cm_clkdm = {
452 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 446 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
453}; 447};
454 448
455#endif
456
457/* 449/*
458 * 2420-only clockdomains 450 * 2420-only clockdomains
459 */ 451 */
@@ -836,8 +828,6 @@ static struct clockdomain dpll5_clkdm = {
836 828
837#endif /* CONFIG_ARCH_OMAP3 */ 829#endif /* CONFIG_ARCH_OMAP3 */
838 830
839#include "clockdomains44xx.h"
840
841/* 831/*
842 * Clockdomain hwsup dependencies (OMAP3 only) 832 * Clockdomain hwsup dependencies (OMAP3 only)
843 */ 833 */
@@ -856,17 +846,10 @@ static struct clkdm_autodep clkdm_autodeps[] = {
856 } 846 }
857}; 847};
858 848
859/* 849static struct clockdomain *clockdomains_omap2[] __initdata = {
860 * List of clockdomain pointers per platform
861 */
862
863static struct clockdomain *clockdomains_omap[] = {
864
865#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
866 &wkup_clkdm, 850 &wkup_clkdm,
867 &cm_clkdm, 851 &cm_clkdm,
868 &prm_clkdm, 852 &prm_clkdm,
869#endif
870 853
871#ifdef CONFIG_ARCH_OMAP2420 854#ifdef CONFIG_ARCH_OMAP2420
872 &mpu_2420_clkdm, 855 &mpu_2420_clkdm,
@@ -908,35 +891,10 @@ static struct clockdomain *clockdomains_omap[] = {
908 &dpll4_clkdm, 891 &dpll4_clkdm,
909 &dpll5_clkdm, 892 &dpll5_clkdm,
910#endif 893#endif
911
912#ifdef CONFIG_ARCH_OMAP4
913 &l4_cefuse_44xx_clkdm,
914 &l4_cfg_44xx_clkdm,
915 &tesla_44xx_clkdm,
916 &l3_gfx_44xx_clkdm,
917 &ivahd_44xx_clkdm,
918 &l4_secure_44xx_clkdm,
919 &l4_per_44xx_clkdm,
920 &abe_44xx_clkdm,
921 &l3_instr_44xx_clkdm,
922 &l3_init_44xx_clkdm,
923 &mpuss_44xx_clkdm,
924 &mpu0_44xx_clkdm,
925 &mpu1_44xx_clkdm,
926 &l3_emif_44xx_clkdm,
927 &l4_ao_44xx_clkdm,
928 &ducati_44xx_clkdm,
929 &l3_2_44xx_clkdm,
930 &l3_1_44xx_clkdm,
931 &l3_d2d_44xx_clkdm,
932 &iss_44xx_clkdm,
933 &l3_dss_44xx_clkdm,
934 &l4_wkup_44xx_clkdm,
935 &emu_sys_44xx_clkdm,
936 &l3_dma_44xx_clkdm,
937#endif
938
939 NULL, 894 NULL,
940}; 895};
941 896
942#endif 897void __init omap2_clockdomains_init(void)
898{
899 clkdm_init(clockdomains_omap2, clkdm_autodeps);
900}
diff --git a/arch/arm/mach-omap2/clockdomains44xx.h b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 7e5ba0f67925..c847a8bad28e 100644
--- a/arch/arm/mach-omap2/clockdomains44xx.h
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -23,12 +23,15 @@
23 * -> Populate the Sleep/Wakeup dependencies for the domains 23 * -> Populate the Sleep/Wakeup dependencies for the domains
24 */ 24 */
25 25
26#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H 26#include <linux/kernel.h>
27#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H 27#include <linux/io.h>
28 28
29#include <plat/clockdomain.h> 29#include <plat/clockdomain.h>
30 30
31#if defined(CONFIG_ARCH_OMAP4) 31#include "cm44xx.h"
32#include "prm44xx.h"
33#include "cm-regbits-44xx.h"
34#include "prm-regbits-44xx.h"
32 35
33static struct clockdomain l4_cefuse_44xx_clkdm = { 36static struct clockdomain l4_cefuse_44xx_clkdm = {
34 .name = "l4_cefuse_clkdm", 37 .name = "l4_cefuse_clkdm",
@@ -245,6 +248,35 @@ static struct clockdomain l3_dma_44xx_clkdm = {
245 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 248 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
246}; 249};
247 250
248#endif 251static struct clockdomain *clockdomains_omap44xx[] __initdata = {
252 &l4_cefuse_44xx_clkdm,
253 &l4_cfg_44xx_clkdm,
254 &tesla_44xx_clkdm,
255 &l3_gfx_44xx_clkdm,
256 &ivahd_44xx_clkdm,
257 &l4_secure_44xx_clkdm,
258 &l4_per_44xx_clkdm,
259 &abe_44xx_clkdm,
260 &l3_instr_44xx_clkdm,
261 &l3_init_44xx_clkdm,
262 &mpuss_44xx_clkdm,
263 &mpu0_44xx_clkdm,
264 &mpu1_44xx_clkdm,
265 &l3_emif_44xx_clkdm,
266 &l4_ao_44xx_clkdm,
267 &ducati_44xx_clkdm,
268 &l3_2_44xx_clkdm,
269 &l3_1_44xx_clkdm,
270 &l3_d2d_44xx_clkdm,
271 &iss_44xx_clkdm,
272 &l3_dss_44xx_clkdm,
273 &l4_wkup_44xx_clkdm,
274 &emu_sys_44xx_clkdm,
275 &l3_dma_44xx_clkdm,
276 NULL,
277};
249 278
250#endif 279void __init omap44xx_clockdomains_init(void)
280{
281 clkdm_init(clockdomains_omap44xx, NULL);
282}
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 40a548b203e3..ba766576e03e 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -42,8 +42,6 @@
42#include <plat/powerdomain.h> 42#include <plat/powerdomain.h>
43 43
44#include <plat/clockdomain.h> 44#include <plat/clockdomain.h>
45#include "clockdomains.h"
46
47#include <plat/omap_hwmod.h> 45#include <plat/omap_hwmod.h>
48#include <plat/multi.h> 46#include <plat/multi.h>
49 47
@@ -341,19 +339,19 @@ void __init omap2_init_common_infrastructure(void)
341 339
342 if (cpu_is_omap242x()) { 340 if (cpu_is_omap242x()) {
343 omap2xxx_powerdomains_init(); 341 omap2xxx_powerdomains_init();
344 clkdm_init(clockdomains_omap, clkdm_autodeps); 342 omap2_clockdomains_init();
345 omap2420_hwmod_init(); 343 omap2420_hwmod_init();
346 } else if (cpu_is_omap243x()) { 344 } else if (cpu_is_omap243x()) {
347 omap2xxx_powerdomains_init(); 345 omap2xxx_powerdomains_init();
348 clkdm_init(clockdomains_omap, clkdm_autodeps); 346 omap2_clockdomains_init();
349 omap2430_hwmod_init(); 347 omap2430_hwmod_init();
350 } else if (cpu_is_omap34xx()) { 348 } else if (cpu_is_omap34xx()) {
351 omap3xxx_powerdomains_init(); 349 omap3xxx_powerdomains_init();
352 clkdm_init(clockdomains_omap, clkdm_autodeps); 350 omap2_clockdomains_init();
353 omap3xxx_hwmod_init(); 351 omap3xxx_hwmod_init();
354 } else if (cpu_is_omap44xx()) { 352 } else if (cpu_is_omap44xx()) {
355 omap44xx_powerdomains_init(); 353 omap44xx_powerdomains_init();
356 clkdm_init(clockdomains_omap, clkdm_autodeps); 354 omap44xx_clockdomains_init();
357 omap44xx_hwmod_init(); 355 omap44xx_hwmod_init();
358 } else { 356 } else {
359 pr_err("Could not init hwmod data - unknown SoC\n"); 357 pr_err("Could not init hwmod data - unknown SoC\n");
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h
index ba0a6c07c0fe..a5f8579f7aa9 100644
--- a/arch/arm/plat-omap/include/plat/clockdomain.h
+++ b/arch/arm/plat-omap/include/plat/clockdomain.h
@@ -4,18 +4,22 @@
4 * OMAP2/3 clockdomain framework functions 4 * OMAP2/3 clockdomain framework functions
5 * 5 *
6 * Copyright (C) 2008 Texas Instruments, Inc. 6 * Copyright (C) 2008 Texas Instruments, Inc.
7 * Copyright (C) 2008-2009 Nokia Corporation 7 * Copyright (C) 2008-2010 Nokia Corporation
8 * 8 *
9 * Written by Paul Walmsley 9 * Paul Walmsley
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 *
15 * XXX This should be moved to mach-omap2/ at the earliest opportunity.
14 */ 16 */
15 17
16#ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 18#ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H
17#define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 19#define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H
18 20
21#include <linux/init.h>
22
19#include <plat/powerdomain.h> 23#include <plat/powerdomain.h>
20#include <plat/clock.h> 24#include <plat/clock.h>
21#include <plat/cpu.h> 25#include <plat/cpu.h>
@@ -138,4 +142,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm);
138int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); 142int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
139int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); 143int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
140 144
145extern void __init omap2_clockdomains_init(void);
146extern void __init omap44xx_clockdomains_init(void);
147
141#endif 148#endif