NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: I cannot make i2c work in raspberry pi Zero W



ea1abz%gmail.com@localhost (Ramiro Aceves) writes:

>I see that i2c works even if not configured on /boot/config.txt 
>commenting the dtparam=i2c_arm=on:

Yes, that dtparam doesn't exist in our DTB file.

Our DTB file makes all 3 I2C devices available, like:

i2c@7e205000 {
   status = "okay";
}

i2c@7e804000 {
   status = "okay";
}

i2c@7e805000 {
   status = "okay";
}

__symbols__ {
   i2c0 = "/soc/i2c@7e205000";
   i2c1 = "/soc/i2c@7e804000";
   i2c2 = "/soc/i2c@7e805000";
}

but only i2c@7e804000 should be used.

I usually switch off the other two with an overlay:

/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2835";

        fragment@0 {
                target = <&i2c2>;

                __overlay__ {
                        status = "disabled";
                };
        };

        fragment@1 {
                target = <&i2c0>;

                __overlay__ {
                        status = "disabled";
                };
        };

        fragment@2 {
                target = <&i2c1>;

                __overlay__ {
                        status = "okay";
                };
        };
};

Since our device units usually just count up, the remaining one
is then bsciic0 / iic0 and a program can access it as /dev/iic0.



Home | Main Index | Thread Index | Old Index