This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Device tree settings for PRU parallel I/O

Part Number: AM5728

Tool/software: Linux

Need assistance in setting up device tree for use of PRUSS2_PRU0 as 16 bit input parallel capture mode along with 4 GPO lines.
First question.. is that even possible? And second question, how do I implement the pru as input capture in the device tree?

I can do it by using MemTools and shell but that's not the desired method for the end product.


# PRUSS_GPCFG0, enable parallel capture

./memtool 0x4b2a6008=0x00002001

# pr2_pru0_gpi0

./memtool 0x4a0035e8=0x0004010c

# pr2_pru0_gpi1

./memtool 0x4a0035ec=0x0004010c

# pr2_pru0_gpi2

./memtool 0x4a0035f0=0x0004010c

# pr2_pru0_gpi3

./memtool 0x4a0035f4=0x0004010c

# pr2_pru0_gpi4

./memtool 0x4a0035f8=0x0004010c

# pr2_pru0_gpi5

./memtool 0x4a0035fc=0x0004010c

# pr2_pru0_gpi6

./memtool 0x4a003600=0x0004010c

# pr2_pru0_gpi7

./memtool 0x4a003604=0x0004010c

# pr2_pru0_gpi8

./memtool 0x4a003608=0x0004010c

# pr2_pru0_gpi9

./memtool 0x4a00360c=0x0004010c

# pr2_pru0_gpi10

./memtool 0x4a003610=0x0004010c

# pr2_pru0_gpi11

./memtool 0x4a003614=0x0004010c

 

# pr2_pru0_gpi16, DCLK

./memtool 0x4a003628=0x0004010c


Here is my section in the Device Tree

/* PRU input = MUXMODE_C  output = MUXMODE_D   */
    pru_test_pins: pru_test_pins {
        pinctrl-single,pins = <
            0x1e8 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d3  PRU Data0 */
            0x1ec (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d4  PRU Data1 */
            0x1f0 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d5  PRU Data2 */
            0x1f4 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d6  PRU Data3 */
            0x1f8 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d7  PRU Data4 */
            0x1fc (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d8  PRU Data5 */
            0x200 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d9  PRU Data6 */
            0x204 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d10  PRU Data7 */
            0x208 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d11  PRU Data8 */
            0x20c (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d12  PRU Data9 */
            0x210 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d13  PRU Data10 */
            0x214 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d14  PRU Data11 */
            0x218 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d15  PRU Data12 */
            0x21c (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d16  PRU Data13 */
            0x220 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d17  PRU Data14 */
            0x224 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d18  PRU Data15 */
            0x228 (PIN_INPUT_PULLDOWN | MUX_MODE12)    /* vout1_d19  PRU Clock Data16 */
            /*       future expansion to output pins as welll               */
            /* 0x22c (PIN_OUTPUT | MUX_MODE13)    /* vout1_d20  PRU AFE Trig    */
            /* 0x230 (PIN_OUTPUT | MUX_MODE13)    /* vout1_d21  PRU AFE SelA    */
            /* 0x234 (PIN_OUTPUT | MUX_MODE13)    /* vout1_d21  PRU AFE SelB    */
            /* 0x238 (PIN_OUTPUT | MUX_MODE13)    /* vout1_d21  PRU AFE SelC    */

        >;
    };

  • Hello there,

    Yes, you can pinmux GPI and GPO - however, the devicetree.txt output file from the pin mux utility should tell you that in AM57xx, MMC modes go in the Linux dts files and all other pinmuxing is done in uboot. You can find instructions fat the Pin Mux Utility for ARM MPU Processors wiki for how to add GPI and GPO pinmuxing in AM57xx uboot using the output files from the pin mux utility.

    The actual PRU configuration of the GPI and GPO pins will not be able to happen until the clocks to the PRUs are enabled - usually once Linux comes up. i.e., enabling parallel capture and editing any other PRU configuration registers. 

    Please note that the value the PRUs drive to the GPO pins is nondeterministic until R30 has been manually set to a value. That means that if you pinmux GPO pins in uboot, you won't know whether the output voltage will go to a 0 or a 1, and it will stay at that random value until you can bring up the PRU and set R30. 

    Does your system need to ensure that output voltage is at a known state during processor startup? 

    Regards, 

    Nick

  • Hello,

    I'm going to mark this thread resolved. If you have any further questions, please let us know!

    Regards,
    Nick
  • Nick,

     First thank you for the response. I must admit that there is a certain amount of confusion as to the "standard" of method used for

    initial setup. This particular application uses a module from an outside source. The advice of that company is that everything is done in

    the devicetree and then compiled. The advice from T.I is as you mentioned, the bare minimum is done in the tree (emmc,etc) and the

    rest is done in the UBOOT compile using the files of the PINMUX utility.

    I've been able to obtain enough information to do the setup using the DeviceTree and also doing it in UBOOT in a redundant manner. This

    is enough to continue progress. Again... thanks for the response.