diff options
author | Johanna Schander <coreboot@mimoja.de> | 2019-07-22 09:24:14 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-09-24 10:35:31 +0000 |
commit | 431d0083a86df5e08c63e621a587e182b1af46f1 (patch) | |
tree | 5fd44b41a60df93b9551f2d4f723fee02bb89efc /src/mainboard/razer/blade_stealth_kbl/acpi | |
parent | b458a4f745c8d7cf44f1d613cab0bef3b7f23a3a (diff) | |
download | coreboot-431d0083a86df5e08c63e621a587e182b1af46f1.tar.xz |
Add Razer Blade Stealth (2016) H2U
The Razer Blade Stealth H2U is a KabyLake System using:
- Intel KBL 7500U
- ITE8528E SuperIO
- Intel 600P Series NVMe SSD
- Either four MT52L1G32D4PG (16GB) or MT52L512MB32D4PG (8GB)
of soldered memory in dualchannel mode
- (Optional) Touchscreen
- HDMI 2.0a via DP-1: Paradetech PS175
- AlpineRidge Thunderbolt 3 controller
- TPS65982 USB-PD power switch / multiplexer
Even though it has a 16MB chip equipped (W25Q128.V) only the first 8MB
are used and mapped via IFD. The rest is left empty (0xFF). The flash is
not secured in any way and can be read via flashrom. It should be the
source for this port's IFD and ME blobs.
Working:
- USB-A Ports left and right
- Speakers
- Touchscreen (USB)
- Onboard Keyboard in Linux
- NVMe SSD
- SeaBIOS, Tianocore and Grub Payloads
- Webcam
- Powersaving Modes
- Battery state and LID switch, sometimes slow to update.
- Touchpad (I2C-HID)
- Headphones
Not part of this commit:
- Thunderbolt / USB-C (Requires advanced EC signaling)
- Full HDMI support (Currently requires plugged connection at boot)
Change-Id: I7ede881d631e1863f07f5130f84bc3b8ca61a350
Signed-off-by: Johanna Schander <coreboot@mimoja.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34475
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Diffstat (limited to 'src/mainboard/razer/blade_stealth_kbl/acpi')
5 files changed, 306 insertions, 0 deletions
diff --git a/src/mainboard/razer/blade_stealth_kbl/acpi/ac.asl b/src/mainboard/razer/blade_stealth_kbl/acpi/ac.asl new file mode 100644 index 0000000000..813c008e68 --- /dev/null +++ b/src/mainboard/razer/blade_stealth_kbl/acpi/ac.asl @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Johanna Schander <coreboot@mimoja.de> + * + * 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 (AC) +{ + Name (_HID, "ACPI0003") + Name (_PCL, Package () { \_SB }) + + Method (_PSR) + { + Return (ACEX) + } + + Method (_STA) + { + Return (0x0F) + } +} diff --git a/src/mainboard/razer/blade_stealth_kbl/acpi/battery.asl b/src/mainboard/razer/blade_stealth_kbl/acpi/battery.asl new file mode 100644 index 0000000000..a89496d69e --- /dev/null +++ b/src/mainboard/razer/blade_stealth_kbl/acpi/battery.asl @@ -0,0 +1,119 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Johanna Schander <coreboot@mimoja.de> + * + * 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 (BAT) +{ + Name (_HID, EisaId ("PNP0C0A")) + Name (_UID, 1) + Name (_PCL, Package () { \_SB }) + + Name (BSTP, 0) + + Name (PBIF, Package () { + 0x00000001, /* 0x00: Power Unit: mAh */ + 0xFFFFFFFF, /* 0x01: Design Capacity */ + 0xFFFFFFFF, /* 0x02: Last Full Charge Capacity */ + 0x00000001, /* 0x03: Battery Technology: Rechargeable */ + 0xFFFFFFFF, /* 0x04: Design Voltage */ + 0x00000003, /* 0x05: Design Capacity of Warning */ + 0xFFFFFFFF, /* 0x06: Design Capacity of Low */ + 0x00000001, /* 0x07: Capacity Granularity 1 */ + 0x00000001, /* 0x08: Capacity Granularity 2 */ + "Razer Blade Stealth", + "SERIAL", + "LiIon", + "Razer" + }) + + + Name (PBST, Package () { + 0x00000000, /* 0x00: Battery State */ + 0xFFFFFFFF, /* 0x01: Battery Present Rate */ + 0xFFFFFFFF, /* 0x02: Battery Remaining Capacity */ + 0xFFFFFFFF, /* 0x03: Battery Present Voltage */ + }) + + Method (_STA, 0, Serialized) + { + Return (0x1F) + } + + Method (_BIF, 0, Serialized) + { + /* Last Full Charge Capacity */ + Store (BFCP, Index (PBIF, 2)) + + /* Design Voltage */ + Store (BDVT, Index (PBIF, 4)) + + /* Design Capacity */ + Store (BDCP, Index (PBIF, 1)) + + /* Design Capacity of Warning */ + Store (BDCP / 0x32, Index (PBIF, 5)) + + /* Design Capacity of Low */ + Store (BDCP / 0x64, Index (PBIF, 6)) + + Store (ToString (BSER, Ones), Index (PBIF, 0x0A)) + + Return (PBIF) + } + + Method (_BST, 0, Serialized) + { + /* + * 0: BATTERY STATE + * + * bit 0 = discharging + * bit 1 = charging + * bit 2 = critical level + */ + + /* Check if AC is present */ + If (ACEX) { + /* Read battery status from EC */ + Store (BCST, Local0) + } Else { + /* Always discharging when on battery power */ + Store (0x01, Local0) + } + + Store (Local0, Index (PBST, 0)) + + /* Notify if battery state has changed since last time */ + If (LNotEqual (Local0, BSTP)) { + Store (Local0, BSTP) + Notify (BAT, 0x80) + } + + /* + * 1: BATTERY PRESENT RATE + */ + Store (BCRT, Index (PBST, 1)) + + /* + * 2: BATTERY REMAINING CAPACITY + */ + Store (BRCP, Index (PBST, 2)) + + /* + * 3: BATTERY PRESENT VOLTAGE + */ + Store (BCVT, Index (PBST, 3)) + + Return (PBST) + } +} diff --git a/src/mainboard/razer/blade_stealth_kbl/acpi/ec.asl b/src/mainboard/razer/blade_stealth_kbl/acpi/ec.asl new file mode 100644 index 0000000000..62a8622dc1 --- /dev/null +++ b/src/mainboard/razer/blade_stealth_kbl/acpi/ec.asl @@ -0,0 +1,105 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 Johanna Schander <coreboot@mimoja.de> + * + * 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, 0x50) // Copied over + + Name (_CRS, ResourceTemplate () { + IO (Decode16, 0x62, 0x62, 0, 1) + IO (Decode16, 0x66, 0x66, 0, 1) + }) + + Name (ACEX, 0) + + OperationRegion (ERAM, EmbeddedControl, 0x00, 0xFF) + Field (ERAM, ByteAcc, NoLock, Preserve) + { + Offset (0x1C), + ODP1, 8, + ODP2, 8, + Offset (0x56), + CPUT, 8, + CPU1, 8, + GPUT, 8, + ADPV, 16, + ADPC, 16, + FANC, 8, + Offset (0x60), + BSER, 256, // BAT Serial Number + Offset (0x90), + BIF0, 16, + BDCP, 16, // BAT Design Capacity + BFCP, 16, // BAT Full Capacity + BRCH, 16, // BAT Rechargable + BDVT, 16, // BAT Design Voltage + BIF5, 16, + BIF6, 16, + BIF7, 16, + BIF8, 16, + BCST, 16, // BAT Current State + BCRT, 16, // BAT Current Rate + BRCP, 16, // BAT Remaining Capacity + BCVT, 16, // BAT Current Voltage + PWRS, 8, // Power State (?) + ECN0, 8, + Offset (0xB0), + SRNM, 16, + MFDA, 16, + PHMR, 8, + BLDA, 8, + Offset (0xE2), + LIDS, 8 // Lid state + } + + Method (_REG, 2, NotSerialized) + { + /* Initialize AC power state */ + Store (PWRS - 0x82, ACEX) + + /* Initialize LID switch state */ + Store (LIDS, \LIDS) + } + + + // Close ? + Method (_Q14, 0, NotSerialized) + { + Store (LIDS, \LIDS) + Notify (LID0, 0x80) + } + + //Open + Method (_Q15, 0, NotSerialized) + { + Store (LIDS, \LIDS) + Notify (LID0, 0x80) + } + + + // AC plugged + Method (_Q13, 0, NotSerialized) + { + Store (PWRS - 0x82, ACEX) + Notify (BAT, 0x80) // Status Change + Notify (BAT, 0x81) // Information Change + Notify (AC, 0x80) // Status Change + } + + #include "ac.asl" + #include "battery.asl" +} diff --git a/src/mainboard/razer/blade_stealth_kbl/acpi/mainboard.asl b/src/mainboard/razer/blade_stealth_kbl/acpi/mainboard.asl new file mode 100644 index 0000000000..6b8cb51380 --- /dev/null +++ b/src/mainboard/razer/blade_stealth_kbl/acpi/mainboard.asl @@ -0,0 +1,52 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2016 Google Inc. + * + * 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) +{ + Device (LID0) + { + Name (_HID, EisaId ("PNP0C0D")) + + Method (_LID) + { + if (\_SB.PCI0.LPCB.EC.LIDS > 1) + { + Return (One) + } + else + { + Return (Zero) + } + } + + Method (_STA) + { + Return (_LID) + } + } + + Device (PWRB) + { + Name (_HID, EisaId ("PNP0C0C")) + + Method (_STA) + { + Return (0xF) + } + + Name (_PRW, Package () { 27, 4 }) + } + +} diff --git a/src/mainboard/razer/blade_stealth_kbl/acpi/superio.asl b/src/mainboard/razer/blade_stealth_kbl/acpi/superio.asl new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/mainboard/razer/blade_stealth_kbl/acpi/superio.asl |