[beagleboard] Cannot set pins by overlay

2015-09-09 Thread bremenpl
Hello there,
I just got back to my BeagleBone Black and i have no idea why but I just 
cannot change a pin configuration using overlay nor through export. This is 
what I am trying to do:

I want to set P8_29 and P8_31 Pins to inputs with a pullup (0x37). here is 
my overlay:

/dts-v1/;
/plugin/;

/{
   compatible = "ti,beaglebone", "ti,beaglebone-black";
   part-number = "BB-AVRDUDE";
   version = "00A0";

   fragment@0 {
 target = <&am33xx_pinmux>;

 __overlay__ {
  ebb_example: BB-AVRDUDE {
pinctrl-single,pins = <
0x0E4 0x37  // P8_29, AVR #RST pin, Input Mode7 pullup
0x0D8 0x37  // P8_31, AVR #HWB pin, Input Mode7 pullup
  
   /* INPUT   GPIO(mode7) 0x27 pulldown, 0x37 pullup, 0x?f 
no pullup/down */
>;
  };
 };
   };

   fragment@1 {
target = <&ocp>;
__overlay__ {
gpio_helper {
compatible = "gpio-of-helper";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&ebb_example>;
};
};
};
};

Then I load the DTS and see in the list (last). HDMI is disabled:

 0: 54:PF--- 
 1: 55:PF--- 
 2: 56:PF--- 
 3: 57:PF--- 
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,NEOSEC-TINYLCD22
 8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-KEYS
 9: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-SPI1-2CS
10: ff:P-O-L Override Board Name,00A0,Override Manuf,am33xx_pwm
11: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-COOLER
12: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5
13: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BUZZER
14: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-W1
*15: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-AVRDUDE*


Dmesg says it was OK:

root@beaglebone:~# dmesg | grep BB-AVRDUDE
[  151.732517] bone-capemgr bone_capemgr.9: part_number 'BB-AVRDUDE', 
version 'N/A'
[  151.732633] bone-capemgr bone_capemgr.9: slot #15: 'Override Board 
Name,00A0,Override Manuf,BB-AVRDUDE'
[  151.732729] bone-capemgr bone_capemgr.9: slot #15: Requesting part 
number/version based 'BB-AVRDUDE-00A0.dtbo
[  151.732744] bone-capemgr bone_capemgr.9: slot #15: Requesting firmware 
'BB-AVRDUDE-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[  151.736445] bone-capemgr bone_capemgr.9: slot #15: dtbo 
'BB-AVRDUDE-00A0.dtbo' loaded; converting to live tree


Then I check the pins and they remain as they were in default:

root@beaglebone:~# cat $PINS | grep "pin 57"
pin 57 (44e108e4) 0027 pinctrl-single 
root@beaglebone:~# cat $PINS | grep "pin 54"
pin 54 (44e108d8) 002f pinctrl-single 


Did I forget something? I really cant think of anything. I would really 
apreciate all help here!

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-12-31 Thread Davide Picchi
@bremenpl

try removing the follwing part in your code:

test_input1 { 
gpio-name = "test_input1"; 
gpio = <&gpio3 23 0x00>;/* 
gpio4 is gpio3 */ 
input; 
count-rising-edge; 
count-falling-edge; 
}; 
  
test_input2 { 
gpio-name = "test_input2"; 
gpio = <&gpio1 10 0x00>;/* 
gpio4 is gpio3 */ 
input; 
count-rising-edge; 
count-falling-edge; 
};



and just leave the following part as it is:



   fragment@1 { 
target = <&ocp>; 
__overlay__ { 
gpio_helper { 
compatible = "gpio-of-helper"; 
status = "okay"; 
pinctrl-names = "default"; 
pinctrl-0 = <&ebb_example>;
 
}; 
}; };

...





Am Samstag, 12. September 2015 12:57:49 UTC+2 schrieb bremenpl:
>
> I also dont think that there is a device tree with this name. I will 
> however try you tips at mo day in the morning and let know here. Thank you 
> for help. 
>
>
> On September 11, 2015 3:41:52 PM Charles Steinkuehler 
> > wrote: 
>
> > On 9/11/2015 3:41 AM, Bremenpl wrote: 
> >> 
> >> Am I still doing something wrong? 
> > 
> > Two things to check: 
> > 
> > 1) The kernel will load any compiled in overlays in preference to 
> > files in /lib/firmware.  I don't think there's a BB_AVRDUDE overlay 
> > compiled into the kernel, but you can test by changing the name of 
> > your *.dtbo file to something guaranteed to be unique (or give it a 
> > custom version number) and try to load that instead.  That will force 
> > the kernel to look for the file in /lib/firmware. 
> > 
> > 2) You can crawl through the live device tree (/proc/device-tree/*) 
> > and make sure it's what you're expecting.  It's easy to have one typo 
> > or similar that will mess up everything you're trying to do.  :) 
> > 
> > -- 
> > Charles Steinkuehler 
> > cha...@steinkuehler.net  
> > 
> > -- 
> > For more options, visit http://beagleboard.org/discuss 
> > --- 
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "BeagleBoard" group. 
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/beagleboard/kL9YPe8NuPg/unsubscribe. 
> > To unsubscribe from this group and all its topics, send an email to 
> > beagleboard...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-10 Thread Bremenpl

Anyone please?

--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-10 Thread Charles Steinkuehler
On 9/9/2015 11:41 AM, bremenpl wrote:
> Hello there,
> I just got back to my BeagleBone Black and i have no idea why but I just 
> cannot change a pin configuration using overlay nor through export. This is 
> what I am trying to do:
> 
> I want to set P8_29 and P8_31 Pins to inputs with a pullup (0x37). here is 
> my overlay:



> Then I check the pins and they remain as they were in default:
> 
> root@beaglebone:~# cat $PINS | grep "pin 57"
> pin 57 (44e108e4) 0027 pinctrl-single 
> root@beaglebone:~# cat $PINS | grep "pin 54"
> pin 54 (44e108d8) 002f pinctrl-single 
> 
> 
> Did I forget something? I really cant think of anything. I would really 
> apreciate all help here!

Well, since you're using gpio-of-helper (designed to allow export of
GPIO pins via the device tree instead of using sysfs), but *NOT*
actually defining any GPIO pins, I'm not sure the gpio-of-helper
driver is applying your pinmux settings.

Try adding the GPIO pins you want to the gpio_helper stanza in
fragment 1 and configure them as inputs.

-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-10 Thread Bremenpl
Im.not sure I understand. I am setting the pins in the dts file i pasted. 
Wrting 0x37 to them to set them as inputs with pullups. I then compile a 
dtbo, load then load the dtbo. It gets loaded. I check the pins and they 
are not 0x37. Could you explain again what did you mean exacly? I wanted to 
simply init the pin with device tree overlay and then manage it with sysfs.



On September 10, 2015 3:34:44 PM Charles Steinkuehler 
 wrote:



On 9/9/2015 11:41 AM, bremenpl wrote:

Hello there,
I just got back to my BeagleBone Black and i have no idea why but I just
cannot change a pin configuration using overlay nor through export. This is
what I am trying to do:

I want to set P8_29 and P8_31 Pins to inputs with a pullup (0x37). here is
my overlay:





Then I check the pins and they remain as they were in default:

root@beaglebone:~# cat $PINS | grep "pin 57"
pin 57 (44e108e4) 0027 pinctrl-single
root@beaglebone:~# cat $PINS | grep "pin 54"
pin 54 (44e108d8) 002f pinctrl-single


Did I forget something? I really cant think of anything. I would really
apreciate all help here!


Well, since you're using gpio-of-helper (designed to allow export of
GPIO pins via the device tree instead of using sysfs), but *NOT*
actually defining any GPIO pins, I'm not sure the gpio-of-helper
driver is applying your pinmux settings.

Try adding the GPIO pins you want to the gpio_helper stanza in
fragment 1 and configure them as inputs.

--
Charles Steinkuehler
char...@steinkuehler.net

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the 
Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/beagleboard/kL9YPe8NuPg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
beagleboard+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-10 Thread Charles Steinkuehler
I mean you have pinmux settings, but you're not using the
gpio-of-helper driver to actually export anything, which it what it
was written for.  There is a difference between the *PINMUX* is setup
for input and the *GPIO PIN* is setup as an input.

Try adding some actual GPIO entries like these:

https://github.com/beagleboard/devicetree-source/blob/master/arch/arm/boot/dts/BB-GPIOHELP-00A0.dts#L48-L62

On 9/10/2015 11:43 AM, Bremenpl wrote:
> Im.not sure I understand. I am setting the pins in the dts file i
> pasted. Wrting 0x37 to them to set them as inputs with pullups. I then
> compile a dtbo, load then load the dtbo. It gets loaded. I check the
> pins and they are not 0x37. Could you explain again what did you mean
> exacly? I wanted to simply init the pin with device tree overlay and
> then manage it with sysfs.
> 
> 
> On September 10, 2015 3:34:44 PM Charles Steinkuehler
>  wrote:
> 
>> On 9/9/2015 11:41 AM, bremenpl wrote:
>>> Hello there,
>>> I just got back to my BeagleBone Black and i have no idea why but I
>>> just
>>> cannot change a pin configuration using overlay nor through export.
>>> This is
>>> what I am trying to do:
>>>
>>> I want to set P8_29 and P8_31 Pins to inputs with a pullup (0x37).
>>> here is
>>> my overlay:
>>
>> 
>>
>>> Then I check the pins and they remain as they were in default:
>>>
>>> root@beaglebone:~# cat $PINS | grep "pin 57"
>>> pin 57 (44e108e4) 0027 pinctrl-single
>>> root@beaglebone:~# cat $PINS | grep "pin 54"
>>> pin 54 (44e108d8) 002f pinctrl-single
>>>
>>>
>>> Did I forget something? I really cant think of anything. I would
>>> really
>>> apreciate all help here!
>>
>> Well, since you're using gpio-of-helper (designed to allow export of
>> GPIO pins via the device tree instead of using sysfs), but *NOT*
>> actually defining any GPIO pins, I'm not sure the gpio-of-helper
>> driver is applying your pinmux settings.
>>
>> Try adding the GPIO pins you want to the gpio_helper stanza in
>> fragment 1 and configure them as inputs.
>>
>> -- 
>> Charles Steinkuehler
>> char...@steinkuehler.net
>>
>> -- 
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to a topic in
>> the Google Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/beagleboard/kL9YPe8NuPg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> beagleboard+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 


-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-10 Thread Bremenpl

I think i get it. I will try this first thing in the morning. Thank you.


On September 10, 2015 7:15:57 PM Charles Steinkuehler 
 wrote:



I mean you have pinmux settings, but you're not using the
gpio-of-helper driver to actually export anything, which it what it
was written for.  There is a difference between the *PINMUX* is setup
for input and the *GPIO PIN* is setup as an input.

Try adding some actual GPIO entries like these:

https://github.com/beagleboard/devicetree-source/blob/master/arch/arm/boot/dts/BB-GPIOHELP-00A0.dts#L48-L62

On 9/10/2015 11:43 AM, Bremenpl wrote:

Im.not sure I understand. I am setting the pins in the dts file i
pasted. Wrting 0x37 to them to set them as inputs with pullups. I then
compile a dtbo, load then load the dtbo. It gets loaded. I check the
pins and they are not 0x37. Could you explain again what did you mean
exacly? I wanted to simply init the pin with device tree overlay and
then manage it with sysfs.


On September 10, 2015 3:34:44 PM Charles Steinkuehler
 wrote:


On 9/9/2015 11:41 AM, bremenpl wrote:

Hello there,
I just got back to my BeagleBone Black and i have no idea why but I
just
cannot change a pin configuration using overlay nor through export.
This is
what I am trying to do:

I want to set P8_29 and P8_31 Pins to inputs with a pullup (0x37).
here is
my overlay:





Then I check the pins and they remain as they were in default:

root@beaglebone:~# cat $PINS | grep "pin 57"
pin 57 (44e108e4) 0027 pinctrl-single
root@beaglebone:~# cat $PINS | grep "pin 54"
pin 54 (44e108d8) 002f pinctrl-single


Did I forget something? I really cant think of anything. I would
really
apreciate all help here!


Well, since you're using gpio-of-helper (designed to allow export of
GPIO pins via the device tree instead of using sysfs), but *NOT*
actually defining any GPIO pins, I'm not sure the gpio-of-helper
driver is applying your pinmux settings.

Try adding the GPIO pins you want to the gpio_helper stanza in
fragment 1 and configure them as inputs.

--
Charles Steinkuehler
char...@steinkuehler.net

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in
the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/beagleboard/kL9YPe8NuPg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.






--
Charles Steinkuehler
char...@steinkuehler.net

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the 
Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/beagleboard/kL9YPe8NuPg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
beagleboard+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-11 Thread Bremenpl

  
  
I have compiled this dts:
https://pastebin.com/EFQ9R8bg

Then added it to slots (it got loaded) and checked the pins. It
still doesnt work:

root@beaglebone:/home/debian/my_dts#
  echo BB-AVRDUDE > $SLOTS
  root@beaglebone:/home/debian/my_dts# cat $SLOTS
   0: 54:PF--- 
   1: 55:PF--- 
   2: 56:PF--- 
   3: 57:PF--- 
   4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
   5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
   6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas
  Instrument,BB-BONELT-HDMIN
   7: ff:P-O-L Override Board Name,00A0,Override
  Manuf,NEOSEC-TINYLCD22
   8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BONE-KEYS
   9: ff:P-O-L Override Board Name,00A0,Override
  Manuf,BB-BONE-SPI1-2CS
  10: ff:P-O-L Override Board Name,00A0,Override Manuf,am33xx_pwm
  11: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-COOLER
  12: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5
  13: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-BUZZER
  14: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-W1
  15: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-AVRDUDE
  root@beaglebone:/home/debian/my_dts# cat $PINS | grep "pin
  57"
  pin 57 (44e108e4) 0027 pinctrl-single (Should be 0x37)

Am I still doing something wrong?


  




-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-11 Thread Charles Steinkuehler
On 9/11/2015 3:41 AM, Bremenpl wrote:
> 
> Am I still doing something wrong?

Two things to check:

1) The kernel will load any compiled in overlays in preference to
files in /lib/firmware.  I don't think there's a BB_AVRDUDE overlay
compiled into the kernel, but you can test by changing the name of
your *.dtbo file to something guaranteed to be unique (or give it a
custom version number) and try to load that instead.  That will force
the kernel to look for the file in /lib/firmware.

2) You can crawl through the live device tree (/proc/device-tree/*)
and make sure it's what you're expecting.  It's easy to have one typo
or similar that will mess up everything you're trying to do.  :)

-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] Cannot set pins by overlay

2015-09-12 Thread Bremenpl
I also dont think that there is a device tree with this name. I will 
however try you tips at mo day in the morning and let know here. Thank you 
for help.



On September 11, 2015 3:41:52 PM Charles Steinkuehler 
 wrote:



On 9/11/2015 3:41 AM, Bremenpl wrote:


Am I still doing something wrong?


Two things to check:

1) The kernel will load any compiled in overlays in preference to
files in /lib/firmware.  I don't think there's a BB_AVRDUDE overlay
compiled into the kernel, but you can test by changing the name of
your *.dtbo file to something guaranteed to be unique (or give it a
custom version number) and try to load that instead.  That will force
the kernel to look for the file in /lib/firmware.

2) You can crawl through the live device tree (/proc/device-tree/*)
and make sure it's what you're expecting.  It's easy to have one typo
or similar that will mess up everything you're trying to do.  :)

--
Charles Steinkuehler
char...@steinkuehler.net

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the 
Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/beagleboard/kL9YPe8NuPg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
beagleboard+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.