Hardware/SMC

From WiiUBrew
Jump to navigation Jump to search

General

The Wii U added a new chip to assist with power management alongside the RTC, labeled "SMC". The SMC is responsible for managing disc drive power/eject, power LED patterns, wireless resets, regulator enable/PGOOD monitoring, and possibly other unknown functionality. Known part numbers include 1224EE429 301, 1225EE423 301. Chip is a 78K0/KC2-L from NEC/Renesas.

Communication

SMC resides as device ID 0x50 on I2C bus 3. It communicates at 5kHz in IOS and 10KHz in Cafe2Wii?

Registers

SMC has two types of registers: Read/write and command-based. Read/write registers operate by having the register number written (1 byte), followed by either another written byte, or a 1 byte read. Command-based registers perform their action just by writing the register number (1 byte). When attempting to read a command-based register, it will read as 0xFF.

Index Type Description
0x00 Command SMC_CMD_ODD_ON
0x01 Command SMC_CMD_ODD_OFF
0x02 Command SMC_CMD_ODD_EJECT
0x10 Command SMC_CMD_SBYLED_OFF
0x11 Command SMC_CMD_PWRLED_ON
0x12 Command SMC_CMD_PWRLED_OFF
0x13 Command SMC_CMD_PWRLED_BLINK
0x14 Command SMC_CMD_C24LED_OFF
0x15 Command SMC_CMD_C24LED_ON
0x16 Command SMC_CMD_C24LED_BLINK
0x1E Command SMC_CMD_SBYLED_ON
0x1F Command SMC_CMD_SBYLED_BLINK
0x20 Command SMC_CMD_RESET_BT
0x21 Command SMC_CMD_RESET_WIFI24
0x22 Command SMC_CMD_RESET_WIFI5
0x30 Read/Write SMC_CMD_TIMER_23_16
0x31 Read/Write SMC_CMD_TIMER_15_08
0x32 Read/Write SMC_CMD_TIMER_07_00
0x40 Read SMC_CMD_PROG_REVISION (val: 0xC5)
0x41 Read SMC_CMD_SYSTEM_EVENT
0x42 Read SMC_CMD_ODD_FLAG (val: 0x0B, 0x0A?)
0x43 Read/Write SMC_CMD_USB_FLAG (bitmask; front USB: 0x1, rear USB: 0x2)
0x44 Read/Write SMC_CMD_CCIND_FLAG
0x45 Read/Write SMC_CMD_PWRERR_FLAG (val: 0x08)
0x46 Read/Write SMC_CMD_DEVEN_FLAG (val: 0x00)
0x47 Read ? not writable (val: 0xFF)
0x48 Read ChipRevision (val: 0x0F)
0x49 Read ? (val: 0x4000000; needs ProgramRevision > 0xD3?)
0x60~0x6F Read/Write Nvram
0x70 Read UnkDataValid (0x01 when UnkData is valid, else 0x00)
0x71 Read/Write? Blinks the drive LED/reset on read? (I2C reads 0xFF briefly).
0x72 Read/Write Seems to affect whether UnkDataValid is set for addrs 0x4~0x81. bit1 fills in UnkData with 0x5, ((reg & 0xF0) > 0x80) returns UnkDataValid to 0? (val: 0x00)
0x73 Read/Write UnkAddrHi? Changes to 0x10 when UnkAddrHi is less than 0x10. (val: 0x00)
0x74 Read/Write UnkAddrLo? Changes UnkData and UnkDataValid. (val: 0x00)
0x75 Read ? (val: 0x00)
0x76 Read UnkData. Changes to 0x5 then 0xf1 when 0x74 is written to 0x00 twice.
0x80~0xFF Read/Write scratch mem? (val: 0x00)

SMC_CMD_SYSTEM_EVENT

Bits Description
0 SMC_WAKE1
1 SMC_WAKE0
2 SMC_BT_IRQ
3 SMC_TIMER
4 SMC_DISK_INSERT
5 SMC_EJECT_BUTTON
6 SMC_POWER_BUTTON
7

SMC_CMD_CCIND_FLAG

Bits Description
0 Yellow LED pulse
1 Yellow LED on
2 Red LED pulse
3 Red LED on
4 Blue LED pulse
5 Blue LED on
6-7

SMC_CMD_DEVEN_FLAG

Bits Description
0 SMC_DEVEN_WIFI24
1-7

Nvram

Must be written from largest to smallest address for values to be set.

Offset Size Description
0x0 0x1 LAPSSetting
0x1 0xF SystemError

Pinout

Counter-clockwise from the dot and PCB arrow:

Pin number Name Notes
01 INTP0/EXLVI Connects to TP146, RTC, WIFI24 (connector pin 21) and BT (connector pin 11). Input. Triggers blinking red LED on LOW.
02 RESET Connects to TP145 and RTC. Resets SMC when measured. On WUP-DEV-X9, attached to a 5-pin header (pin1).
03 XT2/EXCLKS Connects to TP144 and RTC. Input. SMC stops i2c on LOW.
04 XT1 Connects to TP168 and SW4 (pins 1 and 3).
05 IC Disconnected (Internally Connected).
06 X2/EXCLK/TOOLD0 Disc presence sensor (receiver). Connects to TP19 and disc drive (connector pin 19). On WUP-DEV-X9, attached to a 5-pin header (pin2).
07 X1/TOOLC0 Clock (pulses between 3.3v and 0v at 1Hz). Connects to TP175 and RTC. On WUP-DEV-X9, attached to a 5-pin header (pin3).
08 REGC Connected to GND via C137.
09 Vss
10 Vdd Connects to decoupling cap C73.
11 P60/SCLA0 Connects to TP153. I2C SCL.
12 P61/SDAA0 Connects to TP154. I2C SDA.
13 P62 Connects to TP70 (separated by resistor). Power Button (active low).
14 P33 Connects to TP155.
15 P73/KR3 Rear USB enable. Connects to TP80.
16 P72/KR2 Rear USB fault. Connects to TP109.
17 P71/KR1 Connects to TP38.
18 P70/KR0 Connects to TP15.
19 P32 Connects to TP157.
20 P31 Front USB enable. Connects to TP39.
21 P30 Connects to TP68, and faceplate (connector pin 8, not connected to any buttons). Internal pull-up.
22 P17 Front USB power fault. Connects to TP95.
23 P16 Connects to TP156 and BT (connector pin 12).
24 P15 White LED. Transistor pin. PWM at 100Hz.
25 P14 Eject button. Connects to faceplate. Input, internal pull-up.
26 P13 Yellow LED. Connects to TP2001 and faceplate. PWM at 100Hz.
27 P12 Connects to TP37.
28 P11 Connects to TP171 and faceplate.
29 P10 Connects to TP16.
30 AVref Connects to decoupling cap C73.
31 AVss
32 P26 Disc presence sensor (transmitter). Connects to TP18. 8Hz.
33 P25 Fake power button (connected to RTC, pulsed low with Eject). Connects to TP9.
34 P24 Disk eject (to drive, active high). Connects to TP5.
35 P23 Optical power enable? Connects to TP152, TP88 and battery.
36 P22 Connects to TP172 and BT (connector pin 13).
37 P21 Connects to TP173 and WIFI5 (connector pin 7).
38 P20 Connects to TP174 and WIFI24 (connector pin 16).
39 P01 Blue LED. Transistor lead. PWM at 100Hz.
40 P00 Red LED. Connects to TP66, TP2000 and faceplate. PWM at 100Hz.

WUP-DEV debug header

WUP-DEV-X9 has an unpopulated through-hole 5-pin debug header for SMC.

Pin number Name Notes
01 nRST Connects to SMC RESET.
02 ? Connects to SMC TOOLD0 (data input/output for tool).
03 ? Connects to SMC TOOLC0 (clock input for tool).
04 3v3 Connects to TP122.
05 GND Connects to GND.