Difference between revisions of "Hardware/GX2"

From WiiUBrew
Jump to navigation Jump to search
m (add category:hardware)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{stub}}
+
{{Infobox MMIO
 +
| arm = Full
 +
| ppc = Full
 +
| base = 0x0c200000
 +
| len = 0x80000
 +
| bits = 32
 +
| ppcirq = 2
 +
}}
 +
The GX2 is the Wii U's main graphics processor, semantically a part of the Latte despite being used directly by the [[Espresso]]. The chip is a member of the Radeon R7xx family {{ref label|ref-lt-f0f-2013|1}} (used in the Radeon HD 4330) clocked at 549.999775MHz.{{ref label|ref-clk-tweet|2}}. While documentation perfectly matching the card is yet to be found, several documents can be brought together to form a reasonable picture of the register layout.
 +
 
 +
Reverse-engineering has revealed that the GX2's MMIO registers (referred to as ''GpuF0MMReg'' in AMD's docs) are at 0x0c200000; mapped at 0xfc200000 in [[Cafe OS]] userspace. The other MMIO locations (''GpuF0Pcie'', ''VGA_IO'') are not known at this point.
 +
 
 +
*[https://developer.amd.com/wordpress/media/2012/10/42589_rv630_rrg_1.01o.pdf RV630 Register Reference Guide]
 +
:Register guide for a similar, but not identical, card. Covers 2D graphics, CRTCs, the memory controller, etc. Does ''not'' cover 3D. Addresses for registers starting with ''D1'' are known to match the GX2 - this reference has been successfully used to set up a framebuffer without Cafe OS running. There's evidence of another display not mentioned in this document - see the [[#Cafe OS|Cafe OS]] section below.
 +
*[http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/R6xx_3D_Registers.pdf Radeon R6xx/R7xx 3D Register Reference Guide]
 +
:3D register guide. Applies to the whole R7xx family, so there should be no differences for the GX2.{{check}} Has not been tried on hardware at time of writing.
 +
*[http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/R6xx_R7xx_3D.pdf Radeon R6xx/R7xx Acceleration]
 +
:Conceptual document explaining how to actually use the 3D engine, shader pipelines, caches, etc. Names registers, but does not give addresses (readers should cross-reference the 3D Register Reference Guide)
 +
 
 
''Not to be confused with [[gx2.rpl]], the API for interacting with the card. Also see {{hw|GX2 Registers}}.''
 
''Not to be confused with [[gx2.rpl]], the API for interacting with the card. Also see {{hw|GX2 Registers}}.''
  
The GX2 is the Wii U's main graphics processor, semantically a part of the Latte despite being used directly by the {{hw|Espresso}}. The chip is a member of the Radeon R7xx family{{ref label|ref-lt-f0f-2013|1}} (used in the Radeon HD 4330) clocked at 549.999775MHz.{{ref label|ref-clk-tweet|2}}
+
== Cafe OS ==
 +
Cafe OS applies various APIs on top of the GX2's raw hardware registers - [[gx2.rpl]] and [[Coreinit.rpl#Screen|OSScreen]].
 +
 
 +
=== OSScreen ===
 +
OSScreen is the easier of the two to reverse-engineer, and reveals some unknowns in the hardware. For example, it uses the registers at ''GpuF0MMReg'':0x6100 to set up one framebuffer - which matches the D1GRPH registers according to the RV630 Register Reference Guide (see chapter 2.7.1 - Primary Display Graphics Control Registers). However, the API ''also'' uses registers at ''GpuF0MMReg'':0x7100 identically; suggesting the existence of another display controller at that location. The Register Reference Guide does not list any registers at that address, suggesting some major differences between the GX2 and the RV630.
 +
 
 +
OSScreen uses the following D1 registers: D1CRTC_BLANK_CONTROL (sets D1CRTC_BLANK_DATA_EN), D1GRPH_ENABLE, D1GRPH_CONTROL (sets D1GRPH_DEPTH to 32bpp, D1GRPH_FORMAT to ARGB 8888, and D1GRPH_ARRAY_MODE to ARRAY_LINEAR_ALIGNED), D1GRPH_PRIMARY_SURFACE_ADDRESS, D1GRPH_PITCH, D1OVL_PITCH (for unknown reasons, the overlay is disabled) and an unknown register at ''GpuF0MMReg'':0x6914. As mentioned before, OSScreen also uses a set of registers 0x1000 bytes along from the D1 registers (GRPH_ENABLE at ''GpuF0MMReg'':0x7100); which could be for Gamepad video output.
  
==References==
+
== References ==
 
*{{note label|ref-lt-f0f-2013|1}} [https://fail0verflow.com/blog/2014/console-hacking-2013-omake/#latte fail0verflow:: Console Hacking 2013: Omake - Latte]
 
*{{note label|ref-lt-f0f-2013|1}} [https://fail0verflow.com/blog/2014/console-hacking-2013-omake/#latte fail0verflow:: Console Hacking 2013: Omake - Latte]
 
*{{note label|ref-clk-tweet|2}} [https://twitter.com/marcan42/status/274120447023538176 marcan tweets Wii U clock speeds]
 
*{{note label|ref-clk-tweet|2}} [https://twitter.com/marcan42/status/274120447023538176 marcan tweets Wii U clock speeds]
  
 
[[Category:Hardware|{{PAGENAME}}]]
 
[[Category:Hardware|{{PAGENAME}}]]

Latest revision as of 19:41, 14 January 2020

GX2
Access
EspressoFull
StarbuckFull
Registers
Base0x0c200000
Length0x80000
Access size32 bits
Byte orderBig Endian
IRQs
Espresso2
This box: view  talk  edit

The GX2 is the Wii U's main graphics processor, semantically a part of the Latte despite being used directly by the Espresso. The chip is a member of the Radeon R7xx family [1] (used in the Radeon HD 4330) clocked at 549.999775MHz.[2]. While documentation perfectly matching the card is yet to be found, several documents can be brought together to form a reasonable picture of the register layout.

Reverse-engineering has revealed that the GX2's MMIO registers (referred to as GpuF0MMReg in AMD's docs) are at 0x0c200000; mapped at 0xfc200000 in Cafe OS userspace. The other MMIO locations (GpuF0Pcie, VGA_IO) are not known at this point.

Register guide for a similar, but not identical, card. Covers 2D graphics, CRTCs, the memory controller, etc. Does not cover 3D. Addresses for registers starting with D1 are known to match the GX2 - this reference has been successfully used to set up a framebuffer without Cafe OS running. There's evidence of another display not mentioned in this document - see the Cafe OS section below.
3D register guide. Applies to the whole R7xx family, so there should be no differences for the GX2.[check] Has not been tried on hardware at time of writing.
Conceptual document explaining how to actually use the 3D engine, shader pipelines, caches, etc. Names registers, but does not give addresses (readers should cross-reference the 3D Register Reference Guide)

Not to be confused with gx2.rpl, the API for interacting with the card. Also see GX2 Registers.

Cafe OS

Cafe OS applies various APIs on top of the GX2's raw hardware registers - gx2.rpl and OSScreen.

OSScreen

OSScreen is the easier of the two to reverse-engineer, and reveals some unknowns in the hardware. For example, it uses the registers at GpuF0MMReg:0x6100 to set up one framebuffer - which matches the D1GRPH registers according to the RV630 Register Reference Guide (see chapter 2.7.1 - Primary Display Graphics Control Registers). However, the API also uses registers at GpuF0MMReg:0x7100 identically; suggesting the existence of another display controller at that location. The Register Reference Guide does not list any registers at that address, suggesting some major differences between the GX2 and the RV630.

OSScreen uses the following D1 registers: D1CRTC_BLANK_CONTROL (sets D1CRTC_BLANK_DATA_EN), D1GRPH_ENABLE, D1GRPH_CONTROL (sets D1GRPH_DEPTH to 32bpp, D1GRPH_FORMAT to ARGB 8888, and D1GRPH_ARRAY_MODE to ARRAY_LINEAR_ALIGNED), D1GRPH_PRIMARY_SURFACE_ADDRESS, D1GRPH_PITCH, D1OVL_PITCH (for unknown reasons, the overlay is disabled) and an unknown register at GpuF0MMReg:0x6914. As mentioned before, OSScreen also uses a set of registers 0x1000 bytes along from the D1 registers (GRPH_ENABLE at GpuF0MMReg:0x7100); which could be for Gamepad video output.

References