From owner-freebsd-arm@freebsd.org Fri Apr 19 08:05:15 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 9D2471588C8E for ; Fri, 19 Apr 2019 08:05:15 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id F284D6BC8B for ; Fri, 19 Apr 2019 08:05:14 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: by mailman.ysv.freebsd.org (Postfix) id A8DE71588C8D; Fri, 19 Apr 2019 08:05:14 +0000 (UTC) Delivered-To: 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 86A4F1588C8C for ; Fri, 19 Apr 2019 08:05:14 +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 E96F76BC89; Fri, 19 Apr 2019 08:05:13 +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 70f1d001; Fri, 19 Apr 2019 10:05:05 +0200 (CEST) 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=znUMamSyDDv8st0Co9JTbnx/fXc=; b=ftmq1/sHtGYXFenK1SCAfS56YHA0 Xv3ICPB+qwoliT4iMFCCR7QqHEyAbXiIpJ6Q5PckEEaHe2Upqwm2W9Ra1A2T4E++ Z6VsfgaIwdK91i+NZlEpbzHaoKu4LJCTLHw6CzkoOx1czBtCwgCADC7Kd8+5+jvl 5s1ApFWNEcNKjy0= 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=DEef3ehNWJITm+sMPYmKIN17dInK2LzKmd7ev+IviSq6cZi5S8h/mHvA kz+67ZCs5X+IDmsFhDbRPqcqqNrT05ZKpfaCu+HzzUin9UER8MRQjbTYm3pgZ4VK 6phHgQDbrjG/5fwWV+jEyRMLl6iirUjkEgl/NhprXARNFNbqoic= 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 c4325ed5 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 19 Apr 2019 10:05:05 +0200 (CEST) Date: Fri, 19 Apr 2019 10:05:02 +0200 From: Emmanuel Vadot To: Daniel Braniss Cc: Ian Lepore , "freebsd-arm@freebsd.org" Subject: Re: i2c almost working for me, was Re: i2c still not working for me Message-Id: <20190419100502.5546770a5795c20e3f4fa9db@bidouilliste.com> In-Reply-To: References: <12F641C3-9FAA-4A3A-BA18-A7302F3A0F5E@cs.huji.ac.il> <20190409095819.c560dbc156c46e5ca0244e3e@bidouilliste.com> <23A47048-642A-481C-B7BE-B61E55F82955@cs.huji.ac.il> <20190409171604.GA4581@bluezbox.com> <6119CE3B-6042-4DDC-82BE-B0C0C7ADA838@cs.huji.ac.il> <5D4799BC-08DF-4F3D-81A4-C2D938F4AF93@cs.huji.ac.il> <20190417222601.c037efe0cb48987c81032bac@bidouilliste.com> <64b5598e2c8c7265f89a31b1f191cb1be318788a.camel@freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: E96F76BC89 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.975,0] 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: Fri, 19 Apr 2019 08:05:15 -0000 On Fri, 19 Apr 2019 10:20:47 +0300 Daniel Braniss wrote: >=20 >=20 > > On 18 Apr 2019, at 17:19, Ian Lepore wrote: > >=20 > > On Thu, 2019-04-18 at 10:12 +0300, Daniel Braniss wrote: > >>> On 17 Apr 2019, at 23:26, Emmanuel Vadot > >>> wrote: > >>>=20 > >>> On Tue, 16 Apr 2019 09:16:02 +0300 > >>> Daniel Braniss > > >>> wrote: > >>>=20 > >>>>=20 > >>>>=20 > >>>>> On 11 Apr 2019, at 09:56, Daniel Braniss > >>>>> wrote: > >>>>>=20 > >>>>> if no device is connected, I2CRDWR hangs,=20 > >>>>> it also happens with i2c(8) -s, only reboot helps. > >>>>>=20 > >>>>> ichb1: twsi_reset: Using IIC_FASTEST/UNKNOWN mode with speed > >>>>> param=3D2a > >>>>> iichb1: TWSI_WRITE: Writing 0 to 18 > >>>>> iichb1: TWSI_WRITE: Writing 2a to 14 > >>>>> iichb1: TWSI_WRITE: Writing 40 to c > >>>>> iichb1: TWSI_WRITE: Writing c4 to c > >>>>> iichb1: twsi_transfer: transmitting 2 messages > >>>>> iichb1: TWSI_READ: read f8 from 10 > >>>>> iichb1: twsi_transfer: status=3Df8 > >>>>> iichb1: twsi_transfer: msg[0] flags: 0 > >>>>> iichb1: twsi_transfer: msg[0] len: 9 > >>>>> iichb1: TWSI_WRITE: Writing e4 to c > >>>>>=20 > >>>>> and now it?s hung > >>>>=20 > >>>> [?] > >>>=20 > >>> I don't see that on my OrangePi One or Pine64-LTS. > >>=20 > >> well, mine is are Nanopi Neo, maybe it?s a dts issue? > >> I also have a orangepi-zero but it will take me some time to make > >> a sdcard >=20 > I managed to boot my OrangePi Zero, and i2c -s has no issues, does not ha= ng. > still, with the latest (r346368) my NanoPi Neo hangs when no i2c device i= s present, > so what is the difference? or where can I look? Are you using the same i2c controller on both ? Could you paste somewhere the overlays or dts patches ? >=20 > >>>=20 > >>>>=20 > >>>> even with a working device, this happens sometimes: > >>>>=20 > >>>> my app gets ENXIO from the ioctl(fd, I2CRDWR, &data) and on the > >>>> console: > >>>> ? > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 38 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>> gic0: Spurious interrupt detected: last irq: 29 on CPU2 > >>>>=20 > >>>> the good news: my app is killable :-) > >>>=20 > >>> I would need more details for this. > >>=20 > >> it was caused by i2c issues - the cable was a bit too long. > >> BTW, does changing the frequency work? ie dev.iicbus.0.frequency > >=20 > > It looks like that driver does not honor the frequency sysctl/tunable. >=20 > >=20 > > You can often compensate for a too-long cable by adding some stronger > > pullups. It's typical for a SOM to have pullups in the 4.7K range on > > i2c. You can add your own 1K pullups to see if that helps the rise > > times on the bus. >=20 > well, at the moment it works ok with a 6m cable, i?ll try your suggestion= soon. >=20 > >=20 > > -- Ian > >=20 >=20 >=20 > cheers, > danny --=20 Emmanuel Vadot