[RFC 3/7] ARM: OMAP4+: PRCM: parse PRCM MPU base address from DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All the OMAP4+ boards are DT based only, so the prcm_mpu base address
can be parsed from DT.

Signed-off-by: Tero Kristo <t-kristo@xxxxxx>
---
 arch/arm/mach-omap2/io.c         |    4 ----
 arch/arm/mach-omap2/prm_common.c |   18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a253aaf..fc207ff 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -48,7 +48,6 @@
 #include "cm44xx.h"
 #include "prm.h"
 #include "cm.h"
-#include "prcm_mpu44xx.h"
 #include "prminst44xx.h"
 #include "prm2xxx.h"
 #include "prm3xxx.h"
@@ -628,7 +627,6 @@ void __init omap4430_init_early(void)
 {
 	omap2_set_globals_tap(OMAP443X_CLASS,
 			      OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE));
-	omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE));
 	omap2_control_base_init();
 	omap4xxx_check_revision();
 	omap4xxx_check_features();
@@ -656,7 +654,6 @@ void __init omap5_init_early(void)
 {
 	omap2_set_globals_tap(OMAP54XX_CLASS,
 			      OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE));
-	omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
 	omap2_control_base_init();
 	omap4_pm_init_early();
 	omap2_prcm_base_init();
@@ -681,7 +678,6 @@ void __init omap5_init_late(void)
 void __init dra7xx_init_early(void)
 {
 	omap2_set_globals_tap(-1, OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE));
-	omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
 	omap2_control_base_init();
 	omap4_pm_init_early();
 	omap2_prcm_base_init();
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index a3f0aef..ea2fb54 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -38,6 +38,7 @@
 #include "prm7xx.h"
 #include "prcm43xx.h"
 #include "prcm44xx.h"
+#include "prcm_mpu44xx.h"
 #include "common.h"
 #include "clock.h"
 #include "cm.h"
@@ -697,6 +698,13 @@ static struct omap_prcm_init_data dra7_prm_data __initdata = {
 };
 #endif
 
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
+	defined(CONFIG_SOC_DRA7XX)
+static struct omap_prcm_init_data omap4_prcm_mpu_data __initdata = {
+	.part = OMAP4430_PRCM_MPU_PARTITION,
+};
+#endif
+
 #ifdef CONFIG_SOC_AM43XX
 static struct omap_prcm_init_data am4_prm_data __initdata = {
 	.index = TI_CLKM_PRM,
@@ -741,6 +749,10 @@ static const struct of_device_id omap_prcm_dt_match_table[] __initconst = {
 #ifdef CONFIG_SOC_DRA7XX
 	{ .compatible = "ti,dra7-prm", .data = &dra7_prm_data },
 #endif
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
+	defined(CONFIG_SOC_DRA7XX)
+	{ .compatible = "ti,omap4-prcm-mpu", .data = &omap4_prcm_mpu_data },
+#endif
 	{ }
 };
 
@@ -769,6 +781,9 @@ int __init omap2_prm_base_init(void)
 		if (data->index == TI_CLKM_PRM)
 			prm_base = mem + data->offset;
 
+		if (data->part == OMAP4430_PRCM_MPU_PARTITION)
+			omap2_set_globals_prcm_mpu(mem);
+
 		data->mem = mem;
 
 		data->np = np;
@@ -813,6 +828,9 @@ int __init omap_prcm_init(void)
 	for_each_matching_node_and_match(np, omap_prcm_dt_match_table, &match) {
 		data = match->data;
 
+		if (data->part == OMAP4430_PRCM_MPU_PARTITION)
+			continue;
+
 		ret = omap2_clk_provider_init(np, data->index, NULL, data->mem);
 		if (ret)
 			return ret;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux