SHOW:
|
|
- or go back to the newest paste.
| 1 | // -*- mode: c -*- | |
| 2 | // BeagleBone AI adc test | |
| 3 | // | |
| 4 | // Include this into your .dts (after dra7.dtsi). | |
| 5 | // | |
| 6 | // Note that letting the kernel setup pinmux (based on devicetree) may glitch the I/Os. | |
| 7 | // | |
| 8 | // If you're not going to do your pinmux setup in u-boot, at the very least disable the | |
| 9 | // default pinmux performed by u-boot (intended for the am572x uEVM). See: | |
| 10 | // https://github.com/dutchanddutch/u-boot/tree/patch/ti2017.01/x15-pinmux | |
| 11 | ||
| 12 | #include "dra7-uio-pruss.dtsi" | |
| 13 | ||
| 14 | &{/aliases} {
| |
| 15 | spi1 = &mcspi1; | |
| 16 | spi2 = &mcspi2; | |
| 17 | spi3 = &mcspi3; | |
| 18 | spi4 = &mcspi4; | |
| 19 | }; | |
| 20 | ||
| 21 | &mcspi2 {
| |
| 22 | status = "okay"; | |
| 23 | ||
| 24 | pinctrl-names = "default"; | |
| 25 | pinctrl-0 = <&mcspi2_pins>; | |
| 26 | ||
| 27 | spidev@1 {
| |
| 28 | reg = <1>; | |
| 29 | compatible = "spidev"; | |
| 30 | spi-max-frequency = <24000000>; | |
| 31 | spi-cpol; spi-cpha; | |
| 32 | }; | |
| 33 | }; | |
| 34 | ||
| 35 | &dra7_pmx_core {
| |
| 36 | mcspi2_pins: mcspi2 {
| |
| 37 | pinctrl-single,pins = < | |
| 38 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 243, PIN_OUTPUT_PULLUP | MUX_MODE3 ) // P9.17a cs | |
| 39 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 240, PIN_INPUT_PULLUP | MUX_MODE3 ) // P9.22b clk | |
| 40 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 241, PIN_OUTPUT_PULLUP | MUX_MODE3 ) // P9.21b d1 (miso) | |
| 41 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 242, PIN_INPUT_PULLUP | MUX_MODE3 ) // P9.18a d0 (mosi) | |
| 42 | >; | |
| 43 | }; | |
| 44 | }; | |
| 45 | ||
| 46 | ||
| 47 | gpio-demo {
| |
| 48 | compatible = "gpio-of-helper"; | |
| 49 | ||
| 50 | pinctrl-names = "default"; | |
| 51 | pinctrl-0 = <&gpio_demo_pins>; | |
| 52 | ||
| 53 | // output only, active-low, initially high | |
| 54 | reset-adc {
| |
| 55 | gpio = <&gpio2 3 ACTIVE_LOW>; // P8.08 | |
| 56 | init-high; | |
| 57 | }; | |
| 58 | }; | |
| 59 | ||
| 60 | ||
| 61 | // NOTE: for these pins, the desired iodelay configuration is manual with all-zero iodelay values, | |
| 62 | // which is why I'm using MODE_SELECT but don't have an explicit iodelay block. Omitting explicit | |
| 63 | // iodelay configuration isn't laziness, I'm a bit concerned to do so in DT due to erratum i933. | |
| 64 | ||
| 65 | &pruss2 {
| |
| 66 | pinctrl-names = "default"; | |
| 67 | pinctrl-0 = <&pruss2_pins>; | |
| 68 | }; | |
| 69 | ||
| 70 | &dra7_pmx_core {
| |
| 71 | gpio_demo_pins: gpio-demo {
| |
| 72 | pinctrl-single,pins = < | |
| 73 | PIN_GPIO_PULLUP( P8_08 ) // io 2.03 reset-thing | |
| 74 | >; | |
| 75 | }; | |
| 76 | pruss2_pins: pruss2 {
| |
| 77 | pinctrl-single,pins = < | |
| 78 | // pruss2 core 0 ioset 2 | |
| 79 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 123, PIN_INPUT_PULLUP | MUX_MODE12 | MODE_SELECT ) // P8.41 in 1 (sclk) | |
| 80 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 124, PIN_INPUT_PULLUP | MUX_MODE12 | MODE_SELECT ) // P8.42 in 2 (cs) | |
| 81 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 130, PIN_OUTPUT | MUX_MODE13 | MODE_SELECT ) // P8.34 out 8 (miso) | |
| 82 | DRA7XX_CORE_IOPAD( 0x3400 + 4 * 133, PIN_INPUT_PULLDOWN | MUX_MODE12 | MODE_SELECT ) // P8.31 in 11 (mosi) | |
| 83 | >; | |
| 84 | }; | |
| 85 | }; |