Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Mar 2022 14:14:54 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Don Kuenz <mail@crcomp.net>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: PCF8574 I2C configuration for 14.0-CURRENT on a RPi2B
Message-ID:  <47C61079-AB2E-4E81-AD95-F6042477D4E8@yahoo.com>
In-Reply-To: <20220306181214.932C51A05C0D@mlmmj.nyi.freebsd.org>
References:  <20220306181214.932C51A05C0D@mlmmj.nyi.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2022-Mar-6, at 10:11, Don Kuenz <mail@crcomp.net> wrote:

> My RPi2B GPIO header connects to a PCF8574 I2C adapter with these pins:
> 
>    RPi2B           PCF8574
> ---------------     -------
> Pin  2 - +5VDC  <-> VCC
> Pin  3 - GPIO 2 <-> SDA
> Pin  5 - GPIO 3 <-> SCL
> Pin 39 - Gnd    <-> GND
> 
> /boot/loader.conf contains these lines:
> 
> root@generic:/boot # cat /boot/loader.conf
> # Configure USB OTG; see usb_template(4).
> hw.usb.template=3
> umodem_load="YES"
> # Disable the beastie menu and color
> beastie_disable="YES"
> loader_color="NO"
> gpioiic_load="YES"
> 
> and /boot/msdos/config.txt looks like this:
> 
> root@generic:/boot # cat /boot/msdos/config.txt
> init_uart_clock=3000000
> enable_uart=1
> kernel=u-boot.bin
> kernel7=u-boot.bin
> dtoverlay=mmc

config.txt seems fine up to here. But I've never seen
anything indicating that the following notation is
valid for config.txt files:

> / {
>  gpioiic0 {
>    compatible = "i2c-gpio";
>    pinctrl-names = "default";
>    pinctrl-0 = <&pinctrl_gpioiic0>;
>    scl-gpios = <&gpio2  3 GPIO_ACTIVE_HIGH>;
>    sda-gpios = <&gpio3  5 GPIO_ACTIVE_HIGH>;
>    status = "okay";
>  };
> };

If you have a reference indicating otherwise, I'd
be interested to know what it is.

The notation seems to be source code for part of a
.dtb or .dtbo file. As I understand, there is a
separate toolchain involved in producing the binary
file(s) for such ( dtc ) and there is separate
place to put such .dtbo binary files on the msdos
file system: overlays/ .

I've never made my own .dtbo and so am not able to
help with the details. But I expect that producing
and using a .dtbo file is the general direction
of what needs to change for this part of what you
were doing.

"man dtc" should work for getting some information
about the dtc tool and how to use it.

> Nothing happens:
> 
> root@generic:/boot # i2c -sv
> dev: /dev/iic0, addr: 0x0, r/w: r, offset: 0x00, width: 8, count: 1
> Error opening I2C controller (/dev/iic0): No such file or directory
> 
> What's missing? Thank you in advance.




===
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47C61079-AB2E-4E81-AD95-F6042477D4E8>