rcar_canfd.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Renesas R-Car CAN FD controller Device Tree Bindings
  2. ----------------------------------------------------
  3. Required properties:
  4. - compatible: Must contain one or more of the following:
  5. - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller.
  6. - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller.
  7. - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller.
  8. - "renesas,r8a77970-canfd" for R8A77970 (R-Car V3M) compatible controller.
  9. - "renesas,r8a77980-canfd" for R8A77980 (R-Car V3H) compatible controller.
  10. When compatible with the generic version, nodes must list the
  11. SoC-specific version corresponding to the platform first, followed by the
  12. family-specific and/or generic versions.
  13. - reg: physical base address and size of the R-Car CAN FD register map.
  14. - interrupts: interrupt specifiers for the Channel & Global interrupts
  15. - clocks: phandles and clock specifiers for 3 clock inputs.
  16. - clock-names: 3 clock input name strings: "fck", "canfd", "can_clk".
  17. - pinctrl-0: pin control group to be used for this controller.
  18. - pinctrl-names: must be "default".
  19. Required child nodes:
  20. The controller supports two channels and each is represented as a child node.
  21. The name of the child nodes are "channel0" and "channel1" respectively. Each
  22. child node supports the "status" property only, which is used to
  23. enable/disable the respective channel.
  24. Required properties for "renesas,r8a7795-canfd" and "renesas,r8a7796-canfd"
  25. compatible:
  26. In R8A7795 and R8A7796 SoCs, canfd clock is a div6 clock and can be used by both
  27. CAN and CAN FD controller at the same time. It needs to be scaled to maximum
  28. frequency if any of these controllers use it. This is done using the below
  29. properties:
  30. - assigned-clocks: phandle of canfd clock.
  31. - assigned-clock-rates: maximum frequency of this clock.
  32. Optional property:
  33. The controller can operate in either CAN FD only mode (default) or
  34. Classical CAN only mode. The mode is global to both the channels. In order to
  35. enable the later, define the following optional property.
  36. - renesas,no-can-fd: puts the controller in Classical CAN only mode.
  37. Example
  38. -------
  39. SoC common .dtsi file:
  40. canfd: can@e66c0000 {
  41. compatible = "renesas,r8a7795-canfd",
  42. "renesas,rcar-gen3-canfd";
  43. reg = <0 0xe66c0000 0 0x8000>;
  44. interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
  45. <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
  46. clocks = <&cpg CPG_MOD 914>,
  47. <&cpg CPG_CORE R8A7795_CLK_CANFD>,
  48. <&can_clk>;
  49. clock-names = "fck", "canfd", "can_clk";
  50. assigned-clocks = <&cpg CPG_CORE R8A7795_CLK_CANFD>;
  51. assigned-clock-rates = <40000000>;
  52. power-domains = <&cpg>;
  53. status = "disabled";
  54. channel0 {
  55. status = "disabled";
  56. };
  57. channel1 {
  58. status = "disabled";
  59. };
  60. };
  61. Board specific .dts file:
  62. E.g. below enables Channel 1 alone in the board in Classical CAN only mode.
  63. &canfd {
  64. pinctrl-0 = <&canfd1_pins>;
  65. pinctrl-names = "default";
  66. renesas,no-can-fd;
  67. status = "okay";
  68. channel1 {
  69. status = "okay";
  70. };
  71. };
  72. E.g. below enables Channel 0 alone in the board using External clock
  73. as fCAN clock.
  74. &canfd {
  75. pinctrl-0 = <&canfd0_pins &can_clk_pins>;
  76. pinctrl-names = "default";
  77. status = "okay";
  78. channel0 {
  79. status = "okay";
  80. };
  81. };