Hi johlin, can you confirm you see CAN messages using the board?
The build above is working setting the can0, but when using candump (sudo apt-get install can-utils) to inspect the messages on a CAN BUS I get nothing.
I can assert that there are CAN traffic using another board. I tried the INT PA02 and PA07 and nothing. On both cases the can0 interface is created but no traffic.
Looking at the decompiled sun8i-h3-spi1-mcp2515.dtbo
I see the entry below. The frequency is correct to 8MHz, but the reference to the clock seems strange (clocks = <0x2>;)
The same for the irq, but it might be correct.
/dts-v1/;
/ {
compatible = "allwinner,sun8i-h3";
fragment@0 {
target-path = "/aliases";
__overlay__ {
spi1 = "/soc/spi@01c69000";
};
};
fragment@1 {
target-path = "/clocks";
__overlay__ {
#address-cells = <0x1>;
#size-cells = <0x1>;
can0_osc_fixed {
compatible = "fixed-clock";
#clock-cells = <0x0>;
clock-frequency = <0x7a1200>;
linux,phandle = <0x2>;
phandle = <0x2>;
};
};
};
fragment@2 {
target = <0xffffffff>;
__overlay__ {
can0_pin_irq@0 {
allwinner,pins = "PA7";
allwinner,function = "irq";
allwinner,drive = <0x0>;
allwinner,pull = <0x1>;
linux,phandle = <0x1>;
phandle = <0x1>;
};
};
};
fragment@3 {
target = <0xffffffff>;
__overlay__ {
status = "okay";
#address-cells = <0x1>;
#size-cells = <0x0>;
mcp2515@0 {
reg = <0x0>;
compatible = "microchip,mcp2515";
pinctrl-names = "default";
pinctrl-0 = <0x1>;
spi-max-frequency = <0x989680>;
interrupt-parent = <0xffffffff>;
interrupts = <0x0 0x7 0x2>;
clocks = <0x2>;
status = "okay";
linux,phandle = <0x3>;
phandle = <0x3>;
};
};
};
__symbols__ {
can0_osc_fixed = "/fragment@1/__overlay__/can0_osc_fixed";
can0_pin_irq = "/fragment@2/__overlay__/can0_pin_irq@0";
can0 = "/fragment@3/__overlay__/mcp2515@0";
};
__fixups__ {
pio = "/fragment@2:target:0", "/fragment@3/__overlay__/mcp2515@0:interrupt-parent:0";
spi1 = "/fragment@3:target:0";
};
__local_fixups__ {
fragment@3 {
__overlay__ {
mcp2515@0 {
pinctrl-0 = <0x0>;
clocks = <0x0>;
};
};
};
};
};