On Wed, May 17, 2017 at 8:35 PM, Greg Ercolano <[email protected]> wrote:
> > . . .
>
So a lot of text there to "Wade" through so I'll try to answer the
questions you have in order. Without the "Sea of text" ;)
I think Universal IO, which includes the shell script config-pin is a
really cool tool for getting started. Especially, when all you want to do
is get down to writing code for the hardware. However, at the same time I
strongly feel that it is not a permanent solution for configuring the
hardware, especially for a production system. For many reasons, partly
because there can be some glitches, and partly because now we have uboot
overlays, that one can load through the second stage bootloader. Which also
means, for a production system you can have your pins, and hardware
configured exactly how it needs to be. Prior to Linux being up and running.
If you script config-pin, this has to be done after Linux is running.
And . . actually, I think that was your only questions. I would like to add
some things however. Let's take this:
/* P8_07 (ZCZ ball R7 ) */
P8_07_default_pin: pinmux_P8_07_default_pin {
pinctrl-single,pins = <0x090 0x37>; }; /* Mode 7, Pull-Up, RxActive */
This is just part of configuring a pin. Obviously for P8_07. So for pins
that can be operating in GPIO mode. This will be the first entry in any of
the universal io overlay files. The first line after the comment is pretty
much just a "#define", or a "prototype" definition of the pin in question.
Kind of like prototyping a function in C. The second line after the comment
is the actual pin information. 0x090 being the pin, which is a kernel pin
identifier I think. The second number 0x37 is the mux, and pullup mode( put
simply ). You can read the TRM and get a much better explanation of the mux
/ pullup mode register.
Anyway, check this out.
https://github.com/beagleboard/bb.org-overlays/blob/master/include/dt-bindings/board/am335x-bbw-bbb-base.h#L17
The point here, if you #include Robert's header file, you can use all the
BONE_Px_xx #defines in place of the actual "kernel pin value". Which can(
does for me ) remove a lot of tedious work trying to memorize, or digging
through documentation just to get a pin to work the way you want.
Additionally, there is another header file, which #define mux, and other
register modes. These two headers alone can take a lot of learning pressure
off your shoulders. Then if like me, you do know C very well ( I'm assuming
you do ), you can read through these source header files, along with the
TRM, or whatever documentation that makes the most sense to you. Suddenly,
that light at the end of the tunnel starts to appear. Pullup modes, you
simply OR together ( FOO | BAR )
And yeah, I guess there was another question in there. Yes, any dt file
starting with "univ "including "univ" or "universal" will be a universal IO
related overlay. Some originally written by Charles S( Mug cooler ;) ). or
Robert Nelson.
Anyway, right now I am kind of busy with work related code. Bu maybe,
sometime soon I can make a working device tree overlay, with an explanation
of the file for one pin. Put it on my blog page, and link back to it. The
problem with that, is it often takes more work to create a post, than it
does to actually just write the code, and *maybe* explain it, if needed.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/CALHSORpYVGKZVzptX%3D13QVczmERqQnvE9i%2B4YNRk%3DyJEU-p5HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.