Skip to contentSkip to conversation

omap: mailbox: fix detection for previously supported chips

RFC In review Omar Ramirez Luna 4 participants 9 messages Sep 23, 2010 – Sep 24, 2010

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

RFC 1/1 omap: mailbox: fix detection for previously supported chips

Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.

---
- Testing was made under 3630 and 3430 boards.
- Given that 2430 uses similar initialization than OMAP3, changes to handle this case was added to the patch.
- HWMOD adaptation hopefully should solve this mess, but as of now mailbox should work as before at least.

 arch/arm/mach-omap2/mailbox.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/mailbox.c +8 -4
index 42dbfa4..26d6fb0 100644
@@ -394,15 +394,19 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
 
 	if (false)
 		;
-#if defined(CONFIG_ARCH_OMAP3430)
-	else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+	else if (omap3_has_iva()) {
 		list = omap3_mboxes;
 
 		list[0]->irq = platform_get_irq_byname(pdev, "dsp");
 	}
 #endif
-#if defined(CONFIG_ARCH_OMAP2420)
-	else if (cpu_is_omap2420()) {
+#if defined(CONFIG_ARCH_OMAP2)
+	else if (cpu_is_omap2430()) {
+		list = omap2_mboxes;
+
+		list[0]->irq = platform_get_irq_byname(pdev, "dsp");
+	} else if (cpu_is_omap2420()) {
 		list = omap2_mboxes;
 
 		list[0]->irq = platform_get_irq_byname(pdev, "dsp");
Signature · 1 line
1.7.1
#1 lore raw

Hi Omar,

Quoted 38 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Omar Ramirez Luna
Sent: Wednesday, September 22, 2010 7:22 PM
To: Tony Lindgren; Hiroshi DOYU; Felipe Contreras; Anna, Suman; linux- [email protected]
Cc: Ramirez Luna, Omar
Subject: [RFC] omap: mailbox: fix detection for previously supported chips

Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.

---
- Testing was made under 3630 and 3430 boards.
- Given that 2430 uses similar initialization than OMAP3, changes to handle this case was added to the patch.
- HWMOD adaptation hopefully should solve this mess, but as of now mailbox should work as before at least.

 arch/arm/mach-omap2/mailbox.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/mailbox.c +2 -2
index 42dbfa4..26d6fb0 100644
@@ -394,15 +394,19 @@ static int __devinit omap2_mbox_probe(struct
 platform_device *pdev)
 
 	if (false)
 		;
-#if defined(CONFIG_ARCH_OMAP3430)
-	else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+	else if (omap3_has_iva()) {
 		list = omap3_mboxes;
 
 		list[0]->irq = platform_get_irq_byname(pdev, "dsp");

arch/arm/mach-omap2/mailbox.c static int __devinit omap2_mbox_probe(struct · line 410

Quoted 10 lines
arch/arm/mach-omap2/mailbox.c +6 -2
 	}
 #endif
-#if defined(CONFIG_ARCH_OMAP2420)
-	else if (cpu_is_omap2420()) {
+#if defined(CONFIG_ARCH_OMAP2)
+	else if (cpu_is_omap2430()) {
+		list = omap2_mboxes;
+
+		list[0]->irq = platform_get_irq_byname(pdev, "dsp");
+	} else if (cpu_is_omap2420()) {

Isn't both 2430 and 2420 doing the exact same?

If yes, How about just doing:

	else if (cpu_is_omap2430() || cpu_is_omap2420()) {
Quoted 3 lines
arch/arm/mach-omap2/mailbox.c +0 -0
 		list = omap2_mboxes;
 

list[0]->irq = platform_get_irq_byname(pdev, "dsp");

Regards,
Sergio

Quoted 7 lines

--
1.7.1

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

#2 lore raw

Hi Sergio,

Quoted 2 lines · Sergio

Hi Omar,

Quoted 1 line

...

Quoted 9 lines

arch/arm/mach-omap2/mailbox.c static int __devinit omap2_mbox_probe(struct platform_device *pdev) · line 409

Quoted 6 lines
arch/arm/mach-omap2/mailbox.c +6 -0
+#if defined(CONFIG_ARCH_OMAP2)
+	else if (cpu_is_omap2430()) {
+		list = omap2_mboxes;
+
+		list[0]->irq = platform_get_irq_byname(pdev, "dsp");
+	} else if (cpu_is_omap2420()) {

Isn't both 2430 and 2420 doing the exact same?

Code is not the same, it is 2 line which apply for both but couldn't find an easy way of making them share the request for dsp mailbox without changing more code, perhaps a macro to detect if omap2 and then a nested if for the 2420 case, but since HWMOD should handle it better, I left it as is.

As the code previous to reorganization treated 2430 has a user with one single mailbox (same as omap3) I added the code to at least detect it, 2420 has 2 mailboxes one for iva and other for the dsp. From the diagrams for OMAP2430[1] and OMAP2420[2], it made sense as in the later both dsp and iva seem to be separated entities; unfortunately I don't have the hardware to test on any of them.

The patched code should look like:

#if defined(CONFIG_ARCH_OMAP2)
        else if (cpu_is_omap2430()) {
                list = omap2_mboxes;

                list[0]->irq = platform_get_irq_byname(pdev, "dsp");
        } else if (cpu_is_omap2420()) {
                list = omap2_mboxes;

                list[0]->irq = platform_get_irq_byname(pdev, "dsp");
                list[1]->irq = platform_get_irq_byname(pdev, "iva");
        }

#endif

Regards,

Omar

---

[1] http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?contentId=4672&navigationId=12609&templateId=6123
[2] http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?templateId=6123&navigationId=11990&contentId=4671

#3 lore raw

Hi Omar,

Quoted 50 lines

-----Original Message-----
From: Ramirez Luna, Omar
Sent: Thursday, September 23, 2010 11:12 AM
To: Aguirre, Sergio; Tony Lindgren; Hiroshi DOYU; Felipe Contreras; Anna, Suman; [email protected]
Subject: RE: [RFC] omap: mailbox: fix detection for previously supported chips

Hi Sergio,

Quoted 2 lines · Sergio

Hi Omar,

Quoted 1 line

...

Quoted 9 lines

arch/arm/mach-omap2/mailbox.c static int __devinit omap2_mbox_probe(struct platform_device *pdev) · line 409

Quoted 6 lines
arch/arm/mach-omap2/mailbox.c +6 -0
+#if defined(CONFIG_ARCH_OMAP2)
+	else if (cpu_is_omap2430()) {
+		list = omap2_mboxes;
+
+		list[0]->irq = platform_get_irq_byname(pdev, "dsp");
+	} else if (cpu_is_omap2420()) {

Isn't both 2430 and 2420 doing the exact same?

Code is not the same, it is 2 line which apply for both but couldn't find an easy way of making them share the request for dsp mailbox without changing more code, perhaps a macro to detect if omap2 and then a nested if for the 2420 case, but since HWMOD should handle it better, I left it as is.

As the code previous to reorganization treated 2430 has a user with one single mailbox (same as omap3) I added the code to at least detect it, 2420 has 2 mailboxes one for iva and other for the dsp. From the diagrams for OMAP2430[1] and OMAP2420[2], it made sense as in the later both dsp and iva seem to be separated entities; unfortunately I don't have the hardware to test on any of them.

The patched code should look like:

#if defined(CONFIG_ARCH_OMAP2)
        else if (cpu_is_omap2430()) {
                list = omap2_mboxes;

                list[0]->irq = platform_get_irq_byname(pdev, "dsp");
        } else if (cpu_is_omap2420()) {
                list = omap2_mboxes;

                list[0]->irq = platform_get_irq_byname(pdev, "dsp");
                list[1]->irq = platform_get_irq_byname(pdev, "iva");
        }
Quoted 1 line

#endif

Ok, I understand.

I guess I missed to see the second element in the list for acquiring IVA irq.

Thanks for the explanation.

Regards,
Sergio

Quoted 13 lines

Regards,

Omar

---

[1]
http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?contentId=467
2&navigationId=12609&templateId=6123
[2]
http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?templateId=61
23&navigationId=11990&contentId=4671

#4 lore raw
In reply to Ramirez Luna, Omar
Quoted 1 line · Omar

Code is not the same, it is 2 line which apply for both but couldn't find an easy way of making them share the request for dsp mailbox without changing more code, perhaps a macro to detect if omap2 and then a nested if for the 2420 case, but since HWMOD should handle it better, I left it as is.

I sent some patches to migrate to hwmod, at least it was working on OMAP3, somebody would need to fill the values for OMAP2. Would you like me to rebase and send them again?

Signature · 1 line
Felipe Contreras
#5 lore raw
Quoted 8 lines · Felipe Contreras
Quoted 5 lines · Omar

Code is not the same, it is 2 line which apply for both but couldn't find an easy way of making them share the request for dsp mailbox without changing more code, perhaps a macro to detect if omap2 and then a nested if for the 2420 case, but since HWMOD should handle it better, I left it as is.

Quoted 4 lines

I sent some patches to migrate to hwmod, at least it was working on OMAP3, somebody would need to fill the values for OMAP2. Would you like me to rebase and send them again?

Yes, I just found them, I can take care of the rebase if you don't beat me to it.

Regards,

Omar

#6 lore raw
In reply to Omar Ramirez Luna
Quoted 17 lines · Omar

Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.

---
- Testing was made under 3630 and 3430 boards.
- Given that 2430 uses similar initialization than OMAP3, changes to handle this case was added to the patch.
- HWMOD adaptation hopefully should solve this mess, but as of now mailbox should work as before at least.

 arch/arm/mach-omap2/mailbox.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/mailbox.c index 42dbfa4..26d6fb0 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c

arch/arm/mach-omap2/mailbox.c static int __devinit omap2_mbox_probe(struct · line 399

Quoted 8 lines
arch/arm/mach-omap2/mailbox.c +2 -2
@@ -394,15 +394,19 @@ static int __devinit omap2_mbox_probe(struct
 platform_device *pdev) 
 
 	if (false)
 		;
-#if defined(CONFIG_ARCH_OMAP3430)
-	else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+	else if (omap3_has_iva()) {

Hmm, seems omap3_has_ ##feat are only available for built-in and not module configurations, this patch is not so good after all since it throws:

ERROR: "omap3_features" [arch/arm/mach-omap2/mailbox_mach.ko] undefined!

Regards,

Omar

#7 lore raw
Quoted 29 lines · Omar
Quoted 17 lines · Omar

Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.

---
- Testing was made under 3630 and 3430 boards.
- Given that 2430 uses similar initialization than OMAP3, changes to handle this case was added to the patch.
- HWMOD adaptation hopefully should solve this mess, but as of now mailbox should work as before at least.

 arch/arm/mach-omap2/mailbox.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/mailbox.c index 42dbfa4..26d6fb0 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c

Review static int __devinit omap2_mbox_probe(struct · line 399

Quoted 8 lines
(quoted diff) +2 -2
@@ -394,15 +394,19 @@ static int __devinit omap2_mbox_probe(struct
 platform_device *pdev) 
 
 	if (false)
 		;
-#if defined(CONFIG_ARCH_OMAP3430)
-	else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+	else if (omap3_has_iva()) {

Hmm, seems omap3_has_ ##feat are only available for built-in and not module configurations, this patch is not so good after all since it throws:

Quoted 1 line

ERROR: "omap3_features" [arch/arm/mach-omap2/mailbox_mach.ko] undefined!

Well, feature detection certainly should be available to modules.

How about proposing a simple fix for this. Something like the following (untested) should work, since the individual omap3_has_* checks are static inlines.

Kevin

arch/arm/mach-omap2/id.c +1 -0
index 9a879f9..a8c6d19 100644
@@ -31,6 +31,7 @@ static struct omap_chip_id omap_chip;
 static unsigned int omap_revision;
 
 u32 omap3_features;
+EXPORT_SYMBOL(omap3_features);
 
 unsigned int omap_rev(void)
 {
#8 lore raw
Quoted 33 lines · Kevin Hilman
Quoted 31 lines · Omar
Quoted 17 lines · Omar

Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.

---
- Testing was made under 3630 and 3430 boards.
- Given that 2430 uses similar initialization than OMAP3, changes to handle this case was added to the patch.
- HWMOD adaptation hopefully should solve this mess, but as of now mailbox should work as before at least.

 arch/arm/mach-omap2/mailbox.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/mailbox.c index 42dbfa4..26d6fb0 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c

Review static int __devinit omap2_mbox_probe(struct · line 399

Quoted 8 lines
(quoted diff) +2 -2
@@ -394,15 +394,19 @@ static int __devinit omap2_mbox_probe(struct
 platform_device *pdev) 
 
 	if (false)
 		;
-#if defined(CONFIG_ARCH_OMAP3430)
-	else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+	else if (omap3_has_iva()) {

Hmm, seems omap3_has_ ##feat are only available for built-in and not module configurations, this patch is not so good after all since it throws:

Quoted 8 lines
Quoted 2 lines

ERROR: "omap3_features" [arch/arm/mach-omap2/mailbox_mach.ko] undefined!

Well, feature detection certainly should be available to modules.

How about proposing a simple fix for this. Something like the following (untested) should work, since the individual omap3_has_* checks are static inlines.

Ok great, I wasn't sure if exporting this variable as a symbol was desired. Will try and resend.

Regards,

Omar