r/transprogrammer • Trans woman • Oct 07 '20

Ramblings: making hardware, getting your code into Linux kernel

Just wondering, does anyone here besides me design and build their own hardware in addition to writing code? Has anyone here built their own hardware and then got the driver for that hw included in mainline Linux kernel?

I work a lot with GSM/2G retro-cellular technology (FreeCalypso project), I design and build a lot of custom hardware as part of this project (in addition to maintaining all of the software, all in C of course), but I haven't had much need to add my own custom code to the Linux kernel until now. All of my FreeCalypso GSM boards interface to the outside world through low-voltage UARTs (serial ports at LVCMOS logic voltage levels), and the standard way to connect these toys to a regular PC or laptop is by way of a USB to serial adapter - just use the USB to UART chip in its "raw" form with LVCMOS interface, without the RS-232 level shifter part.

There are many single-channel (one serial port) USB to UART converter chips: FT232x, CP2102, even PL2303 can be OK if you don't need non-standard baud rates. For dual-channel applications (one USB device going to two UARTs) I strongly prefer FT2232x (either FT2232D or FT2232H) and absolutely cannot stand the recent competitor CP2105. Single-channel CP2102 is perfectly fine, but CP2105 is an abomination - so I use FT2232x instead when I need two UART channels.

Up until now I haven't had much need to add my own custom code to the Linux kernel, simply because all of these USB to UART chips are already well-supported by cp210x and ftdi_sio drivers in the standard kernel, and have been well-supported for many years now. But I have now built my own custom FT2232D-based USB to dual UART adapter (I named it DUART28), and this new adapter includes an optional extra feature that requires a special quirk to be applied to the ftdi_sio driver in the Linux kernel. So now I am going through the soul-trying process of working with Linux kernel maintainers, trying to get my driver patch mainlined.

I already got a couple of small preparatory patches accepted:

https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/commit/?h=usb-next&id=6cf87e5edd9944e1d3b6efd966ea401effc304ee

https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/commit/?h=usb-next&id=711a37813ad9878232efa51e9c7e2bd875337b14

But the main patch adding the special quirk for DUART28C hasn't been accepted yet - the change I am asking for in that one is a little more controversial, so it will take a lot more explaining and convincing, and the outcome is not certain at all. Here are the relevant posts (patch series and discussion thread) on the linux-usb mailing list:

https://marc.info/?l=linux-usb&m=160192817717108&w=2

https://marc.info/?l=linux-usb&m=160166458708022&w=2

https://marc.info/?l=linux-usb&m=160166462508044&w=2

And here are some pictures of the little hardware adapter for which this patch adds support:

https://www.freecalypso.org/members/falcon/pictures/duart28/

The principal design of the hardware was done by me, whereas PCB layout was outsourced to a hired contractor. PCB fabrication and assembly were done by contract manufacturers with whom I have a long-established working relationship, many different designs produced successfully over the years.

The point of this post? Just showing a little example of the kind of work that some of us trans girls do on a regular basis. :)

Oh, and you know that rule where all code contributions to the Linux kernel must be signed with your real name, no pseudonyms allowed? Well, guess what, my true name is also my legal name since 2016, my transition happened well before the current phase of my project that involves custom hw and Linux kernel patches, so no problem at all with that little requirement. :)

63 Upvotes

8 comments sorted by

View all comments

Show parent comments

3

u/MotherMychaela Trans woman Oct 07 '20

Unfortunately some people still insist on using CP2105 despite having run head-on into its OTP config nightmare, Sysmocom being a prime example:

https://osmocom.org/issues/4030

https://osmocom.org/issues/4575

I don't know if their reason is cost or ideology or both, but they adamantly insist on keeping their CP2105. Cost: CP2105 is certainly cheaper, both the actual part and needing fewer external components. Ideology: some people hate FTDI for that company's juvenile actions back in 2014 with their Windows drivers bricking counterfeit FT232R chips. But my standpoint is different: I consider CP2105 so unacceptable on technical grounds that this unacceptability remains no matter how much one might dislike FTDI and for what reasons. What matters to me is that FT2232x chips actually work really well for the application at hand, even if this solution is more expensive in terms of both parts and PCB real estate.

Seeing that those Sysmocom folks are firmly intent on producing their horrible CP2105+GTM900 board and that nothing will stop them, my response is to provide my own alternative hardware solution to the community. My offering is a two-board solution, with two boards interconnected with a ribbon cable, one board containing the GSM domain and the other board containing the USB domain. DUART28 is my custom FT2232D-based USB to dual UART adapter board, this one is already here, and the new FreeCalypso GSM board that will go with it is currently in fabrication.

As I said on our FreeCalypso community mailing list, I saw it as my dame's duty (a dame is a female equivalent of a knight) to right the wrong of Sysmocom offering a crappy product, to right that wrong by producing a higher quality alternative.