SHARE
TWEET

Untitled

a guest Oct 21st, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // this is the example zmatt gave of how to make a pinmux helper
  2. / {
  3.     my-pinmux-switch {
  4.         compatible = "bone-pinmux-helper";
  5.         pinctrl-names = "default", "foo", "bar";
  6.         pinctrl-0 = <...>;  // pinctrl nodes for the "default" state
  7.         pinctrl-1 = <...>;  // pinctrl nodes for the "foo" state
  8.         pinctrl-2 = <...>;  // pinctrl nodes for the "bar" state
  9.     };
  10. };
  11.  
  12. // this is the example zmatt gave of doing pinmux
  13. &dra7_pmx_core {
  14.     mcspi3_pins: mcspi3 {
  15.         pinctrl-single,pins = <
  16.             // mcspi3 ioset 6
  17.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 228, PIN_OUTPUT_PULLUP | MUX_MODE1 )  // P17.33  cs1
  18.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 224, PIN_INPUT_PULLUP  | MUX_MODE1 )  // P17.04  clk
  19.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 225, PIN_OUTPUT_PULLUP | MUX_MODE1 )  // P17.07  d1 (mosi)
  20.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 226, PIN_INPUT_PULLUP  | MUX_MODE1 )  // P17.36  d0 (miso)
  21.         >;
  22.     };
  23. };
  24.  
  25. // putting them together gives (hopefully)
  26.  
  27. / {
  28.     my-pinmux-switch {
  29.         compatible = "bone-pinmux-helper";
  30.         pinctrl-names = "default", "foo", "bar";
  31.         pinctrl-0 = <
  32.             // mcspi3 ioset 6
  33.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 228, PIN_OUTPUT_PULLUP | MUX_MODE1 )  // P17.33  cs1
  34.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 224, PIN_INPUT_PULLUP  | MUX_MODE1 )  // P17.04  clk
  35.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 225, PIN_OUTPUT_PULLUP | MUX_MODE1 )  // P17.07  d1 (mosi)
  36.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 226, PIN_INPUT_PULLUP  | MUX_MODE1 )  // P17.36  d0 (miso)
  37.         >;  // pinctrl nodes for the "default" state (puts pins in mux mode 1)
  38.         pinctrl-1 = <
  39.             // mcspi3 ioset 6
  40.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 228, PIN_OUTPUT_PULLUP | MUX_MODE2 )  // P17.33  ?
  41.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 224, PIN_INPUT_PULLUP  | MUX_MODE2 )  // P17.04  ?
  42.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 225, PIN_OUTPUT_PULLUP | MUX_MODE2 )  // P17.07  ?
  43.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 226, PIN_INPUT_PULLUP  | MUX_MODE2 )  // P17.36  ?
  44.         >;  // pinctrl nodes for the "foo" state (puts pins in mux mode 2)
  45.         pinctrl-2 = <
  46.             // mcspi3 ioset 6
  47.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 228, PIN_OUTPUT_PULLUP | MUX_MODE3 )  // P17.33  ?
  48.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 224, PIN_INPUT_PULLUP  | MUX_MODE3 )  // P17.04  ?
  49.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 225, PIN_OUTPUT_PULLUP | MUX_MODE3 )  // P17.07  ?
  50.             DRA7XX_CORE_IOPAD( 0x3400 + 4 * 226, PIN_INPUT_PULLUP  | MUX_MODE3 )  // P17.36  ?
  51.         >;  // pinctrl nodes for the "bar" state (puts pins in mux mode 3)
  52.     };
  53. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top