|
| 1 | +Bosch MCAN controller Device Tree Bindings |
| 2 | +------------------------------------------------- |
| 3 | + |
| 4 | +Required properties: |
| 5 | +- compatible : Should be "bosch,m_can" for M_CAN controllers |
| 6 | +- reg : physical base address and size of the M_CAN |
| 7 | + registers map and Message RAM |
| 8 | +- reg-names : Should be "m_can" and "message_ram" |
| 9 | +- interrupts : Should be the interrupt number of M_CAN interrupt |
| 10 | + line 0 and line 1, could be same if sharing |
| 11 | + the same interrupt. |
| 12 | +- interrupt-names : Should contain "int0" and "int1" |
| 13 | +- clocks : Clocks used by controller, should be host clock |
| 14 | + and CAN clock. |
| 15 | +- clock-names : Should contain "hclk" and "cclk" |
| 16 | +- pinctrl-<n> : Pinctrl states as described in bindings/pinctrl/pinctrl-bindings.txt |
| 17 | +- pinctrl-names : Names corresponding to the numbered pinctrl states |
| 18 | +- bosch,mram-cfg : Message RAM configuration data. |
| 19 | + Multiple M_CAN instances can share the same Message |
| 20 | + RAM and each element(e.g Rx FIFO or Tx Buffer and etc) |
| 21 | + number in Message RAM is also configurable, |
| 22 | + so this property is telling driver how the shared or |
| 23 | + private Message RAM are used by this M_CAN controller. |
| 24 | + |
| 25 | + The format should be as follows: |
| 26 | + <offset sidf_elems xidf_elems rxf0_elems rxf1_elems |
| 27 | + rxb_elems txe_elems txb_elems> |
| 28 | + The 'offset' is an address offset of the Message RAM |
| 29 | + where the following elements start from. This is |
| 30 | + usually set to 0x0 if you're using a private Message |
| 31 | + RAM. The remain cells are used to specify how many |
| 32 | + elements are used for each FIFO/Buffer. |
| 33 | + |
| 34 | + M_CAN includes the following elements according to user manual: |
| 35 | + 11-bit Filter 0-128 elements / 0-128 words |
| 36 | + 29-bit Filter 0-64 elements / 0-128 words |
| 37 | + Rx FIFO 0 0-64 elements / 0-1152 words |
| 38 | + Rx FIFO 1 0-64 elements / 0-1152 words |
| 39 | + Rx Buffers 0-64 elements / 0-1152 words |
| 40 | + Tx Event FIFO 0-32 elements / 0-64 words |
| 41 | + Tx Buffers 0-32 elements / 0-576 words |
| 42 | + |
| 43 | + Please refer to 2.4.1 Message RAM Configuration in |
| 44 | + Bosch M_CAN user manual for details. |
| 45 | + |
| 46 | +Example: |
| 47 | +SoC dtsi: |
| 48 | +m_can1: can@020e8000 { |
| 49 | + compatible = "bosch,m_can"; |
| 50 | + reg = <0x020e8000 0x4000>, <0x02298000 0x4000>; |
| 51 | + reg-names = "m_can", "message_ram"; |
| 52 | + interrupts = <0 114 0x04>, |
| 53 | + <0 114 0x04>; |
| 54 | + interrupt-names = "int0", "int1"; |
| 55 | + clocks = <&clks IMX6SX_CLK_CANFD>, |
| 56 | + <&clks IMX6SX_CLK_CANFD>; |
| 57 | + clock-names = "hclk", "cclk"; |
| 58 | + bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>; |
| 59 | + status = "disabled"; |
| 60 | +}; |
| 61 | + |
| 62 | +Board dts: |
| 63 | +&m_can1 { |
| 64 | + pinctrl-names = "default"; |
| 65 | + pinctrl-0 = <&pinctrl_m_can1>; |
| 66 | + status = "enabled"; |
| 67 | +}; |
0 commit comments