Revision as of 20:26, 16 December 2011

Contents

AMD IMC

The AMD IMC register interface visible from PCI space is documented in the AMD reference guides. This page tries to cover everything else which is not documented elsewhere.

The embedded controller is an 8051 CPU most likely derived from SMSC LPC47N350 Data Sheet or any recent SMSC embedded controller core. As the 8051, it has 3 memory spaces. The SFR, internal RAM and external space where the hardware has specific registers mapped. The code is fetched from 16KB? region of flash the base address is set to 0xFFF20000 (in SB710).

The EC is turned on if the soft straps are set to on during the init of the southbridge, this is documented in the SB datasheet. To make it operational you will need to modify the strap bits
and include the IMC firmware in the coreboot image. The 8051 reset vector is first instruction. The firmware itself contains a magic _AMD_IMC_C and you can check validateImcFirmware() how it works.

To check if IMC is active check if PCI 0:14.3 0x40 bit7 set.

SuperIO Register space

The IMC presents itself as an multifunction superIO device. You can read the sioport base in the following register PCI 14.3 0xa4 & ~0x1.
The access pattern is same as for any other superio. The superiotool has some basic routines implemented. In general, there is a "password"
to unlock the SIO part - 0x5a and lock it with 0xa5 again.

The known global registers:

0x0 - device ID register 0xb7 for SB710

0x1 - revision ID?

0x2 - WO btt0 reset?

0x7 - change logical device (LDN)

0x26, 0x27 - the base address again, unclear if the base could be changed using this regs.

If you write to mailbox: prepare all regs then write FUNC to 0x80 and wait until 0xFA is in 0x82 -> EC acked transaction, wait 100ms when polling this reg

To execute a function and send data:

clear 0x82

setup 0x82-0x8f

setup 0x80

wait for 0xfa in 0x82

Firmware commands

The firmware accepts variety of commands through the mailbox interface. The command is passed in 0x80 (SYS_TO_IMC) and data in 0x83 REG1, REG2 ... The format of the commands is: [fn in 0x80]: [data in REG1, REG2 ... ].

unknown command: [0x50] [Unknown]

Zone and Fan setup: [0x80] [0x0, zone NR]

Zone enable?: [0x81] [zone NR, bit0=enable]

Fan related 0x81, 0x83, 0x85, 0x89 (TODO)

Read the memory spaces [0x90] [REG1, REG2, REG3] output in REG4, REG2:REG1 is address, REG3 tells what space it is. Intmem is 0, extmem is 1 and codemem is 2.