Hi all,
   Finally I get my T400s work with a patched version of the newest
   libreboot revision, as well as another patch to enable other wired
   (S)ATA ports.
   It may be possible to add T400s as a new supported board with patch
   0001, and patch 0002 may be useful to improve its extensibility.
   Persmule.
From 97eb66d447377e6463d0660f6a3003358cbaa367 Mon Sep 17 00:00:00 2001
From: persmule <[email protected]>
Date: Sun, 21 Aug 2016 17:17:46 +0800
Subject: [PATCH 2/2] enable all SATA ports for T400(s)

There is an ATA slot for optical drive on the ThinkPad Advanced Dock, which could be used along with T400, and T400s also has an eSATAp port on its back, aswell as on the ThinkPad Mini Dock Plus Series 3 - 90W.
In the original devicetree.cb, only ports 1 and 2 connected to its internal drives are enabled. This patch enables the sata ports 5 and 6, which are confirmed to be wired to the eSATAp ports on T400s, and possibly the ATA slot on the dock for T400.
---
 .../grub/t400_16mb/reused.list                     |  1 +
 .../grub/t400_4mb/reused.list                      |  1 +
 .../0001-lenovo-t400-Enable-all-SATA-ports.patch   | 32 ++++++++++++++++++++++
 3 files changed, 34 insertions(+)
 create mode 100644 resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-lenovo-t400-Enable-all-SATA-ports.patch

diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list
index bdbe9fd..66f08c9 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list
@@ -5,3 +5,4 @@
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
+/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-lenovo-t400-Enable-all-SATA-ports.patch
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list
index bdbe9fd..66f08c9 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list
@@ -5,3 +5,4 @@
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
+/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-lenovo-t400-Enable-all-SATA-ports.patch
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-lenovo-t400-Enable-all-SATA-ports.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-lenovo-t400-Enable-all-SATA-ports.patch
new file mode 100644
index 0000000..964665b
--- /dev/null
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-lenovo-t400-Enable-all-SATA-ports.patch
@@ -0,0 +1,32 @@
+From 1a5c909fadd238868efe06fe2b156e409073c99c Mon Sep 17 00:00:00 2001
+From: persmule <[email protected]>
+Date: Fri, 20 May 2016 17:51:20 +0800
+Subject: [PATCH] lenovo/t400: Enable all SATA ports
+
+There are 2 SATA ports on the chassis of t400(s), but at least one dock for t400 contains a port for (P/S)ATA device, and t400s has a eSATA port on its chassis, and another one on its dock.
+
+They have to be unmasked via device tree to use.
+
+This patch unmasked all SATA ports found within t400s with factory firmware.
+---
+ src/mainboard/lenovo/t400/devicetree.cb | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/mainboard/lenovo/t400/devicetree.cb b/src/mainboard/lenovo/t400/devicetree.cb
+index af92d30..ec01472 100644
+--- a/src/mainboard/lenovo/t400/devicetree.cb
++++ b/src/mainboard/lenovo/t400/devicetree.cb
+@@ -54,8 +54,8 @@ chip northbridge/intel/gm45
+ 			register "gpe0_en" = "0x01000000"
+ 			register "gpi1_routing"  = "2"
+ 
+-			# Set AHCI mode, enable ports 1 and 2.
+-			register "sata_port_map"		= "0x03"
++			# Set AHCI mode, enable ports 1, 2, 5 and 6.
++			register "sata_port_map"		= "0x33"
+ 			register "sata_clock_request"		= "0"
+ 			register "sata_traffic_monitor"		= "0"
+ 
+-- 
+2.8.1
+
-- 
2.8.1

From c23354e5f2ec6e7e21ce614e8a41ee096f782a12 Mon Sep 17 00:00:00 2001
From: persmule <[email protected]>
Date: Sun, 21 Aug 2016 17:05:38 +0800
Subject: [PATCH 1/2] T400s: use UDELAY_IO to make EC initializable.

T400s seems to need CONFIG_UDELAY_IO to initialize its EC.
After applying this patch, the rom images built for T400 can be used on T400s.
---
 resources/libreboot/config/grub/t400_8mb/config    |  4 ++--
 .../grub/t400_16mb/reused.list                     |  1 +
 .../grub/t400_4mb/reused.list                      |  1 +
 ...op-using-udelay_io.c-in-romstage-for-T400.patch | 24 ++++++++++++++++++++++
 4 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-romstage-stop-using-udelay_io.c-in-romstage-for-T400.patch

diff --git a/resources/libreboot/config/grub/t400_8mb/config b/resources/libreboot/config/grub/t400_8mb/config
index be9f61c..4b8ba8c 100644
--- a/resources/libreboot/config/grub/t400_8mb/config
+++ b/resources/libreboot/config/grub/t400_8mb/config
@@ -222,9 +222,9 @@ CONFIG_SSE2=y
 # CONFIG_CPU_TI_AM335X is not set
 # CONFIG_PARALLEL_CPU_INIT is not set
 # CONFIG_PARALLEL_MP is not set
-# CONFIG_UDELAY_IO is not set
+CONFIG_UDELAY_IO=y
 # CONFIG_UDELAY_LAPIC is not set
-CONFIG_UDELAY_TSC=y
+# CONFIG_UDELAY_TSC is not set
 # CONFIG_TSC_CONSTANT_RATE is not set
 # CONFIG_TSC_MONOTONIC_TIMER is not set
 # CONFIG_UDELAY_TIMER2 is not set
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list
index 30301d5..bdbe9fd 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_16mb/reused.list
@@ -1,6 +1,7 @@
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-NOTFORMERGE-ec-lenovo-h8-wlan-trackpoint-touchpad-bl.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-add-acpi-c3-cpu-c4-state-for-gm45-thinpads.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-Revert-hybrid-driver.patch
+/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-romstage-stop-using-udelay_io.c-in-romstage-for-T400.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list
index 30301d5..bdbe9fd 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_4mb/reused.list
@@ -1,6 +1,7 @@
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-NOTFORMERGE-ec-lenovo-h8-wlan-trackpoint-touchpad-bl.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-add-acpi-c3-cpu-c4-state-for-gm45-thinpads.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-Revert-hybrid-driver.patch
+/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-romstage-stop-using-udelay_io.c-in-romstage-for-T400.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
 /resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-romstage-stop-using-udelay_io.c-in-romstage-for-T400.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-romstage-stop-using-udelay_io.c-in-romstage-for-T400.patch
new file mode 100644
index 0000000..260a608
--- /dev/null
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0001-romstage-stop-using-udelay_io.c-in-romstage-for-T400.patch
@@ -0,0 +1,24 @@
+From 9ec59c228ddd2fc222d8b763dc2dee483fe000ab Mon Sep 17 00:00:00 2001
+From: persmule <[email protected]>
+Date: Sun, 21 Aug 2016 16:53:48 +0800
+Subject: [PATCH] romstage: stop using udelay_io.c in romstage for T400s.
+
+---
+ src/drivers/pc80/pc/Makefile.inc | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/drivers/pc80/pc/Makefile.inc b/src/drivers/pc80/pc/Makefile.inc
+index 8c348e3..550ca12 100644
+--- a/src/drivers/pc80/pc/Makefile.inc
++++ b/src/drivers/pc80/pc/Makefile.inc
+@@ -4,7 +4,6 @@ ramstage-y += isa-dma.c
+ ramstage-y += i8254.c
+ ramstage-y += i8259.c
+ ramstage-$(CONFIG_UDELAY_IO) += udelay_io.c
+-romstage-$(CONFIG_UDELAY_IO) += udelay_io.c
+ ramstage-y += keyboard.c
+ ramstage-$(CONFIG_SPKMODEM) += spkmodem.c
+ romstage-$(CONFIG_SPKMODEM) += spkmodem.c
+-- 
+2.8.1
+
-- 
2.8.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to