From owner-freebsd-arm@freebsd.org Sun Apr 25 17:30:18 2021 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAFF35E1091 for ; Sun, 25 Apr 2021 17:30:18 +0000 (UTC) (envelope-from hrant.dadivanyan@gmail.com) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FSw5j6ZlQz3r2d for ; Sun, 25 Apr 2021 17:30:17 +0000 (UTC) (envelope-from hrant.dadivanyan@gmail.com) Received: by mail-ed1-f51.google.com with SMTP id d21so42926273edv.9 for ; Sun, 25 Apr 2021 10:30:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to; bh=B/Yp3tM0PWUaR82DnaxXv1EJiJsUJY68NqRCR4Lpzok=; b=fzc4ITp+THc/IgnBO0wnpXZdVjfieJa0r2tLKQnepIhcqJ+p/SVKy/MPeiIFejt2bQ 5QraIRi/yO66fKtUg8vz7gLha9DXph6RSpSoqZjFbpHMtSThPmUqR05h10Kjq2oizoSf 80hsaEnNUFBXMEmohQCCbeqqQ5sKEtNzqMUYtnMNKNX8v+J0ti+ql9/AFKC5M9IjK9zK FtNmcQkye/UHRTjpNjwfaZaB9TCxuqkkzh5oqmnXrZnBgE09ac+fbc+/zAO3M/JsUU/c OWadBc95YyjmEXIr1gWcqPzFzBVxcO8FGyCZrMPuUgOrs3YKd555QL0lDQfEt0QS43qG o+2w== X-Gm-Message-State: AOAM531KVcaW6WvH8sieugvermqh+gVkyaOXtwr35Tu1/DF23sfBWUot y6ICnxAFxhwT9MzXfr0M1uJcj6qDBo0= X-Google-Smtp-Source: ABdhPJwoCtg6FF+04x9B2KFD36KLc6TA2dhIrXBdngN/cs48tYlCj5SIKJMZ2xvMAKp3aE1y1hn7Gg== X-Received: by 2002:a05:6402:212:: with SMTP id t18mr16704209edv.165.1619371815785; Sun, 25 Apr 2021 10:30:15 -0700 (PDT) Received: from dadivanyan.net ([87.241.140.223]) by smtp.gmail.com with ESMTPSA id f1sm11905675edz.60.2021.04.25.10.30.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Apr 2021 10:30:15 -0700 (PDT) To: freebsd-arm@freebsd.org References: <1C2DD11C-B1F6-4C2A-9AB0-5F1553520FF5@FreeBSD.org> From: Hrant Dadivanyan Subject: Re: I2C/IIC working on RPI4 8GB? Message-ID: Date: Sun, 25 Apr 2021 21:30:13 +0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <1C2DD11C-B1F6-4C2A-9AB0-5F1553520FF5@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KOnGszPo1Cy2wL34VrAjecVt6UzNAGS06" X-Rspamd-Queue-Id: 4FSw5j6ZlQz3r2d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hrantdadivanyan@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=hrantdadivanyan@gmail.com X-Spamd-Result: default: False [-4.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[hrant@dadivanyan.com,hrantdadivanyan@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[87.241.140.223:received]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[hrant@dadivanyan.com,hrantdadivanyan@gmail.com]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.208.51:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; DMARC_NA(0.00)[dadivanyan.com]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[209.85.208.51:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.51:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.51:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to ARM processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 17:30:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KOnGszPo1Cy2wL34VrAjecVt6UzNAGS06 Content-Type: multipart/mixed; boundary="0KfHqylAhmfSoeHaMCQjLWU5rjRF841AX"; protected-headers="v1" From: Hrant Dadivanyan To: freebsd-arm@freebsd.org Message-ID: Subject: Re: I2C/IIC working on RPI4 8GB? References: <1C2DD11C-B1F6-4C2A-9AB0-5F1553520FF5@FreeBSD.org> In-Reply-To: <1C2DD11C-B1F6-4C2A-9AB0-5F1553520FF5@FreeBSD.org> --0KfHqylAhmfSoeHaMCQjLWU5rjRF841AX Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Mark, Exactly the same here for 13.0-RELEASE. I use ds3231 on RPI-B and RPI3,=20 but it never works on RPI4 8GB (periodically trying from August 2020 as=20 far as I can remember). Not even when booting from the SD card pulled=20 out from RPI3 and inserted into RPI4. Found the following workaround though (config.txt): #device_tree_overlay=3Di2c-rtc,ds3231 device_tree_overlay=3Di2c-rtc-gpio,ds3231,i2c_gpio_scl=3D2,i2c_gpio_sda=3D= 3 Please note pins REVERSE assignment in config. # dmesg | egrep -i 'ds3231|rtc|i2c|iic|time-of-day' iichb0: mem 0x7e804000-0x7e804fff irq 26=20 on simplebus0 iicbus0: on iichb0 iic0: on iicbus0 Warning: no time-of-day clock registered, system time will not be set=20 accurately gpioiic0: on ofwbus0 gpioiic0: SCL pin: gpiobus0:3, SDA pin: gpiobus0:2 iicbb0: on gpioiic0 iicbus1: on iicbb0 master-only iic1: on iicbus1 ds32310: at addr 0xd0 on iicbus1 ds32310: registered as a time-of-day clock, resolution 1.000000s # Please note pins CORRECT assignment in the dmesg. Thank you, Hrant On 4/25/21 4:32 PM, Mark Murray wrote: > Hi All, >=20 > Does anyone here have IIC/I2C working on a CURRENT (I'm running latest)=20 FreeBSD? >=20 > I've never seen it work; Last time I had working IIC was on an RPI3. >=20 > There is a /dev/iic0, and I have a known working RTC on it, but the sca= n just times out: >=20 > [root@grasshopper ~]# i2c -s > Hardware may not support START/STOP scanning; trying less-reliable read=20 method. > > Scanning I2C devices on /dev/iic0: >=20 >=20 > I suspect something not-quite-right in DTS land, but I lack the knowled= ge to investigate. I've done some random stumbling around in the dark wit= h overlays and the like, but I've either seen the above error, or a total=20 lack of /dev/iic0. >=20 > Thanks! >=20 > M > -- > Mark R V Murray >=20 --=20 Hrant Dadivanyan - hrant(at)dadivanyan.net /* "Feci quod potui, faciant meliora potentes." */ --0KfHqylAhmfSoeHaMCQjLWU5rjRF841AX-- --KOnGszPo1Cy2wL34VrAjecVt6UzNAGS06 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEPbz+l3tnoK718ci3h/fmw7c/bD0FAmCFpyUFAwAAAAAACgkQh/fmw7c/bD0s twf+JnwBiP3cPJCTUcO/MU0MiVIOkctjLELkwSypQJ3jMLYAS+4jq2nSnar4sGtFv3azMbmouCVo Ciy8+pSKLP7Ig/YxnpEqH8FEpHdM8MI52OPyWQaalmTq5MWnjJaPbDXleFdl50lQCPlY4Kodxy2U WCbD78C5arjnyFCjLDZny5ZZYR2TqNdm/pz5suVpV1FZJb13BmKaVrzibHBY/UmJiOEbD0o52hfJ q/OYF3R9Aa60vEfDyFN4Z6+I21J3/ziJB+fjHadKfhIx0CQDkTjmbbP3eU8tqkB4ya7aG7Pj8Qcd gbK8vt7aAiNhMc1MMyhIN5jXmu9ScozfAaPTBU6itA== =MKO2 -----END PGP SIGNATURE----- --KOnGszPo1Cy2wL34VrAjecVt6UzNAGS06--