James has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39074 )
Change subject: sb/intel/{bd82x6x,ibexpeak}: hide MEI if ME inoperable
......................................................................
sb/intel/{bd82x6x,ibexpeak}: hide MEI if ME inoperable
If the Management Engine is in an inoperable mode, e.g. if me_cleaner is
used, hide the Management Engine Interface device so the OS doesn't try
to access it.
Enable the MEI in device trees of Ibex Peak, Cougar Point and Panther
Point boards where they have been disabled.
Change-Id: Ie4a35bf5fc196e0a02b7591cdb8633d38f0c7f3e
Signed-off-by: James Ye <jye836(a)gmail.com>
---
M src/mainboard/lenovo/s230u/devicetree.cb
M src/mainboard/lenovo/t410/devicetree.cb
M src/mainboard/lenovo/t420/devicetree.cb
M src/mainboard/lenovo/t420s/devicetree.cb
M src/mainboard/lenovo/t430s/devicetree.cb
M src/mainboard/lenovo/x131e/devicetree.cb
M src/mainboard/lenovo/x220/devicetree.cb
M src/mainboard/packardbell/ms2290/devicetree.cb
M src/southbridge/intel/bd82x6x/me.c
M src/southbridge/intel/bd82x6x/me_8.x.c
M src/southbridge/intel/ibexpeak/me.c
11 files changed, 18 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/39074/1
diff --git a/src/mainboard/lenovo/s230u/devicetree.cb b/src/mainboard/lenovo/s230u/devicetree.cb
index b03e2f9..3c0d278 100644
--- a/src/mainboard/lenovo/s230u/devicetree.cb
+++ b/src/mainboard/lenovo/s230u/devicetree.cb
@@ -54,7 +54,7 @@
register "spi_lvscc" = "0x2005"
device pci 14.0 on end # USB 3.0 Controller
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R
device pci 16.3 off end # Management Engine KT
diff --git a/src/mainboard/lenovo/t410/devicetree.cb b/src/mainboard/lenovo/t410/devicetree.cb
index 808e057..fb2876f 100644
--- a/src/mainboard/lenovo/t410/devicetree.cb
+++ b/src/mainboard/lenovo/t410/devicetree.cb
@@ -74,7 +74,9 @@
register "pcie_hotplug_map" = "{ 0, 0, 0, 1, 0, 0, 0, 0 }"
- device pci 16.0 off end # MEI
+ device pci 16.0 on # MEI
+ subsystemid 0x17aa 0x215f
+ end
device pci 16.2 on # IDE/SATA
subsystemid 0x17aa 0x2161
end
diff --git a/src/mainboard/lenovo/t420/devicetree.cb b/src/mainboard/lenovo/t420/devicetree.cb
index 53bd16f..222825b 100644
--- a/src/mainboard/lenovo/t420/devicetree.cb
+++ b/src/mainboard/lenovo/t420/devicetree.cb
@@ -72,7 +72,7 @@
register "spi_uvscc" = "0x2005"
register "spi_lvscc" = "0x2005"
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R
device pci 16.3 off end # Management Engine KT
diff --git a/src/mainboard/lenovo/t420s/devicetree.cb b/src/mainboard/lenovo/t420s/devicetree.cb
index c91b04e..314ca43 100644
--- a/src/mainboard/lenovo/t420s/devicetree.cb
+++ b/src/mainboard/lenovo/t420s/devicetree.cb
@@ -72,7 +72,7 @@
register "spi_uvscc" = "0x2005"
register "spi_lvscc" = "0x2005"
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R
device pci 16.3 off end # Management Engine KT
diff --git a/src/mainboard/lenovo/t430s/devicetree.cb b/src/mainboard/lenovo/t430s/devicetree.cb
index ee612cd..7483c46 100644
--- a/src/mainboard/lenovo/t430s/devicetree.cb
+++ b/src/mainboard/lenovo/t430s/devicetree.cb
@@ -75,7 +75,7 @@
register "spi_lvscc" = "0x2005"
device pci 14.0 on end # USB 3.0 Controller
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R
device pci 16.3 off end # Management Engine KT
diff --git a/src/mainboard/lenovo/x131e/devicetree.cb b/src/mainboard/lenovo/x131e/devicetree.cb
index 2d15d87..510fa9e 100644
--- a/src/mainboard/lenovo/x131e/devicetree.cb
+++ b/src/mainboard/lenovo/x131e/devicetree.cb
@@ -71,7 +71,7 @@
register "spi_lvscc" = "0x2005"
device pci 14.0 on end # USB 3.0 Controller
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R
device pci 16.3 off end # Management Engine KT
diff --git a/src/mainboard/lenovo/x220/devicetree.cb b/src/mainboard/lenovo/x220/devicetree.cb
index 5ae1427..7e9d9bb 100644
--- a/src/mainboard/lenovo/x220/devicetree.cb
+++ b/src/mainboard/lenovo/x220/devicetree.cb
@@ -71,7 +71,7 @@
register "spi_uvscc" = "0x2005"
register "spi_lvscc" = "0x2005"
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on end # Management Engine Interface 1
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R
device pci 16.3 off end # Management Engine KT
diff --git a/src/mainboard/packardbell/ms2290/devicetree.cb b/src/mainboard/packardbell/ms2290/devicetree.cb
index bf1c171..97674d8 100644
--- a/src/mainboard/packardbell/ms2290/devicetree.cb
+++ b/src/mainboard/packardbell/ms2290/devicetree.cb
@@ -66,7 +66,9 @@
register "alt_gp_smi_en" = "0x0000"
register "gen1_dec" = "0x040069"
- device pci 16.0 off end # Management Engine Interface 1
+ device pci 16.0 on # Management Engine Interface 1
+ subsystemid 0x1025 0x0379
+ end
device pci 16.1 off end # Management Engine Interface 2
device pci 16.2 off end # Management Engine IDE-R, only management boot
device pci 16.3 off end # Management Engine KT
diff --git a/src/southbridge/intel/bd82x6x/me.c b/src/southbridge/intel/bd82x6x/me.c
index 15f99cd..280dcb0 100644
--- a/src/southbridge/intel/bd82x6x/me.c
+++ b/src/southbridge/intel/bd82x6x/me.c
@@ -692,6 +692,8 @@
switch (path) {
case ME_S3WAKE_BIOS_PATH:
+ case ME_ERROR_BIOS_PATH:
+ case ME_DISABLE_BIOS_PATH:
intel_me_hide(dev);
break;
@@ -717,9 +719,7 @@
*/
break;
- case ME_ERROR_BIOS_PATH:
case ME_RECOVERY_BIOS_PATH:
- case ME_DISABLE_BIOS_PATH:
case ME_FIRMWARE_UPDATE_BIOS_PATH:
break;
}
diff --git a/src/southbridge/intel/bd82x6x/me_8.x.c b/src/southbridge/intel/bd82x6x/me_8.x.c
index f13ced9..88558e3 100644
--- a/src/southbridge/intel/bd82x6x/me_8.x.c
+++ b/src/southbridge/intel/bd82x6x/me_8.x.c
@@ -681,6 +681,8 @@
switch (path) {
case ME_S3WAKE_BIOS_PATH:
+ case ME_ERROR_BIOS_PATH:
+ case ME_DISABLE_BIOS_PATH:
intel_me_hide(dev);
break;
@@ -721,9 +723,7 @@
*/
break;
- case ME_ERROR_BIOS_PATH:
case ME_RECOVERY_BIOS_PATH:
- case ME_DISABLE_BIOS_PATH:
case ME_FIRMWARE_UPDATE_BIOS_PATH:
break;
}
diff --git a/src/southbridge/intel/ibexpeak/me.c b/src/southbridge/intel/ibexpeak/me.c
index 63dff6a..aa1c002 100644
--- a/src/southbridge/intel/ibexpeak/me.c
+++ b/src/southbridge/intel/ibexpeak/me.c
@@ -577,6 +577,8 @@
switch (path) {
case ME_S3WAKE_BIOS_PATH:
+ case ME_ERROR_BIOS_PATH:
+ case ME_DISABLE_BIOS_PATH:
intel_me_hide(dev);
break;
@@ -595,9 +597,7 @@
*/
break;
- case ME_ERROR_BIOS_PATH:
case ME_RECOVERY_BIOS_PATH:
- case ME_DISABLE_BIOS_PATH:
case ME_FIRMWARE_UPDATE_BIOS_PATH:
break;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/39074
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie4a35bf5fc196e0a02b7591cdb8633d38f0c7f3e
Gerrit-Change-Number: 39074
Gerrit-PatchSet: 1
Gerrit-Owner: James <jye836(a)gmail.com>
Gerrit-MessageType: newchange
Evgeny Zinoviev has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33103
Change subject: mb/apple/macbookair4_2: ACPI support for EC
......................................................................
mb/apple/macbookair4_2: ACPI support for EC
Added ACPI support for battery, AC and LID.
I don't have MacBook Air 4,2 to test, but:
- I tested it on 5,2;
- I found decompiled DSDT for 4,2 and compared registers and bits,
they are the same as on 5,2.
So it should work.
Change-Id: I592cb4501c878fe46684a524e729d32fb1d7920c
Signed-off-by: Evgeny Zinoviev <me(a)ch1p.io>
---
M src/mainboard/apple/macbookair4_2/acpi/ec.asl
1 file changed, 5 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/33103/1
diff --git a/src/mainboard/apple/macbookair4_2/acpi/ec.asl b/src/mainboard/apple/macbookair4_2/acpi/ec.asl
index f70cb3d..cd74865 100644
--- a/src/mainboard/apple/macbookair4_2/acpi/ec.asl
+++ b/src/mainboard/apple/macbookair4_2/acpi/ec.asl
@@ -1,6 +1,8 @@
/*
* This file is part of the coreboot project.
*
+ * Copyright (c) 2019 Evgeny Zinoviev <me(a)ch1p.io>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
@@ -11,10 +13,6 @@
* GNU General Public License for more details.
*/
-Device(EC)
-{
- Name (_HID, EISAID("PNP0C09"))
- Name (_UID, 0)
- Name (_GPE, 23)
-/* FIXME: EC support */
-}
+#include <ec/apple/acpi/ec.asl>
+#include <ec/apple/acpi/ac_60.asl>
+#include <ec/apple/acpi/lid_60.asl>
--
To view, visit https://review.coreboot.org/c/coreboot/+/33103
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I592cb4501c878fe46684a524e729d32fb1d7920c
Gerrit-Change-Number: 33103
Gerrit-PatchSet: 1
Gerrit-Owner: Evgeny Zinoviev <me(a)ch1p.com>
Gerrit-MessageType: newchange
Evgeny Zinoviev has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33102
Change subject: ec/apple: ACPI code for Apple MacBooks
......................................................................
ec/apple: ACPI code for Apple MacBooks
Move ACPI code for Apple MacBooks to a separate directory to avoid it's
duplication in mainboards.
AC and LID implementation files are named by EC register that's used
in them. Older generations (macbook2,1) use 0x01 while newer
generations like 2011-2012 Airs use 0x60. Battery registers seem to be
the same.
Tested on MacBook Air 5,2.
Change-Id: I3d4585aac8e3ebbfed6ce4d4e39fbc33ac983069
Signed-off-by: Evgeny Zinoviev <me(a)ch1p.io>
---
A src/ec/apple/acpi/ac_01.asl
A src/ec/apple/acpi/ac_60.asl
A src/ec/apple/acpi/battery.asl
A src/ec/apple/acpi/ec.asl
A src/ec/apple/acpi/lid_01.asl
A src/ec/apple/acpi/lid_60.asl
6 files changed, 405 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/33102/1
diff --git a/src/ec/apple/acpi/ac_01.asl b/src/ec/apple/acpi/ac_01.asl
new file mode 100644
index 0000000..86966ae8
--- /dev/null
+++ b/src/ec/apple/acpi/ac_01.asl
@@ -0,0 +1,42 @@
+
+ * This file is part of the coreboot project.
+ *
+ * Copyright (c) 2019 Evgeny Zinoviev <me(a)ch1p.io>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Scope(\_SB.PCI0.LPCB.EC)
+{
+ Field(ERAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset(0x01),
+ 1,
+ HPAC, 1, /* AC status */
+ }
+
+ Device(AC)
+ {
+ Name(_HID, "ACPI0003")
+ Name(_UID, 0x00)
+ Name(_PCL, Package() { \_SB } )
+
+ Method(_PSR, 0, NotSerialized)
+ {
+ return(HPAC)
+ }
+
+ Method(_STA, 0, NotSerialized)
+ {
+ Return(0x0f)
+ }
+ }
+}
diff --git a/src/ec/apple/acpi/ac_60.asl b/src/ec/apple/acpi/ac_60.asl
new file mode 100644
index 0000000..76adea1
--- /dev/null
+++ b/src/ec/apple/acpi/ac_60.asl
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (c) 2019 Evgeny Zinoviev <me(a)ch1p.io>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Scope(\_SB.PCI0.LPCB.EC)
+{
+ Field(ERAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset(0x60),
+ , 1,
+ HPAC, 1, /* AC status */
+ }
+
+ Device(AC)
+ {
+ Name(_HID, "ACPI0003")
+ Name(_UID, 0x00)
+ Name(_PCL, Package() { \_SB } )
+
+ Method(_PSR, 0, NotSerialized)
+ {
+ return(HPAC)
+ }
+
+ Method(_STA, 0, NotSerialized)
+ {
+ Return(0x0f)
+ }
+ }
+}
diff --git a/src/ec/apple/acpi/battery.asl b/src/ec/apple/acpi/battery.asl
new file mode 100644
index 0000000..f1706be
--- /dev/null
+++ b/src/ec/apple/acpi/battery.asl
@@ -0,0 +1,163 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Field(ERAM, ByteAcc, NoLock, Preserve)
+{
+ Offset(0x20),
+ SPTR, 8,
+ SSTS, 8,
+ SADR, 8,
+ SCMD, 8,
+ SBFR, 256,
+}
+
+Field(ERAM, ByteAcc, Lock, Preserve)
+{
+ Offset(0x24),
+ SBDW, 16,
+}
+
+Method(SBPC, 0, NotSerialized)
+{
+ Store(1000, Local0)
+ While(Local0)
+ {
+ If(LEqual(SPTR, 0x00))
+ {
+ Return()
+ }
+
+ Sleep(1)
+ Decrement(Local0)
+ }
+}
+
+Method(SBRW, 2, NotSerialized)
+{
+ Acquire(ECLK, 0xFFFF)
+ Store(ShiftLeft(Arg0, 0x01), SADR)
+ Store(Arg1, SCMD)
+ Store(0x09, SPTR)
+ SBPC()
+ Store(SBDW, Local0)
+ Release(ECLK)
+ Return(Local0)
+}
+
+Method(SBRB, 2, NotSerialized)
+{
+ Acquire(ECLK, 0xFFFF)
+ Store(ShiftLeft(Arg0, 0x01), SADR)
+ Store(Arg1, SCMD)
+ Store(0x0B, SPTR)
+ SBPC()
+ Store(SBFR, Local0)
+ Release(ECLK)
+ Return(Local0)
+}
+
+Device(BAT0)
+{
+ Name(_HID, EisaId("PNP0C0A"))
+ Name(_UID, 0x00)
+ Name(_PCL, Package() { \_SB })
+
+ Name(BATS, Package()
+ {
+ 0x00, // 0: PowerUnit: Report in mWh
+ 0xFFFFFFFF, // 1: Design cap
+ 0xFFFFFFFF, // 2: Last full charge cap
+ 0x01, // 3: Battery Technology
+ 10800, // 4: Design Voltage(mV)
+ 0x00, // 5: Warning design capacity
+ 200, // 6: Low design capacity
+ 10, // 7: granularity1
+ 10, // 8: granularity2
+ "", // 9: Model number
+ "", // A: Serial number
+ "", // B: Battery Type
+ "" // C: OEM information
+ })
+
+ Name(BATI, Package()
+ {
+ 0, // Battery State
+ // Bit 0 - discharge
+ // Bit 1 - charge
+ // Bit 2 - critical state
+ 0, // Battery present Rate
+ 0, // Battery remaining capacity
+ 0 // Battery present voltage
+ })
+
+ Method(_BIF, 0, NotSerialized)
+ {
+ Multiply(^^SBRW(0x0B, 0x18), 10, Index(BATS, 0x01))
+ Multiply(^^SBRW(0x0B, 0x10), 10, Index(BATS, 0x02))
+ Store(^^SBRW(0x0B, 0x19), Index(BATS, 0x04))
+ Store(^^SBRB(0x0B, 0x21), Index(BATS, 0x09))
+ Store(^^SBRB(0x0B, 0x22), Index(BATS, 0x0B))
+ Store(^^SBRB(0x0B, 0x20), Index(BATS, 0x0C))
+
+ Return(BATS)
+ }
+
+ Method(_STA, 0, NotSerialized)
+ {
+ If(And(^^SBRW(0x0A, 0x01), 0x01)) {
+ Return(0x1f)
+ } else {
+ Return(0x0f)
+ }
+ }
+
+ Method(_BST, 0, NotSerialized)
+ {
+ /* Check for battery presence. */
+ If(LNot(And(^^SBRW(0x0A, 0x01), 0x01))) {
+ Return(Package(4) {
+ 0,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF,
+ 0xFFFFFFFF
+ })
+ }
+ Store(^^SBRW(0x0B, 0x09), Local1)
+ Store(Local1, Index(BATI, 0x03))
+ Store(^^SBRW(0x0B, 0x0A), Local0)
+ /* Sign-extend Local0. */
+ If(And(Local0, 0x8000))
+ {
+ Not(Local0, Local0)
+ And(Increment(Local0), 0xFFFF, Local0)
+ }
+
+ Multiply(Local0, Local1, Local0)
+ Divide(Local0, 1000, , Index(BATI, 1))
+ Multiply(^^SBRW(0x0B, 0x0F), 10, Index(BATI, 2))
+ If(HPAC)
+ {
+ If(LNot(And(^^SBRW(0x0B, 0x16), 0x40))) {
+ Store(2, Index(BATI, 0))
+ } Else {
+ Store(0, Index(BATI, 0))
+ }
+ }
+ Else
+ {
+ Store(0x01, Index(BATI, 0))
+ }
+
+ Return(BATI)
+ }
+}
diff --git a/src/ec/apple/acpi/ec.asl b/src/ec/apple/acpi/ec.asl
new file mode 100644
index 0000000..982011c
--- /dev/null
+++ b/src/ec/apple/acpi/ec.asl
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Device(EC)
+{
+ Name(_HID, EISAID("PNP0C09"))
+ Name(_UID, 0)
+
+ Name(_GPE, 0x17)
+ Mutex(ECLK, 0)
+
+ OperationRegion(ERAM, EmbeddedControl, 0x00, 0x100)
+
+ /* LID status change. */
+ Method(_Q20, 0, NotSerialized)
+ {
+ Notify(LID, 0x80)
+ }
+
+ /* AC status change. */
+ Method(_Q21, 0, NotSerialized)
+ {
+ Notify(AC, 0x80)
+ }
+
+ Method(_CRS, 0)
+ {
+ Name(ECMD, ResourceTemplate()
+ {
+ IO(Decode16, 0x62, 0x62, 1, 1)
+ IO(Decode16, 0x66, 0x66, 1, 1)
+ })
+ Return(ECMD)
+ }
+
+ Method(_PRW, 0, NotSerialized)
+ {
+ return (Package () { 0x23, 0x04 })
+ }
+
+ Method(_INI, 0, NotSerialized)
+ {
+ }
+
+#include "battery.asl"
+}
diff --git a/src/ec/apple/acpi/lid_01.asl b/src/ec/apple/acpi/lid_01.asl
new file mode 100644
index 0000000..88ad045
--- /dev/null
+++ b/src/ec/apple/acpi/lid_01.asl
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (c) 2019 Evgeny Zinoviev <me(a)ch1p.io>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Scope(\_SB.PCI0.LPCB.EC)
+{
+ Field(ERAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset(0x01),
+ LIDS, 1, /* Lid status */
+
+ Offset(0x02),
+ WKLD, 1, /* Lid wake */
+ }
+
+ Device(LID)
+ {
+ Name(_HID, "PNP0C0D")
+
+ Method(_LID, 0, NotSerialized)
+ {
+ return(LIDS)
+ }
+
+ Method(_PRW, 0, NotSerialized)
+ {
+ Return (Package() { 0x1d, 0x03 })
+ }
+
+ Method(_PSW, 1, NotSerialized)
+ {
+ if (Arg0) {
+ Store(1, WKLD)
+ } else {
+ Store(0, WKLD)
+ }
+ }
+ }
+}
diff --git a/src/ec/apple/acpi/lid_60.asl b/src/ec/apple/acpi/lid_60.asl
new file mode 100644
index 0000000..e0836b6
--- /dev/null
+++ b/src/ec/apple/acpi/lid_60.asl
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (c) 2019 Evgeny Zinoviev <me(a)ch1p.io>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+Scope(\_SB.PCI0.LPCB.EC)
+{
+ Field(ERAM, ByteAcc, NoLock, Preserve)
+ {
+ Offset(0x60),
+ LIDS, 1, /* Lid status */
+
+ Offset(0x68),
+ WKLD, 1, /* Lid wake */
+ }
+
+ Device(LID)
+ {
+ Name(_HID, "PNP0C0D")
+
+ Method(_LID, 0, NotSerialized)
+ {
+ return(LIDS)
+ }
+
+ Method(_PRW, 0, NotSerialized)
+ {
+ Return (Package() { 0x23, 0x04 })
+ }
+
+ Method(_PSW, 1, NotSerialized)
+ {
+ if (Arg0) {
+ Store(1, WKLD)
+ } else {
+ Store(0, WKLD)
+ }
+ }
+ }
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/33102
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3d4585aac8e3ebbfed6ce4d4e39fbc33ac983069
Gerrit-Change-Number: 33102
Gerrit-PatchSet: 1
Gerrit-Owner: Evgeny Zinoviev <me(a)ch1p.com>
Gerrit-MessageType: newchange
Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40808 )
Change subject: soc/amd/picasso/Makefile: Verify bootblock size is power of two
......................................................................
soc/amd/picasso/Makefile: Verify bootblock size is power of two
Enabling caching for bootblock requires its size to be a power of two.
This is because MTRRs have this requirement.
BUG=b:153675909
TEST=Changed bootblock size and saw a build error
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: Idede916cbc75bb0fecd729219b92dc9046c23d78
---
M src/soc/amd/picasso/Makefile.inc
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/40808/1
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index b04e1e9..d137aba 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -189,6 +189,12 @@
# This address must match the BOOTBLOCK logic in arch/x86/memlayout.ld.
PSP_BIOSBIN_DEST=$(shell printf "%x" $(call int-subtract, $(call int-add, $(CONFIG_X86_RESET_VECTOR) 0x10) $(PSP_BIOSBIN_SIZE)))
+# MTRRs sizes must be a power of two. Ensure the bootblock has a compatible size
+# so we can enable caching.
+ifneq ($(call is-power-of-two,$(PSP_BIOSBIN_SIZE)),1)
+$(error Bootblock size $(PSP_BIOSBIN_SIZE) is not a power of two.)
+endif
+
# type = 0x63
ifeq ($(CONFIG_HAVE_ACPI_RESUME),y)
PSP_APOBNV_BASE=$(CONFIG_PSP_APOB_NV_ADDRESS)
--
To view, visit https://review.coreboot.org/c/coreboot/+/40808
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idede916cbc75bb0fecd729219b92dc9046c23d78
Gerrit-Change-Number: 40808
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40765 )
Change subject: Makefile: Add is-power-of-two
......................................................................
Makefile: Add is-power-of-two
It is sometimes necessary to verify if a CONFIG_ option is a power of
two at build time. This adds a `make` function `is-power-of-two`.
I chose to define all the values because it's the most straightforward
way to do this with `make`.
BUG=b:147042464
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: I189a4c722996279e2d8940c566cb362f53ef92d8
---
M Makefile.inc
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/40765/1
diff --git a/Makefile.inc b/Makefile.inc
index e315732..cbec2dd 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -133,6 +133,7 @@
# int-gt: 1 if the first values is greater than the second. 0 otherwise
# int-eq: 1 if the two values are equal. 0 otherwise
# int-align: align $1 to $2 units
+# is-power-of-two:1 if value is a power of two
# file-size: returns the filesize of the given file
# tolower: returns the value in all lowercase
# toupper: returns the value in all uppercase
@@ -151,6 +152,15 @@
int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))
int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) )
int-align-down=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A - \( $$A % $$B \) )
+power-of-twos := 0x00000001 0x00000002 0x00000004 0x00000008 \
+0x00000010 0x00000020 0x00000040 0x00000080 \
+0x00000100 0x00000200 0x00000400 0x00000800 \
+0x00001000 0x00002000 0x00004000 0x00008000 \
+0x00010000 0x00020000 0x00040000 0x00080000 \
+0x00100000 0x00200000 0x00400000 0x00800000 \
+0x01000000 0x02000000 0x04000000 0x08000000 \
+0x10000000 0x20000000 0x40000000 0x80000000
+is-power-of-two=$(if $(filter $(power-of-twos), $(shell printf "0x%08x" $1)),1)
file-size=$(strip $(shell cat $1 | wc -c))
tolower=$(shell echo '$1' | tr '[:upper:]' '[:lower:]')
toupper=$(shell echo '$1' | tr '[:lower:]' '[:upper:]')
@@ -575,6 +585,8 @@
@printf " HOSTCC $(subst $(obj)/,,$(@))\n"
$(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
+APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
+
CBOOTIMAGE:=$(objutil)/cbootimage/cbootimage
FUTILITY?=$(objutil)/futility/futility
--
To view, visit https://review.coreboot.org/c/coreboot/+/40765
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I189a4c722996279e2d8940c566cb362f53ef92d8
Gerrit-Change-Number: 40765
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange