Radarcape:Devicetree: Difference between revisions

From Beast Wiki
Jump to navigation Jump to search
imported>Beastadmin
No edit summary
imported>Beastadmin
Line 14: Line 14:
==Device Tree Overlays==
==Device Tree Overlays==


'''/lib/firmware/BB-W-Radarcape.dts:'''<br>
'''Step 1:''' Create ''~/BB-W-Radarcape.dts'':<br />
<source lang="text" line>
<source lang="text" line>
/*   
/*   
Line 88: Line 88:
};
};
<source>
<source>
'''Step 2:''' Compile (on Beaglebone)<br />
<source lang="bash">dtc -O dtb -o BB-W-Radarcape-00A0.dtbo -b 0 -@ BB-W-Radarcape.dts</source>
'''Step 3:''' Copy to ''/lib/firmware''<br />
<source lang="bash">cp BB-W-Radarcape-00A0.dtbo /lib/firmware</source>
'''Step 4:''' Verify slots before appyling<br />
<source lang="bash">cat $SLOTS</source>
Must result in:<br />
0: 54:PF—<br />
1: 55:PF—<br />
2: 56:PF—<br />
3: 57:PF—<br />
'''Step 5:''' Apply the pinmux patches
<source lang="bash">echo BB-W-Radarcape > $SLOTS</source>
'''Step 6:''' The dmesg command will inform you about what has been done (in case that you do that over serial console, you already will have seen this output)
<source lang="bash">dmesg -s 20</source>
Must result in:<br />
[ 31.862078] bone-capemgr bone_capemgr.8: part_number 'BB-W-Radarcape', version 'N/A'<br />
[ 31.874269] bone-capemgr bone_capemgr.8: slot #4: generic override<br />
[ 31.880473] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 4<br />
[ 31.887937] bone-capemgr bone_capemgr.8: slot #4: 'Override Board Name,00A0,Override Manuf,BB-W-Radarcape'<br />
[ 31.904636] bone-capemgr bone_capemgr.8: slot #4: Requesting part number/version based 'BB-W-Radarcape-00A0.dtbo<br />
[ 31.926576] bone-capemgr bone_capemgr.8: slot #4: Requesting firmware 'BB-W-Radarcape-00A0.dtbo' for board-name 'Override Board Name', version '00A0'<br />
[ 31.952355] bone-capemgr bone_capemgr.8: slot #4: dtbo 'BB-W-Radarcape-00A0.dtbo' loaded; converting to live tree<br />
[ 31.967771] bone-capemgr bone_capemgr.8: slot #4: #2 overlays<br />
[ 31.983656] bone-capemgr bone_capemgr.8: slot #4: Applied #2 overlays.<br />
'''Step 7:''' Verify if all is correct
<source lang="bash">cat $SLOTS</source>
Must result in:
0: 54:PF—<br />
1: 55:PF—<br />
2: 56:PF—<br />
3: 57:PF—<br />
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-W-Radarcape<br />
'''Step 8:''' Apply the rest of the interfaces from standard device tree files
<source lang="bash">
echo BB-UART5 > $SLOTS
echo BB-UART2 > $SLOTS
</source>
'''Step 9:''' verify if all is correct
<source lang="bash">cat $SLOTS</source>
Must result in:<br />
0: 54:PF—<br />
1: 55:PF—<br />
2: 56:PF—<br />
3: 57:PF—<br />
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-W-Radarcape<br />
5: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5<br />
6: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART2<br />

Revision as of 23:24, 30 September 2013

Set Environment Variables and Aliases

/etc/profile:

export SLOTS=/sys/devices/bone_capemgr.7/slots<br>
export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins<br>
alias ll='ls -l'<br>
sleep 3; rdate -s ptbtime1.ptb.de &<br>
stty cols 132<br>
stty rows 50<br>


Device Tree Overlays

Step 1: Create ~/BB-W-Radarcape.dts:

/*  
* 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 Guenter Koellner for the Radarcape
* using: UART5 handshake signals and some GPIOs             
* with a great thanks to Derek Molloy - http://derekmolloy.ie/beaglebone
*
* As on the Beaglebone Black pins beeing used are occupied by eMMC and HDMI,
* it will require a different setting (and obviously, a different cape hardware) 
*/

/dts-v1/;
/plugin/;

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

    fragment@0 {
        target = <&am33xx_pinmux>;
            
        __overlay__ {
            pinctrl_radarcape: radarcape_Pins {
                pinctrl-single,pins = <

                    /* GPIO Values: */
                    /* GPIO 0x07 Output         */
                    /* GPIO 0x27 Input pullup   */
                    /* GPIO 0x37 Input pulldown */
                    /* GPIO 0x2f Input no pull  */
                                                                     
                    /* Watchdog retrigger output */
                    0x078 0x07  /* P9_12 GPIO1_28 #60 Output Mode7 */            
 
                    /* GPS 1PPS Input */
                    0x040 0x37  /* P9_15 GPIO1_16 #48 Input  Mode7 pullup    PPS1 input */
                    
                    /* FPGA Pins */ 
                    0x018 0x37  /* P8_3  GPIO1_6  #38 Input  Mode7 pullup    CONF_DONE  */
                    0x01c 0x07  /* P8_4  GPIO1_7  #39 Output Mode7           DCLK       */
                    0x008 0x37  /* P8_5  GPIO1_2  #34 Input  Mode7 pullup    nStatus    */
                    0x030 0x07  /* P8_12 GPIO1_12 #44 Output Mode7           DATA0      */
                    0x014 0x07  /* P8_22 GPIO1_5  #37 Output Mode7           nCONF      */

                    /* UART5 CTS/RTS as addon to the default UART5 device tree settings */ 
                    0x0d8 0x36  /* P8_31 UART5_CTSN   Input  Mode6 pullup    CTS input  */
                    0x0dc 0x06  /* P8_32 UART5_RTSN   Output Mode6 no pull   RTS output */
                >;
            };
        };
    };

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

'''Step 2:''' Compile (on Beaglebone)<br />
<source lang="bash">dtc -O dtb -o BB-W-Radarcape-00A0.dtbo -b 0 -@ BB-W-Radarcape.dts

Step 3: Copy to /lib/firmware

cp BB-W-Radarcape-00A0.dtbo /lib/firmware

Step 4: Verify slots before appyling

cat $SLOTS

Must result in:
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—

Step 5: Apply the pinmux patches

echo BB-W-Radarcape > $SLOTS

Step 6: The dmesg command will inform you about what has been done (in case that you do that over serial console, you already will have seen this output)

dmesg -s 20

Must result in:
[ 31.862078] bone-capemgr bone_capemgr.8: part_number 'BB-W-Radarcape', version 'N/A'
[ 31.874269] bone-capemgr bone_capemgr.8: slot #4: generic override
[ 31.880473] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 4
[ 31.887937] bone-capemgr bone_capemgr.8: slot #4: 'Override Board Name,00A0,Override Manuf,BB-W-Radarcape'
[ 31.904636] bone-capemgr bone_capemgr.8: slot #4: Requesting part number/version based 'BB-W-Radarcape-00A0.dtbo
[ 31.926576] bone-capemgr bone_capemgr.8: slot #4: Requesting firmware 'BB-W-Radarcape-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 31.952355] bone-capemgr bone_capemgr.8: slot #4: dtbo 'BB-W-Radarcape-00A0.dtbo' loaded; converting to live tree
[ 31.967771] bone-capemgr bone_capemgr.8: slot #4: #2 overlays
[ 31.983656] bone-capemgr bone_capemgr.8: slot #4: Applied #2 overlays.

Step 7: Verify if all is correct

cat $SLOTS

Must result in: 0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-W-Radarcape

Step 8: Apply the rest of the interfaces from standard device tree files

echo BB-UART5 > $SLOTS
echo BB-UART2 > $SLOTS

Step 9: verify if all is correct

cat $SLOTS

Must result in:
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-W-Radarcape
5: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5
6: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART2