mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* GPIO Support on pcm043
@ 2011-05-20 12:07 Tim Sander
  2011-05-20 13:14 ` Eric Bénard
  2011-05-23  7:06 ` Sascha Hauer
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Sander @ 2011-05-20 12:07 UTC (permalink / raw)
  To: barebox

Hi

I just tried (for i in `seq 0 96`)
gpio_set_direction $i 1
and 
gpio_set_direction $i 0

on a barebox for pcm043 with gpio support compiled in.
But no LED was lighting up. 

Is there some obvious error on my side or is there no gpio
support for pcm043? At least there seems to be support for
the gpio ports on imx?

Any hints?
Thanks
Tim

Hottinger Baldwin Messtechnik GmbH, Im Tiefen See 45, 64293 Darmstadt, Germany | www.hbm.com 

Registered as GmbH (German limited liability corporation) in the commercial register at the local court of Darmstadt, HRB 1147  
Company domiciled in Darmstadt | CEO: Andreas Huellhorst | Chairman of the board: James Charles Webster

Als Gesellschaft mit beschraenkter Haftung eingetragen im Handelsregister des Amtsgerichts Darmstadt unter HRB 1147 
Sitz der Gesellschaft: Darmstadt | Geschaeftsfuehrung: Andreas Huellhorst | Aufsichtsratsvorsitzender: James Charles Webster

The information in this email is confidential. It is intended solely for the addressee. If you are not the intended recipient, please let me know and delete this email.

Die in dieser E-Mail enthaltene Information ist vertraulich und lediglich fur den Empfaenger bestimmt. Sollten Sie nicht der eigentliche Empfaenger sein, informieren Sie mich bitte kurz und loeschen diese E-Mail.


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-20 12:07 GPIO Support on pcm043 Tim Sander
@ 2011-05-20 13:14 ` Eric Bénard
  2011-05-20 13:30   ` Tim Sander
  2011-05-23  7:06 ` Sascha Hauer
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Bénard @ 2011-05-20 13:14 UTC (permalink / raw)
  To: Tim Sander; +Cc: barebox

Hi Tim,

On 20/05/2011 14:07, Tim Sander wrote:
> I just tried (for i in `seq 0 96`)
> gpio_set_direction $i 1
> and
> gpio_set_direction $i 0
>
> on a barebox for pcm043 with gpio support compiled in.
> But no LED was lighting up.
>
> Is there some obvious error on my side or is there no gpio
> support for pcm043? At least there seems to be support for
> the gpio ports on imx?
>
> Any hints?

you first need to configure the mux of the pins to GPIO mode, then you can use 
them as gpio.

Eric

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-20 13:14 ` Eric Bénard
@ 2011-05-20 13:30   ` Tim Sander
  2011-05-20 13:34     ` Eric Bénard
  2011-05-23  7:12     ` Sascha Hauer
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Sander @ 2011-05-20 13:30 UTC (permalink / raw)
  To: Eric Bénard; +Cc: barebox

Hi Eric

Thanks for your answer
> > Is there some obvious error on my side or is there no gpio
> > support for pcm043? At least there seems to be support for
> > the gpio ports on imx?
> > Any hints?
> 
> you first need to configure the mux of the pins to GPIO mode, then you can
> use them as gpio.
After tripping into that trap multiple times, i've already checked that, but
forgot to mention it:
static struct pad_desc pcm043_pads[] = {
	...
        MX35_PAD_D3_CLS__GPIO1_4,
        MX35_PAD_D3_SPL__GPIO1_5,
	...

These should be the gpio nrs 4 and 5 which means that
gpio_set_direction 4 1
or
gpio_set_direction 4 0
should light up the led.

The led is working under linux so it's some problem with the gpio setup.

Thanks
Tim

Hottinger Baldwin Messtechnik GmbH, Im Tiefen See 45, 64293 Darmstadt, Germany | www.hbm.com 

Registered as GmbH (German limited liability corporation) in the commercial register at the local court of Darmstadt, HRB 1147  
Company domiciled in Darmstadt | CEO: Andreas Huellhorst | Chairman of the board: James Charles Webster

Als Gesellschaft mit beschraenkter Haftung eingetragen im Handelsregister des Amtsgerichts Darmstadt unter HRB 1147 
Sitz der Gesellschaft: Darmstadt | Geschaeftsfuehrung: Andreas Huellhorst | Aufsichtsratsvorsitzender: James Charles Webster

The information in this email is confidential. It is intended solely for the addressee. If you are not the intended recipient, please let me know and delete this email.

Die in dieser E-Mail enthaltene Information ist vertraulich und lediglich für den Empfaenger bestimmt. Sollten Sie nicht der eigentliche Empfaenger sein, informieren Sie mich bitte kurz und loeschen diese E-Mail.


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-20 13:30   ` Tim Sander
@ 2011-05-20 13:34     ` Eric Bénard
  2011-05-20 14:16       ` Eric Bénard
  2011-05-23  7:12     ` Sascha Hauer
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Bénard @ 2011-05-20 13:34 UTC (permalink / raw)
  To: Tim Sander; +Cc: barebox

On 20/05/2011 15:30, Tim Sander wrote:
> Hi Eric
>
> Thanks for your answer
>>> Is there some obvious error on my side or is there no gpio
>>> support for pcm043? At least there seems to be support for
>>> the gpio ports on imx?
>>> Any hints?
>>
>> you first need to configure the mux of the pins to GPIO mode, then you can
>> use them as gpio.
> After tripping into that trap multiple times, i've already checked that, but
> forgot to mention it:
> static struct pad_desc pcm043_pads[] = {
> 	...
>          MX35_PAD_D3_CLS__GPIO1_4,
>          MX35_PAD_D3_SPL__GPIO1_5,
> 	...
>
> These should be the gpio nrs 4 and 5 which means that
> gpio_set_direction 4 1
> or
> gpio_set_direction 4 0
> should light up the led.
>
if the led is wired on gpio1_5 it should.

Eric

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-20 13:34     ` Eric Bénard
@ 2011-05-20 14:16       ` Eric Bénard
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Bénard @ 2011-05-20 14:16 UTC (permalink / raw)
  To: barebox

Hi,

On 20/05/2011 15:34, Eric Bénard wrote:
> On 20/05/2011 15:30, Tim Sander wrote:
>> Hi Eric
>>
>> Thanks for your answer
>>>> Is there some obvious error on my side or is there no gpio
>>>> support for pcm043? At least there seems to be support for
>>>> the gpio ports on imx?
>>>> Any hints?
>>>
>>> you first need to configure the mux of the pins to GPIO mode, then you can
>>> use them as gpio.
>> After tripping into that trap multiple times, i've already checked that, but
>> forgot to mention it:
>> static struct pad_desc pcm043_pads[] = {
>> ...
>> MX35_PAD_D3_CLS__GPIO1_4,
>> MX35_PAD_D3_SPL__GPIO1_5,
>> ...
>>
>> These should be the gpio nrs 4 and 5 which means that
>> gpio_set_direction 4 1
>> or
>> gpio_set_direction 4 0
>> should light up the led.
>>
> if the led is wired on gpio1_5 it should.
>
I mean 1_4 here

Eric


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-20 12:07 GPIO Support on pcm043 Tim Sander
  2011-05-20 13:14 ` Eric Bénard
@ 2011-05-23  7:06 ` Sascha Hauer
  1 sibling, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2011-05-23  7:06 UTC (permalink / raw)
  To: Tim Sander; +Cc: barebox

Hi Tim,

On Fri, May 20, 2011 at 02:07:08PM +0200, Tim Sander wrote:
> Hi
> 
> I just tried (for i in `seq 0 96`)
> gpio_set_direction $i 1
> and 
> gpio_set_direction $i 0

I suppose the actual command you used is gpio_direction_output, right?
there is no gpio_set_direction command.

I just checked that as of latest master the LED on the baseboard
connected to gpio2_6 works with:

gpio_direction_output 38 0
gpio_direction_output 38 1

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-20 13:30   ` Tim Sander
  2011-05-20 13:34     ` Eric Bénard
@ 2011-05-23  7:12     ` Sascha Hauer
  2011-05-23 10:20       ` Tim Sander
  1 sibling, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2011-05-23  7:12 UTC (permalink / raw)
  To: Tim Sander; +Cc: barebox

On Fri, May 20, 2011 at 03:30:19PM +0200, Tim Sander wrote:
> Hi Eric
> 
> Thanks for your answer
> > > Is there some obvious error on my side or is there no gpio
> > > support for pcm043? At least there seems to be support for
> > > the gpio ports on imx?
> > > Any hints?
> > 
> > you first need to configure the mux of the pins to GPIO mode, then you can
> > use them as gpio.
> After tripping into that trap multiple times, i've already checked that, but
> forgot to mention it:
> static struct pad_desc pcm043_pads[] = {
> 	...
>         MX35_PAD_D3_CLS__GPIO1_4,
>         MX35_PAD_D3_SPL__GPIO1_5,
> 	...

Have you checked that you chose the correct iomux setup? These
particular pins can be routed to three different pads each:

#define MX35_PAD_CAPTURE__GPIO1_4	IOMUX_PAD(0x328, 0x004, 5, 0x850, 0, NO_PAD_CTRL)
#define MX35_PAD_SCKR__GPIO1_4		IOMUX_PAD(0x584, 0x140, 5, 0x850, 1, NO_PAD_CTRL)
#define MX35_PAD_D3_CLS__GPIO1_4	IOMUX_PAD(0x68c, 0x228, 5, 0x850, 2, NO_PAD_CTRL)
#define MX35_PAD_COMPARE__GPIO1_5	IOMUX_PAD(0x32c, 0x008, 5, 0x854, 0, NO_PAD_CTRL)
#define MX35_PAD_FSR__GPIO1_5		IOMUX_PAD(0x588, 0x144, 5, 0x854, 1, NO_PAD_CTRL)
#define MX35_PAD_D3_SPL__GPIO1_5	IOMUX_PAD(0x690, 0x22c, 5, 0x854, 2, NO_PAD_CTRL)

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: GPIO Support on pcm043
  2011-05-23  7:12     ` Sascha Hauer
@ 2011-05-23 10:20       ` Tim Sander
  0 siblings, 0 replies; 8+ messages in thread
From: Tim Sander @ 2011-05-23 10:20 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi

Thanks for your help guys! I just noticed i had two mux entries per pad. The 
last had overriden my first settings. Its now working as intended, sorry for 
the noise.

Best regards
Tim

Hottinger Baldwin Messtechnik GmbH, Im Tiefen See 45, 64293 Darmstadt, Germany | www.hbm.com 

Registered as GmbH (German limited liability corporation) in the commercial register at the local court of Darmstadt, HRB 1147  
Company domiciled in Darmstadt | CEO: Andreas Huellhorst | Chairman of the board: James Charles Webster

Als Gesellschaft mit beschraenkter Haftung eingetragen im Handelsregister des Amtsgerichts Darmstadt unter HRB 1147 
Sitz der Gesellschaft: Darmstadt | Geschaeftsfuehrung: Andreas Huellhorst | Aufsichtsratsvorsitzender: James Charles Webster

The information in this email is confidential. It is intended solely for the addressee. If you are not the intended recipient, please let me know and delete this email.

Die in dieser E-Mail enthaltene Information ist vertraulich und lediglich für den Empfaenger bestimmt. Sollten Sie nicht der eigentliche Empfaenger sein, informieren Sie mich bitte kurz und loeschen diese E-Mail.


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2011-05-23 10:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 12:07 GPIO Support on pcm043 Tim Sander
2011-05-20 13:14 ` Eric Bénard
2011-05-20 13:30   ` Tim Sander
2011-05-20 13:34     ` Eric Bénard
2011-05-20 14:16       ` Eric Bénard
2011-05-23  7:12     ` Sascha Hauer
2011-05-23 10:20       ` Tim Sander
2011-05-23  7:06 ` Sascha Hauer

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