Joseph
Joseph

Reputation: 11

Enable ECSPI2 (/dev/spidev1.0) in mendel linux for Google Coral SOM

I am trying to enable ecspi2 in google coral SOM for a custom PCB that uses the ECSPI 2 to communicate with a RP2040. There are other SPI devices in ECSPI1 and so can not use that here.

Its not enabled by default in mendel.

I followed the getting statred page for mendel linux to download the sources as mentioned in https://coral.googlesource.com/docs/+/4be8a9d7b8c9b06780b9e5c8b08ca254cc811294/GettingStarted.md

With the sources i was attempting to modify the device tree in: linux-imx/arch/arm64/boot/dts/freescale/fsl-imx8mq-phanbell.dts

The modifications to fsl-imx8mq-phanbell.dts are as follows

...
&ecspi2 {
    fsl,spi-num-chipselects = <1>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>;
    cs-gpios = <&gpio5 13 GPIO_ACTIVE_HIGH>;
    status = "okay";

    spidev@0 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "rohm,dh2228fv";
        spi-max-frequency = <20000000>;
        reg = <0>;
        status = "okay";
    };
};
...

...
&iomuxc {
        imx8mq-phanbell {
...
                pinctrl_ecspi1_cs: ecspi1_cs_grp {
                        fsl,pins = <
                                MX8MQ_IOMUXC_ECSPI1_SS0_GPIO5_IO9       0x82
                                MX8MQ_IOMUXC_NAND_CE1_B_GPIO3_IO2       0x82
                        >;
                };
                pinctrl_ecspi2: ecspi2grp {
                        fsl,pins = <
                                MX8MQ_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK        0x82
                                MX8MQ_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI        0x82
                                MX8MQ_IOMUXC_ECSPI2_MISO_ECSPI2_MISO        0x82

                        >;
               };
...
        }
};

I tried building everything with 'm' and loaded the firmware to google coral SOM. I would expect /dev/spidev1.0 to show up if the device tree was correctly done. This did not happen.

I am wondering what i did wrong at this point. Any pointers to correct resources will be great

Upvotes: 1

Views: 111

Answers (0)

Related Questions