All of lore.kernel.org
 help / color / mirror / Atom feed
* how to use mcbsp for i2s?
@ 2009-04-01 18:29 Ernesto Torres
  2009-04-01 18:40 ` Mark Brown
  2009-04-02  7:48 ` Jarkko Nikula
  0 siblings, 2 replies; 8+ messages in thread
From: Ernesto Torres @ 2009-04-01 18:29 UTC (permalink / raw)
  To: alsa-devel

I'm currently working in adding an external codec to the beagleboard, so far
the i2c control part is functional, now i want to use mcbsp3 to provide i2s
transfers

Is there any way to test the mcbsp to validate the connection?

Also, I've done little modifications to the omap3beagle.c to change from
mcbsp2 to mcbsp3, can someone validate this is correct?

In:
static int __init omap3beagle_soc_init(void)

I changed to:
*(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 2; /* McBSP3 */

It was:
*(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */

Is this correct? Or it should be changed in other places too?


Thanks

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

* Re: how to use mcbsp for i2s?
  2009-04-01 18:29 how to use mcbsp for i2s? Ernesto Torres
@ 2009-04-01 18:40 ` Mark Brown
  2009-04-02  7:48 ` Jarkko Nikula
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2009-04-01 18:40 UTC (permalink / raw)
  To: Ernesto Torres; +Cc: alsa-devel

On Wed, Apr 01, 2009 at 12:29:02PM -0600, Ernesto Torres wrote:
> I'm currently working in adding an external codec to the beagleboard, so far
> the i2c control part is functional, now i want to use mcbsp3 to provide i2s
> transfers

> Is there any way to test the mcbsp to validate the connection?

The easiest thing is often to use a scope to check that clocks and data
are present on the relevant lines.

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

* Re: how to use mcbsp for i2s?
  2009-04-01 18:29 how to use mcbsp for i2s? Ernesto Torres
  2009-04-01 18:40 ` Mark Brown
@ 2009-04-02  7:48 ` Jarkko Nikula
  2009-04-02 10:20   ` Jarkko Nikula
  1 sibling, 1 reply; 8+ messages in thread
From: Jarkko Nikula @ 2009-04-02  7:48 UTC (permalink / raw)
  To: Ernesto Torres; +Cc: alsa-devel

On Wed, Apr 1, 2009 at 9:29 PM, Ernesto Torres <skullmate@gmail.com> wrote:

> I'm currently working in adding an external codec to the beagleboard, so
> far
> the i2c control part is functional, now i want to use mcbsp3 to provide i2s
> transfers
>
> Is there any way to test the mcbsp to validate the connection?
>
> Also, I've done little modifications to the omap3beagle.c to change from
> mcbsp2 to mcbsp3, can someone validate this is correct?
>
> In:
> static int __init omap3beagle_soc_init(void)
>
> I changed to:
> *(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 2; /* McBSP3 */
>
> It was:
> *(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */
>
> Is this correct? Or it should be changed in other places too?
>
> It is basically enough as well as setting correct DAI and clocking
configuration (if needed)
in omap3beagle_hw_params.

But by default McBSP1 and 3 which available in Beale pin header are muxed to
GPIO
so you need to mux those pins for McBSP by the bootloader and with
linux-omap
kernel multiplexing support.

I may have a hack patch somewhere... I'll try to find it and post it here
for reference.


Jarkko

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

* Re: how to use mcbsp for i2s?
  2009-04-02  7:48 ` Jarkko Nikula
@ 2009-04-02 10:20   ` Jarkko Nikula
  2009-04-02 16:56     ` Jarkko Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Jarkko Nikula @ 2009-04-02 10:20 UTC (permalink / raw)
  To: Ernesto Torres; +Cc: alsa-devel

On Thu, Apr 2, 2009 at 10:48 AM, Jarkko Nikula <jhnikula@gmail.com> wrote:

>
> But by default McBSP1 and 3 which available in Beale pin header are muxed
> to GPIO
> so you need to mux those pins for McBSP by the bootloader and with
> linux-omap
> kernel multiplexing support.
>
> I may have a hack patch somewhere... I'll try to find it and post it here
> for reference.
>
> Grrr... cannot find the hack, I'm too keen to delete temporary hacks. I was
pretty sure I had
it somewhere.

Basically it was adding necessary pin multiplexing configuration into
arch/arm/plat-omap/include/mach/mux.h and arch/arm/mach-omap2/mux.c and
then using omap_cfg_reg(...) in omap3beagle.c to change pin configuration
from
GPIOs to McBPS[1 | 3] pins.


Jarkko

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

* Re: how to use mcbsp for i2s?
  2009-04-02 10:20   ` Jarkko Nikula
@ 2009-04-02 16:56     ` Jarkko Nikula
  2009-04-02 17:27       ` Ernesto Torres
  0 siblings, 1 reply; 8+ messages in thread
From: Jarkko Nikula @ 2009-04-02 16:56 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: Ernesto Torres, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 829 bytes --]

On Thu, 2 Apr 2009 13:20:36 +0300
Jarkko Nikula <jhnikula@gmail.com> wrote:

> > Grrr... cannot find the hack, I'm too keen to delete temporary
> > hacks. I was
> pretty sure I had
> it somewhere.
> 
> Basically it was adding necessary pin multiplexing configuration into
> arch/arm/plat-omap/include/mach/mux.h and arch/arm/mach-omap2/mux.c
> and then using omap_cfg_reg(...) in omap3beagle.c to change pin
> configuration from
> GPIOs to McBPS[1 | 3] pins.
> 
Yes, I found it. Hack attached :-)

Now I don't have here Beagle to test but hack still applies on top of
linux-omap. Then you will need CONFIG_OMAP_MUX=y and following lines
into omap3beagle.c or board-omap3beagle.c.

omap_cfg_reg(AF6_3430_MCBSP3_DX);
omap_cfg_reg(AE6_3430_MCBSP3_DR);
omap_cfg_reg(AF5_3430_MCBSP3_CLKX);
omap_cfg_reg(AE5_3430_MCBSP3_FSX);


Jarkko

[-- Attachment #2: 0001-ARM-OMAP-Hack-add-some-OMAP3-McBSP-muxing.patch --]
[-- Type: text/x-diff, Size: 3392 bytes --]

>From 01d684991c9683383dd78df61328e67c6f593ad5 Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula@nokia.com>
Date: Thu, 9 Oct 2008 15:28:02 +0300
Subject: [PATCH] ARM: OMAP: Hack add some OMAP3 McBSP muxing

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
---
 arch/arm/mach-omap2/mux.c             |   52 +++++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/mux.h |   29 ++++++++++++++++++
 2 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index dacb41f..1dff09e 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -261,6 +261,58 @@ static struct pin_config __initdata_or_module omap34xx_pins[] = {
  *		mux-mode | [active-mode | off-mode]
  */
 
+/* Primary McBSP multiplexing */
+MUX_CFG_34XX("Y21_3430_MCBSP1_CLKR", 0x18c,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AA21_3430_MCBSP1_FSR", 0x18e,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("Y21_3430_MCBSP1_DX", 0x190,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("U21_3430_MCBSP1_DR", 0x192,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("T21_3430_MCBSP1_CLKS", 0x194,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("K26_3430_MCBSP1_FSX", 0x196,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("W21_3430_MCBSP1_CLKX", 0x198,
+		OMAP34XX_MUX_MODE0)
+
+MUX_CFG_34XX("P21_3430_MCBSP2_FSX", 0x13c,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("N21_3430_MCBSP2_CLKX", 0x13e,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("R21_3430_MCBSP2_DR", 0x140,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("M21_3430_MCBSP2_DX", 0x142,
+		OMAP34XX_MUX_MODE0)
+
+MUX_CFG_34XX("AF6_3430_MCBSP3_DX", 0x16c,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AE6_3430_MCBSP3_DR", 0x16e,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AF5_3430_MCBSP3_CLKX", 0x170,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AE5_3430_MCBSP3_FSX", 0x172,
+		OMAP34XX_MUX_MODE0)
+
+MUX_CFG_34XX("AE1_3430_MCBSP4_CLKX", 0x184,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AD1_3430_MCBSP4_DR", 0x186,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AD2_3430_MCBSP4_DX", 0x188,
+		OMAP34XX_MUX_MODE0)
+MUX_CFG_34XX("AC1_3430_MCBSP4_FSX", 0x18a,
+		OMAP34XX_MUX_MODE0)
+
+MUX_CFG_34XX("AF10_3430_MCBSP5_CLKX", 0x5d8,
+		OMAP34XX_MUX_MODE1)
+MUX_CFG_34XX("AE11_3430_MCBSP5_DR", 0x5e4,
+		OMAP34XX_MUX_MODE1)
+MUX_CFG_34XX("AH9_3430_MCBSP5_FSX", 0x5e6,
+		OMAP34XX_MUX_MODE1)
+MUX_CFG_34XX("AF13_3430_MCBSP5_DX", 0x5e8,
+		OMAP34XX_MUX_MODE1)
+
 /* 34xx I2C */
 MUX_CFG_34XX("K21_34XX_I2C1_SCL", 0x1ba,
 		OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index f4362b8..c0cfa73 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -677,6 +677,35 @@ enum omap24xx_index {
 };
 
 enum omap34xx_index {
+	/* Primary McBSP multiplexing */
+	Y21_3430_MCBSP1_CLKR,
+	AA21_3430_MCBSP1_FSR,
+	Y21_3430_MCBSP1_DX,
+	U21_3430_MCBSP1_DR,
+	T21_3430_MCBSP1_CLKS,
+	K26_3430_MCBSP1_FSX,
+	W21_3430_MCBSP1_CLKX,
+
+	P21_3430_MCBSP2_FSX,
+	N21_3430_MCBSP2_CLKX,
+	R21_3430_MCBSP2_DR,
+	M21_3430_MCBSP2_DX,
+
+	AF6_3430_MCBSP3_DX,
+	AE6_3430_MCBSP3_DR,
+	AF5_3430_MCBSP3_CLKX,
+	AE5_3430_MCBSP3_FSX,
+
+	AE1_3430_MCBSP4_CLKX,
+	AD1_3430_MCBSP4_DR,
+	AD2_3430_MCBSP4_DX,
+	AC1_3430_MCBSP4_FSX,
+
+	AF10_3430_MCBSP5_CLKX,
+	AE11_3430_MCBSP5_DR,
+	AH9_3430_MCBSP5_FSX,
+	AF13_3430_MCBSP5_DX,
+
 	/* 34xx I2C */
 	K21_34XX_I2C1_SCL,
 	J21_34XX_I2C1_SDA,
-- 
1.5.6.5


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: how to use mcbsp for i2s?
  2009-04-02 16:56     ` Jarkko Nikula
@ 2009-04-02 17:27       ` Ernesto Torres
  2009-04-03 16:14         ` Ernesto Torres
  0 siblings, 1 reply; 8+ messages in thread
From: Ernesto Torres @ 2009-04-02 17:27 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: alsa-devel

thank you, I'll try it and let you know how it went

On Thu, Apr 2, 2009 at 10:56 AM, Jarkko Nikula <jhnikula@gmail.com> wrote:

> On Thu, 2 Apr 2009 13:20:36 +0300
> Jarkko Nikula <jhnikula@gmail.com> wrote:
>
> > > Grrr... cannot find the hack, I'm too keen to delete temporary
> > > hacks. I was
> > pretty sure I had
> > it somewhere.
> >
> > Basically it was adding necessary pin multiplexing configuration into
> > arch/arm/plat-omap/include/mach/mux.h and arch/arm/mach-omap2/mux.c
> > and then using omap_cfg_reg(...) in omap3beagle.c to change pin
> > configuration from
> > GPIOs to McBPS[1 | 3] pins.
> >
> Yes, I found it. Hack attached :-)
>
> Now I don't have here Beagle to test but hack still applies on top of
> linux-omap. Then you will need CONFIG_OMAP_MUX=y and following lines
> into omap3beagle.c or board-omap3beagle.c.
>
> omap_cfg_reg(AF6_3430_MCBSP3_DX);
> omap_cfg_reg(AE6_3430_MCBSP3_DR);
> omap_cfg_reg(AF5_3430_MCBSP3_CLKX);
> omap_cfg_reg(AE5_3430_MCBSP3_FSX);
>
>
> Jarkko
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>


-- 
___________
EhTd

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

* Re: how to use mcbsp for i2s?
  2009-04-02 17:27       ` Ernesto Torres
@ 2009-04-03 16:14         ` Ernesto Torres
  2009-04-04 14:39           ` Jarkko Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Ernesto Torres @ 2009-04-03 16:14 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: alsa-devel

Im getting this output from muxing:

MUX: setup AF6_3430_MCBSP3_DX (0xd800216c): 0x0004 ->
0x0000
MUX: setup AE6_3430_MCBSP3_DR (0xd800216e): 0x0004 ->
0x0000
MUX: setup AF5_3430_MCBSP3_CLKX (0xd8002170): 0x0004 ->
0x0000
MUX: setup AE5_3430_MCBSP3_FSX (0xd8002172): 0x0004 -> 0x0000

Is this correct?

On Thu, Apr 2, 2009 at 11:27 AM, Ernesto Torres <skullmate@gmail.com> wrote:

> thank you, I'll try it and let you know how it went
>
> On Thu, Apr 2, 2009 at 10:56 AM, Jarkko Nikula <jhnikula@gmail.com> wrote:
>
>> On Thu, 2 Apr 2009 13:20:36 +0300
>> Jarkko Nikula <jhnikula@gmail.com> wrote:
>>
>> > > Grrr... cannot find the hack, I'm too keen to delete temporary
>> > > hacks. I was
>> > pretty sure I had
>> > it somewhere.
>> >
>> > Basically it was adding necessary pin multiplexing configuration into
>> > arch/arm/plat-omap/include/mach/mux.h and arch/arm/mach-omap2/mux.c
>> > and then using omap_cfg_reg(...) in omap3beagle.c to change pin
>> > configuration from
>> > GPIOs to McBPS[1 | 3] pins.
>> >
>> Yes, I found it. Hack attached :-)
>>
>> Now I don't have here Beagle to test but hack still applies on top of
>> linux-omap. Then you will need CONFIG_OMAP_MUX=y and following lines
>> into omap3beagle.c or board-omap3beagle.c.
>>
>> omap_cfg_reg(AF6_3430_MCBSP3_DX);
>> omap_cfg_reg(AE6_3430_MCBSP3_DR);
>> omap_cfg_reg(AF5_3430_MCBSP3_CLKX);
>> omap_cfg_reg(AE5_3430_MCBSP3_FSX);
>>
>>
>> Jarkko
>>
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>>
>>
>
>
> --
> ___________
> EhTd
>
>


-- 
___________
EhTd

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

* Re: how to use mcbsp for i2s?
  2009-04-03 16:14         ` Ernesto Torres
@ 2009-04-04 14:39           ` Jarkko Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jarkko Nikula @ 2009-04-04 14:39 UTC (permalink / raw)
  To: Ernesto Torres; +Cc: alsa-devel

On Fri, 3 Apr 2009 10:14:45 -0600
Ernesto Torres <skullmate@gmail.com> wrote:

> Im getting this output from muxing:
> 
> MUX: setup AF6_3430_MCBSP3_DX (0xd800216c): 0x0004 ->
> 0x0000
> MUX: setup AE6_3430_MCBSP3_DR (0xd800216e): 0x0004 ->
> 0x0000
> MUX: setup AF5_3430_MCBSP3_CLKX (0xd8002170): 0x0004 ->
> 0x0000
> MUX: setup AE5_3430_MCBSP3_FSX (0xd8002172): 0x0004 -> 0x0000
> 
> Is this correct?
> 
It look likes since debug output says that the muxmode for those pins
are changed from mode 4 (gpio in this case) to 0 (McBSP3 pins in
this case).

Actually all of those pins are configured as outputs in muxing module
point of view but IRCC actually McBSP HW will set the direction
depending on its configuration. At least I didn't notice any
difference what was the muxing direction when I was playing with them
shortly some time ago.

-- 
Jarkko

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

end of thread, other threads:[~2009-04-04 14:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-01 18:29 how to use mcbsp for i2s? Ernesto Torres
2009-04-01 18:40 ` Mark Brown
2009-04-02  7:48 ` Jarkko Nikula
2009-04-02 10:20   ` Jarkko Nikula
2009-04-02 16:56     ` Jarkko Nikula
2009-04-02 17:27       ` Ernesto Torres
2009-04-03 16:14         ` Ernesto Torres
2009-04-04 14:39           ` Jarkko Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.