Note the structure here form this modified file( Modified from Charles S'
Universal IO overlay 'univ-all' ) This is for a single pin instead of all
pins.
https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/univ-all-00A0.dts

IN short here is what is required:


   - /dts-v1/;
   - /plugin/;
   - / {
   -     compatible = "ti,beaglebone", "ti,beaglebone-black",
   "ti,beaglebone-green";
   - part-number = "univ-P8_07";
   - version = "00A0";

Passed that exclusive-use =    "P8.7"; ive seen in each overlay for pins
each uses. BUt if you examine this file closely it should become apparent
what is required to make a like overlay function. This specific file is
mean to offer the ability to change pin mux dynamically as the system is
running. So there are 5 possibilities from this file, but initially the pin
is configured as input.

I will tell you what helps me a good bit while editing device tree files.
You need a good editor that will allow you to arbitrarily set syntax
highlighting. Then, I personally set syntax highlighting to "C".

/dts-v1/;
/plugin/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black",
"ti,beaglebone-green";

    /* identification */
    part-number = "univ-P8_07";
    version = "00A0";

    /* state the resources this cape uses */
    exclusive-use =    "P8.7";

    /* P8_07 (ZCZ ball R7 ) */
    P8_07_default_pin: pinmux_P8_07_default_pin {
        pinctrl-single,pins = <0x090  0x37>; };     /* Mode 7, Pull-Up,
RxActive */
    P8_07_gpio_pin: pinmux_P8_07_gpio_pin {
        pinctrl-single,pins = <0x090  0x2F>; };     /* Mode 7, RxActive */
    P8_07_gpio_pu_pin: pinmux_P8_07_gpio_pu_pin {
        pinctrl-single,pins = <0x090  0x37>; };     /* Mode 7, Pull-Up,
RxActive */
    P8_07_gpio_pd_pin: pinmux_P8_07_gpio_pd_pin {
        pinctrl-single,pins = <0x090  0x27>; };     /* Mode 7, Pull-Down,
RxActive */
    P8_07_timer_pin: pinmux_P8_07_timer_pin {
        pinctrl-single,pins = <0x090  0x32>; };     /* Mode 2, Pull-Up,
RxActive */

    fragment@1 {
        target = <&ocp>;
        __overlay__ {

            P8_07_pinmux {
                compatible = "bone-pinmux-helper";
                status = "okay";
                pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd",
"timer";
                pinctrl-0 = <&P8_07_default_pin>;
                pinctrl-1 = <&P8_07_gpio_pin>;
                pinctrl-2 = <&P8_07_gpio_pu_pin>;
                pinctrl-3 = <&P8_07_gpio_pd_pin>;
                pinctrl-4 = <&P8_07_timer_pin>;
            };
        };
    };

    fragment@2 {
        target = <&ocp>;
        __overlay__ {

            cape-universal {
                compatible = "gpio-of-helper";
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <>;

                P8_07 {
                    gpio-name = "P8_07";
                    gpio = <&gpio2 2 0>;
                    input;
                    dir-changeable;
                };
            };
        };
    };
};

On Mon, Jul 25, 2016 at 10:53 AM, Raul Piper <[email protected]> wrote:

> Hi Greg,
> Thankyou for the elaborative post and the link you sent.My understanding
> is mainly theoretical and inlined with what you wrote..
>
> Yes,I have been scanning across many links on google and stack overflow
> but not able to find single one convincing.
>
> I came to conclusion that i will write a hello world gpio driver with lots
> of printk and build it along with the dts file by placing it in
> arch/arm/boot/dts and then loading that kernel image.According to
> R.Nelson's link i will copy the dtb files as well.
> Init--> probe-->register platform driver(.compatible string in the
> platform_device structure ) should throw something to go ahead with then.
>
> But still the loop holes in the understanding like why to copy all the dtb
> files,how to build only that dtb file and copy it in the lib/firmware and
> dynamically insmod the driver ....where does overlays come into the
> picture...can the drivers without dtb implementation be accepted in
> kernelmain line...
>
> Really looking for some example code here.
>
> On Monday 25 July 2016, Greg <[email protected]> wrote:
>
>> I'm not sure there is a one-stop shop for understanding the Device Tree
>> anywhere.
>>
>> There are at least 4 file types involved:
>>
>> 1.  dts-  This is the source code (text file) which is a data structure
>> to describe hardware.
>> 2.  dtsi-  A sub-chunk or "include" file which is used inside dts files.
>> It's somewhat similar to an "include" or "import" in programming languages.
>> 3.  dtb-  Device tree blob.  This is the compiled version of the dts.
>> This is what gets loaded at boot time.  It's the foundation of the system
>> used by the kernel.
>> 4.  dtbo-  Device tree overlay.  This can be loaded after boot time.
>> This is how the Beaglebone adjusts itself when different "capes" are
>> plugged in.  It does this by reading information stored in the EEPROM in
>> the cape.  These "overlays" can also be loaded at the command line using
>> the "slots" in the sysfs virtual file system.  Look for a substantial
>> collection of already done overlays in the directory /lib/firmware.  If you
>> want to make your own overlay, /lib/firmware is where you want to place it.
>>
>> This topic is really confusing, and no doubt my notes above are full of
>> flaws.
>>
>> You can work through and understand all of the above.  However, depending
>> on the complexity of what you are trying to do, this may be sufficient:
>>
>> https://github.com/cdsteinkuehler/beaglebone-universal-io
>>
>> Using the config-pin -f option and a simple text file you can use your
>> .profile or similar start-up configuration file to set the pins to your
>> requirements.
>> This is a relatively straight-forward solution to tacking the problem.
>>
>> In my opinion the device tree is a major hurdle to making progress with
>> the Beaglebones.  If you google you will get a bunch of out-dated
>> information, so be careful what you read on the net.  Perhaps someone will
>> suggest single source of accurate information on this topic.
>>
>> Regards,
>> Greg
>>
>> --
>> 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/cLDC6Le0Z4A/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/beagleboard/2a565144-1715-4bc2-ae74-b6415a30dea1%40googlegroups.com
>> <https://groups.google.com/d/msgid/beagleboard/2a565144-1715-4bc2-ae74-b6415a30dea1%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/CAEwN%2BMB16im1R%2BtCPjpSk86sQ-2Lr4207yRU9Y_OrCBZfqeOEw%40mail.gmail.com
> <https://groups.google.com/d/msgid/beagleboard/CAEwN%2BMB16im1R%2BtCPjpSk86sQ-2Lr4207yRU9Y_OrCBZfqeOEw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORoui1vnoFQT6hVo1KqM_oxLytJnvLp2%2BO2J5P_gp%2BCMqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to