From nobody Sun Mar 06 22:18:15 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8D40F19EA59D for ; Sun, 6 Mar 2022 22:18:26 +0000 (UTC) (envelope-from freebsd-arm@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KBbZn3d2tz3k8n for ; Sun, 6 Mar 2022 22:18:25 +0000 (UTC) (envelope-from freebsd-arm@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mailhost.netlabit.sk with ESMTPSA; Sun, 06 Mar 2022 23:18:17 +0100 id 00DADC7E.62253329.0001760E Date: Sun, 6 Mar 2022 23:18:15 +0100 From: Milan Obuch To: freebsd-arm@freebsd.org Subject: Re: PCF8574 I2C configuration for 14.0-CURRENT on a RPi2B Message-ID: <20220306231815.6ea9b3b2@zeta.dino.sk> In-Reply-To: <20220306181231.4801A1A059FB@mlmmj.nyi.freebsd.org> References: <20220306181231.4801A1A059FB@mlmmj.nyi.freebsd.org> X-Mailer: Claws Mail 3.18.0git333 (GTK+ 2.24.33; i386-portbld-freebsd11.4) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KBbZn3d2tz3k8n X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-arm@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-arm@dino.sk X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-arm]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 06 Mar 2022 18:11:50 UTC Don Kuenz wrote: > Greetings, > > 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 > / { > 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"; > }; > }; > > 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. > Hi, could you show us what's in /dev directory? Probably no iic0 file there. Also, you did not write which kernel are you using. For /dev/iic0 to appear, you need either 'device iic' in your kernel config or load it dynamically via 'kldload iic', in addition to working i2c controller. Showing your 'dmesg' output helps to determine what's going on, along with DTB used as well. All this are just basic hints what and where to look for, there are probably other as well, but I hope this helps. Regards, Milan