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 <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90318
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
This commit is contained in:
Matt DeVillier 2025-10-14 18:48:17 -05:00
commit 75460f531c
9 changed files with 67 additions and 15 deletions

View file

@ -6,6 +6,21 @@
#include <intelblocks/cfr.h>
#include <soc/cfr.h>
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
};

View file

@ -1,9 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h>
#include <acpi/acpigen.h>
#include <baseboard/variants.h>
#include <device/device.h>
#include <ec/ec.h>
#include <option.h>
#include <soc/pci_devs.h>
#include <soc/nhlt.h>
@ -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)

View file

@ -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 ()

View file

@ -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 })

View file

@ -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 })

View file

@ -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) {

View file

@ -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 })

View file

@ -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 ()

View file

@ -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 ()