Hi,
I want to use an MCP2515 CAN-Interface on the VIM3L. The loading of the driver and the communication over the SPI bus works so far (the MCP25615 gets initialized at boot time). But now I have to configure the interrupt pin of the CAN interface. The interrupt signal is connect to pin 39 (GPIODZ_15) of the 40 pin IO connector.
What I’ve tried:
Adding the MCP to the VIM3L Device Tree (fenix/build/linux/arch/arm64/boot/dts/amlogic/kvim3l_linux.dts
):
&pinctrl_periphs {
...
can0_pins: can0_pins {
mux {
groups = "GPIOZ_15";
function = "gpio_periphs";
input-enable;
};
};
};
...
&pwm_ef {
...
pinctrl-0 = <&pwm_f_pins1>;
};
...
&clkc {
can0_osc: can0_osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <16000000>;
};
};
&spicc1 {
status = "enable";
...
can0: mcp2515@0 {
status = "disabled";
reg = <0>;
compatible = "microchip,mcp2515";
pinctrl-names = "default";
pinctrl-0 = <&can0_pins>;
spi-max-frequency = <10000000>;
interrupt-parent = <&gic>;
interrupt-names = "can0_int";
interrupts = <GIC_SPI 63 IRQ_TYPE_EDGE_FALLING>;
interrupt_pin = <&gpio GPIOZ_15 IRQ_TYPE_EDGE_FALLING>;
clocks = <&can0_osc>;
};
};
The following Overlay file (activated in boot/env.txt
) activates the interface:
/*
* Device tree overlay for mcp251x/can0 on spi1.0
*/
/dts-v1/;
/plugin/;
/ {
/* disable spi-dev for spi1.0 */
fragment@0 {
target = <&spicc1>;
__overlay__ {
status = "okay";
spidev@0 {
status = "disabled";
};
mcp2515@0 {
status = "okay";
};
};
};
fragment@1 {
target = <&uart_C>;
__overlay__ {
status = "disabled";
};
};
};
But when trying to bring it up in Ubuntu with:
$ ip link set can0 type can bitrate 125000
$ ip link set up can0
I get the following error:
RTNETLINK answers: Invalid argument
How do I have to configure the interrupt pin in the device tree correctly?