AMD Geode/Video 3/Script: Difference between revisions

From JookWiki
(→‎Writing code: Save this before I wipe it)
(→‎Writing code: Add breakdown)
Line 109: Line 109:
The datasheet cover page is shown. An 'AMD Geode' logo is shown as well as the text "AMD Geode™ LX Processors Data Book" dated February 2009.
The datasheet cover page is shown. An 'AMD Geode' logo is shown as well as the text "AMD Geode™ LX Processors Data Book" dated February 2009.


Narrator: "I first looked at the at the video processor diagnostic register."
Narrator: "I first looked at the at the video processor diagnostic register. I found three interesting fields:"


A table shows the MBD_DIAP_VP register bit descriptions. It contains the following fields:
Three registers fields are shown. I will quote from the data-sheet here:<blockquote>Bits 27 to 20: DAC Test Value


* RSVD: Reserved bits 63 to 32 are reserved
8-bit data value to drive to CRT DAC when selected by bit 19.
* CM: 32-Bit CRC Mode. Selects 32-bit CRC generation
* NDM: New Dither Mode. Selects either the legacy dither mode or new dither mode
* SM: Sim Mode. This field is used to put the VP in modes to aid verification
* DVAL: DAC Test Value. 8-bit data value to drive the CRT DAC when selected by bit 19
* D: DAC Test Value Select. Selects which data stream is sent to the CRT DAC during DAC test mode
* RSVD: Bits 18 to 16 are reserved for test purposes
* SP: Bits 15 to 0 are spares. No function


Narrator: "The DAC test value registers seems useful. How do I use them?"
Duplicate copies of DAC Test Value are driven on DAC RGB.
 
Only the DAC test value registers and last reserved register are shown on the screen. I won't write a full description for them here, instead noting the highlighted text relevant to the video.
 
Narrator: "It looks like I first set the DAC Test Value field. This will be used for the red, green and blue channels."
 
This text is highlighted in the DAC Test Value register:


* crt_dac_r[7:0] = DAC Test Value[7:0] ([27:20] is this register)
* crt_dac_r[7:0] = DAC Test Value[7:0] ([27:20] is this register)
Line 134: Line 121:
* crt_dac_b[7:0] = DAC Test Value[7:0] ([27:20] is this register)
* crt_dac_b[7:0] = DAC Test Value[7:0] ([27:20] is this register)


Narrator: "Next I set the DAC Test Value Select field to 0 so it will use the test value."
To enable DAC Test Value to be driven to CRT DAC:
 
This text is highlighted in the DAC Test Value register:


* To enable DAC Test Value to be driven to CRT DAC:
* (DAC Test Value Select must = 0) AND
* (DAC Test Value Select must = 0) AND
This text is highlighted in the DAC Test Value Select register:
* <nowiki>0: 24-bit data to CRT DAC = {3{DAC Test Value[27:20]}} (3 time repeated 8-bit value).</nowiki>
Narrator: "Then I set the ... VTM register?"
This text is highlighted in the DAC Test Value Select register:
* ((VTM[6] = 0 AND MBD_MSR_DIAG[18:16] = 101h) OR
* ((VTM[6] = 0 AND MBD_MSR_DIAG[18:16] = 101h) OR
* (VTM[6] = 1 AND VTM[3:0] = 0001h)
* (VTM[6] = 1 AND VTM[3:0] = 0001h)


Narrator: "Okay, I found the Video Processor Test Mode (or VTM) register:"
Bit 19: DAC Test Value Select


A table shows the Video Processor Test Mode register.  
Selects which data stream is sent to CRT DAC during CRT DAC test mode.


The following text is highlighted in the DAC Test Value register bit descriptions:
* <nowiki>0: 24-bit data to CRT DAC = {3{DAC Test Value[27:20]}} (3 time repeated 8-bit value).</nowiki>
 
* 1: 24-bit data to CRT DAC = gfx_data[23:0] (raw input from Display Controller).
* RSVD (RO): Reserved (Read Only). Reads back as 0
* SP: Spare. Read/write; no function
* (RSVD (RO) and SP are repeated for a few more registers)
* RSVD: Reserved. Reserved for test purposes.
* (RSVD is repeated again)
 
Narrator: "It looks like these two registers reserved for tests purposes are the ones I want."
 
The two fields reserved for test purposes are highlighted.
 
One field is bit 6, the other is bits 3 through 0.
 
Narrator: "Okay, what about the MBD_MSR_DIAG register?"
 
This text is highlighted in the DAC Test Value Select register:
 
* ((VTM[6] = 0 AND MBD_MSR_DIAG[18:16] = 101h) OR
 
Narrator: "Well... I couldn't find it. This is the ONLY place it's mentioned in the manual."
 
A big question mark is placed over the text.
 
Narrator: "I did a web search and found THREE instances of it online:"
 
A blurred google search is shown with three results.
 
Narrator: "The first is ... my website?"
 
The top result is revealed to be the [[AMD Geode/Troubleshooting]] page.
 
Narrator: "The second is some X11 source code?"
 
The second result is revealed to be a link to: https://www.linuxconsulting.ro/xorg-drivers/source/xf86-video-nsc-imedia/src/cim/cim_regs.h
 
Narrator: "The third is ... the same data sheet."
 
The third link is revealed to be an upload of the data sheet I'm reading.
 
Narrator: "Looking at the X source code, apparently it was written by Nicu Pavel for iMedia Linux"
 
The [https://www.linuxconsulting.ro/xorg-drivers LinuxConsulting Xorg drivers] web page is shown, with the text "Drivers that I worked on for iMedia Linux. I no longer maintain these." in the first paragraph.
 
Narrator: "Anyway, I dug through this code to try and solve this mystery. Here's what I found."
 
A glossy (insert color here) slide shows the text "Investigation findings"
 
Narrator: "First, each peripheral has an GLD_MSR_DIAG register reserved for bus diagnostics."
 
- display diag registers
 
Narrator: "The video processor has that register as well as other GeodeLink registers."
 
- display vp registers
 
Narrator: "However the video processor also has separate diagnostic and pad select registers."
 
- highlight registers
 
Narrator: "The X driver has the GeodeLink registers laid out with the correct offsets."
 
- show mbus registers
 
Narrator: "But they're prefixed MBD_ instead of GLD_ and refered to as MBus, not GeodeLink!"
 
- highlight mbus and mbd
 
Narrator: "So MBD_MSR_DIAG is a typo, it means GLD_MSR_DIAG"
 
- text: conclusion: diag


Narrator: "Another source file has a variable named MBD_MSR_DIAG_DF."
Bits 18:16: RSVD


- highlight the variable
Reserved. Reserved for test purposes. Set to 000 for normal operation.</blockquote>Narrator: "It looks complicated, but it's quite straight forward. Here's how to use it:"


Narrator: "It points directly to the MSR_DIAG_VP register!"
Narrator: "Don't. Save yourself. This is a nightmare of problems."


- compare registers
Narrator: "First: The MBD_MSR_DIAG register doesn't exist."


Narrator: "It's sole use in the source code is to set the 32-bit CRC bit."
Narrator: "I googled it, it has three results and one of them is my website."


- show 32-bit crc register
Narrator: "It's probably a typo GLD_MSR_DIAG."


Narrator: "So
Narrator: "But that makes no sense! It's reserved for AMD!"


- text: conclusion: either register
Narrator: "Maybe it's a typo for the reserved register?"


Narrator: "I went to set the registers and found it's a mix of MSRs and memory mapping."


Narrator: "To even get the address you need to understand this GeodeLink architecture."


- confused about MSR versus memory mapping
Narrator: "The fuck is a memory descriptor?"


- using MSRs for this is rare right?
Narrator: "I gave up and just edited the kernel driver to set registers for me."


- no display
Narrator: "Test mode just made the screen go black. Is that my fault?"


- couldn't confirm this was even going to work
Narrator: "Has anyone else even used this? Am I alone in this Geode world?"


- dacpwrdwn did nothing
- dacpwrdwn did nothing

Revision as of 05:59, 17 August 2023

This is a work in progress textual description of the video.

Accessibility notice

Narrator: "Quick notice: A full textual description of this video is linked in the description below. Enjoy!"

A glossy purple slide shows the text "A full textual description of this video is linked in the description below"

Recount

Narrator: "Welcome back to my AMD Geode repair video series. If you weren't here for the first few videos, let me give you a quick recount."

A glossy red slide shows the text "Welcome back! Now for a quick recap"

Narrator: "In video 1 I bought and did some basic troubleshooting on an AMD Geode computer board. I drew some wrong conclusions and at the end damaged the board with bad soldering."

Two scenes from part one are shown. The first is me using a bench power supply to power board. The second is a sticky mess of me soldering the board. The text "Part 1: Troubleshooting" is shown.

Narrator: "In video 2 I spent 6 hours trying to repair the board. I was successful in the end but damaged another part later."

Two scenes from part two are shown. The first is soldering an inductor back on to the board. The second is running solder braid over the network adapter with bent and ruined network pins. The text "Part 2: Repair" is shown.

Lessons learned

Narrator: "Okay we're done. Let's talk about the lessons learned."

A glossy green slide shows the text "Lessons learned"

Narrator: "First, make a plan when soldering. Practice on e-waste to see if it's something you can do. Take breaks throughout and assess the situation. I didn't do any of these and I damaged the board."

A glossy green slide shows the the following text:

  • Lesson 1: Have a plan
  • Practice it on e-waste
  • Take breaks
  • Assess the situation
  • I didn't do these and failed

Narrator: "Secondly, understand the circuit properly! Had I done this I wouldn't have even had to solder the board. Let me explain."

A glossy orange slide shows the the following text:

  • Lesson 2:
  • Understand the circuit!
  • I could've avoided soldering altogether

Narrator: "In the video I drew this diagram"

A picture of the circuit board near the CPU is shown. Text and lines are drawn over it, forming a diagram that shows:

  • DAVdd connects to the LM4041AIM3-1.2 voltage reference
  • From the 1.22 volt reference a 0.25 nanofarad capacitor and 10 kiloohm resistor in parallel run to DVREF
  • The 1.21 kiloohm resistor follows from the DVREF capacitor and resistor to the DRSET pin

Narrator: "I also measured these voltages"

The diagram is updated. DAVdd is marked as 3.3 volts, DVREF is 1.22 volts and DRSET is 40 millivolts.

Narrator: "How is DAVdd 3.3 volts if it's connected to a 1.2 volt reference?"

The voltage reference is circled.

Narrator: "How is DVREF 1.22 volts if there's a 10k resistor?"

The 10k resistor is circled instead.

Narrator: "What is this capacitor doing here?"

The capacitor is circled instead.

Narrator: "It makes no sense!"

Three giant question marks are shown overlaid the diagram.

Narrator: "When it comes to the part of the board I spend time troubleshooting and soldering, it gets worse!"

A picture of the circuit board near is shown, near the VGA output port. It contains various surface mount chips, but in the center is a set of 3 small capacitors, 7 inductors, 3 ESD diodes and 7 resistors.

Narrator: "I thought this circuit had the video signals travelling through capacitors, through inductors, through these ESD diodes, and out through these termination resistors."

Text overlays the diagrams labels the capacitors, inductors, ESD diodes and resistors. The top three capacitors are labelled R, G and B. Three separate lines from each of these capacitors draw through a set of inductors, ESD diodes and resistors. The lines are coloured red, green and blue.

Narrator: "I figured that an ESD diode was faulty, pulling a signal line down to GND. This would be responsible for the low voltage."

The text "Would a bad ESD diode pull the signal low?" is shown. The green line is replaced with a shorter line that ends at one of the pins of its ESD diode.

Narrator: "Had I just measured the ESD resistors with my multimeter in resistance and diode mode I could've ruled this out."

A cartoon multimeter is shown with its black probe on the GND pin of the ESD diode and the red probe on the signal pin of the ESD diode.

Narrator: "Even then, I decided to remove the capacitors to isolate the signals"

The circuit board is shown again, this time with the top capacitors removed. The red, green and blue lines stop at the signal side of the capacitor and no longer flow to the inductors. The text "I removed the capacitors to rule out any fault..."

Narrator: "But these are connected to GND, not the signal!"

The red, green and blue lines turn to crossed out stubs. The text "But they weren't connected to the signal!" is shown.

Narrator: "Removing them would not show the fault at all! I was doomed from the start."

The red, green and blue lines start again at the inductors and flow to the resistors again.

Writing code

(WIP)

Narrator: "Without an obvious board issue, maybe I could find some hints in the chip itself?"

A glossy (insert color here) slide shows the text "Investigating the chip"

Narrator: "So I opened the data sheet and started looking for anything useful."

The datasheet cover page is shown. An 'AMD Geode' logo is shown as well as the text "AMD Geode™ LX Processors Data Book" dated February 2009.

Narrator: "I first looked at the at the video processor diagnostic register. I found three interesting fields:"

Three registers fields are shown. I will quote from the data-sheet here:

Bits 27 to 20: DAC Test Value

8-bit data value to drive to CRT DAC when selected by bit 19.

Duplicate copies of DAC Test Value are driven on DAC RGB.

  • crt_dac_r[7:0] = DAC Test Value[7:0] ([27:20] is this register)
  • crt_dac_g[7:0] = DAC Test Value[7:0] ([27:20] is this register)
  • crt_dac_b[7:0] = DAC Test Value[7:0] ([27:20] is this register)

To enable DAC Test Value to be driven to CRT DAC:

  • (DAC Test Value Select must = 0) AND
  • ((VTM[6] = 0 AND MBD_MSR_DIAG[18:16] = 101h) OR
  • (VTM[6] = 1 AND VTM[3:0] = 0001h)

Bit 19: DAC Test Value Select

Selects which data stream is sent to CRT DAC during CRT DAC test mode.

  • 0: 24-bit data to CRT DAC = {3{DAC Test Value[27:20]}} (3 time repeated 8-bit value).
  • 1: 24-bit data to CRT DAC = gfx_data[23:0] (raw input from Display Controller).

Bits 18:16: RSVD

Reserved. Reserved for test purposes. Set to 000 for normal operation.

Narrator: "It looks complicated, but it's quite straight forward. Here's how to use it:"

Narrator: "Don't. Save yourself. This is a nightmare of problems."

Narrator: "First: The MBD_MSR_DIAG register doesn't exist."

Narrator: "I googled it, it has three results and one of them is my website."

Narrator: "It's probably a typo GLD_MSR_DIAG."

Narrator: "But that makes no sense! It's reserved for AMD!"

Narrator: "Maybe it's a typo for the reserved register?"

Narrator: "I went to set the registers and found it's a mix of MSRs and memory mapping."

Narrator: "To even get the address you need to understand this GeodeLink architecture."

Narrator: "The fuck is a memory descriptor?"

Narrator: "I gave up and just edited the kernel driver to set registers for me."

Narrator: "Test mode just made the screen go black. Is that my fault?"

Narrator: "Has anyone else even used this? Am I alone in this Geode world?"

- dacpwrdwn did nothing

- dacvref did nothing

- GLCP_DAC showed low voltage

Measurement

I did what I should have done in the first place: Measured when the display WORKS!

  • The DVREF shunt looks okay and produces the correct voltage
  • The DVREF shunt has a 12nF cap in parallel
  • The DVREF shunt has 13k to the 3V3 rail
  • The DRSET resistor is 1.21K to GND
  • The VGA resistors seem fine and correct values
  • When external DVREF is used, the shunt drops to 800mV, the rail somehow drops to 960mV

Shorting between an existing 3.3V rail nearby caused the screen to suddenly display in full brightness.

Repair

I followed the rail and found a blown resistor, but I also wondered if the capacitor was somehow draining. So I removed both. This wasn't a completely correct fix: The bypass capacitor is in parallel to the circuit, it couldn't drop voltage like this normally. Had I measured it I could've confirmed it was 3.3V. The voltage drop here is 2.34V! So there's some in series resistor that must be dropping voltage based on current or use. The burned resistor looks like a good candidate.

Conclusion

At this point I believe the DAC is working, so the problem might be related to clocking.

I added in a fresh clock battery and it had no effect.

Things to try:

- BIOS flashing

- Fix network