| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,8 +86,6 @@ endif | |
|
|
||
| bootloader = $(word 8,$(subst /, ,$(BUILD_STR))) | ||
|
|
||
| all: clean build | ||
|
|
||
| $(project_dir): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,12 +34,6 @@ | |
| #include <stddef.h> | ||
| #include <string.h> | ||
|
|
||
| /** | ||
| * @defgroup malloc Memory allocation functions | ||
| * @{ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #include <cpu/cpu.h> | ||
| #include <cpu/x86/mtrr.h> | ||
| #include <cpu/x86/msr.h> | ||
| #include <console/console.h> | ||
|
|
||
| /* Get first available variable MTRR. | ||
| * Returns var# if available, else returns -1. | ||
| */ | ||
| int get_free_var_mtrr(void) | ||
| { | ||
| msr_t maskm; | ||
| int vcnt; | ||
| int i; | ||
|
|
||
| vcnt = get_var_mtrr_count(); | ||
|
|
||
| /* Identify the first var mtrr which is not valid. */ | ||
| for (i = 0; i < vcnt; i++) { | ||
| maskm = rdmsr(MTRR_PHYS_MASK(i)); | ||
| if ((maskm.lo & MTRR_PHYS_MASK_VALID) == 0) | ||
| return i; | ||
| } | ||
|
|
||
| /* No free var mtrr. */ | ||
| return -1; | ||
| } | ||
|
|
||
| void set_var_mtrr( | ||
| unsigned int reg, unsigned int base, unsigned int size, unsigned int type) | ||
| { | ||
| /* Bit 32-35 of MTRRphysMask should be set to 1 */ | ||
| /* FIXME: It only support 4G less range */ | ||
| msr_t basem, maskm; | ||
|
|
||
| if (!IS_POWER_OF_2(size)) | ||
| printk(BIOS_ERR, "MTRR Error: size %#x is not a power of two\n", size); | ||
| if (size < 4 * KiB) | ||
| printk(BIOS_ERR, "MTRR Error: size %#x smaller than 4KiB\n", size); | ||
| if (base % size != 0) | ||
| printk(BIOS_ERR, "MTRR Error: base %#x must be aligned to size %#x\n", base, | ||
| size); | ||
|
|
||
| basem.lo = base | type; | ||
| basem.hi = 0; | ||
| wrmsr(MTRR_PHYS_BASE(reg), basem); | ||
| maskm.lo = ~(size - 1) | MTRR_PHYS_MASK_VALID; | ||
| maskm.hi = (1 << (cpu_phys_address_size() - 32)) - 1; | ||
| wrmsr(MTRR_PHYS_MASK(reg), maskm); | ||
| } | ||
|
|
||
| void clear_all_var_mtrr(void) | ||
| { | ||
| msr_t mtrr = {0, 0}; | ||
| int vcnt; | ||
| int i; | ||
|
|
||
| vcnt = get_var_mtrr_count(); | ||
|
|
||
| for (i = 0; i < vcnt; i++) { | ||
| wrmsr(MTRR_PHYS_MASK(i), mtrr); | ||
| wrmsr(MTRR_PHYS_BASE(i), mtrr); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #include <console/console.h> | ||
| #include <fsp/api.h> | ||
| #include <fsp/fsp_debug_event.h> | ||
| #include <fsp/util.h> | ||
|
|
||
| static const uint8_t fsp_string_type_guid[16] = { | ||
| 0x80, 0x10, 0xd1, 0x92, 0x6f, 0x49, 0x95, 0x4d, | ||
| 0xbe, 0x7e, 0x03, 0x74, 0x88, 0x38, 0x2b, 0x0a | ||
| }; | ||
|
|
||
| static efi_return_status_t print_fsp_string_data(const efi_status_code_data_t *data) | ||
| { | ||
| printk(BIOS_SPEW, "%s", ((efi_status_code_string_data *) data)->String.Ascii); | ||
|
|
||
| return FSP_SUCCESS; | ||
| } | ||
|
|
||
| efi_return_status_t fsp_debug_event_handler(efi_status_code_type_t ignored1, | ||
| efi_status_code_value_t ignored2, efi_uint32_t ignored3, efi_guid_t *ignored4, | ||
| efi_status_code_data_t *data) | ||
| { | ||
| if (!fsp_guid_compare((uint8_t *)&(data->Type), fsp_string_type_guid)) | ||
| return FSP_NOT_FOUND; | ||
|
|
||
| return print_fsp_string_data(data); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
|
|
||
| #include <commonlib/bsd/compiler.h> | ||
| #include <console/console.h> | ||
| #include <fsp/util.h> | ||
| #include <lib.h> | ||
|
|
||
| #define TIMESTAMP_MS(x) ((x) / 1000ull) | ||
|
|
||
| static const uint8_t fpdt_guid[16] = { | ||
| 0xfd, 0x7b, 0x38, 0x3b, 0xbc, 0x7a, 0xf2, 0x4c, | ||
| 0xa0, 0xca, 0xb6, 0xa1, 0x6c, 0x1b, 0x1b, 0x25, | ||
| }; | ||
|
|
||
| enum fpdt_record_type { | ||
| FPDT_GUID_EVENT = 0x1010, | ||
| FPDT_STRING_EVENT = 0x1011, | ||
| }; | ||
|
|
||
| struct perf_record_hdr { | ||
| uint16_t type; | ||
| uint8_t length; | ||
| uint8_t revision; | ||
| } __packed; | ||
|
|
||
| struct generic_event_record { | ||
| struct perf_record_hdr header; | ||
| uint16_t progress_id; | ||
| uint32_t apic_id; | ||
| uint64_t timestamp; | ||
| uint8_t guid[16]; | ||
| uint8_t string[0]; | ||
| } __packed; | ||
|
|
||
| /* | ||
| * Performance Hob: | ||
| * GUID - fpdt_guid; | ||
| * Data - FPDT_PEI_EXT_PERF_HEADER one or more FPDT records | ||
| */ | ||
| struct fpdt_pei_ext_perf_header { | ||
| uint32_t table_size; | ||
| uint32_t load_image_count; | ||
| uint32_t hob_is_full; | ||
| } __packed; | ||
|
|
||
| static void print_guid_record(const struct generic_event_record *rec) | ||
| { | ||
| printk(BIOS_INFO, "%5x\t%16llu\t\t", rec->progress_id, TIMESTAMP_MS(rec->timestamp)); | ||
| fsp_print_guid(rec->guid); | ||
| printk(BIOS_INFO, "\n"); | ||
| } | ||
|
|
||
| static void print_string_record(const struct generic_event_record *rec) | ||
| { | ||
| size_t str_len = rec->header.length - offsetof(struct generic_event_record, string); | ||
| printk(BIOS_INFO, "%5x\t%16llu\t\t%*s/", | ||
| rec->progress_id, TIMESTAMP_MS(rec->timestamp), (int)str_len, rec->string); | ||
| fsp_print_guid(rec->guid); | ||
| printk(BIOS_INFO, "\n"); | ||
| } | ||
|
|
||
| static void print_fsp_perf_timestamp(const struct generic_event_record *rec) | ||
| { | ||
| switch (rec->header.type) { | ||
| case FPDT_GUID_EVENT: | ||
| print_guid_record(rec); | ||
| break; | ||
| case FPDT_STRING_EVENT: | ||
| print_string_record(rec); | ||
| break; | ||
| default: | ||
| printk(BIOS_INFO, "Unhandled Event Type 0x%x\n", rec->header.type); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| static void print_fsp_timestamp_header(void) | ||
| { | ||
| printk(BIOS_INFO, "+---------------------------------------------------+\n"); | ||
| printk(BIOS_INFO, "|------ FSP Performance Timestamp Table Dump -------|\n"); | ||
| printk(BIOS_INFO, "+---------------------------------------------------+\n"); | ||
| printk(BIOS_INFO, "| Perf-ID\tTimestamp(ms)\t\tString/GUID |\n"); | ||
| printk(BIOS_INFO, "+---------------------------------------------------+\n"); | ||
| } | ||
|
|
||
| void fsp_display_timestamp(void) | ||
| { | ||
| size_t size; | ||
| const struct fpdt_pei_ext_perf_header *hdr = fsp_find_extension_hob_by_guid(fpdt_guid, | ||
| &size); | ||
|
|
||
| if (!hdr || !size) { | ||
| printk(BIOS_INFO, "FPDT Extended Firmware Performance HOB Not Found!\n" | ||
| "Check if PcdFspPerformanceEnable is set to `TRUE` inside FSP package\n"); | ||
| return; | ||
| } | ||
|
|
||
| const struct generic_event_record *rec = (const struct generic_event_record *)( | ||
| (uint8_t *)hdr + sizeof(struct fpdt_pei_ext_perf_header)); | ||
|
|
||
| print_fsp_timestamp_header(); | ||
| for (size_t i = 0; i < hdr->table_size;) { | ||
| print_fsp_perf_timestamp(rec); | ||
|
|
||
| i += rec->header.length; | ||
| rec = (const struct generic_event_record *)((uint8_t *)rec + | ||
| rec->header.length); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #ifndef FSP_DEBUG_EVENT_H | ||
| #define FSP_DEBUG_EVENT_H | ||
|
|
||
| /* | ||
| * This file to implement FSP_EVENT_HANDLER for Intel FSP to use. | ||
| * More details about this structure can be found here : | ||
| * http://github.com/tianocore/edk2/blob/master/IntelFsp2Pkg/Include/FspEas/FspApi.h | ||
| */ | ||
| #include <efi/efi_datatype.h> | ||
| #include <fsp/soc_binding.h> | ||
|
|
||
| /* fsp debug event handler */ | ||
| efi_return_status_t fsp_debug_event_handler(efi_status_code_type_t ignored1, | ||
| efi_status_code_value_t ignored2, efi_uint32_t ignored3, efi_guid_t *ignored4, | ||
| efi_status_code_data_t *data); | ||
|
|
||
| #endif /* FSP_DEBUG_EVENT_H */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,287 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #include <console/console.h> | ||
| #include <device/device.h> | ||
| #include <device/pnp.h> | ||
| #include <ec/acpi/ec.h> | ||
| #include <option.h> | ||
| #include <pc80/keyboard.h> | ||
|
|
||
| #include "ec.h" | ||
| #include "ecdefs.h" | ||
|
|
||
| uint16_t ec_get_version(void) | ||
| { | ||
| return (ec_read(ECRAM_MAJOR_VERSION) << 8) | ec_read(ECRAM_MINOR_VERSION); | ||
| } | ||
|
|
||
| static uint8_t get_ec_value_from_option(const char *name, | ||
| unsigned int fallback, | ||
| const uint8_t *lut, | ||
| size_t lut_size) | ||
| { | ||
| unsigned int index = get_uint_option(name, fallback); | ||
| if (index >= lut_size) | ||
| index = fallback; | ||
| return lut[index]; | ||
| } | ||
|
|
||
| static uint16_t ec_get_chip_id(unsigned int port) | ||
| { | ||
| return pnp_read_index(port, NUVOTON_CHIPID); | ||
| } | ||
|
|
||
| static void merlin_init(struct device *dev) | ||
| { | ||
| if (!dev->enabled) | ||
| return; | ||
|
|
||
| /* | ||
| * The address/data IO port pair for the Nuvoton EC are configurable | ||
| * through the EC domain and are fixed by the EC's firmware blob. If | ||
| * the value(s) passed through the "dev" structure don't match the | ||
| * expected values then output severe warnings. | ||
| */ | ||
| if (dev->path.pnp.port != NUVOTON_FIXED_ADDR) { | ||
| printk(BIOS_ERR, "NUVOTON: Incorrect ports defined in devicetree.cb.\n"); | ||
| printk(BIOS_ERR, "NUVOTON: Serious operational issues will arise.\n"); | ||
| return; | ||
| } | ||
|
|
||
| const uint16_t chip_id = ec_get_chip_id(dev->path.pnp.port); | ||
|
|
||
| if (chip_id != NUVOTON_CHIPID_VAL) { | ||
| printk(BIOS_ERR, "NUVOTON: Expected chip ID 0x%04x, but got 0x%04x instead.\n", | ||
| NUVOTON_CHIPID_VAL, chip_id); | ||
| return; | ||
| } | ||
|
|
||
| pc_keyboard_init(NO_AUX_DEVICE); | ||
|
|
||
| /* | ||
| * Restore settings from CMOS into EC RAM: | ||
| * | ||
| * kbl_timeout | ||
| * fn_ctrl_swap | ||
| * max_charge | ||
| * fan_mode | ||
| * fn_lock_state | ||
| * trackpad_state | ||
| * kbl_brightness | ||
| * kbl_state | ||
| */ | ||
|
|
||
| /* | ||
| * Keyboard Backlight Timeout | ||
| * | ||
| * Setting: kbl_timeout | ||
| * | ||
| * Values: 30 Seconds, 1 Minute, 3 Minutes, 5 Minutes, Never | ||
| * Default: 30 Seconds | ||
| * | ||
| */ | ||
| const uint8_t kbl_timeout[] = { | ||
| SEC_30, | ||
| MIN_1, | ||
| MIN_3, | ||
| MIN_5, | ||
| NEVER | ||
| }; | ||
|
|
||
| ec_write(ECRAM_KBL_TIMEOUT, | ||
| get_ec_value_from_option("kbl_timeout", | ||
| 0, | ||
| kbl_timeout, | ||
| ARRAY_SIZE(kbl_timeout))); | ||
|
|
||
| /* | ||
| * Fn Ctrl Reverse | ||
| * | ||
| * Setting: fn_ctrl_swap | ||
| * | ||
| * Values: Enabled, Disabled | ||
| * Default: Disabled | ||
| * | ||
| */ | ||
| const uint8_t fn_ctrl_swap[] = { | ||
| FN_CTRL, | ||
| CTRL_FN | ||
| }; | ||
|
|
||
| ec_write(ECRAM_FN_CTRL_REVERSE, | ||
| get_ec_value_from_option("fn_ctrl_swap", | ||
| 1, | ||
| fn_ctrl_swap, | ||
| ARRAY_SIZE(fn_ctrl_swap))); | ||
|
|
||
| /* | ||
| * Maximum Charge Level | ||
| * | ||
| * Setting: max_charge | ||
| * | ||
| * Values: 60%, 80%, 100% | ||
| * Default: 100% | ||
| * | ||
| */ | ||
| const uint8_t max_charge[] = { | ||
| CHARGE_100, | ||
| CHARGE_80, | ||
| CHARGE_60 | ||
| }; | ||
|
|
||
| if (CONFIG(EC_STARLABS_MAX_CHARGE)) | ||
| ec_write(ECRAM_MAX_CHARGE, | ||
| get_ec_value_from_option("max_charge", | ||
| 0, | ||
| max_charge, | ||
| ARRAY_SIZE(max_charge))); | ||
|
|
||
| /* | ||
| * Fan Mode | ||
| * | ||
| * Setting: fan_mode | ||
| * | ||
| * Values: Quiet, Normal, Aggressive | ||
| * Default: Normal | ||
| * | ||
| */ | ||
| const uint8_t fan_mode[] = { | ||
| FAN_NORMAL, | ||
| FAN_AGGRESSIVE, | ||
| FAN_QUIET | ||
| }; | ||
|
|
||
| if (CONFIG(EC_STARLABS_FAN)) | ||
| ec_write(ECRAM_FAN_MODE, | ||
| get_ec_value_from_option("fan_mode", | ||
| 0, | ||
| fan_mode, | ||
| ARRAY_SIZE(fan_mode))); | ||
|
|
||
| /* | ||
| * Function Lock | ||
| * | ||
| * Setting: fn_lock_state | ||
| * | ||
| * Values: Locked, Unlocked | ||
| * Default: Locked | ||
| * | ||
| */ | ||
| const uint8_t fn_lock_state[] = { | ||
| UNLOCKED, | ||
| LOCKED | ||
| }; | ||
|
|
||
| ec_write(ECRAM_FN_LOCK_STATE, | ||
| get_ec_value_from_option("fn_lock_state", | ||
| 1, | ||
| fn_lock_state, | ||
| ARRAY_SIZE(fn_lock_state))); | ||
|
|
||
| /* | ||
| * Trackpad State | ||
| * | ||
| * Setting: trackpad_state | ||
| * | ||
| * Values: Enabled, Disabled | ||
| * Default: Enabled | ||
| * | ||
| */ | ||
| const uint8_t trackpad_state[] = { | ||
| TRACKPAD_ENABLED, | ||
| TRACKPAD_DISABLED | ||
| }; | ||
|
|
||
| ec_write(ECRAM_TRACKPAD_STATE, | ||
| get_ec_value_from_option("trackpad_state", | ||
| 0, | ||
| trackpad_state, | ||
| ARRAY_SIZE(trackpad_state))); | ||
|
|
||
| /* | ||
| * Keyboard Backlight Brightness | ||
| * | ||
| * Setting: kbl_brightness | ||
| * | ||
| * Values: Off, Low, High / Off, On | ||
| * Default: Low | ||
| * | ||
| */ | ||
| const uint8_t kbl_brightness[] = { | ||
| KBL_ON, | ||
| KBL_OFF, | ||
| KBL_LOW, | ||
| KBL_HIGH | ||
| }; | ||
|
|
||
| if (CONFIG(EC_STARLABS_KBL_LEVELS)) | ||
| ec_write(ECRAM_KBL_BRIGHTNESS, | ||
| get_ec_value_from_option("kbl_brightness", | ||
| 2, | ||
| kbl_brightness, | ||
| ARRAY_SIZE(kbl_brightness))); | ||
| else | ||
| ec_write(ECRAM_KBL_BRIGHTNESS, | ||
| get_ec_value_from_option("kbl_brightness", | ||
| 0, | ||
| kbl_brightness, | ||
| ARRAY_SIZE(kbl_brightness))); | ||
|
|
||
| /* | ||
| * Keyboard Backlight State | ||
| * | ||
| * Setting: kbl_state | ||
| * | ||
| * Values: Off, On | ||
| * Default: On | ||
| * | ||
| */ | ||
| const uint8_t kbl_state[] = { | ||
| KBL_DISABLED, | ||
| KBL_ENABLED | ||
| }; | ||
|
|
||
| ec_write(ECRAM_KBL_STATE, | ||
| get_ec_value_from_option("kbl_state", | ||
| 1, | ||
| kbl_state, | ||
| ARRAY_SIZE(kbl_state))); | ||
| } | ||
|
|
||
| static struct device_operations ops = { | ||
| .init = merlin_init, | ||
| .read_resources = noop_read_resources, | ||
| .set_resources = noop_set_resources, | ||
| }; | ||
|
|
||
| static struct pnp_info pnp_dev_info[] = { | ||
| /* System Wake-Up Control (SWUC) */ | ||
| { NULL, NUVOTON_MSWC, PNP_IO0 | PNP_IRQ0, 0xfff0, }, | ||
| /* KBC / Mouse Interface */ | ||
| { NULL, NUVOTON_KBCM, PNP_IRQ0, }, | ||
| /* KBC / Keyboard Interface */ | ||
| { NULL, NUVOTON_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, }, | ||
| /* Shared Memory / Flash Interface (SMFI) */ | ||
| { NULL, NUVOTON_SHM, PNP_IO0 | PNP_IRQ0, 0xfff0, }, | ||
| /* Power Management I/F Channel 1 (PMC1) */ | ||
| { NULL, NUVOTON_PM1, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, }, | ||
| /* Power Management I/F Channel 2 (PMC2) */ | ||
| { NULL, NUVOTON_PM2, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IRQ0, 0x07fc, | ||
| 0x07fc, 0xfff0, }, | ||
| /* Power Management I/F Channel 3 (PMC3) */ | ||
| { NULL, NUVOTON_PM3, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, }, | ||
| /* Extended Shared Memory (ESHM) */ | ||
| { NULL, NUVOTON_ESHM }, | ||
| /* Power Management I/F Channel 4 (PMC4) */ | ||
| { NULL, NUVOTON_PM4, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, }, | ||
| }; | ||
|
|
||
| static void enable_dev(struct device *dev) | ||
| { | ||
| pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); | ||
| } | ||
|
|
||
| struct chip_operations ec_starlabs_merlin_ops = { | ||
| CHIP_NAME("NUVOTON EC") | ||
| .enable_dev = enable_dev | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| /* | ||
| * EC communication interface for ITE Embedded Controller | ||
| */ | ||
|
|
||
| #ifndef _EC_STARLABS_CEZANNE_EC_DEFS_H | ||
| #define _EC_STARLABS_CEZANNE_EC_DEFS_H | ||
|
|
||
| /* IT5570 chip ID byte values */ | ||
| #define ITE_CHIPID_VAL 0x5570 | ||
|
|
||
| /* EC RAM offsets */ | ||
| #define ECRAM_KBL_BRIGHTNESS 0x09 | ||
| #define ECRAM_KBL_TIMEOUT 0x10 | ||
| #define ECRAM_KBL_STATE 0x19 | ||
| #define ECRAM_TRACKPAD_STATE 0x20 | ||
| #define ECRAM_FN_LOCK_STATE 0x21 | ||
| #define ECRAM_FN_CTRL_REVERSE 0x22 | ||
| #define ECRAM_MAX_CHARGE 0x23 | ||
| #define ECRAM_FAN_MODE 0x24 | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| OperationRegion (ECF2, EmbeddedControl, 0x00, 0x100) | ||
| 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 | ||
| OSFG, 8, // OS Flag | ||
| FRMF, 8, // Force Mirror Flag | ||
|
|
||
| Offset(0x0c), | ||
| P0MV, 8, // PD Port 0 Major Version | ||
| P0SV, 8, // PD Port 0 Minor Version | ||
| P1MV, 8, // PD Port 1 Major Version | ||
| P1SV, 8, // PD Port 1 Minor Version | ||
|
|
||
| Offset(0x13), | ||
| AUDI, 8, // Control Audio | ||
| TRAC, 8, // Trackpad Control | ||
|
|
||
| Offset(0x18), | ||
| BSEC, 8, // Save to CMOS | ||
| KLSE, 8, // Keyboard Backlight State | ||
| TPLE, 8, // Trackpad State | ||
| FLKE, 8, // Function Lock State | ||
| FCLS, 8, // Ctrl Fn Reverse (Make Keyboard Apple-like) | ||
| MXCH, 8, // Max Charge Level | ||
| FANM, 8, // Fan Mode | ||
|
|
||
| Offset(0x40), | ||
| SHIP, 8, // Shipping Mode Flag | ||
|
|
||
| Offset(0x46), | ||
| ECPS, 8, // AC & Battery Status | ||
|
|
||
| Offset(0x30), | ||
| STEF, 8, // Sensor T Error F | ||
|
|
||
| Offset(0x62), | ||
| SSKT, 8, // System Skin 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(0x7f), | ||
| LSTE, 8, // Lid Status | ||
| 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 | ||
| CPUT, 8, // PECI CPU Temperature | ||
| STCD, 8, // Shutdown Code | ||
| B1HL, 8, // Battery Health | ||
| CWFU, 8, // CW2015 Full | ||
| B1CC, 16, // Battery Cycle Count | ||
|
|
||
| Offset(0xb0), | ||
| 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(0xc0), | ||
| 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(0xd0), | ||
| 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(0xe0), | ||
| CCS1, 8, // Cross Point Switch Status 1 | ||
| CCS2, 8, // Cross Point Switch Status 2 | ||
| TCI1, 8, // TC Input 1 / TCHC Thermal Charge CMD [TODO, Confirm] | ||
| TCI2, 8, // TC Input 2 / TCHF Thermal Charge Flag [TODO, Confirm] | ||
| PDDT, 8, // PD Det [TODO, Confirm] | ||
| PDBD, 8, // B PD Det [TODO, Confirm] | ||
| ECWD, 16, // EC Wakeup Delay | ||
| ECWE, 8, // EC Wakeup Enable | ||
| PDV1, 8, // PD Vol [TODO, Confirm] | ||
| PDV2, 8, // B PD Vol [TODO, Confirm] | ||
|
|
||
| // Below are the Thunderbolt Offsets from the shared EC code. There aren't | ||
| // use for AMD boards but left for reference. | ||
| // | ||
| // Offset(0xf7), | ||
| // TBTC, 8, // Thunderbolt Command | ||
| // TBTP, 8, // Thunderbolt Data Port | ||
| // TBTD, 8, // Thunderbolt Data | ||
| // TBTA, 8, // Thunderbolt Acknowledge | ||
| // TBTG, 16, // Thunderbolt DBG Data | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| Method (_Q01, 0, NotSerialized) // Event: F1 Hot Key | ||
| { | ||
| Printf ("EC: F1") | ||
| } | ||
|
|
||
| Method (_Q02, 0, NotSerialized) // Event: F2 Hot Key | ||
| { | ||
| Printf ("EC: F2") | ||
| } | ||
|
|
||
| Method (_Q03, 0, NotSerialized) // Event: F3 Hot Key | ||
| { | ||
| Printf ("EC: F3") | ||
| } | ||
|
|
||
| Method (_Q04, 0, NotSerialized) // Event: F4 Hot Key | ||
| { | ||
| Printf ("EC: F4") | ||
| } | ||
|
|
||
| Method (_Q05, 0, NotSerialized) // Event: F5 Hot Key | ||
| { | ||
| Printf ("EC: F5") | ||
| } | ||
|
|
||
| Method (_Q06, 0, NotSerialized) // Event: F6 Hot Key | ||
| { | ||
| Printf ("EC: F6") | ||
| } | ||
|
|
||
| Method (_Q07, 0, NotSerialized) // Event: F7 Hot Key | ||
| { | ||
| Printf ("EC: F7") | ||
| } | ||
|
|
||
| Method (_Q08, 0, NotSerialized) // Event: F8 Hot Key | ||
| { | ||
| Printf ("EC: F8") | ||
| } | ||
|
|
||
| Method (_Q09, 0, NotSerialized) // Event: F9 Hot Key | ||
| { | ||
| Printf ("EC: F9") | ||
| } | ||
|
|
||
| Method (_Q10, 0, NotSerialized) // Event: F10 Hot Key | ||
| { | ||
| Printf ("EC: F10") | ||
| } | ||
|
|
||
| Method (_Q12, 0, NotSerialized) // Event: F12 Hot Key | ||
| { | ||
| Printf ("EC: F12") | ||
| } | ||
|
|
||
| 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 (_Q0C, 0, NotSerialized) // Event: Lid Closed | ||
| { | ||
| \LIDS = LSTE | ||
| Notify (LID0, 0x80) | ||
| } | ||
|
|
||
| Method (_Q0D, 0, NotSerialized) // Event: Lid Open | ||
| { | ||
| \LIDS = LSTE | ||
| Notify (LID0, 0x80) | ||
| } | ||
|
|
||
| Method (_Q0E, 0, NotSerialized) // Event: SLEEP | ||
| { | ||
| Printf ("EC: SLEEP") | ||
| } | ||
|
|
||
| Method (_Q13, 0, NotSerialized) // Event: BRIGHTNESS | ||
| { | ||
| Printf ("EC: BRIGHTNESS") | ||
| } | ||
|
|
||
| Method (_Q20, 0, NotSerialized) // Event: CPU_T | ||
| { | ||
| Printf ("EC: CPU_T") | ||
| } | ||
|
|
||
| Method (_Q21, 0, NotSerialized) // Event: SKIN_T | ||
| { | ||
| Printf ("EC: SKIN_T") | ||
| } | ||
|
|
||
| Method (_Q22, 0, NotSerialized) // Event: CHARGER_T | ||
| { | ||
| Printf ("EC: CHARGER_T") | ||
| } | ||
|
|
||
| Method (_Q30, 0, NotSerialized) // Event: THROT_OFF | ||
| { | ||
| Printf ("EC: THROT_OFF") | ||
| } | ||
|
|
||
| Method (_Q31, 0, NotSerialized) // Event: THROT_LV1 | ||
| { | ||
| Printf ("EC: THROT_LV1") | ||
| } | ||
|
|
||
| Method (_Q32, 0, NotSerialized) // Event: THROT_LV2 | ||
| { | ||
| Printf ("EC: THROT_LV2") | ||
| } | ||
|
|
||
| Method (_Q33, 0, NotSerialized) // Event: THROT_LV3 | ||
| { | ||
| Printf ("EC: THROT_LV3") | ||
| } | ||
|
|
||
| Method (_Q34, 0, NotSerialized) // Event: THROT_LV4 | ||
| { | ||
| Printf ("EC: THROT_LV4") | ||
| } | ||
|
|
||
| Method (_Q35, 0, NotSerialized) // Event: THROT_LV5 | ||
| Printf ("EC: THROT_LV5") | ||
| } | ||
|
|
||
| Method (_Q36, 0, NotSerialized) // Event: THROT_LV6 | ||
| { | ||
| Printf ("EC:THROT_LV6") | ||
| } | ||
|
|
||
| Method (_Q37, 0, NotSerialized) // Event: THROT_LV7 | ||
| { | ||
| Printf ("EC: THROT_LV7") | ||
| } | ||
|
|
||
| Method (_Q3B, 0, NotSerialized) // Event: CPU_DN_SPEED | ||
| Printf ("EC: CPU_DN_SPEED") | ||
| } | ||
|
|
||
| Method (_Q3C, 0, NotSerialized) // Event: CPU_UP_SPEED | ||
| { | ||
| Printf ("EC: CPU_UP_SPEED") | ||
| } | ||
|
|
||
| Method (_Q3D, 0, NotSerialized) // Event: CPU_TURBO_OFF | ||
| { | ||
| Printf ("EC: CPU_TURBO_OFF") | ||
| } | ||
|
|
||
| Method (_Q3E, 0, NotSerialized) // Event: CPU_TURBO_ON | ||
| { | ||
| Printf ("EC: CPU_TURBO_ON") | ||
| } | ||
|
|
||
| Method (_Q3F, 0, NotSerialized) // Event: SHUTDOWN | ||
| Printf ("EC: SHUTDOWN") | ||
| } | ||
|
|
||
| Method (_Q54, 0, NotSerialized) // Event: Power Button Press | ||
| { | ||
| Printf ("EC: PWRBTN") | ||
| } | ||
|
|
||
| Method (_Q79, 0, NotSerialized) // Event: USB Type-C | ||
| { | ||
| Printf ("EC: USB Type-C") | ||
| UCEV() | ||
| } | ||
|
|
||
| Method (_Q80, 0, NotSerialized) // Event: Volume Up | ||
| { | ||
| Printf ("EC:VOLUME_UP") | ||
| } | ||
|
|
||
| Method (_Q81, 0, NotSerialized) // Event: Volume Down | ||
| { | ||
| Printf ("EC: VOLUME_DOWN") | ||
| } | ||
|
|
||
| Method (_Q85, 0, NotSerialized) // Event: HOME | ||
| { | ||
| Printf ("EC: HOME") | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| #include <assert.h> | ||
| #include <stdint.h> | ||
|
|
||
| /* | ||
| * EC communication interface for Nuvoton Embedded Controller. | ||
| */ | ||
|
|
||
| #ifndef _EC_STARLABS_GLKR_EC_DEFS_H | ||
| #define _EC_STARLABS_GLKR_EC_DEFS_H | ||
|
|
||
| /* Nuvoton chip ID byte values. */ | ||
| #define NUVOTON_CHIPID_VAL 0x0004 | ||
|
|
||
| /* EC RAM offsets. */ | ||
| #define ECRAM_TRACKPAD_STATE 0x14 | ||
| #define ECRAM_KBL_STATE 0x16 | ||
| #define ECRAM_KBL_BRIGHTNESS 0x17 | ||
| #define ECRAM_KBL_TIMEOUT 0x12 | ||
| #define ECRAM_FN_LOCK_STATE 0x15 | ||
| #define ECRAM_FN_CTRL_REVERSE 0x13 | ||
| #define ECRAM_MAX_CHARGE dead_code_t(uint8_t) | ||
| #define ECRAM_FAN_MODE dead_code_t(uint8_t) | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
|
||
| OperationRegion (ECF2, EmbeddedControl, 0x00, 0x100) | ||
| 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 | ||
| P0MV, 8, // PD Port 0 Major Version | ||
| P0SV, 8, // PD Port 0 Minor Version | ||
| P1MV, 8, // PD Port 1 Major Version | ||
| P1SV, 8, // PD Port 1 Minor Version | ||
|
|
||
| Offset(0x0c), | ||
| ECT0, 8, // EC Build Time 0 | ||
| ECT1, 8, // EC Build Time 1 | ||
| ECT2, 8, // EC Build Time 2 | ||
| ECT3, 8, // EC Build Time 3 | ||
|
|
||
| Offset(0x12), | ||
| KLTE, 8, // Keyboard Backlight Timeout | ||
| FCLA, 8, // Fn Ctrl Reverse | ||
| TPLE, 8, // Trackpad State | ||
| FLKE, 8, // Function Lock State | ||
| KLSE, 8, // Keyboard Backlight State | ||
| KLBE, 8, // Keyboard Backlight Brightness | ||
|
|
||
| Offset(0x20), | ||
| RCMD, 8, // Send EC command | ||
| RCST, 8, // Status of EC command | ||
|
|
||
| Offset(0x60), | ||
| TSE1, 8, // Sensor 1 Temperature | ||
| TSE2, 8, // Sensor 2 Temperature | ||
| TSE3, 8, // Sensor 3 Temperature | ||
|
|
||
| Offset(0x63), | ||
| TSE4, 4, // Sensor 4 Temperature | ||
| SENF, 8, // Sensor F | ||
| TSHT, 8, // Thermal Sensor High Trip Point | ||
| TSLT, 8, // Thermal Sensor Low Trip Point | ||
| THER, 8, // Thermal Source | ||
| CHRA, 16, // Charge Rate | ||
|
|
||
| Offset(0x72), | ||
| CHAR, 8, // Charger Temperature | ||
|
|
||
| Offset(0x7e), | ||
| OSFG, 8, // OS Flag [TODO: Confirm] | ||
| 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 | ||
|
|
||
| Offset(0x9d), | ||
| OPWE, 8, // OPM write to EC flag for UCSI | ||
|
|
||
| Offset(0xa0), | ||
| BSNL, 8, // Battery Serial Number Low byte | ||
| BSNH, 8, // Battery Serial Number High Byte | ||
| BMN1, 8, // Battery Manufactory Name 1 | ||
| BMN2, 8, // Battery Manufactory Name 2 | ||
| BMN3, 8, // Battery Manufactory Name 3 | ||
| BMN4, 8, // Battery Manufactory Name 4 | ||
| BMN5, 8, // Battery Manufactory Name 5 | ||
| BMN6, 8, // Battery Manufactory Name 6 | ||
| BMN7, 8, // Battery Manufactory Name 7 | ||
| BMN8, 8, // Battery Manufactory Name 8 | ||
| BMN9, 8, // Battery Manufactory Name 9 | ||
| BMNA, 8, // Battery Manufactory Name 10 | ||
| BMNB, 8, // Battery Manufactory Name 11 | ||
| BMNC, 8, // Battery Manufactory Name 12 | ||
| BDN1, 8, // Battery Device Name 1 | ||
| BDN2, 8, // Battery Device Name 2 | ||
| BDN3, 8, // Battery Device Name 3 | ||
| BDN4, 8, // Battery Device Name 4 | ||
| BDN5, 8, // Battery Device Name 5 | ||
| BDN6, 8, // Battery Device Name 6 | ||
| BDN7, 8, // Battery Device Name 7 | ||
| BDN8, 8, // Battery Device Name 8 | ||
| BDN9, 8, // Battery Device Name 9 | ||
| BDNA, 8, // Battery Device Name 10 | ||
| BDNB, 8, // Battery Device Name 11 | ||
| BDNC, 8, // Battery Device Name 12 | ||
| BCT1, 8, // Battery Chemistry Type 1 | ||
| BCT2, 8, // Battery Chemistry Type 2 | ||
| BCT3, 8, // Battery Chemistry Type 3 | ||
| BCT4, 8, // Battery Chemistry Type 4 | ||
| BCT5, 8, // Battery Chemistry Type 5 | ||
| BCT6, 8, // Battery Chemistry Type 6 | ||
|
|
||
| Offset(0xc0), | ||
| 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(0xd0), | ||
| 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(0xe0), | ||
| 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 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /* 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 (_Q09, 0, NotSerialized) // Event: Backlight Brightness Down | ||
| { | ||
| ^^^^HIDD.HPEM (20) | ||
| } | ||
|
|
||
| Method (_Q10, 0, NotSerialized) // Event: Backlight Brightness Up | ||
| { | ||
| ^^^^HIDD.HPEM (19) | ||
| } | ||
|
|
||
| Method (_Q08, 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 (_Q54, 0, NotSerialized) // Event: Power Button Press | ||
| { | ||
| Printf ("EC: PWRBTN") | ||
| } | ||
|
|
||
| Method (_Q02, 0, NotSerialized) // Event: Turn off Backlight | ||
| { | ||
| Printf ("EC: Backlight off") | ||
| } | ||
|
|
||
| Method (_Q79, 0, NotSerialized) // Event: USB Type-C | ||
| { | ||
| Printf ("EC: USB Type-C") | ||
| UCEV() | ||
| } | ||
|
|
||
| Method (_Q60, 0, NotSerialized) // Event: Trackpad Enable | ||
| { | ||
| Printf ("EC: Trackpad Enable") | ||
| SPC0 (0xD0C80600, 0x40800102) | ||
| } | ||
|
|
||
| Method (_Q61, 0, NotSerialized) // Event: Trackpad Disable | ||
| { | ||
| Printf ("EC: Trackpad Disable") | ||
| SPC0 (0xD0C80600, 0x40800200) | ||
| } |