From nobody Mon Jul 11 02:18:13 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 25CCF1D06BED for ; Mon, 11 Jul 2022 02:19:31 +0000 (UTC) (envelope-from warlock@phouka1.phouka.net) Received: from phouka1.phouka.net (phouka1.phouka.net [107.170.196.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "phouka.net", Issuer "Go Daddy Secure Certificate Authority - G2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lh6yp0wCRz3d48 for ; Mon, 11 Jul 2022 02:19:29 +0000 (UTC) (envelope-from warlock@phouka1.phouka.net) Received: from phouka1.phouka.net (localhost [127.0.0.1]) by phouka1.phouka.net (8.16.1/8.16.1) with ESMTPS id 26B2IDQb006496 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Sun, 10 Jul 2022 19:18:13 -0700 (PDT) (envelope-from warlock@phouka1.phouka.net) Received: (from warlock@localhost) by phouka1.phouka.net (8.16.1/8.16.1/Submit) id 26B2IDbv006495 for freebsd-arm@freebsd.org; Sun, 10 Jul 2022 19:18:13 -0700 (PDT) (envelope-from warlock) Date: Sun, 10 Jul 2022 19:18:13 -0700 From: John Kennedy To: freebsd-arm@freebsd.org Subject: i2c bus via USB adapter Message-ID: List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4Lh6yp0wCRz3d48 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of warlock@phouka1.phouka.net has no SPF policy when checking 107.170.196.116) smtp.mailfrom=warlock@phouka1.phouka.net X-Spamd-Result: default: False [-0.26 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_SPAM_SHORT(0.54)[0.544]; FORGED_SENDER(0.30)[warlock@phouka.net,warlock@phouka1.phouka.net]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-arm]; DMARC_NA(0.00)[phouka.net]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:14061, ipnet:107.170.192.0/18, country:US]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_NEQ_ENVFROM(0.00)[warlock@phouka.net,warlock@phouka1.phouka.net] X-ThisMailContainsUnwantedMimeParts: N Along with trying to attach some I2C devices to my RPI4 (which has GPIO-pin exposure issues due to heatsink-case), I tried attaching this device from Adafruit: Adafruit MCP2221A Breakout - General Purpose USB to GPIO ADC I2C Stemma QT / Qwiic https://www.adafruit.com/product/4471 When I plug it into my box, I see this info: kernel: ugen0.4: at usbus0 kernel: umodem0 on uhub2 kernel: umodem0: on usbus0 kernel: umodem0: data interface 1, has no CM over data, has no break kernel: uhid0 on uhub2 kernel: uhid0: on usbus0 I've got a /dev/iic0, but that doesn't seem to be from this device: ... iichb0: mem 0x7e804000-0x7e804fff irq 26 on simplebus0 ... kernel: iicbus0: on iichb0 kernel: iic0: on iicbus0 Simple recursive grepping didn't get me any hits for MCP2221, and there is a TON of hits for Microchip, so currently assuming that FreeBSD doesn't have a driver yet. Total ignorance at this point, but if there was a driver, would the expected behavior (assuming right drivers are loaded) would be for the system to figure out there was an I2C bus hiding behind it and make another /dev/iic# available, devoted to it? A ugen driver (generic USB) seems right. The umodem driver seems reasonable (serial device). The uhid driver seems wrong, at least in this case, but of course most of the hits I see on the forums are mice and such, so maybe misidentified in this case.