i2c_imc: New driver for Intel's iMC, found on LGA2011 SNB chips

Sandy Bridge Xeon and Extreme chips have integrated memory
controllers with (rather limited) onboard SMBUS masters.  This
driver gives access to the bus.

There were various groups working on standardizing a way to arbitrate
access to the bus between the OS, SMM firmware, a BMC, hardware
thermal control, etc.  In the mean time, running this driver is unsafe
except under special circumstances.  Nonetheless, this driver has real
use deployed use cases: there are many Sandy Bridge systems with
pre-NFIT ADR NVDIMMs installed, and many of these NVDIMMs are designed
to be programmed over SMBUS.

As a compromise, the driver will refuse to load unless
i2c_imc.allow_unsafe_access=Y.  When safe access becomes available, we
can leave this option as a way for legacy users to run the driver, and
we'll allow the driver to load by default if safe bus access is
available.

This driver currently only supports SNB.  It should be straightforward
to extend it to all newer CPUs, but I don't have the hardware to test
it.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
3 files changed