On 20-05-28 14:16:21, Alexandru M Stan wrote: > Hello, > > I'm currently helping to design the hardware for yet another chromebook. > > The particular SOC (and most other alternatives BTH) we're using has a > limited amount of USB controllers available, usually just 1. Being a > chromebook we have quite a few needs for USB though: 2 type C ports, > pogo pins for a connected keyboard, 2 cameras, a type A port. We're > probably going to have an internal hub no matter what, but it looks > like even a 4 port hub might not be enough, going to yet a bigger hub > (which might not be as power efficient) is not ideal, chaining hubs > that are builtin is also meh. > > I noticed that some of our cameras use the USB3.0 lines only. Other > cameras, since they're lower resolution ones use only USB2.0. I > wondered what would happen if the 2 types of cameras were to share a > port, since none of the data lines are common between them. > > I've built a little contraption to test this. It seems to work as > intended. Both usb cameras seem to enumerate, I can even stream from > both at the same time with no problem. A macbook seems to also kind of > work (I can't stream from both for some reason, but i can open either > I want). I can upload detailed lsusb outputs if needed. > > My question here is: is this legal as far as Linux is concerned? Can 2 > devices be enumerated under one physical port (even though we're > talking about separate usb2.0 and 3.0 bus topologies). In fact, it is two ports (roothubs) from software view, the possible risk for this design is from hardware view, mainly for USB3 - You can't use external Type-A USB3 port - USB3-only device should be few, USB3 devices need to consider back compatible. And you can't only connect USB3 lines for standard USB3 device, it may cause that device can't work if it downgrade to USB2. > > It seems to work so far with our linux 5.4 chrome os fork (which as > far as I know is identical to 5.4 LTS for matters concerning usb). But > the question is would this keep working? > > Is there any weird port reset interaction that might be annoying here? > I wouldn't want a reset on the usb 2.0 device to affect the 3.0 > device. Bus reset is per roothub, this should not happen. > > Is there any other higher level port management going on in linux, > where there might be plans to keep track of things, but it's not piped > enough to see it affect (negatively) this use case. > > If this is ok, was something like this ever done before? Maybe Alan knows it more. > > Bonus, maybe unrelated, question: I've wondered in the past if it's > legal to route 2.0 and 3.0 lines through different paths. > > For example, imagine I had one of each: > * 2+3.0 controller > * 2+3.0 device (eg a 3.0 type A port) > * 2.0 device (older usb device) > > Would it be legal to use only a 2.0 hub, with the 3.0 data lines for > the 3.0 device bypassing the hub. This would be cheaper than having a > fully fledged 2+3.0 hub with the second port's 3.0 data lines wasted. I think it could work, the USB3 lines go to controller directly, and xHCI driver talks with it and USB2 lines go 2.0 HUB's downstream port, and EHCI driver talks with it, it will not influence each other. -- Thanks, Peter Chen