i2c on RPi Zero?

Oleksandr Tymoshenko gonzo at bluezbox.com
Sat Jan 5 21:56:14 UTC 2019


Per Hedeland (per at hedeland.org) wrote:
> On 2019-01-05 20:58, Oleksandr Tymoshenko wrote:
> > Per Hedeland (per at hedeland.org) wrote:
> >> I did a bit more testing on the Zero to see if the FreeBSD version
> >> mattered:
> >>
> >> FreeBSD-12.0-STABLE-arm-armv6-RPI-B-20190103-r342709.img - still no
> >> luck.
> >>
> >> FreeBSD-11.2-STABLE-arm-armv6-RPI-B-20190103-r342709.img - works!
> >> (I.e. dmesg reports as below and /dev/iic{0,1} get created - I haven't
> >> tested actual usage beyond having 'i2c -s' report "no devices found".)
> >>
> >> I guess that the i2c support hasn't been removed intentionally,
> >> i.e. this seems to be a regression - or is there some additional
> >> config etc required to enable it with FreeBSD-12? The iic and iicbus
> >> drivers appear to be built into the kernel in both 11 and 12.
> >>
> >> (I haven't tested FreeBSD-12 on the Pi B, but I would guess that the
> >> result will be the same as on the Zero, since it seems the hardware is
> >> the same.)
> > 
> > There was a transition in device tree files between 11 and 12.
> > bcm2708-rpi-0-w.dtb has i2c nodes but they're disabled by default.
> > Try editing config.txt on FAT partition and adding following line:
> > 
> > dtparam=i2c
> > 
> > This should make boot firmware to enable device nodes in the device
> > tree blob during the boot.
> 
> Thanks a lot! I can confirm that this makes i2c "work" on Zero with
> 12-RELEASE (almost) to the extent described above for 11.2-STABLE (it
> detects/creates only iic0, not iic1, but as far as I understand from
> other sources, iic0 is all that is needed for "plain B" and thus also
> for Zero).
> 
> Should I file a PR for this? I assume that the i2c nodes being
> disabled is not intentional...

Yes, please do. There are also other devices, that should be enabled by
default, like SPI.

Thanks

-- 
gonzo


More information about the freebsd-arm mailing list