From owner-freebsd-arm@freebsd.org Sat Jan 5 22:09:52 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 E68361424C33 for ; Sat, 5 Jan 2019 22:09:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B3856F509 for ; Sat, 5 Jan 2019 22:09:50 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id d2b00498; Sat, 5 Jan 2019 23:03:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=65kSoiangd8/mEuhHPYAxYYxb+8=; b=FiOX8yep0AnIQ8oCQmqev/0tEZ5+ v6oin1KgHlD2U7FZ/PaKq91y4aTGBUF6o+twbMm2RiGWW+us71T5kt3A03zPTu7B uAlP3oapJf1jpfOCDQ4RlWUt2fheT07TbIoUWq93mUHBt+/m8coy5C7SCldrBao/ Ni7sXa1rnCf3Krc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=RK+JTvifbqNTNg1KCgzy5fzYq+jjEjMJc9pYqLO3/BiXLQfRHNo6MErf aKMVzsia9XhgAOyfUluOWzo7aMQ4g+Jh18yepf/fu4ChbNNB+ELKYZrvJIZP7VhP C/Cq7UgE/fHby1YUw8wX+U8NCdUl6qDmtUQCnvghRvXFuZYiLKU= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id ec54e20d TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 5 Jan 2019 23:03:07 +0100 (CET) Date: Sat, 5 Jan 2019 23:03:06 +0100 From: Emmanuel Vadot To: Oleksandr Tymoshenko Cc: Per Hedeland , freebsd-arm@freebsd.org Subject: Re: i2c on RPi Zero? Message-Id: <20190105230306.2ad9d0ba2c2df0e8fac5f053@bidouilliste.com> In-Reply-To: <20190105215608.GA55315@bluezbox.com> References: <229e0d36-a07b-8551-9613-0bf5748352e7@hedeland.org> <20190105195808.GA53872@bluezbox.com> <20190105215608.GA55315@bluezbox.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9B3856F509 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=FiOX8yep; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-0.12 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; NEURAL_HAM_MEDIUM(-0.78)[-0.777,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_HAM_LONG(-0.91)[-0.912,0]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.35)[0.351,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; MX_GOOD(-0.01)[mx-backup.blih.net,mail.blih.net]; IP_SCORE(0.13)[ipnet: 212.83.160.0/19(0.80), asn: 12876(-0.13), country: FR(-0.02)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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 22:09:52 -0000 On Sat, 5 Jan 2019 13:56:08 -0800 Oleksandr Tymoshenko wrote: > 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. Why should we enabled them by default ? We have no correct way for switching a pin to gpio mode (you can do that with gpioctl on some system but I consider it as a bug) so if I want to use the i2c/spi/whatever pins as gpio and the default image set it to another function I'm stuck. Using the rpi fundation dtb means that every settings that they set for Linux will also be set for us, so every tutorial on the web where people saying that you should set something in config.txt will apply to FreeBSD too. The current settings aren't a bug, it's a feature (c). > Thanks > > -- > gonzo > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" -- Emmanuel Vadot