Doubt about GPIO being initialized in DTO

已查看 39 次
跳至第一个未读帖子

Paulo Sherring

未读,
2016年7月15日 10:51:082016/7/15
收件人 BeagleBoard
Hi all. I am developing a control system which uses GPIO to perform IO operations and control peripherals.
So, right now, I have a DTS file which initializes all GPIOs that I am going to use, mostly outputs. It compiles and loads normally. Here it is: http://pastebin.com/HTB0v8dH
I previously thought that it would initialize the GPIO_OE registers, since it is being configured as output, but apparently it does not.
So, I was wondering how could I create a DTS file that would initialize both GPIO_OE register and set the initial value for it.
Any thoughts on that?
Thanks in advance!
Paulo Sherring.

John Syne

未读,
2016年7月15日 12:08:522016/7/15
收件人 beagl...@googlegroups.com
Think of DTS as a simple database which does nothing unless you specify a driver that then uses the definitions in the dtbo to configure the I/O. 

Regards,
John




--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/56681858-5d87-465f-97ce-5a729a4806ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paulo Sherring

未读,
2016年7月15日 12:11:252016/7/15
收件人 BeagleBoard
Thanks, John! Would mind elucidate a little more, with a sample DTS of how do I achieve this? Or a link to somewhere that shows how to do it?

John Syne

未读,
2016年7月15日 12:16:262016/7/15
收件人 beagl...@googlegroups.com
If you don’t have your own driver, then you should use gpio-of-helper driver which I believe should do what you want. I haven’t used it, but I believe that is the general idea. I always use my own driver. 

&am33xx_pinmux {
    gpio_pins: gpio_pins {         // The GPIO pins
             pinctrl-single,pins = <
                0x070 0x07   // P9_11 MODE7 GPIO output pull‐down
                0x074 0x27   // P9_13 MODE7 GPIO input pull‐down
             >; 
          };
 
&ocp {
   helper {
             compatible = "gpio-of-helper"; 
             status = "okay"; 
             pinctrl-names = "default";
             pinctrl-0 = <&gpio_pins>;
          };


Regards,
John




回复全部
回复作者
转发
0 个新帖子