Date: Sun, 12 Aug 2018 06:53:14 +0200 From: Emmanuel Vadot <manu@bidouilliste.com> To: Daniel Braniss <danny@cs.huji.ac.il> Cc: lyd mc <alydiomc@yahoo.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, Ian Lepore <ian@freebsd.org> Subject: Re: Nanopi Neo I2C Message-ID: <20180812065314.ff83dd595460a0fadee77f59@bidouilliste.com> In-Reply-To: <5E1DB0F5-EF98-46A8-8D33-11052834E35C@cs.huji.ac.il> References: <165877705.5351934.1533988165694.ref@mail.yahoo.com> <165877705.5351934.1533988165694@mail.yahoo.com> <1533999888.31375.6.camel@freebsd.org> <2122126425.5355832.1534000914963@mail.yahoo.com> <5E1DB0F5-EF98-46A8-8D33-11052834E35C@cs.huji.ac.il>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 11 Aug 2018 18:50:18 +0300 Daniel Braniss <danny@cs.huji.ac.il> wrote: >=20 >=20 > > On 11 Aug 2018, at 18:21, lyd mc via freebsd-arm <freebsd-arm@freebsd.o= rg> wrote: > >=20 > > Hi Ian, > > The iic bus seem to be working on linux image. I can detect the device = at 0x18. > > root@nanopi-neo:~/prog/I2C # i2c -f /dev/iic0 -s > > Hardware may not support START/STOP scanning; trying less-reliable read= method. > > Scanning I2C devices on /dev/iic0: <none found> > >=20 > > some kdump output of above command: 871 i2c CALL ioctl(0x3,I2CR= STCARD,0xbfbfec64) > > 871 i2c RET ioctl 0 > > 871 i2c CALL ioctl(0x3,I2CSTART,0xbfbfec64) > > 871 i2c RET ioctl -1 errno 2 No such file or directory > > 871 i2c CALL ioctl(0x3,I2CSTOP,0xbfbfec64) > > 871 i2c RET ioctl 0 > > .<snip> 871 i2c CALL ioctl(0x3,I2CRSTCARD,0xbfbfec64) > > 871 i2c RET ioctl 0 > > 871 i2c CALL ioctl(0x3,I2CRDWR,0xbfbfec50) > > 871 i2c RET ioctl -1 errno 2 No such file or directory > > 871 i2c CALL ioctl(0x3,I2CRSTCARD,0xbfbfec64) > > 871 i2c RET ioctl 0 > > 871 i2c CALL ioctl(0x3,I2CRDWR,0xbfbfec50) > > 871 i2c RET ioctl -1 errno 2 No such file or directory > > Seems I2CRSTCARD and I2CSTOP are the only working ioctl on me. > > I activated i2c0 using below dts code: > > i2c@1c2ac00 { > >=20 > > compatible =3D "allwinner,sun6i-a31-i2c"; > > reg =3D <0x1c2ac00 0x400>; > > interrupts =3D <0x0 0x6 0x4>; > > clocks =3D <0x1d 0x3b>; > > resets =3D <0x1d 0x2e>; > > pinctrl-names =3D "default"; > > pinctrl-0 =3D <0x20>; > > status =3D "okay"; > > #address-cells =3D <0x1>; > > #size-cells =3D <0x0>; > > phandle =3D <0x41>; > >=20 > >=20 > > Regards,Alyd > > On Saturday, August 11, 2018, 11:04:54 PM GMT+8, Ian Lepore <ian@fre= ebsd.org> wrote: =20 > >=20 > > 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.=20 > >>=20 > >> 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 > >>=20 > >> kdump output: > >>=20 > >> 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 > >>=20 > >> This seems to work on my RPI. > >>=20 > >=20 > > 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. > >=20 > > Is the bus working in general? Do any devices show up on a scan with > >=20 > > i2c -f /dev/iic0 -s > >=20 > > -- Ian > >=20 >=20 > the driver has timing issues (among others :-). I?m cc?ing the guys I got= a ?working? twsi stuff=20 > to see if I can pass it on. What timing issue and "other issues" are you talking about ? > danny >=20 > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" --=20 Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180812065314.ff83dd595460a0fadee77f59>