Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. // BeagleBone AI spi test
  2. //
  3. // Include this into your .dts (after dra7.dtsi).
  4. //
  5. // Note that letting the kernel setup pinmux (based on devicetree) may glitch the I/Os.
  6. //
  7. // If you're not going to do your pinmux setup in u-boot, at the very least disable the
  8. // default pinmux performed by u-boot (intended for the am572x uEVM). See:
  9. // https://github.com/dutchanddutch/u-boot/tree/patch/ti2017.01/x15-pinmux
  10. //
  11. // This test requires external loopback connections:
  12. // BBX15
  13. // mcspi pru
  14. // P17.04 --> P17.03
  15. // P17.07 --> P17.06
  16. // P17.33 --> P17.34
  17. // P17.36 <-- P17.37
  18. //
  19. // BBAI
  20. // mcspi pru
  21. // P9.31 --> P8.41
  22. // P9.29 --> P8.31, 8.04
  23. // P9.42 --> P8.42
  24. // P9.30 <-- P8.34, 8.23
  25. //
  26. // Then run spi-test.py in the pru-examples directory.
  27.  
  28. #include "dra7-uio-pruss.dtsi"
  29.  
  30.  
  31. &mcspi3 {
  32. status = "okay";
  33.  
  34. pinctrl-names = "default";
  35. pinctrl-0 = <&mcspi3_pins>;
  36.  
  37. spidev@1 {
  38. reg = <1>;
  39. compatible = "spidev";
  40. spi-max-frequency = <24000000>;
  41. spi-cpol; spi-cpha;
  42. };
  43. };
  44.  
  45. &dra7_pmx_core {
  46. mcspi3_pins: mcspi3 {
  47. pinctrl-single,pins = <
  48. // mcspi3 ioset 6
  49. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 185, PIN_OUTPUT_PULLUP | MUX_MODE3 ) // P9.42 cs1
  50. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 181, PIN_INPUT_PULLUP | MUX_MODE3 ) // P9.31 clk
  51. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 182, PIN_OUTPUT_PULLUP | MUX_MODE3 ) // P9.29 d1 (mosi)
  52. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 183, PIN_INPUT_PULLUP | MUX_MODE3 ) // P9.30 d0 (miso)
  53. >;
  54. };
  55. };
  56.  
  57.  
  58. // NOTE: for these pins, the desired iodelay configuration is manual with all-zero iodelay values,
  59. // which is why I'm using MODE_SELECT but don't have an explicit iodelay block. Omitting explicit
  60. // iodelay configuration isn't laziness, I'm a bit concerned to do so in DT due to erratum i933.
  61.  
  62. &pruss2 {
  63. pinctrl-names = "default";
  64. pinctrl-0 = <&pruss2_pins>;
  65. };
  66.  
  67. &dra7_pmx_core {
  68. pruss2_pins: pruss2 {
  69. pinctrl-single,pins = <
  70. // pruss2 core 0 ioset 2
  71. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 123, PIN_INPUT_PULLUP | MUX_MODE12 | MODE_SELECT ) // P8.41 in 1 (sclk)
  72. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 124, PIN_INPUT_PULLUP | MUX_MODE12 | MODE_SELECT ) // P8.42 in 2 (cs)
  73. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 130, PIN_OUTPUT | MUX_MODE13 | MODE_SELECT ) // P8.34 out 8 (miso)
  74. DRA7XX_CORE_IOPAD( 0x3400 + 4 * 133, PIN_INPUT_PULLUP | MUX_MODE12 | MODE_SELECT ) // P8.31 in 11 (mosi)
  75. >;
  76. };
  77. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement