Sean Rhodes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59388 )
Change subject: ec/starlabs: Add USB Type-C Mailbox interface ......................................................................
ec/starlabs: Add USB Type-C Mailbox interface
Signed-off-by: Sean Rhodes sean@starlabs.systems Change-Id: I77c9a0afec4ad3ad54a0a67d7ab68b7cabca2db6 --- M src/ec/starlabs/merlin/acpi/ec.asl A src/ec/starlabs/merlin/acpi/typec.asl A src/ec/starlabs/merlin/acpi/ubtc.asl 3 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/59388/1
diff --git a/src/ec/starlabs/merlin/acpi/ec.asl b/src/ec/starlabs/merlin/acpi/ec.asl index 8458818..93b3470 100644 --- a/src/ec/starlabs/merlin/acpi/ec.asl +++ b/src/ec/starlabs/merlin/acpi/ec.asl @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include "ubtc.asl" + Scope (_SB.PCI0.LPCB) { #include "cmos.asl" @@ -169,6 +171,7 @@ #include "battery.asl" #include "events.asl" #include "lid.asl" + #include "typec.asl"
Method (_REG, 2, NotSerialized) { diff --git a/src/ec/starlabs/merlin/acpi/typec.asl b/src/ec/starlabs/merlin/acpi/typec.asl new file mode 100644 index 0000000..1acc8a4 --- /dev/null +++ b/src/ec/starlabs/merlin/acpi/typec.asl @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Method (UCSW, 0, Serialized) +{ + Sleep (50) + MGO0 = ^^^^UBTC.MGO0 + MGO1 = ^^^^UBTC.MGO1 + MGO2 = ^^^^UBTC.MGO2 + MGO3 = ^^^^UBTC.MGO3 + MGO4 = ^^^^UBTC.MGO4 + MGO5 = ^^^^UBTC.MGO5 + MGO6 = ^^^^UBTC.MGO6 + MGO7 = ^^^^UBTC.MGO7 + MGO8 = ^^^^UBTC.MGO7 + MGO9 = ^^^^UBTC.MGO9 + MGOA = ^^^^UBTC.MGOA + MGOB = ^^^^UBTC.MGOB + MGOC = ^^^^UBTC.MGOC + MGOD = ^^^^UBTC.MGOD + MGOE = ^^^^UBTC.MGOE + MGOF = ^^^^UBTC.MGOF + CTL0 = ^^^^UBTC.CTL0 + CTL1 = ^^^^UBTC.CTL1 + CTL2 = ^^^^UBTC.CTL2 + CTL3 = ^^^^UBTC.CTL3 + CTL4 = ^^^^UBTC.CTL4 + CTL5 = ^^^^UBTC.CTL5 + CTL6 = ^^^^UBTC.CTL6 + CTL7 = ^^^^UBTC.CTL7 + OPWE = 0xE0 +} + +Method (UCSR, 0, Serialized) +{ + Sleep (50) + ^^^^UBTC.MGI0 = MGI0 + ^^^^UBTC.MGI1 = MGI1 + ^^^^UBTC.MGI2 = MGI2 + ^^^^UBTC.MGI3 = MGI3 + ^^^^UBTC.MGI4 = MGI4 + ^^^^UBTC.MGI5 = MGI5 + ^^^^UBTC.MGI6 = MGI6 + ^^^^UBTC.MGI7 = MGI7 + ^^^^UBTC.MGI8 = MGI8 + ^^^^UBTC.MGI9 = MGI9 + ^^^^UBTC.MGIA = MGIA + ^^^^UBTC.MGIB = MGIB + ^^^^UBTC.MGIC = MGIC + ^^^^UBTC.MGID = MGID + ^^^^UBTC.MGIE = MGIE + ^^^^UBTC.MGIF = MGIF + ^^^^UBTC.CCI0 = CCI0 + ^^^^UBTC.CCI1 = CCI1 + ^^^^UBTC.CCI2 = CCI2 + ^^^^UBTC.CCI3 = CCI3 +} + +Method (UCEV, 0, Serialized) +{ + Sleep (50) + ^^^^UBTC.MGI0 = MGI0 + ^^^^UBTC.MGI1 = MGI1 + ^^^^UBTC.MGI2 = MGI2 + ^^^^UBTC.MGI3 = MGI3 + ^^^^UBTC.MGI4 = MGI4 + ^^^^UBTC.MGI5 = MGI5 + ^^^^UBTC.MGI6 = MGI6 + ^^^^UBTC.MGI7 = MGI7 + ^^^^UBTC.MGI8 = MGI8 + ^^^^UBTC.MGI9 = MGI9 + ^^^^UBTC.MGIA = MGIA + ^^^^UBTC.MGIB = MGIB + ^^^^UBTC.MGIC = MGIC + ^^^^UBTC.MGID = MGID + ^^^^UBTC.MGIE = MGIE + ^^^^UBTC.MGIF = MGIF + ^^^^UBTC.CCI0 = CCI0 + ^^^^UBTC.CCI1 = CCI1 + ^^^^UBTC.CCI2 = CCI2 + ^^^^UBTC.CCI3 = CCI3 + Notify (^^^^UBTC, 0x80) +} diff --git a/src/ec/starlabs/merlin/acpi/ubtc.asl b/src/ec/starlabs/merlin/acpi/ubtc.asl new file mode 100644 index 0000000..f29fb9d --- /dev/null +++ b/src/ec/starlabs/merlin/acpi/ubtc.asl @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +External(_SB.UBTC, DeviceObj) +External(_SB.UBTC.MGI0, IntObj) +External(_SB.UBTC.MGI1, IntObj) +External(_SB.UBTC.MGI2, IntObj) +External(_SB.UBTC.MGI3, IntObj) +External(_SB.UBTC.MGI4, IntObj) +External(_SB.UBTC.MGI5, IntObj) +External(_SB.UBTC.MGI6, IntObj) +External(_SB.UBTC.MGI7, IntObj) +External(_SB.UBTC.MGI8, IntObj) +External(_SB.UBTC.MGI9, IntObj) +External(_SB.UBTC.MGIA, IntObj) +External(_SB.UBTC.MGIB, IntObj) +External(_SB.UBTC.MGIC, IntObj) +External(_SB.UBTC.MGID, IntObj) +External(_SB.UBTC.MGIE, IntObj) +External(_SB.UBTC.MGIF, IntObj) + +External(_SB.UBTC.CTL0, IntObj) +External(_SB.UBTC.CTL1, IntObj) +External(_SB.UBTC.CTL2, IntObj) +External(_SB.UBTC.CTL3, IntObj) +External(_SB.UBTC.CTL4, IntObj) +External(_SB.UBTC.CTL5, IntObj) +External(_SB.UBTC.CTL6, IntObj) +External(_SB.UBTC.CTL7, IntObj) + +External(_SB.UBTC.MGO0, IntObj) +External(_SB.UBTC.MGO1, IntObj) +External(_SB.UBTC.MGO2, IntObj) +External(_SB.UBTC.MGO3, IntObj) +External(_SB.UBTC.MGO4, IntObj) +External(_SB.UBTC.MGO5, IntObj) +External(_SB.UBTC.MGO6, IntObj) +External(_SB.UBTC.MGO7, IntObj) +External(_SB.UBTC.MGO8, IntObj) +External(_SB.UBTC.MGO9, IntObj) +External(_SB.UBTC.MGOA, IntObj) +External(_SB.UBTC.MGOB, IntObj) +External(_SB.UBTC.MGOC, IntObj) +External(_SB.UBTC.MGOD, IntObj) +External(_SB.UBTC.MGOE, IntObj) +External(_SB.UBTC.MGOF, IntObj) + +External(_SB.UBTC.CCI0, IntObj) +External(_SB.UBTC.CCI1, IntObj) +External(_SB.UBTC.CCI2, IntObj) +External(_SB.UBTC.CCI3, IntObj)