dts: bindings: can: mcan: switch to using bosch,mram-cfg property
Switch the Bosch M_CAN devicetree binding to use a bosch,mram-cfg property for specifying the memory layout of the Bosch M_CAN Message RAM. This is identical to the Linux kernel devicetree binding for Bosch M_CAN IP core based CAN controllers. This introduces an offset cell which can be used for controllers with shared Message RAM between Bosch M_CAN instances. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
c52499e447
commit
6cd67e67fe
12 changed files with 35 additions and 86 deletions
|
@ -389,12 +389,13 @@
|
|||
#define MCAN_DT_PATH DT_PATH(soc, can)
|
||||
#endif
|
||||
|
||||
#define NUM_STD_FILTER_ELEMENTS DT_PROP(MCAN_DT_PATH, std_filter_elements)
|
||||
#define NUM_EXT_FILTER_ELEMENTS DT_PROP(MCAN_DT_PATH, ext_filter_elements)
|
||||
#define NUM_RX_FIFO0_ELEMENTS DT_PROP(MCAN_DT_PATH, rx_fifo0_elements)
|
||||
#define NUM_RX_FIFO1_ELEMENTS DT_PROP(MCAN_DT_PATH, rx_fifo0_elements)
|
||||
#define NUM_RX_BUF_ELEMENTS DT_PROP(MCAN_DT_PATH, rx_buffer_elements)
|
||||
#define NUM_TX_BUF_ELEMENTS DT_PROP(MCAN_DT_PATH, tx_buffer_elements)
|
||||
#define NUM_STD_FILTER_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 1)
|
||||
#define NUM_EXT_FILTER_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 2)
|
||||
#define NUM_RX_FIFO0_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 3)
|
||||
#define NUM_RX_FIFO1_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 4)
|
||||
#define NUM_RX_BUF_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 5)
|
||||
#define NUM_TX_EVENT_FIFO_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 6)
|
||||
#define NUM_TX_BUF_ELEMENTS DT_PROP_BY_IDX(MCAN_DT_PATH, bosch_mram_cfg, 7)
|
||||
|
||||
#ifdef CONFIG_CAN_STM32FD
|
||||
#define NUM_STD_FILTER_DATA CONFIG_CAN_MAX_STD_ID_FILTER
|
||||
|
@ -529,7 +530,7 @@ struct can_mcan_msg_sram {
|
|||
volatile struct can_mcan_rx_fifo rx_fifo0[NUM_RX_FIFO0_ELEMENTS];
|
||||
volatile struct can_mcan_rx_fifo rx_fifo1[NUM_RX_FIFO1_ELEMENTS];
|
||||
volatile struct can_mcan_rx_fifo rx_buffer[NUM_RX_BUF_ELEMENTS];
|
||||
volatile struct can_mcan_tx_event_fifo tx_event_fifo[NUM_TX_BUF_ELEMENTS];
|
||||
volatile struct can_mcan_tx_event_fifo tx_event_fifo[NUM_TX_EVENT_FIFO_ELEMENTS];
|
||||
volatile struct can_mcan_tx_buffer tx_buffer[NUM_TX_BUF_ELEMENTS];
|
||||
} __packed __aligned(4);
|
||||
|
||||
|
|
|
@ -48,12 +48,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <0>;
|
||||
tx-buffer-elements = <1>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>;
|
||||
|
||||
can0: can@42001c00 {
|
||||
compatible = "atmel,sam0-can";
|
||||
|
|
|
@ -412,12 +412,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <0>;
|
||||
tx-buffer-elements = <1>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>;
|
||||
|
||||
can0: can@40030000 {
|
||||
compatible = "atmel,sam-can";
|
||||
|
|
|
@ -222,12 +222,7 @@
|
|||
reg = <0x9d000 0x1000>;
|
||||
interrupts = <43 0>, <44 0>;
|
||||
clocks = <&syscon MCUX_MCAN_CLK>;
|
||||
std-filter-elements = <15>;
|
||||
ext-filter-elements = <15>;
|
||||
rx-fifo0-elements = <8>;
|
||||
rx-fifo1-elements = <8>;
|
||||
rx-buffer-elements = <8>;
|
||||
tx-buffer-elements = <15>;
|
||||
bosch,mram-cfg = <0x0 15 15 8 8 0 15 15>;
|
||||
sjw = <1>;
|
||||
sample-point = <875>;
|
||||
sjw-data = <1>;
|
||||
|
|
|
@ -216,12 +216,7 @@
|
|||
reg = <0x9d000 0x1000>;
|
||||
interrupts = <43 0>, <44 0>;
|
||||
clocks = <&syscon MCUX_MCAN_CLK>;
|
||||
std-filter-elements = <15>;
|
||||
ext-filter-elements = <15>;
|
||||
rx-fifo0-elements = <8>;
|
||||
rx-fifo1-elements = <8>;
|
||||
rx-buffer-elements = <8>;
|
||||
tx-buffer-elements = <15>;
|
||||
bosch,mram-cfg = <0x0 15 15 8 8 0 15 15>;
|
||||
sjw = <1>;
|
||||
sample-point = <875>;
|
||||
sjw-data = <1>;
|
||||
|
|
|
@ -254,12 +254,7 @@
|
|||
reg = <0x4009d000 0x1000>;
|
||||
interrupts = <43 0>, <44 0>;
|
||||
clocks = <&syscon MCUX_MCAN_CLK>;
|
||||
std-filter-elements = <15>;
|
||||
ext-filter-elements = <15>;
|
||||
rx-fifo0-elements = <8>;
|
||||
rx-fifo1-elements = <8>;
|
||||
rx-buffer-elements = <8>;
|
||||
tx-buffer-elements = <15>;
|
||||
bosch,mram-cfg = <0x0 15 15 8 8 0 15 15>;
|
||||
sjw = <1>;
|
||||
sample-point = <875>;
|
||||
sjw-data = <1>;
|
||||
|
|
|
@ -34,12 +34,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <0>;
|
||||
tx-buffer-elements = <3>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 3 3>;
|
||||
|
||||
can1: can@40006400 {
|
||||
compatible = "st,stm32-fdcan";
|
||||
|
|
|
@ -385,12 +385,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <0>;
|
||||
tx-buffer-elements = <3>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 3 3>;
|
||||
|
||||
can1: can@40006400 {
|
||||
compatible = "st,stm32-fdcan";
|
||||
|
|
|
@ -440,12 +440,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <0>;
|
||||
tx-buffer-elements = <3>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 3 3>;
|
||||
|
||||
can1: can@4000a400 {
|
||||
compatible = "st,stm32-fdcan";
|
||||
|
|
|
@ -469,12 +469,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <3>;
|
||||
tx-buffer-elements = <3>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 3 3>;
|
||||
|
||||
can1: can@4000a000 {
|
||||
compatible = "st,stm32h7-fdcan";
|
||||
|
|
|
@ -774,12 +774,7 @@
|
|||
compatible = "bosch,m_can-base";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
std-filter-elements = <28>;
|
||||
ext-filter-elements = <8>;
|
||||
rx-fifo0-elements = <3>;
|
||||
rx-fifo1-elements = <3>;
|
||||
rx-buffer-elements = <0>;
|
||||
tx-buffer-elements = <3>;
|
||||
bosch,mram-cfg = <0x0 28 8 3 3 0 3 3>;
|
||||
|
||||
can1: can@4000a400 {
|
||||
compatible = "st,stm32-fdcan";
|
||||
|
|
|
@ -3,26 +3,24 @@ description: Bosch M_CAN CAN-FD controller base
|
|||
compatible: "bosch,m_can-base"
|
||||
|
||||
properties:
|
||||
std-filter-elements:
|
||||
type: int
|
||||
bosch,mram-cfg:
|
||||
type: array
|
||||
required: true
|
||||
description: |
|
||||
Bosch M_CAN message RAM configuration. The cells in the array have the following format:
|
||||
|
||||
ext-filter-elements:
|
||||
type: int
|
||||
required: true
|
||||
<offset std-filter-elements ext-filter-elements rx-fifo0-elements rx-fifo1-elements
|
||||
rx-buffer-elements tx-event-fifo-elements tx-buffer-elements>
|
||||
|
||||
rx-fifo0-elements:
|
||||
type: int
|
||||
required: true
|
||||
The 'offset' is an address offset of the message RAM where the following elements start
|
||||
from. This is normally set to 0x0 when using a non-shared message RAM. The remaining cells
|
||||
specify how many elements are allocated for each filter type/FIFO/buffer.
|
||||
|
||||
rx-fifo1-elements:
|
||||
type: int
|
||||
required: true
|
||||
|
||||
rx-buffer-elements:
|
||||
type: int
|
||||
required: true
|
||||
|
||||
tx-buffer-elements:
|
||||
type: int
|
||||
required: true
|
||||
The Bosch M_CAN IP supports the following elements:
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue