Sean Rhodes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58542 )
Change subject: ec/starlabs: Add ITE EC support for StarLite ......................................................................
ec/starlabs: Add ITE EC support for StarLite
Add EC definitions, Q Events and EC Space for: * StarLite Mk II (APL) * StarLite Mk III (GLK) * StarLite Mk IV (GLK-R)
Signed-off-by: Sean Rhodes sean@starlabs.systems Change-Id: Ie3f7cb9cf43ea0cd242ebd4a776bc5154a0518b2 --- A src/ec/starlabs/merlin/variants/apl/ecdefs.h A src/ec/starlabs/merlin/variants/apl/emem.asl A src/ec/starlabs/merlin/variants/apl/events.asl A src/ec/starlabs/merlin/variants/glk/ecdefs.h A src/ec/starlabs/merlin/variants/glk/emem.asl A src/ec/starlabs/merlin/variants/glk/events.asl 6 files changed, 594 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/58542/1
diff --git a/src/ec/starlabs/merlin/variants/apl/ecdefs.h b/src/ec/starlabs/merlin/variants/apl/ecdefs.h new file mode 100644 index 0000000..1e2c610 --- /dev/null +++ b/src/ec/starlabs/merlin/variants/apl/ecdefs.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* + * EC communication interface for ITE ITE Embedded Controller. + */ + +#ifndef _EC_STARLABS_ITE_CFG_H +#define _EC_STARLABS_ITE_CFG_H + +/* IT5570 chip ID byte values. */ +#define ITE_CHIPID1_VAL 0x89 +#define ITE_CHIPID2_VAL 0x87 + +/* EC RAM offsets. */ +#define ECRAM_TRACKPAD_STATE 0x14 +#define ECRAM_KBL_STATE 0x18 +#define ECRAM_KBL_BRIGHTNESS 0x19 +#define ECRAM_KBL_TIMEOUT 0x1a +#define ECRAM_FN_LOCK_STATE 0x2c +#define ECRAM_FN_CTRL_REVERSE 0x2d +#define ECRAM_MAX_CHARGE 0x46 + +#endif diff --git a/src/ec/starlabs/merlin/variants/apl/emem.asl b/src/ec/starlabs/merlin/variants/apl/emem.asl new file mode 100644 index 0000000..4ca879f --- /dev/null +++ b/src/ec/starlabs/merlin/variants/apl/emem.asl @@ -0,0 +1,175 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +OperationRegion (ECF2, EmbeddedControl, 0x00, 0xFF) +Field (ECF2, ByteAcc, Lock, Preserve) +{ + Offset(0x00), + ECMV, 8, // Major Version Number + ECSV, 8, // Minor Version Number + KBVS, 8, // Keyboard Controller Version + ECTV, 8, // Test Version Number + FRMF, 8, // Froce Mirror Flag + TXEL, 8, // TXE Lock + + Offset(0x10), + CPWR, 8, // Control Power + CDEV, 8, // Control Device + OSFG, 8, // OS Flag + CWFU, 8, // CW2015 Full + TPLA, 8, // Trackpad State + AFG3, 8, // After G3 + CLTP, 8, // Close Trackpad + WKOL, 8, // Wake on Lid + KLSE, 8, // Keyboard Backlight State + KLBE, 8, // Keyboard Backlight Brightness + + Offset(0x1a), + KLTE, 8, // Keyboard Backlight Timeout + + Offset(0x22), + ECT0, 8, // EC Build Time 0 + ECT1, 8, // EC Build Time 1 + ECT2, 8, // EC Build Time 2 + ECT3, 8, // EC Build Time 3 + ECT4, 8, // EC Build Time 4 + ECT5, 8, // EC Build Time 5 + ECT6, 8, // EC Build Time 6 + ECT7, 8, // EC Build Time 7 + ECT8, 8, // EC Build Time 8 + ECT9, 8, // EC Build Time 9 + + Offset(0x2c), + FLKA, 8, // Function Lock State + + Offset(0x30), + STEF, 8, // Sensor T Error F + ECD0, 8, // EC Build Date 0 + ECD1, 8, // EC Build Date 1 + ECD2, 8, // EC Build Date 2 + ECD3, 8, // EC Build Date 3 + ECD4, 8, // EC Build Date 4 + ECD5, 8, // EC Build Date 5 + ECD6, 8, // EC Build Date 6 + ECD7, 8, // EC Build Date 7 + ECD8, 8, // EC Build Date 8 + ECD9, 8, // EC Build Date 9 + + Offset(0x40), + SHIP, 8, // Shipping Mode Flag + LEDF, 8, // LED Control Flag + LIDF, 8, // Lid Flag + KBFL, 8, // Keyboard Flag + CYCC, 8, // Cycle Count + + Offset(0x46), + BFCP, 8, // Battery Full Charge Percentage + + Offset(0x62), + TSE2, 8, // Sensor 2 Temperature + SENF, 8, // Sensor F + TSHT, 8, // Thermal Sensor High Trip Point + TSLT, 8, // Thermal Sensor Low Trip Point + THER, 8, // Thermal Source + + Offset(0x70), + CPUT, 8, // PECI CPU Temperature + PMXT, 8, // PLMX Temperature + CHAR, 8, // Charger Temperature + + Offset(0x7e), + OCTF, 8, // OEM Control Flag + LSTE, 1, // Lid Status + , 7, // Reserved + + Offset(0x80), + ECPS, 8, // AC & Battery status + B1MN, 8, // Battery Model Number Code + B1SN, 16, // Battery Serial Number + B1DC, 16, // Battery Design Capacity + B1DV, 16, // Battery Design Voltage + B1FC, 16, // Battery Last Full Charge Capacity + B1TP, 16, // Battery Trip Point + B1ST, 8, // Battery State + B1PR, 16, // Battery Present Rate + B1RC, 16, // Battery Remaining Capacity + B1PV, 16, // Battery Present Voltage + BPRP, 8, // Battery Remaining percentage + BT1A, 8, // Bt1 ASOC + BT1T, 16, // Bt1 Temperature + BT1C, 8, // Bt1 Control + + // Unicorn - doesn't actually exist + Offset(0x9d), + OPWE, 8, // OPM write to EC flag for UCSI + // Unicorn - doesn't actually exist + + Offset(0xbf), + EJ8A, 8, // EJ898A Firmware Version + + Offset(0xc0), + MGI0, 8, // UCSI DS MGI 0 + MGI1, 8, // UCSI DS MGI 1 + MGI2, 8, // UCSI DS MGI 2 + MGI3, 8, // UCSI DS MGI 3 + MGI4, 8, // UCSI DS MGI 4 + MGI5, 8, // UCSI DS MGI 5 + MGI6, 8, // UCSI DS MGI 6 + MGI7, 8, // UCSI DS MGI 7 + MGI8, 8, // UCSI DS MGI 8 + MGI9, 8, // UCSI DS MGI 9 + MGIA, 8, // UCSI DS MGI A + MGIB, 8, // UCSI DS MGI B + MGIC, 8, // UCSI DS MGI C + MGID, 8, // UCSI DS MGI D + MGIE, 8, // UCSI DS MGI E + MGIF, 8, // UCSI DS MGI F + + Offset(0xd0), + MGO0, 8, // UCSI DS MGO 0 + MGO1, 8, // UCSI DS MGO 1 + MGO2, 8, // UCSI DS MGO 2 + MGO3, 8, // UCSI DS MGO 3 + MGO4, 8, // UCSI DS MGO 4 + MGO5, 8, // UCSI DS MGO 5 + MGO6, 8, // UCSI DS MGO 6 + MGO7, 8, // UCSI DS MGO 7 + MGO8, 8, // UCSI DS MGO 8 + MGO9, 8, // UCSI DS MGO 9 + MGOA, 8, // UCSI DS MGO A + MGOB, 8, // UCSI DS MGO B + MGOC, 8, // UCSI DS MGO C + MGOD, 8, // UCSI DS MGO D + MGOE, 8, // UCSI DS MGO E + MGOF, 8, // UCSI DS MGO F + + Offset(0xe0), + UCSV, 16, // UCSI DS Version + UCSD, 16, // UCSI DS Reserved + CCI0, 8, // UCSI DS CCI 0 + CCI1, 8, // UCSI DS CCI 1 + CCI2, 8, // UCSI DS CCI 2 + CCI3, 8, // UCSI DS CCI 3 + CTL0, 8, // UCSI DS Control 0 + CTL1, 8, // UCSI DS Control 0 + CTL2, 8, // UCSI DS Control 0 + CTL3, 8, // UCSI DS Control 0 + CTL4, 8, // UCSI DS Control 0 + CTL5, 8, // UCSI DS Control 0 + CTL6, 8, // UCSI DS Control 0 + CTL7, 8, // UCSI DS Control 0 + + Offset(0xf0), + P0SD, 8, // PD Port Status DD + P0S4, 8, // PD Port Status 4 + P0S5, 8, // PD Port Status 5 + P0SE, 8, // PD Port Status E + P0SA, 8, // PD Port Status 10 + P0SB, 8, // PD Port Status 11 + + Offset(0xfd), + STCD, 8, // Shutdown Code + EJ8R, 8, // EJ898A Need Reboot + // TODO: + // Causes build failure, but 0xff is in range + // EJ8E, 8, // EJ898A Error +} diff --git a/src/ec/starlabs/merlin/variants/apl/events.asl b/src/ec/starlabs/merlin/variants/apl/events.asl new file mode 100644 index 0000000..5271d8e --- /dev/null +++ b/src/ec/starlabs/merlin/variants/apl/events.asl @@ -0,0 +1,99 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Method (_Q0D, 0, NotSerialized) // Event: Lid Opened +{ + \LIDS = LSTE + Notify (LID0, 0x80) +} + +Method (_Q0C, 0, NotSerialized) // Event: Lid Closed +{ + \LIDS = LSTE + Notify (LID0, 0x80) +} + +Method (_Q0A, 0, NotSerialized) // Event: AC Power Connected +{ + Notify (BAT0, 0x81) + Notify (ADP1, 0x80) +} + +Method (_Q0B, 0, NotSerialized) // Event: AC Power Disconnected +{ + Notify (BAT0, 0x81) + Notify (BAT0, 0x80) +} + +Method (_Q06, 0, NotSerialized) // Event: Backlight Brightness Down +{ + ^^^^HIDD.HPEM (20) +} + +Method (_Q07, 0, NotSerialized) // Event: Backlight Brightness Up +{ + ^^^^HIDD.HPEM (19) +} + +Method (_Q08, 0, NotSerialized) // Event: Function Lock +{ + FLKS = FLKA +} +// +// TODO: +// Below Q Events need to be added +// +// Method (_Q04, 0, NotSerialized) // Event: Trackpad Lock +// { +// TPLS = TPLA +// } +// +// Method (_Q__, 0, NotSerialized) // Event: Keyboard Backlight Brightness +// { +// KLBC = KLBE +// } +// + +Method (_Q99, 0, NotSerialized) // Event: Airplane Mode +{ + ^^^^HIDD.HPEM (8) +} + +Method (_QD5, 0, NotSerialized) // Event: 10 Second Power Button Pressed +{ + Notify (HIDD, 0xCE) +} + +Method (_QD6, 0, NotSerialized) // Event: 10 Second Power Button Released +{ + Notify (HIDD, 0xCF) +} + +Method (_Q22, 0, NotSerialized) // Event: CHARGER_T +{ + Store ("EC: CHARGER_T", Debug) +} + +Method (_Q80, 0, NotSerialized) // Event: Volume Up +{ + Store ("EC: VOLUME_UP", Debug) +} + +Method (_Q81, 0, NotSerialized) // Event: Volume Down +{ + Store ("EC: VOLUME_DOWN", Debug) +} + +Method (_Q54, 0, NotSerialized) // Event: Power Button Press +{ + Store ("EC: PWRBTN", Debug) +} + +Method (_QF0, 0, NotSerialized) // Event: Temperature Report +{ + Store ("EC: Temperature Report", Debug) +} + +Method (_QF1, 0, NotSerialized) // Event: Temperature Trigger +{ + // Notify (SEN3, 0x90) +} diff --git a/src/ec/starlabs/merlin/variants/glk/ecdefs.h b/src/ec/starlabs/merlin/variants/glk/ecdefs.h new file mode 100644 index 0000000..1e2c610 --- /dev/null +++ b/src/ec/starlabs/merlin/variants/glk/ecdefs.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* + * EC communication interface for ITE ITE Embedded Controller. + */ + +#ifndef _EC_STARLABS_ITE_CFG_H +#define _EC_STARLABS_ITE_CFG_H + +/* IT5570 chip ID byte values. */ +#define ITE_CHIPID1_VAL 0x89 +#define ITE_CHIPID2_VAL 0x87 + +/* EC RAM offsets. */ +#define ECRAM_TRACKPAD_STATE 0x14 +#define ECRAM_KBL_STATE 0x18 +#define ECRAM_KBL_BRIGHTNESS 0x19 +#define ECRAM_KBL_TIMEOUT 0x1a +#define ECRAM_FN_LOCK_STATE 0x2c +#define ECRAM_FN_CTRL_REVERSE 0x2d +#define ECRAM_MAX_CHARGE 0x46 + +#endif diff --git a/src/ec/starlabs/merlin/variants/glk/emem.asl b/src/ec/starlabs/merlin/variants/glk/emem.asl new file mode 100644 index 0000000..4ca879f --- /dev/null +++ b/src/ec/starlabs/merlin/variants/glk/emem.asl @@ -0,0 +1,175 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +OperationRegion (ECF2, EmbeddedControl, 0x00, 0xFF) +Field (ECF2, ByteAcc, Lock, Preserve) +{ + Offset(0x00), + ECMV, 8, // Major Version Number + ECSV, 8, // Minor Version Number + KBVS, 8, // Keyboard Controller Version + ECTV, 8, // Test Version Number + FRMF, 8, // Froce Mirror Flag + TXEL, 8, // TXE Lock + + Offset(0x10), + CPWR, 8, // Control Power + CDEV, 8, // Control Device + OSFG, 8, // OS Flag + CWFU, 8, // CW2015 Full + TPLA, 8, // Trackpad State + AFG3, 8, // After G3 + CLTP, 8, // Close Trackpad + WKOL, 8, // Wake on Lid + KLSE, 8, // Keyboard Backlight State + KLBE, 8, // Keyboard Backlight Brightness + + Offset(0x1a), + KLTE, 8, // Keyboard Backlight Timeout + + Offset(0x22), + ECT0, 8, // EC Build Time 0 + ECT1, 8, // EC Build Time 1 + ECT2, 8, // EC Build Time 2 + ECT3, 8, // EC Build Time 3 + ECT4, 8, // EC Build Time 4 + ECT5, 8, // EC Build Time 5 + ECT6, 8, // EC Build Time 6 + ECT7, 8, // EC Build Time 7 + ECT8, 8, // EC Build Time 8 + ECT9, 8, // EC Build Time 9 + + Offset(0x2c), + FLKA, 8, // Function Lock State + + Offset(0x30), + STEF, 8, // Sensor T Error F + ECD0, 8, // EC Build Date 0 + ECD1, 8, // EC Build Date 1 + ECD2, 8, // EC Build Date 2 + ECD3, 8, // EC Build Date 3 + ECD4, 8, // EC Build Date 4 + ECD5, 8, // EC Build Date 5 + ECD6, 8, // EC Build Date 6 + ECD7, 8, // EC Build Date 7 + ECD8, 8, // EC Build Date 8 + ECD9, 8, // EC Build Date 9 + + Offset(0x40), + SHIP, 8, // Shipping Mode Flag + LEDF, 8, // LED Control Flag + LIDF, 8, // Lid Flag + KBFL, 8, // Keyboard Flag + CYCC, 8, // Cycle Count + + Offset(0x46), + BFCP, 8, // Battery Full Charge Percentage + + Offset(0x62), + TSE2, 8, // Sensor 2 Temperature + SENF, 8, // Sensor F + TSHT, 8, // Thermal Sensor High Trip Point + TSLT, 8, // Thermal Sensor Low Trip Point + THER, 8, // Thermal Source + + Offset(0x70), + CPUT, 8, // PECI CPU Temperature + PMXT, 8, // PLMX Temperature + CHAR, 8, // Charger Temperature + + Offset(0x7e), + OCTF, 8, // OEM Control Flag + LSTE, 1, // Lid Status + , 7, // Reserved + + Offset(0x80), + ECPS, 8, // AC & Battery status + B1MN, 8, // Battery Model Number Code + B1SN, 16, // Battery Serial Number + B1DC, 16, // Battery Design Capacity + B1DV, 16, // Battery Design Voltage + B1FC, 16, // Battery Last Full Charge Capacity + B1TP, 16, // Battery Trip Point + B1ST, 8, // Battery State + B1PR, 16, // Battery Present Rate + B1RC, 16, // Battery Remaining Capacity + B1PV, 16, // Battery Present Voltage + BPRP, 8, // Battery Remaining percentage + BT1A, 8, // Bt1 ASOC + BT1T, 16, // Bt1 Temperature + BT1C, 8, // Bt1 Control + + // Unicorn - doesn't actually exist + Offset(0x9d), + OPWE, 8, // OPM write to EC flag for UCSI + // Unicorn - doesn't actually exist + + Offset(0xbf), + EJ8A, 8, // EJ898A Firmware Version + + Offset(0xc0), + MGI0, 8, // UCSI DS MGI 0 + MGI1, 8, // UCSI DS MGI 1 + MGI2, 8, // UCSI DS MGI 2 + MGI3, 8, // UCSI DS MGI 3 + MGI4, 8, // UCSI DS MGI 4 + MGI5, 8, // UCSI DS MGI 5 + MGI6, 8, // UCSI DS MGI 6 + MGI7, 8, // UCSI DS MGI 7 + MGI8, 8, // UCSI DS MGI 8 + MGI9, 8, // UCSI DS MGI 9 + MGIA, 8, // UCSI DS MGI A + MGIB, 8, // UCSI DS MGI B + MGIC, 8, // UCSI DS MGI C + MGID, 8, // UCSI DS MGI D + MGIE, 8, // UCSI DS MGI E + MGIF, 8, // UCSI DS MGI F + + Offset(0xd0), + MGO0, 8, // UCSI DS MGO 0 + MGO1, 8, // UCSI DS MGO 1 + MGO2, 8, // UCSI DS MGO 2 + MGO3, 8, // UCSI DS MGO 3 + MGO4, 8, // UCSI DS MGO 4 + MGO5, 8, // UCSI DS MGO 5 + MGO6, 8, // UCSI DS MGO 6 + MGO7, 8, // UCSI DS MGO 7 + MGO8, 8, // UCSI DS MGO 8 + MGO9, 8, // UCSI DS MGO 9 + MGOA, 8, // UCSI DS MGO A + MGOB, 8, // UCSI DS MGO B + MGOC, 8, // UCSI DS MGO C + MGOD, 8, // UCSI DS MGO D + MGOE, 8, // UCSI DS MGO E + MGOF, 8, // UCSI DS MGO F + + Offset(0xe0), + UCSV, 16, // UCSI DS Version + UCSD, 16, // UCSI DS Reserved + CCI0, 8, // UCSI DS CCI 0 + CCI1, 8, // UCSI DS CCI 1 + CCI2, 8, // UCSI DS CCI 2 + CCI3, 8, // UCSI DS CCI 3 + CTL0, 8, // UCSI DS Control 0 + CTL1, 8, // UCSI DS Control 0 + CTL2, 8, // UCSI DS Control 0 + CTL3, 8, // UCSI DS Control 0 + CTL4, 8, // UCSI DS Control 0 + CTL5, 8, // UCSI DS Control 0 + CTL6, 8, // UCSI DS Control 0 + CTL7, 8, // UCSI DS Control 0 + + Offset(0xf0), + P0SD, 8, // PD Port Status DD + P0S4, 8, // PD Port Status 4 + P0S5, 8, // PD Port Status 5 + P0SE, 8, // PD Port Status E + P0SA, 8, // PD Port Status 10 + P0SB, 8, // PD Port Status 11 + + Offset(0xfd), + STCD, 8, // Shutdown Code + EJ8R, 8, // EJ898A Need Reboot + // TODO: + // Causes build failure, but 0xff is in range + // EJ8E, 8, // EJ898A Error +} diff --git a/src/ec/starlabs/merlin/variants/glk/events.asl b/src/ec/starlabs/merlin/variants/glk/events.asl new file mode 100644 index 0000000..5271d8e --- /dev/null +++ b/src/ec/starlabs/merlin/variants/glk/events.asl @@ -0,0 +1,99 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Method (_Q0D, 0, NotSerialized) // Event: Lid Opened +{ + \LIDS = LSTE + Notify (LID0, 0x80) +} + +Method (_Q0C, 0, NotSerialized) // Event: Lid Closed +{ + \LIDS = LSTE + Notify (LID0, 0x80) +} + +Method (_Q0A, 0, NotSerialized) // Event: AC Power Connected +{ + Notify (BAT0, 0x81) + Notify (ADP1, 0x80) +} + +Method (_Q0B, 0, NotSerialized) // Event: AC Power Disconnected +{ + Notify (BAT0, 0x81) + Notify (BAT0, 0x80) +} + +Method (_Q06, 0, NotSerialized) // Event: Backlight Brightness Down +{ + ^^^^HIDD.HPEM (20) +} + +Method (_Q07, 0, NotSerialized) // Event: Backlight Brightness Up +{ + ^^^^HIDD.HPEM (19) +} + +Method (_Q08, 0, NotSerialized) // Event: Function Lock +{ + FLKS = FLKA +} +// +// TODO: +// Below Q Events need to be added +// +// Method (_Q04, 0, NotSerialized) // Event: Trackpad Lock +// { +// TPLS = TPLA +// } +// +// Method (_Q__, 0, NotSerialized) // Event: Keyboard Backlight Brightness +// { +// KLBC = KLBE +// } +// + +Method (_Q99, 0, NotSerialized) // Event: Airplane Mode +{ + ^^^^HIDD.HPEM (8) +} + +Method (_QD5, 0, NotSerialized) // Event: 10 Second Power Button Pressed +{ + Notify (HIDD, 0xCE) +} + +Method (_QD6, 0, NotSerialized) // Event: 10 Second Power Button Released +{ + Notify (HIDD, 0xCF) +} + +Method (_Q22, 0, NotSerialized) // Event: CHARGER_T +{ + Store ("EC: CHARGER_T", Debug) +} + +Method (_Q80, 0, NotSerialized) // Event: Volume Up +{ + Store ("EC: VOLUME_UP", Debug) +} + +Method (_Q81, 0, NotSerialized) // Event: Volume Down +{ + Store ("EC: VOLUME_DOWN", Debug) +} + +Method (_Q54, 0, NotSerialized) // Event: Power Button Press +{ + Store ("EC: PWRBTN", Debug) +} + +Method (_QF0, 0, NotSerialized) // Event: Temperature Report +{ + Store ("EC: Temperature Report", Debug) +} + +Method (_QF1, 0, NotSerialized) // Event: Temperature Trigger +{ + // Notify (SEN3, 0x90) +}