mcp2515 CAN controller via SPI
Posted: Mon Sep 23, 2019 8:11 am
I've enabled SPI via UART4 with the help of this post
There is a dst file for NVIDEA Tegra boards here
However I have difficulties to enable the MPC2515 CAN controller via SPI, since I don't know how to bring up the correct DST config.
Here is my config from arch/arm64/boot/dts/rockchip/rk3399-nanopi4-common.dtsi so far:
I have wired GPIO4_C5 (GPIO 149) for the interrupt line. The rest (MISO, MOSI, CS and CLK) should be the default ones from the 260 pin spec.
I have no clue what interrupt-parent should look like, how to reference GPIO4_C5 in interrupts, what vdd-supply and xceiver-supply are.
How would the correct dst config look like?
There is a dst file for NVIDEA Tegra boards here
However I have difficulties to enable the MPC2515 CAN controller via SPI, since I don't know how to bring up the correct DST config.
Here is my config from arch/arm64/boot/dts/rockchip/rk3399-nanopi4-common.dtsi so far:
Code: Select all
...
clocks {
/* 8MHz external crystal oscillator */
clk8m: mcp251x_osc {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <8000000>;
};
};
...
spi1 {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-1 = <&spi1_gpio>;
spidev0: spidev@0 {
compatible = "rockchip,spidev";
reg = <0>;
spi-max-frequency = <10000000>;
status = "okay";
};
can@0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "microchip,mcp2515";
reg = <0x0>;
clocks = <&clk8m>;
interrupt-parent = <&tegra_aon_gpio>;
interrupts = <DAXC03_INT IRQ_TYPE_EDGE_FALLING>;
spi-max-frequency = <2000000>;
vdd-supply = <&spmic_ldo5>;
xceiver-supply = <&spmic_ldo5>;
};
};
I have wired GPIO4_C5 (GPIO 149) for the interrupt line. The rest (MISO, MOSI, CS and CLK) should be the default ones from the 260 pin spec.
I have no clue what interrupt-parent should look like, how to reference GPIO4_C5 in interrupts, what vdd-supply and xceiver-supply are.
How would the correct dst config look like?