Hi, 
I am definitely not an expert in device tree overlays, but I somehow got 
most of the PRU output pins to work. I load and compile with the following 
command: 

#!/bin/bash
NAME=lockbox

echo "Compiling the overlay from .dts to .dtbo"

dtc -O dtb -o $NAME-00A0.dtbo -b 0 -@ ./$NAME.dts

cp $NAME-00A0.dtbo /lib/firmware

My file lockbox.dts contains the following code: 
/*  
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Purpose License Version 2 as
* published by the Free Software Foundation
*
* Original from: 
github.com/jadonk/validation-scripts/blob/master/test-capemgr/ 
*
* Modified by Derek Molloy for the example on www.derekmolloy.ie
* that maps GPIO pins for the example
*/

/dts-v1/;
/plugin/;

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

       fragment@0 {
             target = <&am33xx_pinmux>;
            
             __overlay__ {
                  pru_pru_pins: pinmux_pru_pru_pins {
            pinctrl-single,pins = <
                /* INPUTS PRU0 */
                //0x190 0x2E  /* P9_31 = PRU0_r31_0 */
                //0x194 0x2E  /* P9_29 = PRU0_r31_1 */
                //0x198 0x2E  /* P9_30 = PRU0_r31_2 */
                //0x19C 0x2E  /* P9_28 = PRU0_r31_3 */
                //0x1A0 0x2E  /* P9_42.1 = PRU0_r31_4 */
                //0x1A4 0x2E  /* P9_27 = PRU0_r31_5 */
                //0x1A8 0x2E  /* P9_41.1 = PRU0_r31_6 */
                //0x1AC 0x2E  /* P9_25 = PRU0_r31_7 */
                //0x038 0x2E  /* P8_16 = PRU0_r31_14 */
                //0x03C 0x2E  /* P8_15 = PRU0_r31_15 */
                
                /*unclear pins, even more available*/
                /*0x184 0x2E*/  /* P9_24 = PRU0_r31_16 */
                /*0x180 0x2E*/  /* P9_26 = PRU0_r31_16 */

                /* OUTPUTS PRU0 */
                //0x034 0x06  /* P8_11 = PRU0_r30_15 */
                //0x030 0x06  /* P8_12 = PRU0_r30_14 */
                
                /* OUTPUTS PRU1 */
                0x0A0 0x05  /* P8_45 = PRU1_r30_0 */
                0x0A4 0x05  /* P8_46 = PRU1_r30_1 */
                0x0A8 0x05  /* P8_43 = PRU1_r30_2 */
                0x0AC 0x05  /* P8_44 = PRU1_r30_3 */
                0x0B0 0x05  /* P8_41 = PRU1_r30_4 */
                0x0B4 0x05  /* P8_42 = PRU1_r30_5 */
                0x0B8 0x05  /* P8_39 = PRU1_r30_6 */
                0x0BC 0x05  /* P8_40 = PRU1_r30_7 */
                0x0E0 0x05  /* P8_27 = PRU1_r30_8 */
                0x0E4 0x05  /* P8_29 = PRU1_r30_9 */
                0x0E8 0x05  /* P8_28 = PRU1_r30_10 */
                0x0EC 0x05  /* P8_30 = PRU1_r30_11 */
                0x084 0x05  /* P8_22 = PRU1_r30_12 */
                0x080 0x05  /* P8_21 = PRU1_r30_13 */
                
                /* INPUTS PRU1 */
                /* NONE */

                       
                   /* OUTPUT  GPIO(mode7) 0x07 pulldown, 0x17 pullup, 0x?f 
no pullup/down */
                   /* INPUT   GPIO(mode7) 0x27 pulldown, 0x37 pullup, 0x?f 
no pullup/down */

            >;
          };
             };
       };

       fragment@1 {
        target = <&ocp>;
        __overlay__ {
            test_helper: helper {
                compatible = "bone-pinmux-helper";
                pinctrl-names = "default";
                pinctrl-0 = <&pru_pru_pins>;
                status = "okay";
            };
        };
    };


        fragment@2 {
                target = <&pruss>;
                __overlay__ {
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <&pru_pru_pins>;
                };
        };
};



However, I dont even know what all these lines mean, but it works for me. 

All pins which are not in out-commented work properly for data output, and 
when your command
cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins | grep 9a4
gives the output you would expect. I dont remember if all of the other pins 
(in comments) work properly, but I think I tested most of them. 

One issue that I had in the beginning, was that many of the PRU pins are 
used either by the eMMC or by the hdmi module, so that I had to set the line
optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G 

in the uEnv.txt file, and boot the linux from an SD card. 

Hope this helps, 
Lenny

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to