From owner-freebsd-arm@freebsd.org Sat Aug 11 15:05:00 2018 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 1DF0B106FD21 for ; Sat, 11 Aug 2018 15:05:00 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 9B6F782E41 for ; Sat, 11 Aug 2018 15:04:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: e447933b-9d77-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e447933b-9d77-11e8-aff6-0b9b8210da61; Sat, 11 Aug 2018 15:04:50 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7BF4mT4063988; Sat, 11 Aug 2018 09:04:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533999888.31375.6.camel@freebsd.org> Subject: Re: Nanopi Neo I2C From: Ian Lepore To: lyd mc , "freebsd-arm@freebsd.org" Date: Sat, 11 Aug 2018 09:04:48 -0600 In-Reply-To: <165877705.5351934.1533988165694@mail.yahoo.com> References: <165877705.5351934.1533988165694.ref@mail.yahoo.com> <165877705.5351934.1533988165694@mail.yahoo.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 15:05:00 -0000 On Sat, 2018-08-11 at 11:49 +0000, lyd mc via freebsd-arm wrote: > Hi List, > Can you help me make I2C work in this board? > I can detect the controller but cannot access it through iic ioctl.  > > root@nanopi-neo:~/prog/I2C # dmesg |grep iic > iichb0: mem 0x1c2ac00- > 0x1c2afff irq 34 on simplebus0 > iicbus0: on iichb0 > iichb1: mem 0x1c2b000- > 0x1c2b3ff irq 35 on simplebus0 > iicbus1: on iichb1 > iichb2: mem 0x1c2b400- > 0x1c2b7ff irq 36 on simplebus0 > iicbus2: on iichb2 > iic0: on iicbus0 > iic1: on iicbus1 > iic2: on iicbus2 > > kdump output: > >   1290 mcp      NAMI  "/dev/iic0" >   1290 mcp      RET   openat 3 >   1290 mcp      CALL  ioctl(0x3,I2CRDWR,0xbfbfecd4) >   1290 mcp      RET   ioctl -1 errno 2 No such file or directory > > This seems to work on my RPI. > In this case, I wonder if the "errno 2" is not ENOENT, but rather IIC_ENOACK which has not been translated to a proper errno before returning. IIC_ENOACK is basically a timeout and can happen if the slave address is wrong, or if the pinmux is wrong so that the bus is electrically inactive. Is the bus working in general? Do any devices show up on a scan with   i2c -f /dev/iic0 -s -- Ian