Advertisement
zmatt

encx24j600.dts

Jul 4th, 2020
1,525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. /dts-v1/;
  2. /plugin/;
  3.  
  4. #include <dt-bindings/pinctrl/am33xx.h>
  5. #include <dt-bindings/board/am335x-bbw-bbb-base.h>
  6. #include <dt-bindings/interrupt-controller/irq.h>
  7.  
  8. &{/chosen} {
  9.     overlays {
  10.         // use name of this file (without .dts) as property name
  11.         encx24j600 = __TIMESTAMP__;
  12.     };
  13. };
  14.  
  15. // disable cape-universal for pins used
  16. &ocp {
  17.     P9_12_pinmux { status = "disabled"; };  // encx24j600 irq
  18.     P9_17_pinmux { status = "disabled"; };  // spi0 cs0
  19.     P9_18_pinmux { status = "disabled"; };  // spi0 d1
  20.     P9_21_pinmux { status = "disabled"; };  // spi0 d0
  21.     P9_22_pinmux { status = "disabled"; };  // spi0 sclk
  22. };
  23.  
  24. &spi0 {
  25.     status = "okay";
  26.     pinctrl-names = "default";
  27.     pinctrl-0 = <&spi0_pins>;
  28.  
  29.     // use same node name as cape-universal does
  30.     channel@0 {
  31.         reg = <0>;
  32.         compatible = "microchip,encx24j600";
  33.         pinctrl-names = "default";
  34.         pinctrl-0 = <&encx24j600_pins>;
  35.         spi-max-frequency = <20000000>;
  36.         interrupts-extended = <&gpio1 28 IRQ_TYPE_EDGE_FALLING>;
  37.     };
  38. };
  39.  
  40. &am33xx_pinmux {
  41.     spi0_pins: spi0 {
  42.         pinctrl-single,pins = <
  43.             BONE_P9_17 ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) // cs0
  44.             BONE_P9_18 ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) // d1 / mosi
  45.             BONE_P9_21 ( PIN_INPUT_PULLUP  | MUX_MODE0 ) // d0 / miso
  46.             BONE_P9_22 ( PIN_INPUT_PULLUP  | MUX_MODE0 ) // sclk
  47.         >;
  48.     };
  49.  
  50.     encx24j600_pins: encx24j600 {
  51.         pinctrl-single,pins = <
  52.             BONE_P9_12 ( PIN_INPUT_PULLUP  | MUX_MODE7 ) // gpio 1.28 / irq
  53.         >;
  54.     };
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement