From owner-freebsd-arm@freebsd.org Tue Apr 9 08:16:49 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 B894B1578FB2 for ; Tue, 9 Apr 2019 08:16:49 +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 1DA3A82198 for ; Tue, 9 Apr 2019 08:16:49 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: by mailman.ysv.freebsd.org (Postfix) id D0AAF1578FA4; Tue, 9 Apr 2019 08:16:48 +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 ABA751578FA3 for ; Tue, 9 Apr 2019 08:16:48 +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 2D5B882197 for ; Tue, 9 Apr 2019 08:16:47 +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 b25a44ed; Tue, 9 Apr 2019 10:16:46 +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=15h6wW3J59myijTn46Ttx7W3dZY=; b=WN6VVOmHEdGmZITDZd3eHR8RZv+L mMVTmYlHaI5tAJnaWzQSz3voxAzY6eBpDk2m44NBcK7ZhpCA1AspXd0CY3B55VEs 9yz8RiH7goek9ska4DSd6HmbKTocPKCdVBpvItKDa9iCSAPPC6WST45e1uhi361y WKmGlNhrSy5/Dd4= 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=NEsOLtFjNMIMSyYYHEpUL2Pk72oR/M79T+tWnKCXQ1WS8Je6XhEa3hnU 9LfO3biQs5EOjjkjGXxw6/InncqNwH1oxmtEN3Qz5HXvP03O7Co7/ZndGs8TZCgw LGEEwQMNeUo0EYfRm++AOXccwBFova2ANrPlJtwahNbfJL3xu8Y= 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 e0d9032f TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Tue, 9 Apr 2019 10:16:46 +0200 (CEST) Date: Tue, 9 Apr 2019 10:16:45 +0200 From: Emmanuel Vadot To: Daniel Braniss Cc: "freebsd-arm@freebsd.org" Subject: Re: i2c still not working for me Message-Id: <20190409101645.d645241fe12451f166e033a2@bidouilliste.com> In-Reply-To: <23A47048-642A-481C-B7BE-B61E55F82955@cs.huji.ac.il> References: <12F641C3-9FAA-4A3A-BA18-A7302F3A0F5E@cs.huji.ac.il> <20190409095819.c560dbc156c46e5ca0244e3e@bidouilliste.com> <23A47048-642A-481C-B7BE-B61E55F82955@cs.huji.ac.il> 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: 2D5B882197 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,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: Tue, 09 Apr 2019 08:16:50 -0000 On Tue, 9 Apr 2019 11:04:23 +0300 Daniel Braniss wrote: >=20 >=20 > > On 9 Apr 2019, at 10:58, Emmanuel Vadot wrote: > >=20 > > On Tue, 9 Apr 2019 10:50:22 +0300 > > Daniel Braniss wrote: > >=20 > >> Hi, > >> after the latest changes to i2c there is a small improvement, > >> i2c -s finds the device but complains: > >>=20 > >> root@neo-14:~ # i2c -s > >> Hardware may not support START/STOP scanning; trying less-reliable rea= d method. > >> Scanning I2C devices on /dev/iic0: 24 > >>=20 > >> but nothing else works. > >>=20 > >> I?ll try and connect my saleae signal analyzer later, but in the mean= time this is what I get > >> on the console: > >> [?] > >> iichb0: twsi_control_clear: read val=3D58 > >> iichb0: twsi_control_clear: write val=3D40 > >> iichb0: TWSI_WRITE: Writing 40 to c > >> iichb0: twsi_start: twsi_start: slave=3D48 > >> iichb0: twsi_locked_start: send start > >> iichb0: TWSI_READ: read 58 from c > >> iichb0: twsi_control_set: read val=3D58 > >> iichb0: twsi_control_set: write val=3D68 > >> iichb0: TWSI_WRITE: Writing 68 to c > >> iichb0: twsi_poll_ctrl: Waiting for ctrl r. > >> eg to match mask 8 > >> iichb0: TWSI_READ: read 48 from c > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> twsi_poll_ctrl: done > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> TWSI_READ: read 8 from 10 > >> iichb0: twsi_locked_start: status=3D8 > >> iichb0: TWSI_WRITE: Writing 48 to 8 > >> gic0: Spurious interrupt detected: last irq: 32 on CPU1 > >> iichb0: TWSI_READ: read 48 from c > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> twsi_control_clear: read val=3D48 > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> twsi_control_clear: write val=3D40 > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> TWSI_WRITE: Writing 40 to c > >> gic0: Spurious interrupt detected: last irq: 32 on CPU1 > >> iichb0: twsi_poll_ctrl: Waiting for ctrl reg to match mask 8 > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> TWSI_READ: read 48 from c > >> iichb0: twsi_poll_ctrl: done > >> iichb0: TWSI_READ: read 8 from 10 > >> iichb0: twsi_locked_start: no ACK (status: 08) after sending slave add= ress > >> gic0: iichb0: Spurious interrupt detected: last irq: 32 on CPU1 > >> twsi_stop: twsi_stop > >> [?] > >>=20 > >> BTW, the hardware is NanoPi-neo and it?s running Current 345984 > >>=20 > >> thanks, > >> danny > >>=20 > >=20 > > Based on the function names you are using directly stop/start/etc ... > > My changes were only for i2c_transfer (I2CRDWR ioctls) > >=20 >=20 > ok, this will show my ignorance, but could you send me some sample code t= hat uses I2CRDWR? > btw, the device i?m trying out is an RFID reader pn533, which works with = a modified driver ? >=20 > thanks, > danny You can have a look at i2c(8) source code, it uses RDWR. Basically you give the ioctl some i2c messages (struct iic_rdwr_data). Also man 4 iic --=20 Emmanuel Vadot