mb/51nb: Add support for the 51nb X210

The 51nb X210 is a replacement motherboard for Thinkpad X200/X201 systems,
based on a modern Kabylake CPU. It also ships with no firmware protection,
(IFD is fully unlocked, no protected regions are set, no Bootguard),
making it an ideal coreboot target. This port is based on the support for
the Skylake-based Purism Librem 13v3, with the following significant
changes:

* EC firmware is contained within the system SPI flash, and so a blob of
  EC firmware must be injected to a defined location during image build.
* GPIO layout is different - this is currently just a raw import of the
  GPIO configuration from the vendor firmware
* The system has two DIMMs, so an additional SPD address has been added
* The USB port layout is different
* The EC must be enabled at boot time through SuperIO-style logical device
  configuration
* EC register layout is different, necessitating changes in the ACPI tables
* The HDA pins are different
* The genx_dec config is different

All hardware appears to work as expected, although the SD reader is
untested.

Signed-off-by: Matthew Garrett <mjg59@google.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Change-Id: If74621e76d703f629b54f1feb1acfc95cc72d183
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32531
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/mainboard/51nb/x210/acpi/graphics.asl b/src/mainboard/51nb/x210/acpi/graphics.asl
new file mode 100644
index 0000000..218b957
--- /dev/null
+++ b/src/mainboard/51nb/x210/acpi/graphics.asl
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later  */
+/* This file is part of the coreboot project. */
+
+Device (GFX0)
+{
+	Name (_ADR, 0x00020000)
+	Method (_DOS, 1, NotSerialized)
+	{
+		/* We never do anything in firmware, so _DOS is a noop */
+	}
+	Method (_DOD, 0, NotSerialized)
+	{
+		return (Package (0x03)
+		{
+			0x80000410, /* LCD */
+			0x80000120, /* VGA */
+			0x80000330 /* DP */
+		})
+	}
+	Device (LCD)
+	{
+		Method (_ADR, 0, Serialized)
+		{
+			Return (0x800000410)
+		}
+
+		Method (_BCL, 0, NotSerialized)
+		{
+			Return (Package (0x12)
+			{
+				0x0A,
+				0x0F,
+				0x00,
+				0x01,
+				0x02,
+				0x03,
+				0x04,
+				0x05,
+				0x06,
+				0x07,
+				0x08,
+				0x09,
+				0x0A,
+				0x0B,
+				0x0C,
+				0x0D,
+				0x0E,
+				0x0F
+			})
+		}
+		Method (_BCM, 1, NotSerialized)
+		{
+			\_SB.PCI0.LPCB.EC.BKLG = Arg0
+		}
+		Method (_BQC, 0, NotSerialized)
+		{
+			Return (\_SB.PCI0.LPCB.EC.BKLG)
+		}
+	}
+}