polarfire-soc / polarfire-soc-documentation

PolarFire SoC Documentation
Other
37 stars 19 forks source link

CAN bus interface #129

Closed Shivaraj199 closed 2 years ago

Shivaraj199 commented 2 years ago

hello, I am trying to use the classic can driver modules (can0 & can1) in Linux on the icicle kit. I am using the yocto BSP. I have enabled the can configurations in /recipes-kernel/linux/files/icicle-kit-es-amp directory and include the file in recipe. CAN BUS
CONFIG_CAN=y CONFIG_CAN_RAW=y CONFIG_CAN_BCM=y CONFIG_CAN_GW=y CONFIG_CAN_GS_USB=y CONFIG_CAN_CALC_BITTIMING=y CONFIG_CAN_VCAN=y CONFIG_CAN_DEV=y CONFIG_CAN_MCP251X=y With menuconfig i can confirm bus controller is enabled, Also i changed the dtsi file in the /kernel-source/arch/riscv/boot/dts/microchip to enable can0 and can1

             can0: can@2010c000 {
        compatible = "microchip,mpfs-can";
        reg = <0x0 0x2010c000 0x0 0x1000>;
        clocks = <&clkcfg CLK_CAN0>;
        interrupt-parent = <&plic>;
        interrupts = <56>;
        status = "okay";
        };

    can1: can@2010d000 {
        compatible = "microchip,mpfs-can";
        reg = <0x0 0x2010d000 0x0 0x1000>;
        clocks = <&clkcfg CLK_CAN1>;
        interrupt-parent = <&plic>;
        interrupts = <57>;
        status = "okay";
    };

When i build the image and flash it in the icicle kit I can see that CAN_RAW is enable with dmesg, but when i try to add can0 i get an error "Cannot find device "can0" Can anyone please tell what i am missing out or to enable can0 & can1 in the kernel?

Cyril-Jean commented 2 years ago

Please follow the steps in the issue template, this issue should be filed as a discussion item.