Nanopi Neo I2C
Ian Lepore
ian at freebsd.org
Sat Aug 11 15:05:00 UTC 2018
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 at 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
More information about the freebsd-arm
mailing list