jaredmcneill / quartz64_uefi

EDK2 UEFI for Rockchip RK3566 and RK3568 based SBCs.
153 stars 61 forks source link

SOQuartz HDMI plug detection fails. #22

Closed gillham closed 2 years ago

gillham commented 2 years ago

HDMI plug detection appears to break SOQuartz. If I comment out the plug detect check HDMI works:

Hpd = DwHdmiPhyDetect ();
DEBUG ((DEBUG_INFO, "HDMI: Plug %adetected\n", Hpd ? "" : "not "));
// if (!Hpd) {
// return FALSE;
// }

I'm using a WaveShare Compute Module 4 PoE Board (B) with my SOQuartz and I've tried two different monitors. A generic 1080P panel and a Samsung 4K. Neither seems to satisfy the plug detection. (the 4K was tried in 4K and a PiP mode) The generic 1080P seems to work and the 4K in PiP mode. In 4K mode the screen just turns on and off with no display, though the log seems reasonable.

Anyway, it seems like some boards might need some special treatment and I'm not sure how to handle that in an abstracted way.

Log: HDMI: version 2.11A, phytype 0xF3 HDMI: DwHdmiPhyDetect: DwHdmiRead: 1 HDMI: Plug not detected DwHdmiDdcExec: Error! I2CM_STAT0 = 0x3 HDMI: Read 0 extention blocks (of possible 1) EDID: [00] +0000: 00 FF FF FF FF FF FF 00 26 13 00 00 01 00 00 00 [ ... working 1080p setup ]

gillham commented 2 years ago

@bluerise Is HDMI working with the latest changes on your SOQuartz & carrier board? If so, what carrier board are you using?

bluerise commented 2 years ago

This is a SOQuartz on a WaveShare Mini Base Board (A), Plug detection works for me and output shows up just fine:

HDMI: version 2.11A, phytype 0xF3
HDMI: Plug detected
DwHdmiDdcExec: Error! I2CM_STAT0 = 0x3
HDMI: Read 0 extention blocks (of possible 1)
EDID: [00] +0000: 00 FF FF FF FF FF FF 00   4A 8B 3B 2A 01 01 01 01
EDID: [00] +0010: 24 1B 01 03 80 34 20 78   EA 1E C5 AE 4F 34 B1 26
EDID: [00] +0020: 0E 50 54 A5 4B 00 81 80   A9 40 D1 C0 71 4F 01 01
EDID: [00] +0030: 01 01 01 01 01 01 02 3A   80 18 71 38 2D 40 58 2C
EDID: [00] +0040: 45 00 13 2B 21 00 00 1E   00 00 00 FF 00 4A 32 35
EDID: [00] +0050: 37 4D 39 36 42 30 30 46   4C 0A 00 00 00 FC 00 52
EDID: [00] +0060: 54 4B 20 46 48 44 0A 20   20 20 20 20 00 00 00 FD
EDID: [00] +0070: 00 38 4C 1E 51 11 00 0A   20 20 20 20 20 20 01 19
HDMI: EDID preferred mode (VIC 0):
      DotClock 148500 kHz
      HDisplay 1920 HSyncStart 2008 HSyncEnd 2052 HTotal 2200 HSyncPol +
      VDisplay 1080 VSyncStart 1084 VSyncEnd 1089 VTotal 1125 VSyncPol +
bluerise commented 2 years ago

The schematics of the WaveShare boards also don't seem to be any different really between those two boards. The HPD pin is simply brought from the CM4 connector to the HDMI port, should be fine really.

gillham commented 2 years ago

I've tested this more over the weekend with different cables, monitors, boards etc. It appears to be a defect of my board. I'm not sure if it is my specific board, or this model. The schematic shows hot plug on the two HDMI ports, but it clearly doesn't work. I need to test for continuity between those pins and the CM4 100 pin connectors, but haven't gotten to that yet.

I also have a Piunora with a real CM4 also and decided to swap modules with the SOQuartz. The real CM4 appears to have the same issue with this particular WaveShare board and doesn't display on either HDMI. Well it does briefly a couple times early in the boot and then goes dark.

Meanwhile UEFI on the SOQuartz works with the HDMI on the Piunora. So the SOQuartz and RPi CM4 work with the Piunora and don't work with this particular WaveShare.

I ordered a different board (the same model as yours @bluerise) that is due tomorrow. Once I get that I'll look at the electrical side of this board and probably try to contact WaveShare directly. After that I would probably close this as either a QA problem on my specific board or a defect on this model. Thanks.

gillham commented 2 years ago

Ok, Waveshare got back to me that the "first version" of the board is missing 5V to the HDMI connectors which causes HPD to fail. They provided details on a board level repair to fix it. Straight-forward but of course the parts are tiny. With this fix both HDMI ports work with a real CM4 booted into Raspberry Pi OS. I'm able to boot with either port connected and move a cable between ports and have it figure it out.

The SOQuartz also works as expected with UEFI and no HPD patch. Booting into UEFI and NetBSD happily uses the HDMI0 port now. The Linux kernel I'm using still turns off HDMI after it probes the GPU but that is not related to the board or firmware.

So I think that fixes it. I'm concerned that Waveshare happily sold a whole batch of these boards that don't actually work correctly. It isn't mentioned on the Amazon item page or anything.

I'll add the repair details here for anyone that stumbles across it. I've also asked them for a method of identifying the original revision versus presumably reworked 2nd revision boards. I'll update this if I get more details.

# The board: WaveShare Compute Module 4 PoE Board (B) "first revision" that does not work with HDMI hot plug detection. The issue: Symptoms would be the display not working, or coming on briefly during some boot stage and going back off.

Remove the two components marked with PURPLE and install a 0R resistor (wire/solder bridge) at the location pointed to by the RED arrow. image

Schematic details look like this: (post repair) K{LVLVV7RJNTS%6{O M$3GG

You will have removed the two leftmost "NC" components (top level vertical orientation, middle left horizontal) and added a bridge or 0 ohm component on the lower left vertical position with "0R".

Here is a photo of a somewhat hastily done repair, that does work correctly now.

IMG_2316