DisplayPort: Taming The Altmode

The DisplayPort altmode is semi-proprietary, but it can absolutely be picked apart if we try. Last time, we found a cool appnote describing the DisplayPort altmode in detail, switched the FUSB302 into packet sniffing mode and got packet captures, learned about PD VDMs (vendor-defined messages), and successfully replayed the captured messages to switch a USB-C port into the DisplayPort altmode. Today, we will go through the seven messages that summon the DisplayPort altmode, implement them, and tie them all into a library – then, figure out the hardware we need to have DisplayPort work in the wild.

For a start, as you might have seen from the diagram, a single command can be either a request or a response. For instance, if you get a Discover Identity REQ (request), you reply to it with a Discover Identity ACK (response), adding your identity data to your response along the way. With some commands, the DP source will add some data for you to use; for most commands, your DP sink will have to provide information instead – and we’ll do just that, armed with the PDF provided and the packet captures.

We have seven commands we need to handle in order to get DisplayPort out of a compatible USB-C port – if you need a refresher on these commands, page 13 of the ST’s PDF on the DP altmode will show you the message sequence. These commands are: Discover Identity, Discover SVIDs, Discover Modes, Enter Mode, DP Status Update, DP Configure, and Attention. Out of these, the first four are already partially described in the base USB PD standard, the two DP commands afterwards are DisplayPort-altmode-specific but sufficiently described in the PDF we have, and the Attention command is from the base standard as well, mostly helpful for reporting state of the HPD pin. Let’s start with the first two! Continue reading “DisplayPort: Taming The Altmode”

Clipper Windpower: Solutions In Search Of Problems

The first modern wind turbines designed for bulk electricity generation came online gradually throughout the 80s and early 90s. By today’s standards these turbines are barely recognizable. They were small, had low power ratings often in the range of tens to hundreds of kilowatts, and had tiny blades that had to rotate extremely quickly.

When comparing one of these tiny machines next to a modern turbine with a power rating of 10 or more megawatts with blades with lengths on the order of a hundred meters, one might wonder if there is anything in common at all. In fact, plenty of turbines across the decades share fundamental similarities including a three-blade design, a fairly simple gearbox, and a single electric generator. While more modern turbines are increasingly using direct-drive systems that eliminate the need for a gearbox and the maintenance associated with them, in the early 2000s an American wind turbine manufacturer named Clipper Windpower went in the opposite direction, manufacturing wind turbines with an elaborate, expensive, and heavy gearbox that supported four generators in each turbine. This ended up sealing the company’s fate only a few years after the turbines were delivered to wind farms.

Some history: the largest terrestrial wind turbines were approaching the neighborhood of 2 megawatts, but some manufacturers were getting to these milestones essentially by slapping on larger blades and generators to existing designs rather than re-designing their turbines from the ground up to host these larger components. This was leading to diminishing returns, as well as an increased amount of mechanical issues in the turbines themselves, and it was only a matter of time before the existing designs wouldn’t support this trend further. Besides increased weight and other mechanical stresses on the structure itself, another major concern was finding (and paying for) cranes with enough capacity to hoist these larger components to ever-increasing heights, especially in the remote locations that wind farms are typically located. And cranes aren’t needed just for construction; they are also used whenever a large component like a generator or blade needs to be repaired or replaced. Continue reading “Clipper Windpower: Solutions In Search Of Problems”

DisplayPort: Tapping The Altmode

Really, the most modern implementation of DisplayPort is the USB-C DisplayPort altmode, synonymous with “video over USB-C”, and we’d miss out if I were to skip it. Incidentally, our last two articles about talking USB-PD have given a few people a cool new toy to play with – people have commented on the articles, reached out to me for debugging help, and I’ve even seen people build the FUSB302B into their projects! Hot on the heels of that achievement, let’s reach further and conquer one more USB-C feature – one that isn’t yet openly available for us to hack on, even though it deserves to be.

For our long-time readers, it’s no surprise to see mundane capabilities denied to hackers. By now, we all know that many laptops and phones let you get a DisplayPort connection out of a USB-C port. Given that the USB-C specifications are openly available, and we’ve previously implemented a PD sink using those specifications, you’d expect that we could do DisplayPort with the same ease. Yet, the DisplayPort altmode specification is behind a VESA membership paywall, with a hefty pricetag – a practice of theirs that has been widely criticized, counter to their purpose as a standards organization and having resulted in some of their standards failing.

Not to worry, however – we can easily find an assortment of PDFs giving a high-level overview and some details of the DisplayPort altmode, and here’s my favorite! I also have a device running MicroPython with a FUSB302 chip connected, and a few DisplayPort altmode devices of mine that I can disassemble. This, turns out, is more than enough for us to reverse-engineer our way into an open-source DisplayPort altmode library!

Continue reading “DisplayPort: Tapping The Altmode”

PCIe For Hackers: An M.2 Card Journey

I’ve designed a few M.2 adapters for my own and my friends’ use, and having found those designs online, people have asked me for custom-made adapters. One of these requests is quite specific – an adapter that adds one more PCIe link to an E-key M.2 slot, the kind of slot you will see used in laptops for WiFi cards.

See, the M.2 specification allows two separate PCIe links connected to the E-key slot; however, no WiFi cards use this apart from some really old WiGig-capable ones, and manufacturers have long given up on connecting a second link. Nevertheless, there are some cards like the Google Coral M.2 E-key dual AI accelerator and the recently announced uSDR, that do indeed require the second link – otherwise, only half of their capacity is available.

It’s not clear why both Google and WaveletSDR designed for a dual-link E-key socket, since those are a rare occurrence; for the Google card, there are plenty of people complaining that the board they bought just doesn’t fully work. In theory, all you need to do to help such a situation, is getting a second PCIe link from somewhere, then wiring it up to the socket – and a perfect way to do it is to get a PCIe switch chip. You will lose out on some bandwidth because the uplink PCIe connection of the switch can only go so fast; for things like this AI accelerator, it’s not much of a problem since the main point is to get the second device accessible. For the aforementioned SDR, it might turn out useless, or you might win some but lose some – can’t know until you try! Continue reading “PCIe For Hackers: An M.2 Card Journey”

Crab Shells Massively Improve Zinc-Ion Batteries

In the fast-moving world of battery research, scientists are constantly on the lookout for innovative materials with the right properties to help improve energy storage. Meanwhile, batteries are in greater demand than ever as production of EVs and renewable energy projects ramp up to new heights.

In the hunt for new and better battery materials, scientists found an unexpected hero: crab shells.Researchers at the University of Maryland have uncovered a remarkable breakthrough by exploring their use in battery production.

Continue reading “Crab Shells Massively Improve Zinc-Ion Batteries”

DisplayPort: Under The Hood

Last time, we looked at all the things that make DisplayPort unique for its users. What about the things that make it unique for hackers? Let’s get into all the ways that DisplayPort can serve you on your modern tech wrangling adventures.

You Are Watching The AUX Channel

With DisplayPort, the I2C bus we’ve always seen come bundled with VGA, DVI and HDMI, is no more – it’s been replaced by the AUX bus. AUX is a 1 MHz bidirectional diffpair – just a bit too complex for a cheap logic analyzer, though, possibly, something you could wrangle with the RP2040’s PIOs. Hacking thoughts aside, it’s a transparent replacement for I2C, so that software doesn’t have to be rewritten – for instance, it usually does I2C device passthrough over AUX, so that EDID data can still be stored in a separate EEPROM chip on the monitor or eDP LCD panel.

AUX isn’t just a differential bus, it’s more pseudodifferential, like USB2 – for instance, AUX_P and AUX_N are used separately, with a combination of 1 MΩ and 100 kΩ pullups and pulldowns signaling different states of the physical connection – for instance, a pullup on AUX+ and a pulldown on AUX- means that an external device has been connected. If you’d like to learn which combination of resistors means what, you can find in the DisplayPort specification, which isn’t distributed openly but isn’t hard to come by, either.

Also, DisplayPort link training happens over AUX, and in order to facilitate that, a piece of DisplayPort controller’s external memory is usually exposed over the AUX channel, through a mechanism that’s called DPCD. If you dig a bit, using “DPCD” as the keyword, you can easily reach into the lower-level details of your DisplayPort connection. Some of the DPCD memory map is static, and some parts are FIFOs you can funnel data into, or out of. You can find a wide variety of documents online which describe the DPCD structure – for now, here’s a piece of Bash that works on Linux graphics drivers for AMD and Intel, and will show you you the first 16 bytes of DPCD:

# sudo dd if=/dev/drm_dp_aux0 bs=1 skip=256 count=16 |xxd
00000000: 0084 0000 0000 0000 0108 0000 0000 0000 ................
[...]

In particular, the 4th nibble (digit) here describes the amount of lanes for the DisplayPort link established – as you can see, my laptop uses a four-lane link. Also, the /dev/drm_dp_aux0 path might need to be adjusted for your device. In case you ever want to debug your DP link, having direct access to the DPCD memory space like this might help you quite a bit! For now, let’s move onto other practical aspects. Continue reading “DisplayPort: Under The Hood”

Keeping Thermal Plants Cool Without Breaking The Cooling Water Budget

Steam generators in thermal (steam-cycle) power plants require a constant influx of cool water to maximize the transfer of thermal energy. How this water is cooled again in the condensor after much of the steam’s thermal energy has been spent in the steam turbines or heat exchangers is a very important consideration in the design and construction of these plants. The most obvious and straightforward system is direct “once-through” cooling, where the water is drawn straight from a nearby river or other body of water and released after passing through the condenser. This type of system is by far the cheapest, but is also impacted by both the seasons and environmental considerations.

Where cool surface water is less abundantly available, evaporative cooling in a recirculating system such as with spray ponds and cooling towers is a good alternative. Although slightly more costly, a big benefit of these is that they require far less water and have much more control over the intake water temperature, which can raise plant efficiency. Finally, dry cooling is essentially a closed-loop system, which is exceedingly useful in areas where water is scarce. This latter type of cooling is what allows thermal plants to operate even in desert regions.

As the global climate changes – with more extreme weather events – picking the right cooling solution is more important than ever, and has us looking at retrofitting existing thermal plants with more efficient solutions. If you were ever curious how power plants keep the cool side cool, read on!

Continue reading “Keeping Thermal Plants Cool Without Breaking The Cooling Water Budget”