Fran A100's post in MCP2515 CAN Controller on Allwinner D1 (MangoPi Mqpro) was marked as the answer
Finally I made it! Thanks a lot for the help but it was something else. The final overlay is the next one:
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,d1-nezha\0allwinner,sun20i-d1";
fragment@0 {
target-path = "/clocks";
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
/* External crystal oscillator on the board */
can0_osc_fixed: can0_osc_fixed {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <8000000>;
phandle = <0x81>;
};
};
};
fragment@1 {
target = <&pinctrl>; // pinctrl@2000000
__overlay__ {
can0_pin_irq: can0_pin_irq {
pins = "PD17";
function = "irq";
phandle = <0x85>;
bias-pull-up;
};
};
};
fragment@2 {
target = <&spi>; //spi@4026000
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
mcp2515 {
reg = <0>; // SPI 1
compatible = "microchip,mcp2515";
pinctrl-names = "default";
pinctrl-0 = <0x85>;
spi-max-frequency = <10000000>;
interrupt-parent = <0x22>; // pinctrl@2000000
interrupts = <3 17 8>; // IRQ LINE, try with <0 65 2>
clocks = <0x81>;
status = "okay";
};
};
};
};
I learnt some things about the interrupts field:
* The part of interrupts is like this, <BANK NUMBER TYPE_INTERRUPT>
* BANK is like, A -> 0, B-> 1, C->2, D->3
* NUMBER, PD17 -> 17
* TYPE_INTERRUPT, is described here