From owner-freebsd-arm@freebsd.org Sat Jan 5 21:56:14 2019 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 510A314247B4 for ; Sat, 5 Jan 2019 21:56:14 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD4F6ED9F for ; Sat, 5 Jan 2019 21:56:13 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1gftvN-000EOa-5w; Sat, 05 Jan 2019 13:56:09 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id x05Lu8sn055339; Sat, 5 Jan 2019 13:56:08 -0800 (PST) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Sat, 5 Jan 2019 13:56:08 -0800 From: Oleksandr Tymoshenko To: Per Hedeland Cc: freebsd-arm@freebsd.org Subject: Re: i2c on RPi Zero? Message-ID: <20190105215608.GA55315@bluezbox.com> References: <229e0d36-a07b-8551-9613-0bf5748352e7@hedeland.org> <20190105195808.GA53872@bluezbox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Per Hedeland (per@hedeland.org) wrote: > On 2019-01-05 20:58, Oleksandr Tymoshenko wrote: > > Per Hedeland (per@hedeland.org) wrote: > >> I did a bit more testing on the Zero to see if the FreeBSD ver [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 5BD4F6ED9F X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [3.05 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_SPAM_SHORT(0.61)[0.610,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; NEURAL_SPAM_MEDIUM(0.72)[0.715,0]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx.bluezbox.com]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.43)[0.427,0]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.61)[asn: 14061(3.12), country: US(-0.08)] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 21:56:14 -0000 Per Hedeland (per@hedeland.org) wrote: > On 2019-01-05 20:58, Oleksandr Tymoshenko wrote: > > Per Hedeland (per@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