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

BUG=b:229938024
TEST=emerge-nissa coreboot

Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Change-Id: Ib5770f02a6d524417be6723f7f70aa80d9452f62
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64417
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
This commit is contained in:
Tyler Wang 2022-05-17 15:06:09 +08:00 committed by Felix Held
parent 10fb9c7f36
commit 3c88dc85f6
2 changed files with 44 additions and 7 deletions

View File

@ -21,6 +21,21 @@ static const struct pad_config lte_disable_pads[] = {
PAD_NC(GPP_F12, NONE),
};
static const struct pad_config wfc_disable_pads[] = {
/* D3 : WCAM_RST_L */
PAD_NC(GPP_D3, NONE),
/* D15 : EN_PP2800_WCAM_X */
PAD_NC(GPP_D15, NONE),
/* D16 : EN_PP1800_PP1200_WCAM_X */
PAD_NC(GPP_D16, NONE),
/* 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),
};
static void fw_config_handle(void *unused)
{
if (fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
@ -30,5 +45,10 @@ static void fw_config_handle(void *unused)
printk(BIOS_INFO, "Disable LTE-related GPIO pins on craask.\n");
gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads));
}
if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
gpio_configure_pads(wfc_disable_pads, ARRAY_SIZE(wfc_disable_pads));
}
}
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);

View File

@ -1,8 +1,16 @@
fw_config
field DB_USB 0 1
option DB_NONE 0
option DB_1C_1A 1
option DB_1C_LTE 2
option DB_NONE 0
option DB_1C_1A 1
option DB_1C_LTE 2
end
field WFC 2 3
option WFC_ABSENT 0
option WFC_MIPI_OVTI5675 1
end
field STYLUS 4
option STYLUS_ABSENT 0
option STYLUS_PRESENT 1
end
end
@ -36,6 +44,7 @@ chip soc/intel/alderlake
register "cio2_prt[0]" = "1"
device generic 0 on end
end
probe WFC WFC_MIPI_OVTI5675
end
device ref i2c1 on
chip drivers/i2c/hid
@ -66,7 +75,9 @@ chip soc/intel/alderlake
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
device generic 0 on end
device generic 0 on
probe STYLUS STYLUS_PRESENT
end
end
end
device ref i2c2 on
@ -159,7 +170,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_MIPI_OVTI5675
end
end
chip drivers/intel/mipi_camera
register "acpi_uid" = "3"
@ -170,7 +183,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_MIPI_OVTI5675
end
end
chip drivers/intel/mipi_camera
register "acpi_hid" = "ACPI_DT_NAMESPACE_HID"
@ -187,7 +202,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_MIPI_OVTI5675
end
end
end
device ref i2c3 on