From owner-freebsd-questions@freebsd.org Thu Mar 28 16:35:00 2019 Return-Path: Delivered-To: freebsd-questions@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 73F491562470 for ; Thu, 28 Mar 2019 16:35:00 +0000 (UTC) (envelope-from per@hedeland.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (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 600B1807FC for ; Thu, 28 Mar 2019 16:34:58 +0000 (UTC) (envelope-from per@hedeland.org) ARC-Seal: i=1; a=rsa-sha256; t=1553789928; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=wB0BwRd+oDl/+KMYsHiZTG/dHvG9VtHs+oOt4DvZ5fBht8NaOhUeqtC2GuSTRxzwmPKvhCNG186wd Xm/V071BjWDXDwKQ1+Uxay9aNM8IjaBjNsS30kYKWZ8MaMHvkaG05i6cwP5vT6tFsGPKHCoyB2b3zv oTw5COJFCEz1AjmJniA7S/iklvPuD/A1787O3v09sddb295N2RyGa3BaKpigUbIj8FSqPTVtvcdJOa HcINio2lW7H2yLYjqSn0LlIFU36ziIE5SrMO/yVvaHSpIctjbnkeLtqVvyczt6cqy4I/pKaMak+ghw LebKjWOEROaHf1gbFTovK3lRCa3Hvcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:dkim-signature:from; bh=SKIPT2fax7cQD6JobdiUZNDzIe4YN//cOTmFhf8snfQ=; b=BTUZcU4pmhWOGruqgy1xZoqIHcd3p64w/NOGY+d60yYYsiHFq2hS0jn2eTFfh56mpXQe7Llf+g96G jfYebHT09G9R+QeO3zHRXEm5Rsb8yFxGLrhw/Cy3QoIgjROUQ1bdzY/y0/VHNJzWWrT/trRiAHwaKK 0SpVdLuomqnYjK2KPNTurMeGLN21qLdisCNL5jeBPWqwOOD9WJUIiF9feGqu2WqxzMTZfl8ZkHSEYU cM4mX3wLSVHCBhprV1duUv4cg/o/rcANf5xn7RxlczzzcAQ4Wc5pLONcCA/krr1fNxq9a1hPyUcHQ+ xd54gyI10jlOtwl4Wg/94KfxSO5OShg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=none smtp.mailfrom=hedeland.org smtp.remote-ip=81.228.155.78; dmarc=none header.from=hedeland.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:from; bh=SKIPT2fax7cQD6JobdiUZNDzIe4YN//cOTmFhf8snfQ=; b=UfWIeQL452+ZoUVZBfmBxH50tyKgSxSi1NPigjbJ5V3DvLmCuBSPBrHeM6kxz1fRrHWkCciqCX9oq Mg0wOzBI7RB/ZtXotGRrGJ7WnPnTXWicBAIQduUNrGxGt1DR93OxTkHgAmVB6T8NtOYlVCcgURdkEK 2JBFffIb9q7sd8t/RK8TBCzWV4Cc6DPBSVaciso9qj7RqMXzkato8UkCu1rSH6sClbARzXOFYhGq6U o1/zKhfZqodRFbm8CPzaDw2YzFwRK3qtYBmRbqjUcmLvc26BMYziLVL9/vqFY+CCUU1W7JBoa0tkKZ ghKUq/nZmciQuvTztfE9W3Az33Ols5g== X-MHO-RoutePath: cGVyaGVkZWxhbmQ= X-MHO-User: 271714d8-5175-11e9-befd-af03bedce89f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 81.228.155.78 X-Mail-Handler: DuoCircle Outbound SMTP Received: from hedeland.org (unknown [81.228.155.78]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 271714d8-5175-11e9-befd-af03bedce89f; Thu, 28 Mar 2019 16:18:46 +0000 (UTC) Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id x2SGIfFo053624 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 28 Mar 2019 17:18:41 +0100 (CET) (envelope-from per@hedeland.org) Subject: Re: How to force host mode for RPi Zero USB? To: Hans Petter Selasky , freebsd-arm@freebsd.org Cc: freebsd-questions@freebsd.org References: <222dd329-e0d5-31ad-512a-898040c44c1c@hedeland.org> From: Per Hedeland Message-ID: <7f6d9c20-42b0-1f47-dc49-2394c3da7cab@hedeland.org> Date: Thu, 28 Mar 2019 17:18:41 +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: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 600B1807FC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=outbound.mailhop.org header.s=dkim-high header.b=UfWIeQL4 X-Spamd-Result: default: False [-4.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; MX_GOOD(-0.01)[cached: hedeland.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; RECEIVED_SPAMHAUS_PBL(0.00)[78.155.228.81.zen.spamhaus.org : 127.0.0.11]; IP_SCORE(-1.24)[ipnet: 54.148.0.0/15(-4.81), asn: 16509(-1.31), country: US(-0.07)]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_ALLOW(-1.00)[i=1]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org:s=dkim-high]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[hedeland.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[64.219.148.54.list.dnswl.org : 127.0.20.0]; R_SPF_NA(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2019 16:35:00 -0000 On 2019-03-28 15:43, Hans Petter Selasky wrote: > 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". Uh.... - OK, so I looked at the dwc2-overlay.dts that Linux uses, stripped it down to what I guessed was the bare minimum, changed its dr_mode = "otg" to dr_mode = "host": -------------------------------- /dts-v1/; /plugin/; /{ compatible = "brcm,bcm2708"; fragment@0 { target = <&usb>; __overlay__ { dr_mode = "host"; }; }; }; -------------------------------- - compiled it, put it in /boot/msdos/overlays, and added a dtoverlay= line for it in /boot/msdos/config.txt - and it worked!:-) Thanks a lot! Um, I don't suppose there is a simpler way, like adding a line to /boot/loader.conf? --Per