Jump to content

How to bring up mcp2517fd device on OpenWRT?


Gediminas

Recommended Posts

I'm trying to get mcp25xxfd device to work on OpenWRT. Currently I'm using ramips platform (Linux Kernel version is 4.14.180). I have the following configuration in one of my DTS files:       

osc: oscillator {
                compatible = "fixed-clock";
                clock-frequency  = <40000000>;
        };

        spidev1 {
            compatible = "spi-gpio";
            gpio-sck  = <&gpio0 25 GPIO_ACTIVE_HIGH>;
            gpio-mosi = <&gpio0 26 GPIO_ACTIVE_HIGH>;
            gpio-miso = <&gpio0 27 GPIO_ACTIVE_HIGH>;
            cs-gpios  = <&gpio0 28 GPIO_ACTIVE_HIGH>;
            num-chipselects = <1>;


            can0: mcp2517fd@0 {
                    compatible = "microchip,mcp2517fd";
                    status = "okay";
                    clock-names = "can0_osc";
                    clocks = <&osc>;
                    reg = <0>;
                    spi-max-frequency = <16000000>;
                    interrupt-parent = <&gpio0>;
                    interrupts = <11>;
            };
        };

However, when I try to probe it using insmod utility, I get error:

    [   30.522030] mcp25xxfd: probe of spi1.0 failed with error -2

If I comment out the following section

        compatible = "spi-gpio";
        gpio-sck  = <&gpio0 25 GPIO_ACTIVE_HIGH>;
        gpio-mosi = <&gpio0 26 GPIO_ACTIVE_HIGH>;
        gpio-miso = <&gpio0 27 GPIO_ACTIVE_HIGH>;
        cs-gpios  = <&gpio0 28 GPIO_ACTIVE_HIGH>;
        num-chipselects = <1>;


and try to create SPI device manually

    insmod spi-gpio-custom bus0=1,25,26,27,0,1000000,28


and then again try to load mcp25xxfd, nothing happens:

    root@Sensors:/# insmod mcp25xxfd
    root@Sensors:/#

I can see spidev1.0 is on /dev, but no can0.
Can anyone help with this problem?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines