From 75460f531c17832ab8622bda994c6b97e3ca140f Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 14 Oct 2025 18:48:17 -0500 Subject: [PATCH] mb/google/poppy: Add CFR option to enable/disable IPU cameras IPU cameras on popp-based devices are currently not properly supported under Windows, which causes the camera status LED to be permanently on when using Windows. To work around this, add a CFR option to disable the IPU camera(s) on a given board. TEST=build/boot google/poppy (nocturne), verify camera status LED is off when CFR option disable and Windows booted. Change-Id: I664ecac47211350b861504c3075e524f045dbf40 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/90318 Tested-by: build bot (Jenkins) Reviewed-by: Jason Glenesk --- src/mainboard/google/poppy/cfr.c | 24 +++++++++++++++++++ src/mainboard/google/poppy/mainboard.c | 13 ++++++++++ .../atlas/include/variant/acpi/cam0.asl | 6 +++-- .../baseboard/include/baseboard/acpi/cam0.asl | 9 ++++--- .../baseboard/include/baseboard/acpi/cam1.asl | 3 ++- .../include/baseboard/acpi/camera_pmic.asl | 3 ++- .../nautilus/include/variant/acpi/cam0.asl | 9 ++++--- .../nocturne/include/variant/acpi/cam0.asl | 6 +++-- .../nocturne/include/variant/acpi/cam1.asl | 9 ++++--- 9 files changed, 67 insertions(+), 15 deletions(-) diff --git a/src/mainboard/google/poppy/cfr.c b/src/mainboard/google/poppy/cfr.c index 2025ad32ee..01793c080c 100644 --- a/src/mainboard/google/poppy/cfr.c +++ b/src/mainboard/google/poppy/cfr.c @@ -6,6 +6,21 @@ #include #include +static const struct sm_object ipu_camera = SM_DECLARE_ENUM({ + .opt_name = "ipu_camera", + .ui_name = "IPU Camera", + .ui_helptext = "Enable or disable integrated camera devices", + .default_value = true, + .values = (const struct sm_enum_value[]) { + { "Disabled", 0 }, + { "Enabled", 1 }, + SM_ENUM_VALUE_END }, + #if !CONFIG(VARIANT_HAS_CAMERA_ACPI) + .flags = CFR_OPTFLAG_SUPPRESS, + #endif +}); + + static struct sm_obj_form system = { .ui_name = "System", .obj_list = (const struct sm_object *[]) { @@ -34,9 +49,18 @@ static struct sm_obj_form ec = { }, }; +static struct sm_obj_form devices = { + .ui_name = "Devices", + .obj_list = (const struct sm_object *[]) { + &ipu_camera, + NULL + }, +}; + static struct sm_obj_form *sm_root[] = { &system, &ec, + &devices, NULL }; diff --git a/src/mainboard/google/poppy/mainboard.c b/src/mainboard/google/poppy/mainboard.c index 30b46fb771..b9847b7ac1 100644 --- a/src/mainboard/google/poppy/mainboard.c +++ b/src/mainboard/google/poppy/mainboard.c @@ -1,9 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include +#include #include #include @@ -14,6 +16,16 @@ static void mainboard_init(struct device *dev) mainboard_ec_init(); } +static void mainboard_fill_ssdt(const struct device *dev) +{ + /* Get camera enable option from CFR */ + unsigned int camera_enabled = get_uint_option("ipu_camera", 1); + + acpigen_write_scope("\\_SB.PCI0"); + acpigen_write_name_integer("CSTA", camera_enabled ? 0xF : 0x0); + acpigen_pop_len(); /* Scope */ +} + static unsigned long mainboard_write_acpi_tables(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp) { @@ -47,6 +59,7 @@ static void mainboard_enable(struct device *dev) { dev->ops->init = mainboard_init; dev->ops->write_acpi_tables = mainboard_write_acpi_tables; + dev->ops->acpi_fill_ssdt = mainboard_fill_ssdt; } static void mainboard_chip_init(void *chip_info) diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl index a3098a961f..a5779524f9 100644 --- a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl @@ -49,10 +49,11 @@ Scope (\_SB.PCI0.I2C3) Name (_HID, "INT3478") Name (_UID, 0) Name (_DDN, "SONY IMX208 Camera") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate () @@ -111,10 +112,11 @@ Scope (\_SB.PCI0.I2C3) Name (_HID, "INT3499") Name (_UID, 0) Name (_DDN, "GT24C16S") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate () diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam0.asl b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam0.asl index d7b7aef505..8dc9068c33 100644 --- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam0.asl +++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam0.asl @@ -8,10 +8,11 @@ Scope (\_SB.PCI0.I2C2) Name (_UID, 0) Name (_DDN, "OV 13858 Camera") /* _DDN: DOS Device Name */ Name (CAMD, 0x02) + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) @@ -95,10 +96,11 @@ Scope (\_SB.PCI0.I2C2) Name (_UID, 0) Name (_DDN, "Dongwoon AF DAC") /* _DDN: DOS Device Name */ Name (CAMD, 0x03) + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) @@ -126,10 +128,11 @@ Scope (\_SB.PCI0.I2C2) Name (_HID, "INT3499") Name (_UID, 0) Name (_DDN, "GT24C16S/CAT24C16") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam1.asl b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam1.asl index 38284b33f2..286c1699de 100644 --- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam1.asl +++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/cam1.asl @@ -8,10 +8,11 @@ Scope (\_SB.PCI0.I2C4) Name (_UID, 0) Name (_DDN, "OV 5670 Camera") /* _DDN: DOS Device Name */ Name (CAMD, 0x02) + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/camera_pmic.asl b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/camera_pmic.asl index 82f52b9d36..0294cab6e7 100644 --- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/camera_pmic.asl +++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/acpi/camera_pmic.asl @@ -8,10 +8,11 @@ Scope (\_SB.PCI0.I2C2) Name (_UID, 0) Name (_DDN, "TPS68470 PMIC") /* _DDN: DOS Device Name */ Name (CAMD, 0x64) + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Method (PMON, 0, Serialized) { diff --git a/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/cam0.asl b/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/cam0.asl index fd1c6eed20..f6bc683aac 100644 --- a/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/cam0.asl +++ b/src/mainboard/google/poppy/variants/nautilus/include/variant/acpi/cam0.asl @@ -7,10 +7,11 @@ Scope (\_SB.PCI0.I2C2) Name (_HID, "SONY258A") Name (_UID, 0) Name (_DDN, "SONY IMX258 Camera") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) @@ -75,10 +76,11 @@ Scope (\_SB.PCI0.I2C2) Name (_HID, "PRP0001") Name (_UID, 0) Name (_DDN, "Dongwoon AF DAC") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) @@ -106,10 +108,11 @@ Scope (\_SB.PCI0.I2C2) Name (_HID, "INT3499") Name (_UID, 0) Name (_DDN, "Dongwoon NVM") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_DEP, Package() { \_SB.PCI0.I2C2.PMIC }) diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl index cedab20530..ac3413a4fd 100644 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl +++ b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl @@ -43,10 +43,11 @@ Scope (\_SB.PCI0.I2C3) Name (_HID, "SONY319A") Name (_UID, 0) Name (_DDN, "Sony IMX319 Camera") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate () @@ -106,10 +107,11 @@ Scope (\_SB.PCI0.I2C3) Name (_HID, "INT3499") Name (_UID, 0) Name (_DDN, "M24C64S") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate () diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl index bab32e9f5d..50d672172f 100644 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl +++ b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl @@ -42,10 +42,11 @@ Scope (\_SB.PCI0.I2C5) Name (_HID, "SONY355A") Name (_UID, 0) Name (_DDN, "SONY IMX355A Camera") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate () @@ -108,10 +109,11 @@ Scope (\_SB.PCI0.I2C5) Name (_HID, "PRP0001") Name (_UID, 3) Name (_DDN, "AKM AF DAC") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate () @@ -140,10 +142,11 @@ Scope (\_SB.PCI0.I2C5) Name (_HID, "INT3499") Name (_UID, 1) Name (_DDN, "M24C64S") /* _DDN: DOS Device Name */ + External (CSTA, IntObj) Method (_STA, 0, NotSerialized) { - Return (0x0F) + Return (CSTA) } Name (_CRS, ResourceTemplate ()