Date: Mon, 3 Oct 2022 17:26:07 +0200 From: Axel Rau <Axel.Rau@chaos1.de> To: hardware@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Accessing I2C-Bus via ELV USB-I2C Message-ID: <35D556D7-56EC-4295-93D6-80A4CFE6DCE9@Chaos1.DE> In-Reply-To: <996df5c0-ffa7-f1bf-a9e2-6dd47d7b49e6@Chaos1.DE> References: <996df5c0-ffa7-f1bf-a9e2-6dd47d7b49e6@Chaos1.DE>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] From time to time the I2C layer on top of the uart locks up and can’t be recovered via its built in reset command. Initialialization at [1]:2564 is missing the greeting message. looking at the traffic with usbdump -d ugen1.3 -v -v -v -s 1024 > usb.txt I’m missing some response data from the I2C controller. Questions: 1. On usbdump, why is the hexdump mssing on some lines like frame[0] WRITE <n> bytes ? 2. Do we have a tool to dump traffic directly on the uart layer? Any help appreciated, Axel [1]: https://github.com/mc3/home2l/blob/master/brownies/brownies.C > Am 27.04.2022 um 23:08 schrieb Axel Rau <Axel.Rau@chaos1.de>: > > Next journey starts: > > For the home2l project, I need a supported I2C interface via USB. > I got this one: > https://de.elv.com/elv-usb-ic-interface-usb-i2c-092255?fs=1805459039 > Unfortunately it shows up as a serial device on FreeBSD: > > ugen0.2: <Silicon Labs ELV USB-I2C-Interface> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA) > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0110 > bDeviceClass = 0x0000 <Probed by interface class> > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x10c4 > idProduct = 0xea60 > bcdDevice = 0x0100 > iManufacturer = 0x0001 <Silicon Labs> > iProduct = 0x0002 <ELV USB-I2C-Interface> > iSerialNumber = 0x0003 <B5AAP0EEUK6A3CIZ> > bNumConfigurations = 0x0001 > > In loader.conf, I have: > uslcom_load="YES" > iic_load="YES" > iicbus_loa > > But the i2c utility does not show a new bus. > > From dmesg: > root@axels-bsdbox:~ # dmesg | grep iic > ig4iic0: <Intel Sunrise Point-H I2C Controller-0> mem 0xdf230000-0xdf230fff irq 16 at device 21.0 on pci0 > ig4iic0: Using MSI > iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0 > iic0: <I2C generic I/O> on iicbus0 > ig4iic1: <Intel Sunrise Point-H I2C Controller-1> mem 0xdf22f000-0xdf22ffff irq 17 at device 21.1 on pci0 > ig4iic1: Using MSI > iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1 > iic1: <I2C generic I/O> on iicbus1 > root@axels-bsdbox:~ # dmesg | grep I2C > ig4iic0: <Intel Sunrise Point-H I2C Controller-0> mem 0xdf230000-0xdf230fff irq 16 at device 21.0 on pci0 > iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0 > iic0: <I2C generic I/O> on iicbus0 > ig4iic1: <Intel Sunrise Point-H I2C Controller-1> mem 0xdf22f000-0xdf22ffff irq 17 at device 21.1 on pci0 > iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1 > iic1: <I2C generic I/O> on iicbus1 > ugen0.2: <Silicon Labs ELV USB-I2C-Interface> at usbus0 > uslcom0: <ELV USB-I2C-Interface> on usbus0 > > They provide a (linux) driver ("Treiber") which seems to implement the I2C protocoll on top of the serial interface. > Do we have such a driver on FreeBSD, or exist other supported I2C devices to be plugged into USB? > > Any help appreciated, > Axel --- PGP-Key: CDE74120 ☀ computing @ chaos claudius [-- Attachment #2 --] <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">From time to time the I2C layer on top of the uart locks up<div class="">and can’t be recovered via its built in reset command.</div><div class="">Initialialization at [1]:2564 is missing the greeting message.</div><div class=""><br class=""></div><div class=""><span style="font-family: Monaco; font-size: 11px; background-color: rgb(255, 255, 255);" class="">looking at the traffic with</span></div><div class=""><span style="font-family: Monaco; font-size: 11px; background-color: rgb(255, 255, 255);" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>usbdump -d ugen1.3 -v -v -v -s 1024 > usb.txt</span></div><div class="">I’m missing some response data from the I2C controller.</div><div class=""><br class=""></div><div class="">Questions:</div><div class="">1. On usbdump, why is the hexdump mssing on some lines like</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span style="font-family: Menlo-Regular;" class="">frame[0] WRITE <n> bytes ?</span></div><div class=""><span style="font-family: Menlo-Regular;" class=""><br class=""></span></div><div class="">2. Do we have a tool to dump traffic directly on the uart layer?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div>Any help appreciated, Axel</div><div><br class=""></div><div>[1]: <a href="https://github.com/mc3/home2l/blob/master/brownies/brownies.C" class="">https://github.com/mc3/home2l/blob/master/brownies/brownies.C</a></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><br class=""><blockquote type="cite" class=""><div class="">Am 27.04.2022 um 23:08 schrieb Axel Rau <<a href="mailto:Axel.Rau@chaos1.de" class="">Axel.Rau@chaos1.de</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">Next journey starts:<br class=""><br class="">For the home2l project, I need a supported I2C interface via USB.<br class="">I got this one:<br class=""><a href="https://de.elv.com/elv-usb-ic-interface-usb-i2c-092255?fs=1805459039" class="">https://de.elv.com/elv-usb-ic-interface-usb-i2c-092255?fs=1805459039</a><br class="">Unfortunately it shows up as a serial device on FreeBSD:<br class=""><br class="">ugen0.2: <Silicon Labs ELV USB-I2C-Interface> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)<br class=""><br class=""> bLength = 0x0012<br class=""> bDescriptorType = 0x0001<br class=""> bcdUSB = 0x0110<br class=""> bDeviceClass = 0x0000 <Probed by interface class><br class=""> bDeviceSubClass = 0x0000<br class=""> bDeviceProtocol = 0x0000<br class=""> bMaxPacketSize0 = 0x0040<br class=""> idVendor = 0x10c4<br class=""> idProduct = 0xea60<br class=""> bcdDevice = 0x0100<br class=""> iManufacturer = 0x0001 <Silicon Labs><br class=""> iProduct = 0x0002 <ELV USB-I2C-Interface><br class=""> iSerialNumber = 0x0003 <B5AAP0EEUK6A3CIZ><br class=""> bNumConfigurations = 0x0001<br class=""><br class="">In loader.conf, I have:<br class="">uslcom_load="YES"<br class="">iic_load="YES"<br class="">iicbus_loa<br class=""><br class="">But the i2c utility does not show a new bus.<br class=""><br class="">From dmesg:<br class="">root@axels-bsdbox:~ # dmesg | grep iic<br class="">ig4iic0: <Intel Sunrise Point-H I2C Controller-0> mem 0xdf230000-0xdf230fff irq 16 at device 21.0 on pci0<br class="">ig4iic0: Using MSI<br class="">iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0<br class="">iic0: <I2C generic I/O> on iicbus0<br class="">ig4iic1: <Intel Sunrise Point-H I2C Controller-1> mem 0xdf22f000-0xdf22ffff irq 17 at device 21.1 on pci0<br class="">ig4iic1: Using MSI<br class="">iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1<br class="">iic1: <I2C generic I/O> on iicbus1<br class="">root@axels-bsdbox:~ # dmesg | grep I2C<br class="">ig4iic0: <Intel Sunrise Point-H I2C Controller-0> mem 0xdf230000-0xdf230fff irq 16 at device 21.0 on pci0<br class="">iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0<br class="">iic0: <I2C generic I/O> on iicbus0<br class="">ig4iic1: <Intel Sunrise Point-H I2C Controller-1> mem 0xdf22f000-0xdf22ffff irq 17 at device 21.1 on pci0<br class="">iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1<br class="">iic1: <I2C generic I/O> on iicbus1<br class="">ugen0.2: <Silicon Labs ELV USB-I2C-Interface> at usbus0<br class="">uslcom0: <ELV USB-I2C-Interface> on usbus0<br class=""><br class="">They provide a (linux) driver ("Treiber") which seems to implement the I2C protocoll on top of the serial interface.<br class="">Do we have such a driver on FreeBSD, or exist other supported I2C devices to be plugged into USB?<br class=""><br class="">Any help appreciated,<br class="">Axel<br class=""></div></div></blockquote><br class=""></div><br class=""><div class=""> <div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">---<br class="">PGP-Key: CDE74120 ☀ computing @ chaos claudius</div></div></div></div></div></div> </div> <br class=""></div></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35D556D7-56EC-4295-93D6-80A4CFE6DCE9>
