Open danieleftodi opened 2 weeks ago
Hi,
I recently bought a USB-SD-Mux FAST ... and I love it 😄
it's great to hear that, thanks!
... though, I noticed it doesn't have macOS support.
Also no Windows or BSD support. There are two reasons for that:
While our own focus is very Linux-centric we would be very happy about contributions that add support for other platforms.
I have done some reading through your code and and the MicroChip USB2642 documentation.
Especially the "USB82642/2642 I2C Over USB User’s Guide - Using USB Mass Storage Class Bulk-Only Transport & SCSI Pass Through"
From what I can gather, correct me if I'm wrong, but it just a matter of being able to send an I2C message over USB - to the MicroChip USB2642.
I2C messages over SCSI over USB but yes, there is not much more to how the USB-SD-Mux works.
On the USB-SD-Mux FAST we have a TCA6408 i²c GPIO expander that is connected to the USB2642 via i²c and that controls the muxing and the external GPIOs.
To set the mux to HOST we set output pin 0 of the GPIO expander high. To set the mux to DUT we set output pin 0 of the GPIO expander low. To set the pin high/low we set/clear the corresponding bit in the GPIO expander output register via i²c:
The i²c transfer is encapsulated in a SCSI command …
… the SCSI command is sent to the Linux Kernel via the SCSI generic device using an ioctl …
and the kernel wraps it into USB transfers.
Ergo, all we would need to create, is a USB driver with DriverKit SDK for the usb-sd-mux.
I would suggest trying to implement it at the SCSI first, instead of the USB level. Talking raw USB means having to implement the SCSI layer on top and more potential for confusing the USB and SCSI state machines in the USB2642 and your OS Kernel.
And I do understand, that maybe you guy's don't have a Mac or interested to do this work. But since this an OSS project. Could you maybe assist with some technical information, when needed?
Sure! You can reach us here or in the #lxa channel on libera.chat. We are usually not too secretive about the inner workings of our devices.
Hi,
I recently bought a USB-SD-Mux FAST ... and I love it 😄
... though, I noticed it doesn't have macOS support.
I have done some reading through your code and and the MicroChip USB2642 documentation.
Especially the "USB82642/2642 I2C Over USB User’s Guide - Using USB Mass Storage Class Bulk-Only Transport & SCSI Pass Through"
From what I can gather, correct me if I'm wrong, but it just a matter of being able to send an I2C message over USB - to the MicroChip USB2642.
Ergo, all we would need to create, is a USB driver with DriverKit SDK for the usb-sd-mux.
And I do understand, that maybe you guy's don't have a Mac or interested to do this work. But since this an OSS project. Could you maybe assist with some technical information, when needed?
Cheers, Daniel
Also found these sources: Building a Simple USB Driver USBDriverKit Creating a Driver Using the DriverKit SDK Sending SCSI or ATA commands to storage devices Accessing SCSI Architecture Model Devices WWDC 2020 - Modernize PCI and SCSI drivers with DriverKit SCSIControllerDriverKit SCSIPeripheralsDriverKit VendorSpecificType00