From owner-freebsd-arm@freebsd.org Thu Mar 28 14:44:00 2019 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A745B155F808; Thu, 28 Mar 2019 14:44:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD12C74D2F; Thu, 28 Mar 2019 14:43:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D03332603F3; Thu, 28 Mar 2019 15:43:49 +0100 (CET) Subject: Re: How to force host mode for RPi Zero USB? To: Per Hedeland , freebsd-arm@freebsd.org Cc: freebsd-questions@freebsd.org References: <222dd329-e0d5-31ad-512a-898040c44c1c@hedeland.org> From: Hans Petter Selasky Message-ID: Date: Thu, 28 Mar 2019 15:43:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <222dd329-e0d5-31ad-512a-898040c44c1c@hedeland.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DD12C74D2F X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.43 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[selasky.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.turbocat.net]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; IP_SCORE(-3.21)[ip: (-9.42), ipnet: 88.99.0.0/16(-4.68), asn: 24940(-1.93), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2019 14:44:00 -0000 On 3/28/19 1:50 PM, Per Hedeland wrote: > Hi, > > I have a 4-port USB hub that attaches directly to the RPi Zero board: > http://www.uugear.com/product/zero4u/ . This seems to work fine on > FreeBSD - as long as I have an OTG adapter/cable connected to the then > otherwise unused data port on the Zero, which is a quite annoying > requirement IMHO. Without it, the FreeBSD USB stack uses device mode > (as described in the handbook), and (of course) doesn't even see the > add-on hub. > > According to the hub documentation > (http://www.uugear.com/doc/Zero4U_UserManual.pdf), "Linux" uses host > mode by default, and requries a DT overlay to use device mode. The > FreeBSD automatic switching is arguably more elegant, but is IMHO > inferior in a case like this (it's of course also impossible to make > any USB devices work when connected to the Zero data port *without* an > OTG adapter/cable). > > So, as $SUBJECT - surely there is a way to force host mode? > Hi, You can add a "dr_mode" property to the DWC OTG driver instance and set it to "host". --HPS