[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-arm
Subject:    Re: How to force host mode for RPi Zero USB?
From:       Per Hedeland <per () hedeland ! org>
Date:       2019-03-28 16:18:41
Message-ID: 7f6d9c20-42b0-1f47-dc49-2394c3da7cab () hedeland ! org
[Download RAW message or body]

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
_______________________________________________
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"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic