mb/google/nissa/var/xivu: Disable WFC and pen garage based on fw_config

Use fw_config Bit 0 and Bit 1 to control:
Bit 0 = 0 --> enable WFC
Bit 0 = 1 --> disable WFC

Bit 1 = 0 --> enable pen garage wake
Bit 1 = 1 --> disable pen garage wake

BUG=b:238045498
TEST=emerge-nissa coreboot chromeos-bootimage

Signed-off-by: Ian Feng <ian_feng@compal.corp-partner.google.com>
Change-Id: I85bc4753bfd16fd460286aa2b3bb5f3341049f61
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66043
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
This commit is contained in:
Ian Feng 2022-07-21 16:28:12 +08:00 committed by Martin Roth
parent d86860b84f
commit 52d0ec25ee
3 changed files with 55 additions and 3 deletions

View File

@ -3,4 +3,5 @@ bootblock-y += gpio.c
romstage-y += gpio.c
ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
ramstage-y += gpio.c

View File

@ -0,0 +1,32 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <bootstate.h>
#include <console/console.h>
#include <fw_config.h>
static const struct pad_config wfc_disable_pads[] = {
/* D3 : WCAM_RST_L */
PAD_NC_LOCK(GPP_D3, NONE, LOCK_CONFIG),
/* D15 : EN_PP2800_WCAM_X */
PAD_NC_LOCK(GPP_D15, NONE, LOCK_CONFIG),
/* D16 : EN_PP1800_PP1200_WCAM_X */
PAD_NC_LOCK(GPP_D16, NONE, LOCK_CONFIG),
/* H22 : WCAM_MCLK_R */
PAD_NC(GPP_H22, NONE),
/* R6 : DMIC_WCAM_CLK_R */
PAD_NC(GPP_R6, NONE),
/* R7 : DMIC_WCAM_DATA */
PAD_NC(GPP_R7, NONE),
};
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
{
if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
gpio_padbased_override(padbased_table, wfc_disable_pads,
ARRAY_SIZE(wfc_disable_pads));
}
}

View File

@ -1,3 +1,14 @@
fw_config
field WFC 0
option WFC_PRESENT 0
option WFC_ABSENT 1
end
field STYLUS 1
option STYLUS_PRESENT 0
option STYLUS_ABSENT 1
end
end
chip soc/intel/alderlake
register "sagv" = "SaGv_Enabled"
@ -40,6 +51,7 @@ chip soc/intel/alderlake
register "cio2_prt[0]" = "2"
device generic 0 on end
end
probe WFC WFC_PRESENT
end
device ref i2c1 on
chip drivers/i2c/hid
@ -73,6 +85,7 @@ chip soc/intel/alderlake
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
device generic 0 on
probe STYLUS STYLUS_PRESENT
end
end
end
@ -117,7 +130,9 @@ chip soc/intel/alderlake
register "off_seq.ops[2]" = "SEQ_OPS_GPIO_DISABLE(1, 0)"
register "off_seq.ops[3]" = "SEQ_OPS_GPIO_DISABLE(0, 0)"
device i2c 36 on end
device i2c 36 on
probe WFC WFC_PRESENT
end
end
chip drivers/intel/mipi_camera
register "acpi_uid" = "3"
@ -128,7 +143,9 @@ chip soc/intel/alderlake
register "pr0" = ""\\_SB.PCI0.I2C2.CAM0.PRIC""
register "vcm_compat" = ""dongwoon,dw9714""
device i2c 0C on end
device i2c 0C on
probe WFC WFC_PRESENT
end
end
chip drivers/intel/mipi_camera
register "acpi_hid" = "ACPI_DT_NAMESPACE_HID"
@ -145,7 +162,9 @@ chip soc/intel/alderlake
register "nvm_width" = "0x10"
register "nvm_compat" = ""atmel,24c08""
device i2c 50 on end
device i2c 50 on
probe WFC WFC_PRESENT
end
end
end
device ref i2c3 on