Advertisement
anand6105

mcp2515_bbai

Apr 23rd, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1.  
  2. #include <dt-bindings/interrupt-controller/irq.h>
  3.  
  4. /dts-v1/;
  5. /plugin/;
  6.  
  7. &{/chosen} {
  8. overlays {
  9. BBAI-MCP2515-SPI = __TIMESTAMP__;
  10. };
  11. };
  12.  
  13.  
  14. &{/} {
  15. mcp2515_clock: mcp2515-clock {
  16. #clock-cells = <0>;
  17. compatible = "fixed-clock";
  18. clock-frequency = <16000000>;
  19. };
  20. };
  21.  
  22. &ocp {
  23. P9_23_pinmux { status = "disabled"; }; // cs
  24. P9_18_pinmux { status = "disabled"; }; // mosi
  25. P9_21_pinmux { status = "disabled"; }; // miso
  26. P9_22_pinmux { status = "disabled"; }; // clk
  27. P9_24_pinmux { status = "disabled"; }; // int
  28. };
  29.  
  30. &bone_spi_0 {
  31. status = "okay";
  32. #address-cells = <1>;
  33. #size-cells = <0>;
  34.  
  35. pinctrl-names = "default";
  36. pinctrl-0 = <&P9_23_spi_cs_pin>, //cs
  37. <&P9_18_spi_pin>, //mosi
  38. <&P9_21_spi_pin>, //miso
  39. <&P9_22_spi_sclk_pin>; //clk
  40.  
  41. can@0 {
  42. compatible = "microchip,mcp2515";
  43. reg = <1>;
  44. mode = <0>;
  45. spi-max-frequency = <10000000>;
  46. clocks = <&mcp2515_clock>;
  47. pinctrl-names = "default";
  48. pinctrl-0 = <&P9_24_gpio_pin>; // GPIO6_15 corresponds to P9_24 for interrupt signal
  49. interrupts-extended = <&gpio6 15 IRQ_TYPE_EDGE_FALLING>; // Using GPIO6_15 as the interrupt
  50. mcp251x,oscillator-frequency = <16000000>;
  51. mcp251x,irq-gpios = <&gpio4 21 0>;
  52. mcp251x,stay-awake = <1>;
  53. mcp251x,enable-clkout = <1>;
  54. };
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement