Date: Sat, 11 Aug 2018 09:04:48 -0600 From: Ian Lepore <ian@freebsd.org> To: lyd mc <alydiomc@yahoo.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: Nanopi Neo I2C Message-ID: <1533999888.31375.6.camel@freebsd.org> In-Reply-To: <165877705.5351934.1533988165694@mail.yahoo.com> References: <165877705.5351934.1533988165694.ref@mail.yahoo.com> <165877705.5351934.1533988165694@mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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: <Allwinner Integrated I2C Bus Controller> mem 0x1c2ac00- > 0x1c2afff irq 34 on simplebus0 > iicbus0: <OFW I2C bus> on iichb0 > iichb1: <Allwinner Integrated I2C Bus Controller> mem 0x1c2b000- > 0x1c2b3ff irq 35 on simplebus0 > iicbus1: <OFW I2C bus> on iichb1 > iichb2: <Allwinner Integrated I2C Bus Controller> mem 0x1c2b400- > 0x1c2b7ff irq 36 on simplebus0 > iicbus2: <OFW I2C bus> on iichb2 > iic0: <I2C generic I/O> on iicbus0 > iic1: <I2C generic I/O> on iicbus1 > iic2: <I2C generic I/O> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1533999888.31375.6.camel>