@Edward big thanks for the explanation, that really makes sense now.
This is my current external CAN node definition and Im still having the same errors in dmesg:
&pinctrl_gpio4{
/* changing gpio5_27 pin settings */
fsl,pins = <
MX8MM_IOMUXC_UART3_TXD_GPIO5_IO27 0x1c4 /* SODIMM 212 */
>;
};
&ecspi2 {
#address-cells = <1>;
#size-cells = <0>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
/* This property is required, even if marked as obsolete in the doku */
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
can3: can@0 {
compatible = "microchip,mcp2517fd";
clocks = <&clk20m>;
gpio-controller;
/* dev board gpio4 pin -> gpio5_27 */
interrupt-parent = <&gpio5>;
interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
microchip,clock-allways-on;
microchip,clock-out-div = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio4>;
reg = <0>;
spi-max-frequency = <2000000>;
status = "okay";
};
};