mb/clevo/l140cu: make use of the new clevo/it5570e ec driver
Hook up the new EC driver. Tested: - Fn hotkeys work (brightness, display, volume, tp toggle, ...) - Display lid - Sleep/wake - Camera (including Fn toggle) - Bluetooth (both CNVi and PCIe card) - Wi-Fi (both CNVi and PCIe card) - CMOS options Known issues: - Touchpad toggle needs OS setup; see CB:68791 - UCSI is not implemented; see CB:68791 Change-Id: I28ac401ada2945bb58fe862895458b10fed505fe Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/68795 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -20,6 +20,7 @@ config BOARD_CLEVO_CMLU_COMMON
|
|||||||
config BOARD_CLEVO_L140CU_BASE
|
config BOARD_CLEVO_L140CU_BASE
|
||||||
bool
|
bool
|
||||||
select BOARD_CLEVO_CMLU_COMMON
|
select BOARD_CLEVO_CMLU_COMMON
|
||||||
|
select EC_CLEVO_IT5570E
|
||||||
select HAVE_SPD_IN_CBFS
|
select HAVE_SPD_IN_CBFS
|
||||||
|
|
||||||
if BOARD_CLEVO_CMLU_COMMON
|
if BOARD_CLEVO_CMLU_COMMON
|
||||||
@@ -71,7 +72,7 @@ config SEABIOS_PS2_TIMEOUT
|
|||||||
depends on PAYLOAD_SEABIOS
|
depends on PAYLOAD_SEABIOS
|
||||||
default 500
|
default 500
|
||||||
|
|
||||||
config EC_SYSTEM76_EC_BAT_THRESHOLDS
|
config EC_CLEVO_IT5570E_MEM_BASE
|
||||||
default n if BOARD_CLEVO_L140CU_BASE
|
default 0xfe700000
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/acpi
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
@@ -9,6 +10,9 @@ romstage-y += variants/$(VARIANT_DIR)/romstage.c
|
|||||||
ramstage-y += ramstage.c
|
ramstage-y += ramstage.c
|
||||||
ramstage-y += variants/$(VARIANT_DIR)/gpio.c
|
ramstage-y += variants/$(VARIANT_DIR)/gpio.c
|
||||||
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
|
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
|
||||||
|
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c
|
||||||
ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads
|
ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads
|
||||||
|
|
||||||
|
smm-$(CONFIG_EC_CLEVO_IT5570E) += smihandler.c
|
||||||
|
|
||||||
subdirs-y += variants/$(VARIANT_DIR)
|
subdirs-y += variants/$(VARIANT_DIR)
|
||||||
|
@@ -1,9 +1,21 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <bootblock_common.h>
|
#include <bootblock_common.h>
|
||||||
|
#include <ec/clevo/it5570e/early_init.h>
|
||||||
|
#include <intelblocks/lpc_lib.h>
|
||||||
#include <variant/gpio.h>
|
#include <variant/gpio.h>
|
||||||
|
|
||||||
void bootblock_mainboard_early_init(void)
|
void bootblock_mainboard_early_init(void)
|
||||||
{
|
{
|
||||||
variant_configure_early_gpios();
|
variant_configure_early_gpios();
|
||||||
|
|
||||||
|
/* Open LGMR window for EC */
|
||||||
|
if (CONFIG(EC_CLEVO_IT5570E))
|
||||||
|
lpc_open_mmio_window(CONFIG_EC_CLEVO_IT5570E_MEM_BASE, 64 * KiB);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bootblock_mainboard_init(void)
|
||||||
|
{
|
||||||
|
if (CONFIG(EC_CLEVO_IT5570E))
|
||||||
|
ec_configure_kbled_booteffect();
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,14 @@
|
|||||||
boot_option=Fallback
|
boot_option=Fallback
|
||||||
debug_level=Debug
|
debug_level=Debug
|
||||||
power_on_after_fail=Disable
|
power_on_after_fail=Disable
|
||||||
|
|
||||||
|
# EC options
|
||||||
|
ac_fan_always_on=Disable
|
||||||
|
camera_boot_state=Keep
|
||||||
|
fn_win_swap=Disable
|
||||||
|
tp_toggle_mode=CtrlAltF9
|
||||||
|
flexicharger_on=Disable
|
||||||
|
flexicharger_start=95
|
||||||
|
flexicharger_stop=100
|
||||||
|
kbled_booteffect=Disable
|
||||||
|
kbled_timeout=15
|
||||||
|
@@ -23,6 +23,20 @@ entries
|
|||||||
# coreboot config options: southbridge
|
# coreboot config options: southbridge
|
||||||
410 2 e 7 power_on_after_fail
|
410 2 e 7 power_on_after_fail
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
# EC options
|
||||||
|
500 1 e 1 ac_fan_always_on
|
||||||
|
502 2 e 7 camera_boot_state
|
||||||
|
504 1 e 1 fn_win_swap
|
||||||
|
505 1 e 8 tp_toggle_mode
|
||||||
|
|
||||||
|
519 1 e 1 flexicharger_on
|
||||||
|
520 8 h 0 flexicharger_start
|
||||||
|
528 8 h 0 flexicharger_stop
|
||||||
|
|
||||||
|
543 1 e 1 kbled_booteffect
|
||||||
|
544 16 h 0 kbled_timeout
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# vboot nv area
|
# vboot nv area
|
||||||
800 128 r 0 vbnv
|
800 128 r 0 vbnv
|
||||||
@@ -54,6 +68,8 @@ enumerations
|
|||||||
7 0 Disable
|
7 0 Disable
|
||||||
7 1 Enable
|
7 1 Enable
|
||||||
7 2 Keep
|
7 2 Keep
|
||||||
|
8 0 CtrlAltF9
|
||||||
|
8 1 KeycodeF7F8
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
checksums
|
checksums
|
||||||
|
@@ -28,4 +28,9 @@ DefinitionBlock(
|
|||||||
{
|
{
|
||||||
#include <drivers/pc80/pc/ps2_controller.asl>
|
#include <drivers/pc80/pc/ps2_controller.asl>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG(EC_CLEVO_IT5570E)
|
||||||
|
#include <variant.asl>
|
||||||
|
#include <ec/clevo/it5570e/acpi/common.asl>
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
10
src/mainboard/clevo/cml-u/fadt.c
Normal file
10
src/mainboard/clevo/cml-u/fadt.c
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
|
#include <acpi/acpi.h>
|
||||||
|
#include <intelblocks/acpi.h>
|
||||||
|
|
||||||
|
void mainboard_fill_fadt(acpi_fadt_t *fadt)
|
||||||
|
{
|
||||||
|
/* Control method power button (EC) */
|
||||||
|
fadt->flags |= ACPI_FADT_POWER_BUTTON;
|
||||||
|
}
|
20
src/mainboard/clevo/cml-u/smihandler.c
Normal file
20
src/mainboard/clevo/cml-u/smihandler.c
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
|
||||||
|
#include <console/console.h>
|
||||||
|
#include <cpu/x86/smm.h>
|
||||||
|
#include <ec/clevo/it5570e/smm.h>
|
||||||
|
#include <intelblocks/smihandler.h>
|
||||||
|
|
||||||
|
void mainboard_smi_sleep(u8 slp_typ)
|
||||||
|
{
|
||||||
|
printk(BIOS_DEBUG, "Mainboard SMI sleep handler: %02x\n", slp_typ);
|
||||||
|
ec_smi_sleep(slp_typ);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mainboard_smi_apmc(u8 apmc)
|
||||||
|
{
|
||||||
|
printk(BIOS_DEBUG, "Mainboard SMI APMC handler: %02x\n", apmc);
|
||||||
|
ec_smi_apmc(apmc);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
|
#define EC_GPE_SCI GPE0_DW2_16 /* GPP_E16 */
|
||||||
|
#define EC_GPE_PWRB GPE0_DW1_09 /* GPP_D9 (SWI#) */
|
||||||
|
#define EC_GPE_SLPB GPE0_DW1_09 /* GPP_D9 (SWI#) */
|
||||||
|
#define EC_GPE_LID GPE0_DW1_09 /* GPP_D9 (SWI#) */
|
@@ -183,6 +183,10 @@ chip soc/intel/cannonlake
|
|||||||
device pci 1e.2 off end # GSPI #0
|
device pci 1e.2 off end # GSPI #0
|
||||||
device pci 1e.3 off end # GSPI #1
|
device pci 1e.3 off end # GSPI #1
|
||||||
device pci 1f.0 on # LPC Interface
|
device pci 1f.0 on # LPC Interface
|
||||||
|
chip ec/clevo/it5570e
|
||||||
|
device generic 0 on end
|
||||||
|
register "pl2_on_battery" = "15"
|
||||||
|
end
|
||||||
chip drivers/pc80/tpm # TPM
|
chip drivers/pc80/tpm # TPM
|
||||||
device pnp 0c31.0 on end
|
device pnp 0c31.0 on end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user