coreboot/src
Duncan Laurie 21a097aedc i2c: Add a generic i2c driver
This adds a generic I2C driver that can be described in the devicetree
and used to generate ACPI objects in the SSDT based on the information
provided in the config registers.

The I2C bus can be configured and the device can provide an interrupt and
wake capability to the OS.  A configuration option allows for a GPIO to
be provided that will be checked to determine if the device is preset on
the board before including it in the generated SSDT.

The driver is generic enough to be used for basic I2C devices that do
not have special configuration needs such as touchpads, touchscreens,
sensors, some audio codec/amplifiers, etc.

Sample usage for a touchpad device:

device pci 15.1 on
  chip drivers/i2c/generic
    register "hid" = ""ELAN0000""
    register "desc" = "ELAN Touchpad"
    register "irq" = "IRQ_EDGE_LOW(GPP_B3_IRQ)"
    register "wake" = "GPE0_DW0_05"
    device i2c 15.0 on end
  end
end

Will result in the following code in the SSDT:

Scope (\_SB.PCI0.I2C1) {
  Device (D015) {
    Name (_HID, "ELAN0000")
    Name (_UID, 0)
    Name (_S0W, 4)
    Name (_PRW, Package () { 5, 3 })
    Method (_STA) { Return (0x0f) }
    Name (_CRS, ResourceTemplate () {
      I2cSerialBus (0x15, ControllerInitiated, 400000, AddressingMode7Bit,
                    "\\_S.PCI0.I2C1", 0, ResourceConsumer)
      Interrupt (ResourceConsumer, Edge, ActiveLow) { 51 }
    })
  }
}

Change-Id: Ib32055720835b70e91ede5e4028ecd91894d70d5
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/15016
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 05:36:41 +02:00
..
acpi acpi/: add missing license header 2016-01-14 22:52:11 +01:00
arch acpi_device: Add support for writing ACPI Device Properties 2016-05-28 03:48:55 +02:00
commonlib commonlib/lz4: Avoid unaligned memory access on RISC-V 2016-05-31 21:07:03 +02:00
console console/post: be explicit about conditional cmos_post_log() compiling 2016-05-25 18:04:11 +02:00
cpu AGESA vendorcode: Build a common amdlib 2016-05-18 10:44:43 +02:00
device device: Add an ACPI device name and path concept to devices 2016-05-21 05:59:52 +02:00
drivers i2c: Add a generic i2c driver 2016-06-02 05:36:41 +02:00
ec ec/google/chromeec/acpi: Add MKBP support 2016-05-18 20:22:38 +02:00
include wrdd: Export WRDD info in the header 2016-06-02 05:34:17 +02:00
lib lib/hardwaremain: Add \n to "Boot failed" message 2016-05-31 20:20:44 +02:00
mainboard Gale board: Move TPM setup function to verstage.c 2016-06-02 00:19:11 +02:00
northbridge nb/intel/x4x: Add DMI/EP init 2016-05-31 20:02:09 +02:00
soc Gale board: Move TPM setup function to verstage.c 2016-06-02 00:19:11 +02:00
southbridge drivers/lenovo: Add hybrid graphics driver 2016-06-01 23:22:01 +02:00
superio sio/winbond/w83667hg-a: Add pinmux defines for UART B 2016-05-29 19:34:54 +02:00
vendorcode vendorcode/google/chromeos/vboot2: use cbmem for postcar region selection 2016-05-25 18:04:30 +02:00
Kconfig src/Kconfig: Move acpi Kconfig below chipset Kconfigs 2016-05-19 19:29:59 +02:00