diff options
author | Tero Kristo <t-kristo@ti.com> | 2014-11-20 08:02:59 -0500 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2015-03-31 14:26:36 -0400 |
commit | ab7b2ffcf576a49b51c240dcd68ca4b7cd60b84d (patch) | |
tree | d4d34e048713a8f7029ec525118469b7a79d35d8 | |
parent | 2208bf115fecae211480ea41d25e6d56ec20d405 (diff) |
ARM: OMAP2+: PRM: move SoC specific init calls within a generic API
This gets rid of need for some exported driver APIs, and simplifies the
initialization of the PRM driver. Done in preparation to make PRM a
separate driver. The init data is now also passed to the SoC specific
implementations, allowing future expansion to add feature flags etc.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/io.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm-common.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm33xx.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm33xx.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm3xxx.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm3xxx.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm44xx_54xx.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm54xx.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm7xx.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 76 |
15 files changed, 90 insertions, 39 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 622ee3bddd32..7632dfead166 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -386,7 +386,7 @@ void __init omap2420_init_early(void) | |||
386 | OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE)); | 386 | OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE)); |
387 | omap2_control_base_init(); | 387 | omap2_control_base_init(); |
388 | omap2xxx_check_revision(); | 388 | omap2xxx_check_revision(); |
389 | omap2xxx_prm_init(); | 389 | omap2_prcm_base_init(); |
390 | omap2xxx_cm_init(); | 390 | omap2xxx_cm_init(); |
391 | omap2xxx_voltagedomains_init(); | 391 | omap2xxx_voltagedomains_init(); |
392 | omap242x_powerdomains_init(); | 392 | omap242x_powerdomains_init(); |
@@ -413,7 +413,7 @@ void __init omap2430_init_early(void) | |||
413 | OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE)); | 413 | OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE)); |
414 | omap2_control_base_init(); | 414 | omap2_control_base_init(); |
415 | omap2xxx_check_revision(); | 415 | omap2xxx_check_revision(); |
416 | omap2xxx_prm_init(); | 416 | omap2_prcm_base_init(); |
417 | omap2xxx_cm_init(); | 417 | omap2xxx_cm_init(); |
418 | omap2xxx_voltagedomains_init(); | 418 | omap2xxx_voltagedomains_init(); |
419 | omap243x_powerdomains_init(); | 419 | omap243x_powerdomains_init(); |
@@ -453,7 +453,8 @@ void __init omap3_init_early(void) | |||
453 | omap2_control_base_init(); | 453 | omap2_control_base_init(); |
454 | omap3xxx_check_revision(); | 454 | omap3xxx_check_revision(); |
455 | omap3xxx_check_features(); | 455 | omap3xxx_check_features(); |
456 | omap3xxx_prm_init(); | 456 | omap2_prcm_base_init(); |
457 | omap3xxx_prm_init(NULL); | ||
457 | omap3xxx_cm_init(); | 458 | omap3xxx_cm_init(); |
458 | omap3xxx_voltagedomains_init(); | 459 | omap3xxx_voltagedomains_init(); |
459 | omap3xxx_powerdomains_init(); | 460 | omap3xxx_powerdomains_init(); |
@@ -551,7 +552,7 @@ void __init ti814x_init_early(void) | |||
551 | omap2_control_base_init(); | 552 | omap2_control_base_init(); |
552 | omap3xxx_check_revision(); | 553 | omap3xxx_check_revision(); |
553 | ti81xx_check_features(); | 554 | ti81xx_check_features(); |
554 | am33xx_prm_init(); | 555 | omap2_prcm_base_init(); |
555 | am33xx_cm_init(); | 556 | am33xx_cm_init(); |
556 | omap3xxx_voltagedomains_init(); | 557 | omap3xxx_voltagedomains_init(); |
557 | omap3xxx_powerdomains_init(); | 558 | omap3xxx_powerdomains_init(); |
@@ -569,7 +570,7 @@ void __init ti816x_init_early(void) | |||
569 | omap2_control_base_init(); | 570 | omap2_control_base_init(); |
570 | omap3xxx_check_revision(); | 571 | omap3xxx_check_revision(); |
571 | ti81xx_check_features(); | 572 | ti81xx_check_features(); |
572 | am33xx_prm_init(); | 573 | omap2_prcm_base_init(); |
573 | am33xx_cm_init(); | 574 | am33xx_cm_init(); |
574 | omap3xxx_voltagedomains_init(); | 575 | omap3xxx_voltagedomains_init(); |
575 | omap3xxx_powerdomains_init(); | 576 | omap3xxx_powerdomains_init(); |
@@ -589,7 +590,7 @@ void __init am33xx_init_early(void) | |||
589 | omap2_control_base_init(); | 590 | omap2_control_base_init(); |
590 | omap3xxx_check_revision(); | 591 | omap3xxx_check_revision(); |
591 | am33xx_check_features(); | 592 | am33xx_check_features(); |
592 | am33xx_prm_init(); | 593 | omap2_prcm_base_init(); |
593 | am33xx_cm_init(); | 594 | am33xx_cm_init(); |
594 | am33xx_powerdomains_init(); | 595 | am33xx_powerdomains_init(); |
595 | am33xx_clockdomains_init(); | 596 | am33xx_clockdomains_init(); |
@@ -612,7 +613,7 @@ void __init am43xx_init_early(void) | |||
612 | omap2_control_base_init(); | 613 | omap2_control_base_init(); |
613 | omap3xxx_check_revision(); | 614 | omap3xxx_check_revision(); |
614 | am33xx_check_features(); | 615 | am33xx_check_features(); |
615 | omap44xx_prm_init(); | 616 | omap2_prcm_base_init(); |
616 | omap4_cm_init(); | 617 | omap4_cm_init(); |
617 | am43xx_powerdomains_init(); | 618 | am43xx_powerdomains_init(); |
618 | am43xx_clockdomains_init(); | 619 | am43xx_clockdomains_init(); |
@@ -638,7 +639,7 @@ void __init omap4430_init_early(void) | |||
638 | omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE)); | 639 | omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE)); |
639 | omap4xxx_check_revision(); | 640 | omap4xxx_check_revision(); |
640 | omap4xxx_check_features(); | 641 | omap4xxx_check_features(); |
641 | omap44xx_prm_init(); | 642 | omap2_prcm_base_init(); |
642 | omap4_cm_init(); | 643 | omap4_cm_init(); |
643 | omap4_pm_init_early(); | 644 | omap4_pm_init_early(); |
644 | omap44xx_voltagedomains_init(); | 645 | omap44xx_voltagedomains_init(); |
@@ -667,7 +668,7 @@ void __init omap5_init_early(void) | |||
667 | OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE)); | 668 | OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE)); |
668 | omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); | 669 | omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); |
669 | omap4_pm_init_early(); | 670 | omap4_pm_init_early(); |
670 | omap44xx_prm_init(); | 671 | omap2_prcm_base_init(); |
671 | omap5xxx_check_revision(); | 672 | omap5xxx_check_revision(); |
672 | omap4_cm_init(); | 673 | omap4_cm_init(); |
673 | omap54xx_voltagedomains_init(); | 674 | omap54xx_voltagedomains_init(); |
@@ -694,7 +695,7 @@ void __init dra7xx_init_early(void) | |||
694 | OMAP2_L4_IO_ADDRESS(DRA7XX_CTRL_BASE)); | 695 | OMAP2_L4_IO_ADDRESS(DRA7XX_CTRL_BASE)); |
695 | omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); | 696 | omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); |
696 | omap4_pm_init_early(); | 697 | omap4_pm_init_early(); |
697 | omap44xx_prm_init(); | 698 | omap2_prcm_base_init(); |
698 | dra7xxx_check_revision(); | 699 | dra7xxx_check_revision(); |
699 | omap4_cm_init(); | 700 | omap4_cm_init(); |
700 | dra7xx_powerdomains_init(); | 701 | dra7xx_powerdomains_init(); |
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 9e4dd0b7dd6a..461bdc4ea8ec 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -524,12 +524,16 @@ struct omap_prcm_irq_setup { | |||
524 | * @mem: IO mem pointer for this module | 524 | * @mem: IO mem pointer for this module |
525 | * @offset: module base address offset from the IO base | 525 | * @offset: module base address offset from the IO base |
526 | * @flags: PRCM module init flags | 526 | * @flags: PRCM module init flags |
527 | * @init: low level PRCM init function for this module | ||
528 | * @np: device node for this PRCM module | ||
527 | */ | 529 | */ |
528 | struct omap_prcm_init_data { | 530 | struct omap_prcm_init_data { |
529 | int index; | 531 | int index; |
530 | void __iomem *mem; | 532 | void __iomem *mem; |
531 | s16 offset; | 533 | s16 offset; |
532 | u16 flags; | 534 | u16 flags; |
535 | int (*init)(const struct omap_prcm_init_data *data); | ||
536 | struct device_node *np; | ||
533 | }; | 537 | }; |
534 | 538 | ||
535 | extern void omap_prcm_irq_cleanup(void); | 539 | extern void omap_prcm_irq_cleanup(void); |
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index 670733365287..3936e6c38cea 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h | |||
@@ -21,6 +21,7 @@ extern u16 prm_features; | |||
21 | extern void omap2_set_globals_prm(void __iomem *prm); | 21 | extern void omap2_set_globals_prm(void __iomem *prm); |
22 | int omap_prcm_init(void); | 22 | int omap_prcm_init(void); |
23 | int omap2_prm_base_init(void); | 23 | int omap2_prm_base_init(void); |
24 | int omap2_prcm_base_init(void); | ||
24 | # endif | 25 | # endif |
25 | 26 | ||
26 | /* | 27 | /* |
diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c index 29e203f38d07..752018ce129c 100644 --- a/arch/arm/mach-omap2/prm2xxx.c +++ b/arch/arm/mach-omap2/prm2xxx.c | |||
@@ -220,9 +220,8 @@ static struct prm_ll_data omap2xxx_prm_ll_data = { | |||
220 | .clear_mod_irqs = &omap2xxx_prm_clear_mod_irqs, | 220 | .clear_mod_irqs = &omap2xxx_prm_clear_mod_irqs, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | int __init omap2xxx_prm_init(void) | 223 | int __init omap2xxx_prm_init(const struct omap_prcm_init_data *data) |
224 | { | 224 | { |
225 | omap2_prm_base_init(); | ||
226 | return prm_register(&omap2xxx_prm_ll_data); | 225 | return prm_register(&omap2xxx_prm_ll_data); |
227 | } | 226 | } |
228 | 227 | ||
diff --git a/arch/arm/mach-omap2/prm2xxx.h b/arch/arm/mach-omap2/prm2xxx.h index 9c91f4fac36d..9008a9e55a1a 100644 --- a/arch/arm/mach-omap2/prm2xxx.h +++ b/arch/arm/mach-omap2/prm2xxx.h | |||
@@ -124,7 +124,7 @@ | |||
124 | extern int omap2xxx_clkdm_sleep(struct clockdomain *clkdm); | 124 | extern int omap2xxx_clkdm_sleep(struct clockdomain *clkdm); |
125 | extern int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm); | 125 | extern int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm); |
126 | 126 | ||
127 | extern int __init omap2xxx_prm_init(void); | 127 | int __init omap2xxx_prm_init(const struct omap_prcm_init_data *data); |
128 | 128 | ||
129 | #endif | 129 | #endif |
130 | 130 | ||
diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c index 1e052aaf92cd..dcb5001d77da 100644 --- a/arch/arm/mach-omap2/prm33xx.c +++ b/arch/arm/mach-omap2/prm33xx.c | |||
@@ -378,9 +378,8 @@ static struct prm_ll_data am33xx_prm_ll_data = { | |||
378 | .reset_system = am33xx_prm_global_warm_sw_reset, | 378 | .reset_system = am33xx_prm_global_warm_sw_reset, |
379 | }; | 379 | }; |
380 | 380 | ||
381 | int __init am33xx_prm_init(void) | 381 | int __init am33xx_prm_init(const struct omap_prcm_init_data *data) |
382 | { | 382 | { |
383 | omap2_prm_base_init(); | ||
384 | return prm_register(&am33xx_prm_ll_data); | 383 | return prm_register(&am33xx_prm_ll_data); |
385 | } | 384 | } |
386 | 385 | ||
diff --git a/arch/arm/mach-omap2/prm33xx.h b/arch/arm/mach-omap2/prm33xx.h index 98ac41f271da..2bc4ec52ba78 100644 --- a/arch/arm/mach-omap2/prm33xx.h +++ b/arch/arm/mach-omap2/prm33xx.h | |||
@@ -118,7 +118,7 @@ | |||
118 | #define AM33XX_PM_CEFUSE_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004) | 118 | #define AM33XX_PM_CEFUSE_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004) |
119 | 119 | ||
120 | #ifndef __ASSEMBLER__ | 120 | #ifndef __ASSEMBLER__ |
121 | int am33xx_prm_init(void); | 121 | int am33xx_prm_init(const struct omap_prcm_init_data *data); |
122 | 122 | ||
123 | #endif /* ASSEMBLER */ | 123 | #endif /* ASSEMBLER */ |
124 | #endif | 124 | #endif |
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index a347993a7bfe..62680aad2126 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c | |||
@@ -670,12 +670,10 @@ static struct prm_ll_data omap3xxx_prm_ll_data = { | |||
670 | .vp_clear_txdone = &omap3_prm_vp_clear_txdone, | 670 | .vp_clear_txdone = &omap3_prm_vp_clear_txdone, |
671 | }; | 671 | }; |
672 | 672 | ||
673 | int __init omap3xxx_prm_init(void) | 673 | int __init omap3xxx_prm_init(const struct omap_prcm_init_data *data) |
674 | { | 674 | { |
675 | omap2_clk_legacy_provider_init(TI_CLKM_PRM, | 675 | omap2_clk_legacy_provider_init(TI_CLKM_PRM, |
676 | prm_base + OMAP3430_IVA2_MOD); | 676 | prm_base + OMAP3430_IVA2_MOD); |
677 | omap2_prm_base_init(); | ||
678 | |||
679 | if (omap3_has_io_wakeup()) | 677 | if (omap3_has_io_wakeup()) |
680 | prm_features |= PRM_HAS_IO_WAKEUP; | 678 | prm_features |= PRM_HAS_IO_WAKEUP; |
681 | 679 | ||
diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h index 55e4c898ba25..5f095eec339c 100644 --- a/arch/arm/mach-omap2/prm3xxx.h +++ b/arch/arm/mach-omap2/prm3xxx.h | |||
@@ -140,7 +140,7 @@ extern u32 omap3_prm_vcvp_read(u8 offset); | |||
140 | extern void omap3_prm_vcvp_write(u32 val, u8 offset); | 140 | extern void omap3_prm_vcvp_write(u32 val, u8 offset); |
141 | extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | 141 | extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); |
142 | 142 | ||
143 | extern int __init omap3xxx_prm_init(void); | 143 | int __init omap3xxx_prm_init(const struct omap_prcm_init_data *data); |
144 | void omap3xxx_prm_iva_idle(void); | 144 | void omap3xxx_prm_iva_idle(void); |
145 | void omap3_prm_reset_modem(void); | 145 | void omap3_prm_reset_modem(void); |
146 | int omap3xxx_prm_clear_global_cold_reset(void); | 146 | int omap3xxx_prm_clear_global_cold_reset(void); |
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index b479a33eacfd..e3f2d313e341 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -703,9 +703,8 @@ static struct prm_ll_data omap44xx_prm_ll_data = { | |||
703 | .vp_clear_txdone = omap4_prm_vp_clear_txdone, | 703 | .vp_clear_txdone = omap4_prm_vp_clear_txdone, |
704 | }; | 704 | }; |
705 | 705 | ||
706 | int __init omap44xx_prm_init(void) | 706 | int __init omap44xx_prm_init(const struct omap_prcm_init_data *data) |
707 | { | 707 | { |
708 | omap2_prm_base_init(); | ||
709 | omap_prm_base_init(); | 708 | omap_prm_base_init(); |
710 | 709 | ||
711 | if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) | 710 | if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) |
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h index 7db2422faa16..efd6035d0871 100644 --- a/arch/arm/mach-omap2/prm44xx.h +++ b/arch/arm/mach-omap2/prm44xx.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #define __ARCH_ARM_MACH_OMAP2_PRM44XX_H | 26 | #define __ARCH_ARM_MACH_OMAP2_PRM44XX_H |
27 | 27 | ||
28 | #include "prm44xx_54xx.h" | 28 | #include "prm44xx_54xx.h" |
29 | #include "prcm-common.h" | ||
30 | #include "prm.h" | 29 | #include "prm.h" |
31 | 30 | ||
32 | #define OMAP4430_PRM_BASE 0x4a306000 | 31 | #define OMAP4430_PRM_BASE 0x4a306000 |
diff --git a/arch/arm/mach-omap2/prm44xx_54xx.h b/arch/arm/mach-omap2/prm44xx_54xx.h index a470185d9ede..3f139ebc8398 100644 --- a/arch/arm/mach-omap2/prm44xx_54xx.h +++ b/arch/arm/mach-omap2/prm44xx_54xx.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_54XX_H | 23 | #ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_54XX_H |
24 | #define __ARCH_ARM_MACH_OMAP2_PRM44XX_54XX_H | 24 | #define __ARCH_ARM_MACH_OMAP2_PRM44XX_54XX_H |
25 | 25 | ||
26 | #include "prcm-common.h" | ||
27 | |||
26 | /* Function prototypes */ | 28 | /* Function prototypes */ |
27 | #ifndef __ASSEMBLER__ | 29 | #ifndef __ASSEMBLER__ |
28 | 30 | ||
@@ -34,7 +36,7 @@ extern u32 omap4_prm_vcvp_read(u8 offset); | |||
34 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); | 36 | extern void omap4_prm_vcvp_write(u32 val, u8 offset); |
35 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); | 37 | extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); |
36 | 38 | ||
37 | extern int __init omap44xx_prm_init(void); | 39 | int __init omap44xx_prm_init(const struct omap_prcm_init_data *data); |
38 | 40 | ||
39 | #endif | 41 | #endif |
40 | 42 | ||
diff --git a/arch/arm/mach-omap2/prm54xx.h b/arch/arm/mach-omap2/prm54xx.h index e4411010309c..1eb22ff087dc 100644 --- a/arch/arm/mach-omap2/prm54xx.h +++ b/arch/arm/mach-omap2/prm54xx.h | |||
@@ -22,7 +22,6 @@ | |||
22 | #define __ARCH_ARM_MACH_OMAP2_PRM54XX_H | 22 | #define __ARCH_ARM_MACH_OMAP2_PRM54XX_H |
23 | 23 | ||
24 | #include "prm44xx_54xx.h" | 24 | #include "prm44xx_54xx.h" |
25 | #include "prcm-common.h" | ||
26 | #include "prm.h" | 25 | #include "prm.h" |
27 | 26 | ||
28 | #define OMAP54XX_PRM_BASE 0x4ae06000 | 27 | #define OMAP54XX_PRM_BASE 0x4ae06000 |
diff --git a/arch/arm/mach-omap2/prm7xx.h b/arch/arm/mach-omap2/prm7xx.h index 4bb50fbf29be..cc1e6a2b97f6 100644 --- a/arch/arm/mach-omap2/prm7xx.h +++ b/arch/arm/mach-omap2/prm7xx.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #ifndef __ARCH_ARM_MACH_OMAP2_PRM7XX_H | 22 | #ifndef __ARCH_ARM_MACH_OMAP2_PRM7XX_H |
23 | #define __ARCH_ARM_MACH_OMAP2_PRM7XX_H | 23 | #define __ARCH_ARM_MACH_OMAP2_PRM7XX_H |
24 | 24 | ||
25 | #include "prm44xx_54xx.h" | ||
26 | #include "prcm-common.h" | 25 | #include "prcm-common.h" |
26 | #include "prm44xx_54xx.h" | ||
27 | #include "prm.h" | 27 | #include "prm.h" |
28 | 28 | ||
29 | #define DRA7XX_PRM_BASE 0x4ae06000 | 29 | #define DRA7XX_PRM_BASE 0x4ae06000 |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index a943e1447536..aede589822fb 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "prm2xxx_3xxx.h" | 32 | #include "prm2xxx_3xxx.h" |
33 | #include "prm2xxx.h" | 33 | #include "prm2xxx.h" |
34 | #include "prm3xxx.h" | 34 | #include "prm3xxx.h" |
35 | #include "prm33xx.h" | ||
35 | #include "prm44xx.h" | 36 | #include "prm44xx.h" |
36 | #include "common.h" | 37 | #include "common.h" |
37 | #include "clock.h" | 38 | #include "clock.h" |
@@ -633,12 +634,17 @@ int prm_unregister(struct prm_ll_data *pld) | |||
633 | return 0; | 634 | return 0; |
634 | } | 635 | } |
635 | 636 | ||
636 | static struct omap_prcm_init_data prm_data = { | 637 | #ifdef CONFIG_ARCH_OMAP2 |
638 | static struct omap_prcm_init_data omap2_prm_data __initdata = { | ||
637 | .index = TI_CLKM_PRM, | 639 | .index = TI_CLKM_PRM, |
640 | .init = omap2xxx_prm_init, | ||
638 | }; | 641 | }; |
642 | #endif | ||
639 | 643 | ||
640 | static struct omap_prcm_init_data omap3_prm_data = { | 644 | #ifdef CONFIG_ARCH_OMAP3 |
645 | static struct omap_prcm_init_data omap3_prm_data __initdata = { | ||
641 | .index = TI_CLKM_PRM, | 646 | .index = TI_CLKM_PRM, |
647 | .init = omap3xxx_prm_init, | ||
642 | 648 | ||
643 | /* | 649 | /* |
644 | * IVA2 offset is a negative value, must offset the prm_base | 650 | * IVA2 offset is a negative value, must offset the prm_base |
@@ -646,23 +652,57 @@ static struct omap_prcm_init_data omap3_prm_data = { | |||
646 | */ | 652 | */ |
647 | .offset = -OMAP3430_IVA2_MOD, | 653 | .offset = -OMAP3430_IVA2_MOD, |
648 | }; | 654 | }; |
655 | #endif | ||
649 | 656 | ||
650 | static struct omap_prcm_init_data scrm_data = { | 657 | #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_TI81XX) |
651 | .index = TI_CLKM_SCRM, | 658 | static struct omap_prcm_init_data am3_prm_data __initdata = { |
659 | .index = TI_CLKM_PRM, | ||
660 | .init = am33xx_prm_init, | ||
661 | }; | ||
662 | #endif | ||
663 | |||
664 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ | ||
665 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) | ||
666 | static struct omap_prcm_init_data omap4_prm_data __initdata = { | ||
667 | .index = TI_CLKM_PRM, | ||
668 | .init = omap44xx_prm_init, | ||
652 | }; | 669 | }; |
670 | #endif | ||
653 | 671 | ||
654 | static const struct of_device_id omap_prcm_dt_match_table[] = { | 672 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) |
655 | { .compatible = "ti,am3-prcm", .data = &prm_data }, | 673 | static struct omap_prcm_init_data scrm_data __initdata = { |
656 | { .compatible = "ti,am4-prcm", .data = &prm_data }, | 674 | .index = TI_CLKM_SCRM, |
657 | { .compatible = "ti,dm814-prcm", .data = &prm_data }, | 675 | }; |
658 | { .compatible = "ti,dm816-prcm", .data = &prm_data }, | 676 | #endif |
659 | { .compatible = "ti,omap2-prcm", .data = &prm_data }, | 677 | |
678 | static const struct of_device_id omap_prcm_dt_match_table[] __initconst = { | ||
679 | #ifdef CONFIG_SOC_AM33XX | ||
680 | { .compatible = "ti,am3-prcm", .data = &am3_prm_data }, | ||
681 | #endif | ||
682 | #ifdef CONFIG_SOC_AM43XX | ||
683 | { .compatible = "ti,am4-prcm", .data = &omap4_prm_data }, | ||
684 | #endif | ||
685 | #ifdef CONFIG_SOC_TI81XX | ||
686 | { .compatible = "ti,dm814-prcm", .data = &am3_prm_data }, | ||
687 | { .compatible = "ti,dm816-prcm", .data = &am3_prm_data }, | ||
688 | #endif | ||
689 | #ifdef CONFIG_ARCH_OMAP2 | ||
690 | { .compatible = "ti,omap2-prcm", .data = &omap2_prm_data }, | ||
691 | #endif | ||
692 | #ifdef CONFIG_ARCH_OMAP3 | ||
660 | { .compatible = "ti,omap3-prm", .data = &omap3_prm_data }, | 693 | { .compatible = "ti,omap3-prm", .data = &omap3_prm_data }, |
661 | { .compatible = "ti,omap4-prm", .data = &prm_data }, | 694 | #endif |
695 | #ifdef CONFIG_ARCH_OMAP4 | ||
696 | { .compatible = "ti,omap4-prm", .data = &omap4_prm_data }, | ||
662 | { .compatible = "ti,omap4-scrm", .data = &scrm_data }, | 697 | { .compatible = "ti,omap4-scrm", .data = &scrm_data }, |
663 | { .compatible = "ti,omap5-prm", .data = &prm_data }, | 698 | #endif |
699 | #ifdef CONFIG_SOC_OMAP5 | ||
700 | { .compatible = "ti,omap5-prm", .data = &omap4_prm_data }, | ||
664 | { .compatible = "ti,omap5-scrm", .data = &scrm_data }, | 701 | { .compatible = "ti,omap5-scrm", .data = &scrm_data }, |
665 | { .compatible = "ti,dra7-prm", .data = &prm_data }, | 702 | #endif |
703 | #ifdef CONFIG_SOC_DRA7XX | ||
704 | { .compatible = "ti,dra7-prm", .data = &omap4_prm_data }, | ||
705 | #endif | ||
666 | { } | 706 | { } |
667 | }; | 707 | }; |
668 | 708 | ||
@@ -691,11 +731,21 @@ int __init omap2_prm_base_init(void) | |||
691 | prm_base = mem + data->offset; | 731 | prm_base = mem + data->offset; |
692 | 732 | ||
693 | data->mem = mem; | 733 | data->mem = mem; |
734 | |||
735 | data->np = np; | ||
736 | |||
737 | if (data->init) | ||
738 | data->init(data); | ||
694 | } | 739 | } |
695 | 740 | ||
696 | return 0; | 741 | return 0; |
697 | } | 742 | } |
698 | 743 | ||
744 | int __init omap2_prcm_base_init(void) | ||
745 | { | ||
746 | return omap2_prm_base_init(); | ||
747 | } | ||
748 | |||
699 | /** | 749 | /** |
700 | * omap_prcm_init - low level init for the PRCM drivers | 750 | * omap_prcm_init - low level init for the PRCM drivers |
701 | * | 751 | * |