Bosch MCAN controller

Schema identifier ($id): "http://devicetree.org/schemas/net/can/bosch,m_can.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Bosch MCAN controller for CAN bus

Maintainers (maintainers): "Chandrasekar Ramakrishnan <rcsekar@samsung.com>"

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): can-controller.yaml#

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "bosch,m_can"

reg — required here #

Array item rules (items) #

Item 1

M_CAN registers map

Item 2

message RAM

reg-names — required here #

Array item rules (items) #

Item 1

Exact value (const): "m_can"

Item 2

Exact value (const): "message_ram"

interrupts — not listed as required here #

Array item rules (items) #

Item 1

interrupt line0

Item 2

interrupt line1

Minimum number of items (minItems): 1

interrupt-names — not listed as required here #

Array item rules (items) #

Item 1

Exact value (const): "int0"

Item 2

Exact value (const): "int1"

Minimum number of items (minItems): 1

clocks — required here #

Array item rules (items) #

Item 1

peripheral clock

Item 2

bus clock

clock-names — required here #

Array item rules (items) #

Item 1

Exact value (const): "hclk"

Item 2

Exact value (const): "cclk"

resets — not listed as required here #

Maximum number of items (maxItems): 1

bosch,mram-cfg — required here #

Message RAM configuration data. Multiple M_CAN instances can share the same Message RAM and each element(e.g Rx FIFO or Tx Buffer and etc) number in Message RAM is also configurable, so this property is telling driver how the shared or private Message RAM are used by this M_CAN controller.

The format should be as follows: <offset sidf_elems xidf_elems rxf0_elems rxf1_elems rxb_elems txe_elems txb_elems> The 'offset' is an address offset of the Message RAM where the following elements start from. This is usually set to 0x0 if you're using a private Message RAM. The remain cells are used to specify how many elements are used for each FIFO/Buffer.

M_CAN includes the following elements according to user manual: 11-bit Filter 0-128 elements / 0-128 words 29-bit Filter 0-64 elements / 0-128 words Rx FIFO 0 0-64 elements / 0-1152 words Rx FIFO 1 0-64 elements / 0-1152 words Rx Buffers 0-64 elements / 0-1152 words Tx Event FIFO 0-32 elements / 0-64 words Tx Buffers 0-32 elements / 0-576 words

Please refer to 2.4.1 Message RAM Configuration in Bosch M_CAN user manual for details.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/int32-array

Array item rules (items) #

Item 1

The 'offset' is an address offset of the Message RAM where the following elements start from. This is usually set to 0x0 if you're using a private Message RAM.

Default value (default): 0

Item 2

11-bit Filter 0-128 elements / 0-128 words

Minimum value (minimum): 0

Maximum value (maximum): 128

Item 3

29-bit Filter 0-64 elements / 0-128 words

Minimum value (minimum): 0

Maximum value (maximum): 64

Item 4

Rx FIFO 0 0-64 elements / 0-1152 words

Minimum value (minimum): 0

Maximum value (maximum): 64

Item 5

Rx FIFO 1 0-64 elements / 0-1152 words

Minimum value (minimum): 0

Maximum value (maximum): 64

Item 6

Rx Buffers 0-64 elements / 0-1152 words

Minimum value (minimum): 0

Maximum value (maximum): 64

Item 7

Tx Event FIFO 0-32 elements / 0-64 words

Minimum value (minimum): 0

Maximum value (maximum): 32

Item 8

Tx Buffers 0-32 elements / 0-576 words

Minimum value (minimum): 0

Maximum value (maximum): 32

Minimum number of items (minItems): 1

pinctrl-0 — not listed as required here #

Default pinctrl state

pinctrl-1 — not listed as required here #

Can be "sleep" or "wakeup" pinctrl state

pinctrl-2 — not listed as required here #

Can be "sleep" or "wakeup" pinctrl state

pinctrl-names — not listed as required here #

When present should contain at least "default" describing the default pin states. Other states are "sleep" which describes the pinstate when sleeping and "wakeup" describing the pins if wakeup is enabled.

Minimum number of items (minItems): 1

Array item rules (items) #

Item 1

Exact value (const): "default"

Item 2

Allowed values (enum): "sleep", "wakeup"

Item 3

Exact value (const): "wakeup"

power-domains — not listed as required here #

Power domain provider node and an args specifier containing the can device id value.

Maximum number of items (maxItems): 1

can-transceiver — not listed as required here #

Shared schema rule ($ref): can-transceiver.yaml#

phys — not listed as required here #

Maximum number of items (maxItems): 1

access-controllers — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

wakeup-source — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array

List of phandles to system idle states in which mcan can wakeup the system.

Required in this object (required): "compatible", "reg", "reg-names", "clocks", "clock-names", "bosch,mram-cfg"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

// Example with interrupts
#include <dt-bindings/clock/imx6sx-clock.h>
can@20e8000 {
  compatible = "bosch,m_can";
  reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
  reg-names = "m_can", "message_ram";
  interrupts = <0 114 0x04>, <0 114 0x04>;
  interrupt-names = "int0", "int1";
  clocks = <&clks IMX6SX_CLK_CANFD>,
           <&clks IMX6SX_CLK_CANFD>;
  clock-names = "hclk", "cclk";
  bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;

  can-transceiver {
    max-bitrate = <5000000>;
  };
};
// Example with timer polling
#include <dt-bindings/clock/imx6sx-clock.h>
can@20e8000 {
  compatible = "bosch,m_can";
  reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
  reg-names = "m_can", "message_ram";
  clocks = <&clks IMX6SX_CLK_CANFD>,
           <&clks IMX6SX_CLK_CANFD>;
  clock-names = "hclk", "cclk";
  bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>;

  can-transceiver {
    max-bitrate = <5000000>;
  };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Edit this page