aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-10-29 22:57:39 -0400
committerPaul Walmsley <paul@pwsan.com>2012-11-08 17:09:26 -0500
commitd9a16f9ab9332b7cf1c95086a4efb98a0d13a57a (patch)
tree3f15e84beccd384ac1c3d5f2d3260e164e422da8
parent5b78e61b1cf28f061a7989b25180fcef26d31eb8 (diff)
ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
Split omap2_set_globals_prcm() into PRM, CM, and PRCM_MPU variants, since these are all separate IP blocks. This should make it easier to move the PRM, CM, PRCM_MPU code into drivers/ in future patchsets. At this point arch/arm/plat-omap/include/plat/prcm.h is empty; a subsequent patch will remove it, and remove the #include from all the files that #include it. Signed-off-by: Paul Walmsley <paul@pwsan.com> Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpllcore.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c2
-rw-r--r--arch/arm/mach-omap2/cm.h8
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h2
-rw-r--r--arch/arm/mach-omap2/cm_common.c22
-rw-r--r--arch/arm/mach-omap2/cminst44xx.h2
-rw-r--r--arch/arm/mach-omap2/io.c51
-rw-r--r--arch/arm/mach-omap2/mcbsp.c2
-rw-r--r--arch/arm/mach-omap2/omap4-common.c1
-rw-r--r--arch/arm/mach-omap2/prcm-common.h16
-rw-r--r--arch/arm/mach-omap2/prcm.c19
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.c17
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.h9
-rw-r--r--arch/arm/mach-omap2/prm.h7
-rw-r--r--arch/arm/mach-omap2/prm_common.c15
-rw-r--r--arch/arm/mach-omap2/prminst44xx.h2
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h6
17 files changed, 111 insertions, 72 deletions
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
index 08a896ba3f5d..e687163a68fe 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
@@ -30,7 +30,7 @@
30#include "clock.h" 30#include "clock.h"
31#include "clock2xxx.h" 31#include "clock2xxx.h"
32#include "opp2xxx.h" 32#include "opp2xxx.h"
33#include "cm2xxx_3xxx.h" 33#include "cm2xxx.h"
34#include "cm-regbits-24xx.h" 34#include "cm-regbits-24xx.h"
35#include "sdrc.h" 35#include "sdrc.h"
36 36
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index ad658fc6baef..b9b981bac9d3 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -39,7 +39,7 @@
39#include "clock.h" 39#include "clock.h"
40#include "clock2xxx.h" 40#include "clock2xxx.h"
41#include "opp2xxx.h" 41#include "opp2xxx.h"
42#include "cm2xxx_3xxx.h" 42#include "cm2xxx.h"
43#include "cm-regbits-24xx.h" 43#include "cm-regbits-24xx.h"
44#include "sdrc.h" 44#include "sdrc.h"
45 45
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index e419ecb7cce4..93473f9a551c 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2+ Clock Management prototypes 2 * OMAP2+ Clock Management prototypes
3 * 3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
@@ -22,6 +22,12 @@
22 */ 22 */
23#define MAX_MODULE_READY_TIME 2000 23#define MAX_MODULE_READY_TIME 2000
24 24
25# ifndef __ASSEMBLER__
26extern void __iomem *cm_base;
27extern void __iomem *cm2_base;
28extern void omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2);
29# endif
30
25/* 31/*
26 * MAX_MODULE_DISABLE_TIME: max duration in microseconds to wait for 32 * MAX_MODULE_DISABLE_TIME: max duration in microseconds to wait for
27 * the PRCM to request that a module enter the inactive state in the 33 * the PRCM to request that a module enter the inactive state in the
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index f74a5d1b803f..98e6b3c9cd9b 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -16,7 +16,7 @@
16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H 16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H 17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
18 18
19#include "prcm-common.h" 19#include "cm.h"
20 20
21/* 21/*
22 * Module specific CM register offsets from CM_BASE + domain offset 22 * Module specific CM register offsets from CM_BASE + domain offset
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c
index 561969bb511e..0bab493ec133 100644
--- a/arch/arm/mach-omap2/cm_common.c
+++ b/arch/arm/mach-omap2/cm_common.c
@@ -2,7 +2,7 @@
2 * OMAP2+ common Clock Management (CM) IP block functions 2 * OMAP2+ common Clock Management (CM) IP block functions
3 * 3 *
4 * Copyright (C) 2012 Texas Instruments, Inc. 4 * Copyright (C) 2012 Texas Instruments, Inc.
5 * Paul Walmsley <paul@pwsan.com> 5 * Paul Walmsley
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
@@ -17,6 +17,7 @@
17#include "cm2xxx.h" 17#include "cm2xxx.h"
18#include "cm3xxx.h" 18#include "cm3xxx.h"
19#include "cm44xx.h" 19#include "cm44xx.h"
20#include "common.h"
20 21
21/* 22/*
22 * cm_ll_data: function pointers to SoC-specific implementations of 23 * cm_ll_data: function pointers to SoC-specific implementations of
@@ -25,6 +26,25 @@
25static struct cm_ll_data null_cm_ll_data; 26static struct cm_ll_data null_cm_ll_data;
26static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; 27static struct cm_ll_data *cm_ll_data = &null_cm_ll_data;
27 28
29/* cm_base: base virtual address of the CM IP block */
30void __iomem *cm_base;
31
32/* cm2_base: base virtual address of the CM2 IP block (OMAP44xx only) */
33void __iomem *cm2_base;
34
35/**
36 * omap2_set_globals_cm - set the CM/CM2 base addresses (for early use)
37 * @cm: CM base virtual address
38 * @cm2: CM2 base virtual address (if present on the booted SoC)
39 *
40 * XXX Will be replaced when the PRM/CM drivers are completed.
41 */
42void __init omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2)
43{
44 cm_base = cm;
45 cm2_base = cm2;
46}
47
28/** 48/**
29 * cm_split_idlest_reg - split CM_IDLEST reg addr into its components 49 * cm_split_idlest_reg - split CM_IDLEST reg addr into its components
30 * @idlest_reg: CM_IDLEST* virtual address 50 * @idlest_reg: CM_IDLEST* virtual address
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
index d69fdefef985..bd7bab889745 100644
--- a/arch/arm/mach-omap2/cminst44xx.h
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -38,4 +38,6 @@ extern u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst,
38extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx, 38extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx,
39 u32 mask); 39 u32 mask);
40 40
41extern void omap_cm_base_init(void);
42
41#endif 43#endif
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 772dc7e05c88..d36172ee01d1 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -47,7 +47,11 @@
47#include "serial.h" 47#include "serial.h"
48#include "cm2xxx.h" 48#include "cm2xxx.h"
49#include "cm3xxx.h" 49#include "cm3xxx.h"
50 50#include "prm.h"
51#include "cm.h"
52#include "prcm_mpu44xx.h"
53#include "prminst44xx.h"
54#include "cminst44xx.h"
51/* 55/*
52 * The machine specific code may provide the extra mapping besides the 56 * The machine specific code may provide the extra mapping besides the
53 * default mapping provided here. 57 * default mapping provided here.
@@ -386,9 +390,8 @@ void __init omap2420_init_early(void)
386 OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE)); 390 OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE));
387 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE), 391 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
388 NULL); 392 NULL);
389 omap2_set_globals_prcm(OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE), 393 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE));
390 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), 394 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), NULL);
391 NULL, NULL);
392 omap2xxx_check_revision(); 395 omap2xxx_check_revision();
393 omap2xxx_cm_init(); 396 omap2xxx_cm_init();
394 omap_common_init_early(); 397 omap_common_init_early();
@@ -416,9 +419,8 @@ void __init omap2430_init_early(void)
416 OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE)); 419 OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE));
417 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE), 420 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
418 NULL); 421 NULL);
419 omap2_set_globals_prcm(OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE), 422 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE));
420 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), 423 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), NULL);
421 NULL, NULL);
422 omap2xxx_check_revision(); 424 omap2xxx_check_revision();
423 omap2xxx_cm_init(); 425 omap2xxx_cm_init();
424 omap_common_init_early(); 426 omap_common_init_early();
@@ -450,9 +452,8 @@ void __init omap3_init_early(void)
450 OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE)); 452 OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE));
451 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE), 453 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
452 NULL); 454 NULL);
453 omap2_set_globals_prcm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE), 455 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE));
454 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), 456 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL);
455 NULL, NULL);
456 omap3xxx_check_revision(); 457 omap3xxx_check_revision();
457 omap3xxx_check_features(); 458 omap3xxx_check_features();
458 omap3xxx_cm_init(); 459 omap3xxx_cm_init();
@@ -491,9 +492,8 @@ void __init ti81xx_init_early(void)
491 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 492 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
492 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE), 493 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
493 NULL); 494 NULL);
494 omap2_set_globals_prcm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), 495 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
495 OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), 496 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
496 NULL, NULL);
497 omap3xxx_check_revision(); 497 omap3xxx_check_revision();
498 ti81xx_check_features(); 498 ti81xx_check_features();
499 omap_common_init_early(); 499 omap_common_init_early();
@@ -555,9 +555,8 @@ void __init am33xx_init_early(void)
555 AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE)); 555 AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE));
556 omap2_set_globals_control(AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE), 556 omap2_set_globals_control(AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
557 NULL); 557 NULL);
558 omap2_set_globals_prcm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE), 558 omap2_set_globals_prm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE));
559 AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE), 559 omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE), NULL);
560 NULL, NULL);
561 omap3xxx_check_revision(); 560 omap3xxx_check_revision();
562 ti81xx_check_features(); 561 ti81xx_check_features();
563 omap_common_init_early(); 562 omap_common_init_early();
@@ -577,10 +576,12 @@ void __init omap4430_init_early(void)
577 OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE)); 576 OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE));
578 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE), 577 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
579 OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE)); 578 OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE));
580 omap2_set_globals_prcm(OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE), 579 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE));
581 OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE), 580 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
582 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE), 581 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE));
583 OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE)); 582 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE));
583 omap_prm_base_init();
584 omap_cm_base_init();
584 omap4xxx_check_revision(); 585 omap4xxx_check_revision();
585 omap4xxx_check_features(); 586 omap4xxx_check_features();
586 omap_common_init_early(); 587 omap_common_init_early();
@@ -607,10 +608,12 @@ void __init omap5_init_early(void)
607 OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE)); 608 OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE));
608 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE), 609 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
609 OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE)); 610 OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE));
610 omap2_set_globals_prcm(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE), 611 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE));
611 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE), 612 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE),
612 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE), 613 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE));
613 OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 614 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
615 omap_prm_base_init();
616 omap_cm_base_init();
614 omap5xxx_check_revision(); 617 omap5xxx_check_revision();
615 omap_common_init_early(); 618 omap_common_init_early();
616} 619}
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index a106c75c5338..bf496510eb5e 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -29,7 +29,7 @@
29 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle. 29 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
30 * Sidetone needs non-gated ICLK and sidetone autoidle is broken. 30 * Sidetone needs non-gated ICLK and sidetone autoidle is broken.
31 */ 31 */
32#include "cm2xxx_3xxx.h" 32#include "cm3xxx.h"
33#include "cm-regbits-34xx.h" 33#include "cm-regbits-34xx.h"
34 34
35static int omap3_enable_st_clock(unsigned int id, bool enable) 35static int omap3_enable_st_clock(unsigned int id, bool enable)
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 3b1398798b61..64fce07a3ccd 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -34,6 +34,7 @@
34#include "mmc.h" 34#include "mmc.h"
35#include "hsmmc.h" 35#include "hsmmc.h"
36#include "prminst44xx.h" 36#include "prminst44xx.h"
37#include "prcm_mpu44xx.h"
37#include "omap4-sar-layout.h" 38#include "omap4-sar-layout.h"
38#include "omap-secure.h" 39#include "omap-secure.h"
39 40
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 72df97482cc0..b25a32a5e548 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -421,22 +421,6 @@
421#define MAX_IOPAD_LATCH_TIME 100 421#define MAX_IOPAD_LATCH_TIME 100
422 422
423# ifndef __ASSEMBLER__ 423# ifndef __ASSEMBLER__
424extern void __iomem *prm_base;
425extern void __iomem *cm_base;
426extern void __iomem *cm2_base;
427extern void __iomem *prcm_mpu_base;
428
429#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
430extern void omap_prm_base_init(void);
431extern void omap_cm_base_init(void);
432#else
433static inline void omap_prm_base_init(void)
434{
435}
436static inline void omap_cm_base_init(void)
437{
438}
439#endif
440 424
441/** 425/**
442 * struct omap_prcm_irq - describes a PRCM interrupt bit 426 * struct omap_prcm_irq - describes a PRCM interrupt bit
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 75a7246c7bbe..22dee215d4dd 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -40,25 +40,6 @@
40#include "prm-regbits-44xx.h" 40#include "prm-regbits-44xx.h"
41#include "control.h" 41#include "control.h"
42 42
43void __iomem *prm_base;
44void __iomem *cm_base;
45void __iomem *cm2_base;
46void __iomem *prcm_mpu_base;
47
48
49void __init omap2_set_globals_prcm(void __iomem *prm, void __iomem *cm,
50 void __iomem *cm2, void __iomem *prcm_mpu)
51{
52 prm_base = prm;
53 cm_base = cm;
54 cm2_base = cm2;
55 prcm_mpu_base = prcm_mpu;
56
57 if (cpu_is_omap44xx() || soc_is_omap54xx()) {
58 omap_prm_base_init();
59 omap_cm_base_init();
60 }
61}
62 43
63/* 44/*
64 * Stubbed functions so that common files continue to build when 45 * Stubbed functions so that common files continue to build when
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.c b/arch/arm/mach-omap2/prcm_mpu44xx.c
index 928dbd4f20ed..c30e44a7fab0 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.c
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.c
@@ -20,6 +20,12 @@
20#include "prcm_mpu44xx.h" 20#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h" 21#include "cm-regbits-44xx.h"
22 22
23/*
24 * prcm_mpu_base: the virtual address of the start of the PRCM_MPU IP
25 * block registers
26 */
27void __iomem *prcm_mpu_base;
28
23/* PRCM_MPU low-level functions */ 29/* PRCM_MPU low-level functions */
24 30
25u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg) 31u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
@@ -43,3 +49,14 @@ u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
43 49
44 return v; 50 return v;
45} 51}
52
53/**
54 * omap2_set_globals_prcm_mpu - set the MPU PRCM base address (for early use)
55 * @prcm_mpu: PRCM_MPU base virtual address
56 *
57 * XXX Will be replaced when the PRM/CM drivers are completed.
58 */
59void __init omap2_set_globals_prcm_mpu(void __iomem *prcm_mpu)
60{
61 prcm_mpu_base = prcm_mpu;
62}
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h
index 8a6e250f04b5..884af7bb4afd 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.h
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP44xx PRCM MPU instance offset macros 2 * OMAP44xx PRCM MPU instance offset macros
3 * 3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley (paul@pwsan.com) 7 * Paul Walmsley (paul@pwsan.com)
@@ -25,6 +25,12 @@
25#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H 25#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
26#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H 26#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
27 27
28#include "common.h"
29
30# ifndef __ASSEMBLER__
31extern void __iomem *prcm_mpu_base;
32# endif
33
28#define OMAP4430_PRCM_MPU_BASE 0x48243000 34#define OMAP4430_PRCM_MPU_BASE 0x48243000
29 35
30#define OMAP44XX_PRCM_MPU_REGADDR(inst, reg) \ 36#define OMAP44XX_PRCM_MPU_REGADDR(inst, reg) \
@@ -98,6 +104,7 @@ extern u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 idx);
98extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx); 104extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx);
99extern u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, 105extern u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst,
100 s16 idx); 106 s16 idx);
107extern void __init omap2_set_globals_prcm_mpu(void __iomem *prcm_mpu);
101# endif 108# endif
102 109
103#endif 110#endif
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index c30ab5de8d1d..fb7dee29ce76 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions 2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions
3 * 3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
@@ -15,6 +15,11 @@
15 15
16#include "prcm-common.h" 16#include "prcm-common.h"
17 17
18# ifndef __ASSEMBLER__
19extern void __iomem *prm_base;
20extern void omap2_set_globals_prm(void __iomem *prm);
21# endif
22
18/* 23/*
19 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP 24 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
20 * 25 *
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 6c595798c5c5..2294daf95c2e 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -31,6 +31,7 @@
31#include "prm2xxx.h" 31#include "prm2xxx.h"
32#include "prm3xxx.h" 32#include "prm3xxx.h"
33#include "prm44xx.h" 33#include "prm44xx.h"
34#include "common.h"
34 35
35/* 36/*
36 * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs 37 * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs
@@ -55,6 +56,9 @@ static struct irq_chip_generic **prcm_irq_chips;
55 */ 56 */
56static struct omap_prcm_irq_setup *prcm_irq_setup; 57static struct omap_prcm_irq_setup *prcm_irq_setup;
57 58
59/* prm_base: base virtual address of the PRM IP block */
60void __iomem *prm_base;
61
58/* 62/*
59 * prm_ll_data: function pointers to SoC-specific implementations of 63 * prm_ll_data: function pointers to SoC-specific implementations of
60 * common PRM functions 64 * common PRM functions
@@ -329,6 +333,17 @@ err:
329} 333}
330 334
331/** 335/**
336 * omap2_set_globals_prm - set the PRM base address (for early use)
337 * @prm: PRM base virtual address
338 *
339 * XXX Will be replaced when the PRM/CM drivers are completed.
340 */
341void __init omap2_set_globals_prm(void __iomem *prm)
342{
343 prm_base = prm;
344}
345
346/**
332 * prm_read_reset_sources - return the sources of the SoC's last reset 347 * prm_read_reset_sources - return the sources of the SoC's last reset
333 * 348 *
334 * Return a u32 bitmask representing the reset sources that caused the 349 * Return a u32 bitmask representing the reset sources that caused the
diff --git a/arch/arm/mach-omap2/prminst44xx.h b/arch/arm/mach-omap2/prminst44xx.h
index 46f2efb36596..a2ede2d65481 100644
--- a/arch/arm/mach-omap2/prminst44xx.h
+++ b/arch/arm/mach-omap2/prminst44xx.h
@@ -30,4 +30,6 @@ extern int omap4_prminst_assert_hardreset(u8 shift, u8 part, s16 inst,
30extern int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst, 30extern int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst,
31 u16 rstctrl_offs); 31 u16 rstctrl_offs);
32 32
33extern void omap_prm_base_init(void);
34
33#endif 35#endif
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
index 3ccee9f192c8..08eda93a6eda 100644
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -27,11 +27,7 @@
27#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H 27#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
28#define __ASM_ARM_ARCH_OMAP_PRCM_H 28#define __ASM_ARM_ARCH_OMAP_PRCM_H
29 29
30#include <linux/kernel.h> 30/* XXX To be removed */
31#include <linux/io.h>
32
33void __init omap2_set_globals_prcm(void __iomem *prm, void __iomem *cm,
34 void __iomem *cm2, void __iomem *prcm_mpu);
35 31
36#endif 32#endif
37 33