Skip to contentSkip to conversation

ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

PATCH New Vaibhav Hiremath 2 participants 13 messages Jun 11, 2012 – Jul 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

As omap1 and omap2 will never be compiled together, due to different compiler flags, so we can simply make cpu_class_is_omap2() = true, for all non-omap1 platforms.

---
 arch/arm/plat-omap/include/plat/cpu.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/arm/plat-omap/include/plat/cpu.h +1 -2
index 14f050f..6a42558 100644
@@ -374,8 +374,7 @@ IS_OMAP_TYPE(3430, 0x3430)
 /* Macros to detect if we have OMAP1 or OMAP2 */
 #define cpu_class_is_omap1()	(cpu_is_omap7xx() || cpu_is_omap15xx() || \
 				cpu_is_omap16xx())
-#define cpu_class_is_omap2()	(cpu_is_omap24xx() || cpu_is_omap34xx() || \
-				cpu_is_omap44xx())
+#define cpu_class_is_omap2()	!cpu_class_is_omap1()
 
 /* Various silicon revisions for omap2 */
 #define OMAP242X_CLASS		0x24200024
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 9 lines · Vaibhav

As omap1 and omap2 will never be compiled together, due to different compiler flags, so we can simply make cpu_class_is_omap2() = true, for all non-omap1 platforms.

---
 arch/arm/plat-omap/include/plat/cpu.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Tony,

Ping???

Thanks,
Vaibhav

#2 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 11 lines · Hiremath, Vaibhav
Quoted 9 lines · Vaibhav

As omap1 and omap2 will never be compiled together, due to different compiler flags, so we can simply make cpu_class_is_omap2() = true, for all non-omap1 platforms.

---
 arch/arm/plat-omap/include/plat/cpu.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Quoted 3 lines

Tony,

Ping???

Thanks applying into devel-am33xx branch.

Tony

#3 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Hiremath, Vaibhav
Quoted 9 lines · Vaibhav

As omap1 and omap2 will never be compiled together, due to different compiler flags, so we can simply make cpu_class_is_omap2() = true, for all non-omap1 platforms.

---
 arch/arm/plat-omap/include/plat/cpu.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 3 lines

Tony,

Ping???

Thanks applying into devel-am33xx branch.

Thanks Tony,

There are few cleanup patches pending for your review, it would be good if you provide your review comments.

Thanks,
Vaibhav

#4 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 3 lines · Hiremath, Vaibhav

There are few cleanup patches pending for your review, it would be good if you provide your review comments.

Hmm care to post the Subject: lines for those? I may have marked something as read accidentally..

Tony

#5 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 8 lines · Tony Lindgren
Quoted 3 lines · Hiremath, Vaibhav

There are few cleanup patches pending for your review, it would be good if you provide your review comments.

Hmm care to post the Subject: lines for those? I may have marked something as read accidentally..

I will resubmit the patches again ontop of linux-omap/master, makes more sense.

These patches are,

ARM: OMAP2+: CLEANUP: All OMAP2PLUS uses omap-device.o target so add one entry
ARM: OMAP2+: CLEANUP: Move omap3 dpll ops to dpll3xxx.c
ARM: OMAP2+: CLEANUP: Remove ARCH_OMAPx ifdef from struct dpll_data

Thanks,
Vaibhav

#6 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

In reply to Tony Lindgren
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Hiremath, Vaibhav
Quoted 9 lines · Vaibhav

As omap1 and omap2 will never be compiled together, due to different compiler flags, so we can simply make cpu_class_is_omap2() = true, for all non-omap1 platforms.

---
 arch/arm/plat-omap/include/plat/cpu.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Quoted 5 lines
Quoted 3 lines

Tony,

Ping???

Thanks applying into devel-am33xx branch.

Actually looks like this fails for the dynamic detection case with omap1_defconfig.. Looks like you did not build test your patch with omap1_defconfig? Please do it for every patch!

It seems we need something better though for multi zImage too, we can't really rely on CONFIG_ARCH_OMAP1 or CONFIG_ARCH_OMAP2PLUS here to determine anything.

Anyways, dropping this for now, let's try to come up with something better.

Tony

#7 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 24 lines · Tony Lindgren
Quoted 12 lines · Tony Lindgren
Quoted 11 lines · Hiremath, Vaibhav
Quoted 9 lines · Vaibhav

As omap1 and omap2 will never be compiled together, due to different compiler flags, so we can simply make cpu_class_is_omap2() = true, for all non-omap1 platforms.

---
 arch/arm/plat-omap/include/plat/cpu.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Quoted 5 lines
Quoted 3 lines

Tony,

Ping???

Thanks applying into devel-am33xx branch.

Actually looks like this fails for the dynamic detection case with omap1_defconfig.. Looks like you did not build test your patch with omap1_defconfig? Please do it for every patch!

Quoted 7 lines

It seems we need something better though for multi zImage too, we can't really rely on CONFIG_ARCH_OMAP1 or CONFIG_ARCH_OMAP2PLUS here to determine anything.

Anyways, dropping this for now, let's try to come up with something better.

Yes Tony, you are right I did not test omap1 for this patch. My bad...

How about something like, considering the fact that, omap_type() is the culprit here and is not applicable to omap1 at all. In case of omap1, we don't use omap_type() function.

arch/arm/plat-omap/include/plat/cpu.h +8 -0
index 6a42558..5900a3d 100644
@@ -42,7 +42,14 @@
 #define OMAP2_DEVICE_TYPE_GP           3
 #define OMAP2_DEVICE_TYPE_BAD          4
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
 int omap_type(void);
+#else
+inline static int omap_type(void)
+{
+	/* Always return GP, since it is not being used anyway for omap1 */
+	return OMAP2_DEVICE_TYPE_GP;
+}
+#endif
 
 /*

* omap_rev bits:

Thanks,
Vaibhav

#8 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 8 lines · Hiremath, Vaibhav
arch/arm/plat-omap/include/plat/cpu.h +1 -0
@@ -42,7 +42,14 @@
 #define OMAP2_DEVICE_TYPE_GP           3
 #define OMAP2_DEVICE_TYPE_BAD          4
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
 int omap_type(void);

arch/arm/plat-omap/include/plat/cpu.h

Quoted 10 lines
arch/arm/plat-omap/include/plat/cpu.h +7 -0
+#else
+inline static int omap_type(void)
+{
+	/* Always return GP, since it is not being used anyway for omap1 */
+	return OMAP2_DEVICE_TYPE_GP;
+}
+#endif
 
 /*
  * omap_rev bits:

Just to follow-up on this, looks like we need to postpone this for v3.7. While at it, we need to make sure all soc_is_omapxxxx() are false by default.

What you're suggesting above would also depend on some MULTI_ARCH option set if multiple ARM architectures are selected. Above patch would only optimize things when ARCH_OMAP2PLUS alone is selected.

Regards,

Tony

#9 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Hiremath, Vaibhav
arch/arm/plat-omap/include/plat/cpu.h +8 -0
@@ -42,7 +42,14 @@
 #define OMAP2_DEVICE_TYPE_GP           3
 #define OMAP2_DEVICE_TYPE_BAD          4
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
 int omap_type(void);
+#else
+inline static int omap_type(void)
+{
+	/* Always return GP, since it is not being used anyway for omap1 */
+	return OMAP2_DEVICE_TYPE_GP;
+}
+#endif
 
Quoted 7 lines

arch/arm/plat-omap/include/plat/cpu.h

Quoted 2 lines
arch/arm/plat-omap/include/plat/cpu.h +0 -0
 /*
  * omap_rev bits:

Just to follow-up on this, looks like we need to postpone this for v3.7. While at it, we need to make sure all soc_is_omapxxxx() are false by default.

Just FYI, I had submitted V2 of this patch.

Quoted 4 lines

What you're suggesting above would also depend on some MULTI_ARCH option set if multiple ARM architectures are selected. Above patch would only optimize things when ARCH_OMAP2PLUS alone is selected.

Isn't this only applicable for ARCH_OMAP2PLUS and OMAP1?? And above patch take cares of both, as OMAP1 and 2 will not be build together, since compiler flags itself will be different.

Can you elaborate on how things will break if multiple ARM architectures are selected?

I am not sure whether I am following you completely.

Thanks,
Vaibhav

#10 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 28 lines · Hiremath, Vaibhav
Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Hiremath, Vaibhav
arch/arm/plat-omap/include/plat/cpu.h +8 -0
@@ -42,7 +42,14 @@
 #define OMAP2_DEVICE_TYPE_GP           3
 #define OMAP2_DEVICE_TYPE_BAD          4
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
 int omap_type(void);
+#else
+inline static int omap_type(void)
+{
+	/* Always return GP, since it is not being used anyway for omap1 */
+	return OMAP2_DEVICE_TYPE_GP;
+}
+#endif
 
Quoted 7 lines

arch/arm/plat-omap/include/plat/cpu.h

Quoted 2 lines
arch/arm/plat-omap/include/plat/cpu.h +0 -0
 /*
  * omap_rev bits:

Just to follow-up on this, looks like we need to postpone this for v3.7. While at it, we need to make sure all soc_is_omapxxxx() are false by default.

Just FYI, I had submitted V2 of this patch.

Quoted 8 lines
Quoted 4 lines

What you're suggesting above would also depend on some MULTI_ARCH option set if multiple ARM architectures are selected. Above patch would only optimize things when ARCH_OMAP2PLUS alone is selected.

Isn't this only applicable for ARCH_OMAP2PLUS and OMAP1?? And above patch take cares of both, as OMAP1 and 2 will not be build together, since compiler flags itself will be different.

Right, but we also need to deal with

Quoted 4 lines

Can you elaborate on how things will break if multiple ARM architectures are selected?

I am not sure whether I am following you completely.

We have quite a few initcalls that exit early with various soc_is, cpu_is, cpu_class_is tests that would fail for multi zImage kernels. Some of these have been patched away with additional calls in MACHINE_START, but some still remain.

We probably always need to return false for all soc_is_omapxxxx() unless the SoC detection is initialized in id.c.

Regards,

Tony

#11 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 43 lines · Tony Lindgren
Quoted 28 lines · Hiremath, Vaibhav
Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Hiremath, Vaibhav
arch/arm/plat-omap/include/plat/cpu.h +8 -0
@@ -42,7 +42,14 @@
 #define OMAP2_DEVICE_TYPE_GP           3
 #define OMAP2_DEVICE_TYPE_BAD          4
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
 int omap_type(void);
+#else
+inline static int omap_type(void)
+{
+	/* Always return GP, since it is not being used anyway for omap1 */
+	return OMAP2_DEVICE_TYPE_GP;
+}
+#endif
 
Quoted 7 lines

arch/arm/plat-omap/include/plat/cpu.h

Quoted 2 lines
arch/arm/plat-omap/include/plat/cpu.h +0 -0
 /*
  * omap_rev bits:

Just to follow-up on this, looks like we need to postpone this for v3.7. While at it, we need to make sure all soc_is_omapxxxx() are false by default.

Just FYI, I had submitted V2 of this patch.

Quoted 8 lines
Quoted 4 lines

What you're suggesting above would also depend on some MULTI_ARCH option set if multiple ARM architectures are selected. Above patch would only optimize things when ARCH_OMAP2PLUS alone is selected.

Isn't this only applicable for ARCH_OMAP2PLUS and OMAP1?? And above patch take cares of both, as OMAP1 and 2 will not be build together, since compiler flags itself will be different.

Right, but we also need to deal with

Quoted 3 lines

Can you elaborate on how things will break if multiple ARM architectures are selected?

Quoted 7 lines
Quoted 1 line

I am not sure whether I am following you completely.

We have quite a few initcalls that exit early with various soc_is, cpu_is, cpu_class_is tests that would fail for multi zImage kernels. Some of these have been patched away with additional calls in MACHINE_START, but some still remain.

Let me check on this inside code but if you have any quick reference, please let me know, I can fix it and submit the patch.

Quoted 3 lines

We probably always need to return false for all soc_is_omapxxxx() unless the SoC detection is initialized in id.c.

Ditto...

Thanks,
Vaibhav

#12 lore raw

PATCH 1/1 ARM: OMAP2+: cpu: Make cpu_class_is_omap2 true for all non-omap1 platforms

Quoted 9 lines · Hiremath, Vaibhav
Quoted 6 lines · Tony Lindgren

We have quite a few initcalls that exit early with various soc_is, cpu_is, cpu_class_is tests that would fail for multi zImage kernels. Some of these have been patched away with additional calls in MACHINE_START, but some still remain.

Let me check on this inside code but if you have any quick reference, please let me know, I can fix it and submit the patch.

Any initcall that returns early if (!cpu_class_is_omap2()) would continue running on multi zImage kernel on other SoCs compiled in unless we check for each cpu_is_omapxxxx() || soc_is_omapxxxx() tests like we currently do.

Regards,

Tony