starlabs: drop CMOS option tables
Remove CMOS option tables and defaults from Star Labs boards now that EC state is persisted through EFI variable store options. Drop remaining Merlin EC CMOS plumbing (RTC reads and ACPI fields) and read settings only via the option backend. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I3cc7f6240adc4b396912d566c7de176d4d2cb92b Reviewed-on: https://review.coreboot.org/c/coreboot/+/91305 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
9dac2b9e53
commit
cfbf8f3953
19 changed files with 32 additions and 545 deletions
|
|
@ -1,17 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
OperationRegion (CMS2, SystemIO, 0x72, 0x2)
|
||||
Field (CMS2, ByteAcc, NoLock, Preserve)
|
||||
{
|
||||
IND2, 8,
|
||||
DAT2, 8,
|
||||
}
|
||||
|
||||
IndexField (IND2, DAT2, ByteAcc, NoLock, Preserve)
|
||||
{
|
||||
Offset (0x80),
|
||||
FLKC, 8, // Function Lock State
|
||||
TPLC, 8, // Trackpad State
|
||||
KLBC, 8, // Keyboard Backlight Brightness
|
||||
KLSC, 8, // Keyboard Backlight State
|
||||
}
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
Scope (\_SB.PCI0.LPCB)
|
||||
{
|
||||
#include "cmos.asl"
|
||||
|
||||
Device (EC)
|
||||
{
|
||||
Name (_HID, EisaId ("PNP0C09"))
|
||||
|
|
|
|||
|
|
@ -69,66 +69,6 @@ Method (RPTS, 1, Serialized)
|
|||
EOSV (EOFL, \_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.FLKE)))
|
||||
EOSV (EOKS, \_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.KLSE)))
|
||||
EOSV (EOKB, \_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.KLBE)))
|
||||
#else
|
||||
/* Store current EC settings in CMOS */
|
||||
Switch (ToInteger (\_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.TPLE))))
|
||||
{
|
||||
// 0x00 == Enabled == 0x00
|
||||
// 0x11 == Re-enabled == 0x00
|
||||
// 0x22 == Disabled == 0x01
|
||||
Case (0x00)
|
||||
{
|
||||
Store (0x00, \_SB.PCI0.LPCB.TPLC)
|
||||
}
|
||||
Case (0x11)
|
||||
{
|
||||
Store (0x00, \_SB.PCI0.LPCB.TPLC)
|
||||
}
|
||||
Case (0x22)
|
||||
{
|
||||
Store (0x01, \_SB.PCI0.LPCB.TPLC)
|
||||
}
|
||||
}
|
||||
|
||||
Store (\_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.FLKE)), \_SB.PCI0.LPCB.FLKC)
|
||||
|
||||
Switch (ToInteger (\_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.KLSE))))
|
||||
{
|
||||
// 0x00 == Disabled == 0x00
|
||||
// 0xdd == Enabled == 0x01
|
||||
Case (0x00)
|
||||
{
|
||||
Store (0x00, \_SB.PCI0.LPCB.KLSC)
|
||||
}
|
||||
Case (0xdd)
|
||||
{
|
||||
Store (0x01, \_SB.PCI0.LPCB.KLSC)
|
||||
}
|
||||
}
|
||||
|
||||
Switch (ToInteger (\_SB.PCI0.LPCB.EC.ECRD (RefOf (\_SB.PCI0.LPCB.EC.KLBE))))
|
||||
{
|
||||
// 0xdd == On == 0x00
|
||||
// 0xcc == Off == 0x01
|
||||
// 0xbb == Low == 0x02
|
||||
// 0xaa == High == 0x03
|
||||
Case (0xdd)
|
||||
{
|
||||
Store (0x00, \_SB.PCI0.LPCB.KLBC)
|
||||
}
|
||||
Case (0xcc)
|
||||
{
|
||||
Store (0x01, \_SB.PCI0.LPCB.KLBC)
|
||||
}
|
||||
Case (0xbb)
|
||||
{
|
||||
Store (0x02, \_SB.PCI0.LPCB.KLBC)
|
||||
}
|
||||
Case (0xaa)
|
||||
{
|
||||
Store (0x03, \_SB.PCI0.LPCB.KLBC)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -192,62 +132,6 @@ Method (RWAK, 1, Serialized)
|
|||
\_SB.PCI0.LPCB.EC.ECWR (0xaa, RefOf(\_SB.PCI0.LPCB.EC.KLBE))
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Restore EC settings from CMOS */
|
||||
Switch (ToInteger (\_SB.PCI0.LPCB.TPLC))
|
||||
{
|
||||
// 0x00 == Enabled == 0x00
|
||||
// 0x00 == Re-enabled == 0x11
|
||||
// 0x01 == Disabled == 0x22
|
||||
Case (0x00)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0x00, RefOf(\_SB.PCI0.LPCB.EC.TPLE))
|
||||
}
|
||||
Case (0x01)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0x22, RefOf(\_SB.PCI0.LPCB.EC.TPLE))
|
||||
}
|
||||
}
|
||||
|
||||
\_SB.PCI0.LPCB.EC.ECWR (\_SB.PCI0.LPCB.FLKC, RefOf(\_SB.PCI0.LPCB.EC.FLKE))
|
||||
|
||||
Switch (ToInteger (\_SB.PCI0.LPCB.KLSC))
|
||||
{
|
||||
// 0x00 == Disabled == 0x00
|
||||
// 0x01 == Enabled == 0xdd
|
||||
Case (0x00)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0x00, RefOf(\_SB.PCI0.LPCB.EC.KLSE))
|
||||
}
|
||||
Case (0x01)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0xdd, RefOf(\_SB.PCI0.LPCB.EC.KLSE))
|
||||
}
|
||||
}
|
||||
|
||||
Switch (ToInteger (\_SB.PCI0.LPCB.KLBC))
|
||||
{
|
||||
// 0x00 == On == 0xdd
|
||||
// 0x01 == Off == 0xcc
|
||||
// 0x02 == Low == 0xbb
|
||||
// 0x03 == High == 0xaa
|
||||
Case (0x00)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0xdd, RefOf(\_SB.PCI0.LPCB.EC.KLBE))
|
||||
}
|
||||
Case (0x01)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0xcc, RefOf(\_SB.PCI0.LPCB.EC.KLBE))
|
||||
}
|
||||
Case (0x02)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0xbb, RefOf(\_SB.PCI0.LPCB.EC.KLBE))
|
||||
}
|
||||
Case (0x03)
|
||||
{
|
||||
\_SB.PCI0.LPCB.EC.ECWR (0xaa, RefOf(\_SB.PCI0.LPCB.EC.KLBE))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Return (Arg0)
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@
|
|||
#include <device/pnp.h>
|
||||
#include <ec/acpi/ec.h>
|
||||
#include <option.h>
|
||||
#include <pc80/mc146818rtc.h>
|
||||
#include <halt.h>
|
||||
|
||||
#include "ecdefs.h"
|
||||
#include "option_table.h"
|
||||
#include "ec.h"
|
||||
|
||||
#define ITE_IT5570 0x5570
|
||||
|
|
@ -20,40 +18,9 @@ uint16_t ec_get_version(void)
|
|||
return (ec_read(ECRAM_MAJOR_VERSION) << 8) | ec_read(ECRAM_MINOR_VERSION);
|
||||
}
|
||||
|
||||
static uint8_t get_cmos_value(uint32_t bit, uint32_t length)
|
||||
static uint8_t get_ec_value_from_option(const char *name, uint8_t fallback, const uint8_t *lut,
|
||||
size_t lut_size)
|
||||
{
|
||||
uint32_t byte, byte_bit;
|
||||
uint8_t uchar;
|
||||
|
||||
byte = bit / 8; // find the byte where the data starts
|
||||
byte_bit = bit % 8; // find the bit in the byte where the data starts
|
||||
|
||||
uchar = cmos_read(byte); // load the byte
|
||||
uchar >>= byte_bit; // shift the bits to byte align
|
||||
// clear unspecified bits
|
||||
return uchar & ((1U << length) - 1);
|
||||
}
|
||||
|
||||
static uint8_t get_ec_value_from_option(const char *name, uint32_t fallback, const uint8_t *lut,
|
||||
size_t lut_size, uint32_t cmos_start_bit,
|
||||
uint32_t cmos_length)
|
||||
{
|
||||
/*
|
||||
* CMOS-backed EC options store an index (see cmos.layout and ACPI
|
||||
* RPTS/RWAK mappings), while the option backend stores the EC's raw
|
||||
* values (e.g. 0xaa/0xbb/0xdd).
|
||||
*/
|
||||
if (cmos_start_bit != UINT_MAX) {
|
||||
unsigned int index = get_cmos_value(cmos_start_bit, cmos_length);
|
||||
|
||||
if (index >= lut_size)
|
||||
index = fallback;
|
||||
if (index >= lut_size)
|
||||
index = 0;
|
||||
|
||||
return lut[index];
|
||||
}
|
||||
|
||||
const uint8_t value = get_uint_option(name, fallback);
|
||||
|
||||
/* Check if the value exists in the LUT array */
|
||||
|
|
@ -94,7 +61,7 @@ static void merlin_init(struct device *dev)
|
|||
}
|
||||
|
||||
/*
|
||||
* Restore settings from CMOS into EC RAM:
|
||||
* Restore settings from options into EC RAM:
|
||||
*
|
||||
* kbl_timeout
|
||||
* fn_ctrl_swap
|
||||
|
|
@ -122,7 +89,7 @@ static void merlin_init(struct device *dev)
|
|||
|
||||
ec_write(ECRAM_KBL_TIMEOUT,
|
||||
get_ec_value_from_option("kbl_timeout", SEC_30, kbl_timeout,
|
||||
ARRAY_SIZE(kbl_timeout), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(kbl_timeout)));
|
||||
|
||||
/*
|
||||
* Fn Ctrl Reverse
|
||||
|
|
@ -137,7 +104,7 @@ static void merlin_init(struct device *dev)
|
|||
|
||||
ec_write(ECRAM_FN_CTRL_REVERSE,
|
||||
get_ec_value_from_option("fn_ctrl_swap", FN_CTRL, fn_ctrl_swap,
|
||||
ARRAY_SIZE(fn_ctrl_swap), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(fn_ctrl_swap)));
|
||||
|
||||
/*
|
||||
* Maximum Charge Level
|
||||
|
|
@ -153,7 +120,7 @@ static void merlin_init(struct device *dev)
|
|||
if (CONFIG(EC_STARLABS_MAX_CHARGE))
|
||||
ec_write(ECRAM_MAX_CHARGE,
|
||||
get_ec_value_from_option("max_charge", CHARGE_100, max_charge,
|
||||
ARRAY_SIZE(max_charge), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(max_charge)));
|
||||
|
||||
/*
|
||||
* Fan Mode
|
||||
|
|
@ -169,7 +136,7 @@ static void merlin_init(struct device *dev)
|
|||
if (CONFIG(EC_STARLABS_FAN))
|
||||
ec_write(ECRAM_FAN_MODE,
|
||||
get_ec_value_from_option("fan_mode", FAN_NORMAL, fan_mode,
|
||||
ARRAY_SIZE(fan_mode), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(fan_mode)));
|
||||
|
||||
/*
|
||||
* Function Lock
|
||||
|
|
@ -180,15 +147,11 @@ static void merlin_init(struct device *dev)
|
|||
* Default: Locked
|
||||
*
|
||||
*/
|
||||
#ifdef CMOS_VLEN_fn_lock_state
|
||||
const uint8_t fn_lock_state[] = {UNLOCKED, LOCKED};
|
||||
|
||||
ec_write(ECRAM_FN_LOCK_STATE,
|
||||
get_ec_value_from_option(
|
||||
"fn_lock_state", UNLOCKED, fn_lock_state, ARRAY_SIZE(fn_lock_state),
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VSTART_fn_lock_state : UINT_MAX,
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VLEN_fn_lock_state : UINT_MAX));
|
||||
#endif
|
||||
"fn_lock_state", UNLOCKED, fn_lock_state, ARRAY_SIZE(fn_lock_state)));
|
||||
|
||||
/*
|
||||
* Trackpad State
|
||||
|
|
@ -199,16 +162,12 @@ static void merlin_init(struct device *dev)
|
|||
* Default: Enabled
|
||||
*
|
||||
*/
|
||||
#ifdef CMOS_VSTART_trackpad_state
|
||||
const uint8_t trackpad_state[] = {TRACKPAD_ENABLED, TRACKPAD_DISABLED};
|
||||
|
||||
ec_write(ECRAM_TRACKPAD_STATE,
|
||||
get_ec_value_from_option(
|
||||
"trackpad_state", TRACKPAD_ENABLED, trackpad_state,
|
||||
ARRAY_SIZE(trackpad_state),
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VSTART_trackpad_state : UINT_MAX,
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VLEN_trackpad_state : UINT_MAX));
|
||||
#endif
|
||||
ARRAY_SIZE(trackpad_state)));
|
||||
|
||||
/*
|
||||
* Keyboard Backlight Brightness
|
||||
|
|
@ -219,19 +178,16 @@ static void merlin_init(struct device *dev)
|
|||
* Default: Low
|
||||
*
|
||||
*/
|
||||
#ifdef CMOS_VSTART_kbl_brightness
|
||||
const uint8_t kbl_brightness[] = {KBL_ON, KBL_OFF, KBL_LOW, KBL_HIGH};
|
||||
|
||||
const uint8_t kbl_brightness_fallback =
|
||||
CONFIG(EC_STARLABS_KBL_LEVELS) ? KBL_LOW : KBL_ON;
|
||||
|
||||
ec_write(ECRAM_KBL_BRIGHTNESS,
|
||||
get_ec_value_from_option(
|
||||
"kbl_brightness",
|
||||
CONFIG(USE_OPTION_TABLE) ?
|
||||
(CONFIG(EC_STARLABS_KBL_LEVELS) ? 2 : 0) :
|
||||
(CONFIG(EC_STARLABS_KBL_LEVELS) ? KBL_LOW : KBL_ON),
|
||||
kbl_brightness, ARRAY_SIZE(kbl_brightness),
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VSTART_kbl_brightness : UINT_MAX,
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VLEN_kbl_brightness : UINT_MAX));
|
||||
#endif
|
||||
kbl_brightness_fallback,
|
||||
kbl_brightness, ARRAY_SIZE(kbl_brightness)));
|
||||
|
||||
/*
|
||||
* Keyboard Backlight State
|
||||
|
|
@ -261,8 +217,7 @@ static void merlin_init(struct device *dev)
|
|||
if (CONFIG(EC_STARLABS_CHARGING_SPEED))
|
||||
ec_write(ECRAM_CHARGING_SPEED,
|
||||
get_ec_value_from_option("charging_speed", SPEED_0_5C, charging_speed,
|
||||
ARRAY_SIZE(charging_speed), UINT_MAX,
|
||||
UINT_MAX));
|
||||
ARRAY_SIZE(charging_speed)));
|
||||
|
||||
/*
|
||||
* Lid Switch
|
||||
|
|
@ -278,7 +233,7 @@ static void merlin_init(struct device *dev)
|
|||
if (CONFIG(EC_STARLABS_LID_SWITCH))
|
||||
ec_write(ECRAM_LID_SWITCH,
|
||||
get_ec_value_from_option("lid_switch", SWITCH_NORMAL, lid_switch,
|
||||
ARRAY_SIZE(lid_switch), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(lid_switch)));
|
||||
|
||||
/*
|
||||
* Power LED Brightness
|
||||
|
|
@ -294,8 +249,7 @@ static void merlin_init(struct device *dev)
|
|||
if (CONFIG(EC_STARLABS_POWER_LED))
|
||||
ec_write(ECRAM_POWER_LED,
|
||||
get_ec_value_from_option("power_led", LED_NORMAL, led_brightness,
|
||||
ARRAY_SIZE(led_brightness), UINT_MAX,
|
||||
UINT_MAX));
|
||||
ARRAY_SIZE(led_brightness)));
|
||||
|
||||
/*
|
||||
* Charge LED Brightness
|
||||
|
|
@ -310,8 +264,7 @@ static void merlin_init(struct device *dev)
|
|||
if (CONFIG(EC_STARLABS_CHARGE_LED))
|
||||
ec_write(ECRAM_CHARGE_LED,
|
||||
get_ec_value_from_option("charge_led", LED_NORMAL, led_brightness,
|
||||
ARRAY_SIZE(led_brightness), UINT_MAX,
|
||||
UINT_MAX));
|
||||
ARRAY_SIZE(led_brightness)));
|
||||
}
|
||||
|
||||
static struct device_operations ops = {
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@
|
|||
#include <device/pnp.h>
|
||||
#include <ec/acpi/ec.h>
|
||||
#include <option.h>
|
||||
#include <pc80/mc146818rtc.h>
|
||||
#include <halt.h>
|
||||
|
||||
#include "ecdefs.h"
|
||||
#include "option_table.h"
|
||||
#include "ec.h"
|
||||
|
||||
uint16_t ec_get_version(void)
|
||||
|
|
@ -17,40 +15,9 @@ uint16_t ec_get_version(void)
|
|||
return (ec_read(ECRAM_MAJOR_VERSION) << 8) | ec_read(ECRAM_MINOR_VERSION);
|
||||
}
|
||||
|
||||
static uint8_t get_cmos_value(uint32_t bit, uint32_t length)
|
||||
static uint8_t get_ec_value_from_option(const char *name, uint8_t fallback, const uint8_t *lut,
|
||||
size_t lut_size)
|
||||
{
|
||||
uint32_t byte, byte_bit;
|
||||
uint8_t uchar;
|
||||
|
||||
byte = bit / 8; // find the byte where the data starts
|
||||
byte_bit = bit % 8; // find the bit in the byte where the data starts
|
||||
|
||||
uchar = cmos_read(byte); // load the byte
|
||||
uchar >>= byte_bit; // shift the bits to byte align
|
||||
// clear unspecified bits
|
||||
return uchar & ((1U << length) - 1);
|
||||
}
|
||||
|
||||
static uint8_t get_ec_value_from_option(const char *name, uint32_t fallback, const uint8_t *lut,
|
||||
size_t lut_size, uint32_t cmos_start_bit,
|
||||
uint32_t cmos_length)
|
||||
{
|
||||
/*
|
||||
* CMOS-backed EC options store an index (see cmos.layout and ACPI
|
||||
* RPTS/RWAK mappings), while the option backend stores the EC's raw
|
||||
* values (e.g. 0xaa/0xbb/0xdd).
|
||||
*/
|
||||
if (cmos_start_bit != UINT_MAX) {
|
||||
unsigned int index = get_cmos_value(cmos_start_bit, cmos_length);
|
||||
|
||||
if (index >= lut_size)
|
||||
index = fallback;
|
||||
if (index >= lut_size)
|
||||
index = 0;
|
||||
|
||||
return lut[index];
|
||||
}
|
||||
|
||||
const uint8_t value = get_uint_option(name, fallback);
|
||||
|
||||
/* Check if the value exists in the LUT array */
|
||||
|
|
@ -92,7 +59,7 @@ static void merlin_init(struct device *dev)
|
|||
}
|
||||
|
||||
/*
|
||||
* Restore settings from CMOS into EC RAM:
|
||||
* Restore settings from options into EC RAM:
|
||||
*
|
||||
* kbl_timeout
|
||||
* fn_ctrl_swap
|
||||
|
|
@ -117,7 +84,7 @@ static void merlin_init(struct device *dev)
|
|||
|
||||
ec_write(ECRAM_KBL_TIMEOUT,
|
||||
get_ec_value_from_option("kbl_timeout", 0, kbl_timeout,
|
||||
ARRAY_SIZE(kbl_timeout), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(kbl_timeout)));
|
||||
|
||||
/*
|
||||
* Fn Ctrl Reverse
|
||||
|
|
@ -132,7 +99,7 @@ static void merlin_init(struct device *dev)
|
|||
|
||||
ec_write(ECRAM_FN_CTRL_REVERSE,
|
||||
get_ec_value_from_option("fn_ctrl_swap", 0, fn_ctrl_swap,
|
||||
ARRAY_SIZE(fn_ctrl_swap), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(fn_ctrl_swap)));
|
||||
|
||||
/*
|
||||
* Maximum Charge Level
|
||||
|
|
@ -148,7 +115,7 @@ static void merlin_init(struct device *dev)
|
|||
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), UINT_MAX, UINT_MAX));
|
||||
ARRAY_SIZE(max_charge)));
|
||||
|
||||
/*
|
||||
* Fan Mode
|
||||
|
|
@ -163,8 +130,7 @@ static void merlin_init(struct device *dev)
|
|||
|
||||
if (CONFIG(EC_STARLABS_FAN))
|
||||
ec_write(ECRAM_FAN_MODE,
|
||||
get_ec_value_from_option("fan_mode", 0, fan_mode, ARRAY_SIZE(fan_mode),
|
||||
UINT_MAX, UINT_MAX));
|
||||
get_ec_value_from_option("fan_mode", 0, fan_mode, ARRAY_SIZE(fan_mode)));
|
||||
|
||||
/*
|
||||
* Function Lock
|
||||
|
|
@ -175,15 +141,11 @@ static void merlin_init(struct device *dev)
|
|||
* Default: Locked
|
||||
*
|
||||
*/
|
||||
#ifdef CMOS_VLEN_fn_lock_state
|
||||
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),
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VSTART_fn_lock_state : UINT_MAX,
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VLEN_fn_lock_state : UINT_MAX));
|
||||
#endif
|
||||
"fn_lock_state", 1, fn_lock_state, ARRAY_SIZE(fn_lock_state)));
|
||||
|
||||
/*
|
||||
* Trackpad State
|
||||
|
|
@ -194,15 +156,11 @@ static void merlin_init(struct device *dev)
|
|||
* Default: Enabled
|
||||
*
|
||||
*/
|
||||
#ifdef CMOS_VSTART_trackpad_state
|
||||
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),
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VSTART_trackpad_state : UINT_MAX,
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VLEN_trackpad_state : UINT_MAX));
|
||||
#endif
|
||||
"trackpad_state", 0, trackpad_state, ARRAY_SIZE(trackpad_state)));
|
||||
|
||||
/*
|
||||
* Keyboard Backlight Brightness
|
||||
|
|
@ -213,20 +171,16 @@ static void merlin_init(struct device *dev)
|
|||
* Default: Low
|
||||
*
|
||||
*/
|
||||
#ifdef CMOS_VSTART_kbl_brightness
|
||||
const uint8_t kbl_brightness[] = {KBL_ON, KBL_OFF, KBL_LOW, KBL_HIGH};
|
||||
|
||||
const uint8_t kbl_brightness_fallback =
|
||||
CONFIG(EC_STARLABS_KBL_LEVELS) ? KBL_LOW : KBL_ON;
|
||||
|
||||
ec_write(ECRAM_KBL_BRIGHTNESS,
|
||||
get_ec_value_from_option(
|
||||
"kbl_brightness",
|
||||
CONFIG(USE_OPTION_TABLE) ?
|
||||
(CONFIG(EC_STARLABS_KBL_LEVELS) ? 2 : 0) :
|
||||
(CONFIG(EC_STARLABS_KBL_LEVELS) ? KBL_LOW : KBL_ON),
|
||||
kbl_brightness, ARRAY_SIZE(kbl_brightness),
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VSTART_kbl_brightness : UINT_MAX,
|
||||
CONFIG(USE_OPTION_TABLE) ? CMOS_VLEN_kbl_brightness : UINT_MAX));
|
||||
|
||||
#endif
|
||||
kbl_brightness_fallback,
|
||||
kbl_brightness, ARRAY_SIZE(kbl_brightness)));
|
||||
|
||||
/*
|
||||
* Keyboard Backlight State
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ config BOARD_STARLABS_ADL_SERIES
|
|||
select EC_STARLABS_MERLIN
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_OPTION_TABLE
|
||||
select INTEL_GMA_HAVE_VBT
|
||||
select INTEL_LPSS_UART_FOR_CONSOLE
|
||||
select NO_UART_ON_SUPERIO
|
||||
|
|
@ -27,7 +26,6 @@ config BOARD_STARLABS_ADL_HORIZON
|
|||
select BOARD_STARLABS_ADL_SERIES
|
||||
select DRIVERS_GFX_GENERIC
|
||||
select DRIVERS_I2C_HID
|
||||
select HAVE_CMOS_DEFAULT
|
||||
select HAVE_HDA_DMIC
|
||||
select HAVE_SPD_IN_CBFS
|
||||
select MAINBOARD_HAS_TPM2
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
# Functions
|
||||
fn_lock_state=0x1
|
||||
trackpad_state=0x1
|
||||
kbl_brightness=0x0
|
||||
kbl_state=0x1
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
entries
|
||||
|
||||
# Bank: 1
|
||||
# -----------------------------------------------------------------
|
||||
0 120 r 0 reserved_memory
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# coreboot config options: ramtop
|
||||
304 80 h 0 ramtop
|
||||
|
||||
# RTC_BOOT_BYTE (coreboot hardcoded)
|
||||
388 4 h 0 reboot_counter
|
||||
|
||||
# coreboot config options: cpu
|
||||
#400 8 r 0 reserved for century byte
|
||||
|
||||
# coreboot config options: check sums
|
||||
984 16 h 0 check_sum
|
||||
|
||||
# Bank: 2
|
||||
# embedded controller settings (outside the checksummed area)
|
||||
1024 8 h 1 fn_lock_state
|
||||
1032 8 h 1 trackpad_state
|
||||
1040 8 h 2 kbl_brightness
|
||||
1048 8 h 1 kbl_state
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
|
||||
2 0 Off
|
||||
2 1 Low
|
||||
2 2 High
|
||||
2 3 On
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
entries
|
||||
|
||||
# Bank: 1
|
||||
# -----------------------------------------------------------------
|
||||
0 120 r 0 reserved_memory
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# coreboot config options: ramtop
|
||||
304 80 h 0 ramtop
|
||||
|
||||
# RTC_BOOT_BYTE (coreboot hardcoded)
|
||||
388 4 h 0 reboot_counter
|
||||
|
||||
# coreboot config options: cpu
|
||||
#400 8 r 0 reserved for century byte
|
||||
|
||||
# coreboot config options: check sums
|
||||
984 16 h 0 check_sum
|
||||
|
||||
# Bank: 2
|
||||
# embedded controller settings (outside the checksummed area)
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
entries
|
||||
|
||||
# Bank: 1
|
||||
# -----------------------------------------------------------------
|
||||
0 120 r 0 reserved_memory
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# coreboot config options: ramtop
|
||||
304 80 h 0 ramtop
|
||||
|
||||
# RTC_BOOT_BYTE (coreboot hardcoded)
|
||||
388 4 h 0 reboot_counter
|
||||
|
||||
# coreboot config options: cpu
|
||||
#400 8 r 0 reserved for century byte
|
||||
|
||||
# coreboot config options: check sums
|
||||
984 16 h 0 check_sum
|
||||
|
||||
# Bank: 2
|
||||
# embedded controller settings (outside the checksummed area)
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
|
|
@ -9,8 +9,6 @@ config BOARD_STARLABS_LITE_SERIES
|
|||
select DRIVERS_I2C_HID
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
select HAVE_OPTION_TABLE
|
||||
select HAVE_INTEL_PTT
|
||||
select INTEL_GMA_HAVE_VBT
|
||||
select INTEL_LPSS_UART_FOR_CONSOLE
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
# Functions
|
||||
fn_lock_state=0x1
|
||||
trackpad_state=0x1
|
||||
kbl_brightness=0x0
|
||||
kbl_state=0x1
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
entries
|
||||
|
||||
# Bank: 1
|
||||
# -----------------------------------------------------------------
|
||||
0 120 r 0 reserved_memory
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# RTC_BOOT_BYTE (coreboot hardcoded)
|
||||
388 4 h 0 reboot_counter
|
||||
|
||||
# coreboot config options: cpu
|
||||
#400 8 r 0 reserved for century byte
|
||||
|
||||
# coreboot config options: check sums
|
||||
984 16 h 0 check_sum
|
||||
|
||||
# Bank: 2
|
||||
# embedded controller settings (outside the checksummed area)
|
||||
1024 8 h 1 fn_lock_state
|
||||
1032 8 h 1 trackpad_state
|
||||
1040 8 h 2 kbl_brightness
|
||||
1048 8 h 1 kbl_state
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
|
||||
2 0 Off
|
||||
2 1 Low
|
||||
2 2 High
|
||||
2 3 On
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
|
|
@ -10,9 +10,7 @@ config BOARD_STARLABS_STARBOOK_SERIES
|
|||
select EC_STARLABS_FAN
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
select HAVE_HDA_DMIC
|
||||
select HAVE_OPTION_TABLE
|
||||
select INTEL_GMA_HAVE_VBT
|
||||
select INTEL_LPSS_UART_FOR_CONSOLE
|
||||
select NO_UART_ON_SUPERIO
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
# Functions
|
||||
fn_lock_state=0x1
|
||||
trackpad_state=0x1
|
||||
kbl_brightness=0x0
|
||||
kbl_state=0x1
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
entries
|
||||
|
||||
# Bank: 1
|
||||
# -----------------------------------------------------------------
|
||||
0 120 r 0 reserved_memory
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# coreboot config options: ramtop
|
||||
304 80 h 0 ramtop
|
||||
|
||||
# RTC_BOOT_BYTE (coreboot hardcoded)
|
||||
388 4 h 0 reboot_counter
|
||||
|
||||
# coreboot config options: cpu
|
||||
#400 8 r 0 reserved for century byte
|
||||
|
||||
# coreboot config options: check sums
|
||||
984 16 h 0 check_sum
|
||||
|
||||
# Bank: 2
|
||||
# embedded controller settings (outside the checksummed area)
|
||||
1024 8 h 1 fn_lock_state
|
||||
1032 8 h 1 trackpad_state
|
||||
1040 8 h 2 kbl_brightness
|
||||
1048 8 h 1 kbl_state
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
|
||||
2 0 Off
|
||||
2 1 Low
|
||||
2 2 High
|
||||
2 3 On
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
|
|
@ -15,9 +15,7 @@ config BOARD_STARLABS_STARFIGHTER_SERIES
|
|||
select EC_STARLABS_MERLIN
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
select HAVE_HDA_DMIC
|
||||
select HAVE_OPTION_TABLE
|
||||
select HAVE_SPD_IN_CBFS
|
||||
select INTEL_GMA_HAVE_VBT
|
||||
select INTEL_LPSS_UART_FOR_CONSOLE
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
# Functions
|
||||
fn_lock_state=0x1
|
||||
trackpad_state=0x1
|
||||
kbl_brightness=0x0
|
||||
kbl_state=0x1
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
entries
|
||||
|
||||
# Bank: 1
|
||||
# -----------------------------------------------------------------
|
||||
0 120 r 0 reserved_memory
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# coreboot config options: ramtop
|
||||
304 80 h 0 ramtop
|
||||
|
||||
# RTC_BOOT_BYTE (coreboot hardcoded)
|
||||
388 4 h 0 reboot_counter
|
||||
|
||||
# coreboot config options: cpu
|
||||
#400 8 r 0 reserved for century byte
|
||||
|
||||
# coreboot config options: check sums
|
||||
984 16 h 0 check_sum
|
||||
|
||||
# Bank: 2
|
||||
# embedded controller settings (outside the checksummed area)
|
||||
1024 8 h 1 fn_lock_state
|
||||
1032 8 h 1 trackpad_state
|
||||
1040 8 h 2 kbl_brightness
|
||||
1048 8 h 1 kbl_state
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
|
||||
2 0 Off
|
||||
2 1 Low
|
||||
2 2 High
|
||||
2 3 On
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
Loading…
Add table
Add a link
Reference in a new issue