public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] omap: mailbox: fix detection for previously supported chips
@ 2010-09-23  0:21 Omar Ramirez Luna
  2010-09-23 12:56 ` Aguirre, Sergio
  2010-09-24  0:08 ` Ramirez Luna, Omar
  0 siblings, 2 replies; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-09-23  0:21 UTC (permalink / raw)
  To: Tony Lindgren, Hiroshi DOYU, Felipe Contreras, Suman Anna,
	linux-omap
  Cc: Omar Ramirez Luna

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

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
- 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(-)

diff --git a/arch/arm/mach-omap2/mailbox.c 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
@@ -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");
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-23  0:21 [RFC] omap: mailbox: fix detection for previously supported chips Omar Ramirez Luna
@ 2010-09-23 12:56 ` Aguirre, Sergio
  2010-09-23 16:11   ` Ramirez Luna, Omar
  2010-09-24  0:08 ` Ramirez Luna, Omar
  1 sibling, 1 reply; 9+ messages in thread
From: Aguirre, Sergio @ 2010-09-23 12:56 UTC (permalink / raw)
  To: Tony Lindgren, Hiroshi DOYU, Felipe Contreras,
	"Anna, Suman" <s-a>
  Cc: Ramirez Luna, Omar

Hi Omar,

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Omar Ramirez Luna
> Sent: Wednesday, September 22, 2010 7:22 PM
> To: Tony Lindgren; Hiroshi DOYU; Felipe Contreras; Anna, Suman; linux-
> omap@vger.kernel.org
> 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.
> 
> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
> ---
> - 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(-)
> 
> diff --git a/arch/arm/mach-omap2/mailbox.c 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
> @@ -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()) {

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

If yes, How about just doing:

	else if (cpu_is_omap2430() || cpu_is_omap2420()) {

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

Regards,
Sergio

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-23 12:56 ` Aguirre, Sergio
@ 2010-09-23 16:11   ` Ramirez Luna, Omar
  2010-09-23 16:50     ` Aguirre, Sergio
  2010-09-24  9:49     ` Felipe Contreras
  0 siblings, 2 replies; 9+ messages in thread
From: Ramirez Luna, Omar @ 2010-09-23 16:11 UTC (permalink / raw)
  To: Aguirre, Sergio, Tony Lindgren, Hiroshi DOYU, Felipe Contreras,
	Anna, Suman

Hi Sergio,

Aguirre, Sergio wrote:
> Hi Omar,
>> 
...
>> +#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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-23 16:11   ` Ramirez Luna, Omar
@ 2010-09-23 16:50     ` Aguirre, Sergio
  2010-09-24  9:49     ` Felipe Contreras
  1 sibling, 0 replies; 9+ messages in thread
From: Aguirre, Sergio @ 2010-09-23 16:50 UTC (permalink / raw)
  To: Ramirez Luna, Omar, Tony Lindgren, Hiroshi DOYU, Felipe Contreras,
	"Anna, Suman" <s-a>

Hi Omar,

> -----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; linux-omap@vger.kernel.org
> Subject: RE: [RFC] omap: mailbox: fix detection for previously supported
> chips
> 
> Hi Sergio,
> 
> Aguirre, Sergio wrote:
> > Hi Omar,
> >>
> ...
> >> +#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

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

> 
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-23  0:21 [RFC] omap: mailbox: fix detection for previously supported chips Omar Ramirez Luna
  2010-09-23 12:56 ` Aguirre, Sergio
@ 2010-09-24  0:08 ` Ramirez Luna, Omar
  2010-09-24  0:30   ` Kevin Hilman
  1 sibling, 1 reply; 9+ messages in thread
From: Ramirez Luna, Omar @ 2010-09-24  0:08 UTC (permalink / raw)
  To: Hiroshi DOYU, Felipe Contreras, Anna, Suman,
	linux-omap@vger.kernel.org, Tony

Ramirez Luna, Omar wrote:
> Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.
> 
> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
> ---
> - 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(-)
> 
> diff --git a/arch/arm/mach-omap2/mailbox.c
> 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
> @@ -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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-24  0:08 ` Ramirez Luna, Omar
@ 2010-09-24  0:30   ` Kevin Hilman
  2010-09-24  0:39     ` Ramirez Luna, Omar
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Hilman @ 2010-09-24  0:30 UTC (permalink / raw)
  To: Ramirez Luna, Omar
  Cc: Hiroshi DOYU, Felipe Contreras, Anna, Suman,
	linux-omap@vger.kernel.org, Tony Lindgren

"Ramirez Luna, Omar" <omar.ramirez@ti.com> writes:

> Ramirez Luna, Omar wrote:
>> Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.
>> 
>> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
>> ---
>> - 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(-)
>> 
>> diff --git a/arch/arm/mach-omap2/mailbox.c
>> 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
>> @@ -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!

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


diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9a879f9..a8c6d19 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -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)
 {


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-24  0:30   ` Kevin Hilman
@ 2010-09-24  0:39     ` Ramirez Luna, Omar
  0 siblings, 0 replies; 9+ messages in thread
From: Ramirez Luna, Omar @ 2010-09-24  0:39 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Hiroshi DOYU, Felipe Contreras, Anna, Suman,
	linux-omap@vger.kernel.org, Tony Lindgren

Kevin Hilman wrote:
> "Ramirez Luna, Omar" <omar.ramirez@ti.com> writes:
> 
>> Ramirez Luna, Omar wrote:
>>> Fix the mailbox support detection for OMAP3630, 3530/25 and 2430.
>>> 
>>> Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
>>> ---
>>> - 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(-)
>>> 
>>> diff --git a/arch/arm/mach-omap2/mailbox.c
>>> 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
>>> @@ -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! 
> 
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-23 16:11   ` Ramirez Luna, Omar
  2010-09-23 16:50     ` Aguirre, Sergio
@ 2010-09-24  9:49     ` Felipe Contreras
  2010-09-24 14:11       ` Ramirez Luna, Omar
  1 sibling, 1 reply; 9+ messages in thread
From: Felipe Contreras @ 2010-09-24  9:49 UTC (permalink / raw)
  To: Ramirez Luna, Omar
  Cc: Aguirre, Sergio, Tony Lindgren, Hiroshi DOYU, Anna, Suman,
	linux-omap@vger.kernel.org

On Thu, Sep 23, 2010 at 7:11 PM, Ramirez Luna, Omar <omar.ramirez@ti.com> wrote:
> 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?

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [RFC] omap: mailbox: fix detection for previously supported chips
  2010-09-24  9:49     ` Felipe Contreras
@ 2010-09-24 14:11       ` Ramirez Luna, Omar
  0 siblings, 0 replies; 9+ messages in thread
From: Ramirez Luna, Omar @ 2010-09-24 14:11 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: Aguirre, Sergio, Tony Lindgren, Hiroshi DOYU, Anna, Suman,
	linux-omap@vger.kernel.org

Felipe Contreras wrote:
> On Thu, Sep 23, 2010 at 7:11 PM, Ramirez Luna, Omar
> <omar.ramirez@ti.com> wrote: 
>> 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?  
> 

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

Regards,

Omar

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-09-24 14:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23  0:21 [RFC] omap: mailbox: fix detection for previously supported chips Omar Ramirez Luna
2010-09-23 12:56 ` Aguirre, Sergio
2010-09-23 16:11   ` Ramirez Luna, Omar
2010-09-23 16:50     ` Aguirre, Sergio
2010-09-24  9:49     ` Felipe Contreras
2010-09-24 14:11       ` Ramirez Luna, Omar
2010-09-24  0:08 ` Ramirez Luna, Omar
2010-09-24  0:30   ` Kevin Hilman
2010-09-24  0:39     ` Ramirez Luna, Omar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox