diff options
Diffstat (limited to 'src/soc/intel/common/block/cnvi/cnvi.c')
-rw-r--r-- | src/soc/intel/common/block/cnvi/cnvi.c | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/src/soc/intel/common/block/cnvi/cnvi.c b/src/soc/intel/common/block/cnvi/cnvi.c index cf46fdb206..4c434b2260 100644 --- a/src/soc/intel/common/block/cnvi/cnvi.c +++ b/src/soc/intel/common/block/cnvi/cnvi.c @@ -6,12 +6,71 @@ #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <intelblocks/cnvi.h> static const char *cnvi_wifi_acpi_name(const struct device *dev) { return "CNVW"; } +static void cnvw_fill_ssdt(const struct device *dev) +{ + const char *scope = acpi_device_path(dev); + + acpi_device_write_pci_dev(dev); + + acpigen_write_scope(scope); +/* + * OperationRegion(CWAR, SystemMemory, Add(\_SB.PCI0.GPCB(), 0xa3000), 0x100) + * Field(CWAR, WordAcc, NoLock, Preserve) { + * VDID, 32, // 0x00, VID DID + * Offset(CNVI_DEV_CAP), + * , 28, + * WFLR, 1, // Function Level Reset Capable + * Offset(CNVI_DEV_CONTROL), + * , 15, + * WIFR, 1, // Init Function Level Reset + * Offset(CNVI_POWER_STATUS), + * WPMS, 32, + * } + */ + + /* RegionOffset stored in Local0 */ + /* Local0 = \_SB_.PCI0.GPCB() + 0xa3000 */ + acpigen_emit_byte(ADD_OP); + acpigen_write_integer(0xa3000); + acpigen_emit_namestring("\\_SB_.PCI0.GPCB()"); + acpigen_emit_byte(LOCAL0_OP); + + /* OperationRegion */ + acpigen_emit_ext_op(OPREGION_OP); + /* NameString 4 chars only */ + acpigen_emit_namestring("CWAR"); + /* RegionSpace */ + acpigen_emit_byte(SYSTEMMEMORY); + /* RegionOffset */ + acpigen_emit_byte(LOCAL0_OP); + /* RegionLen */ + acpigen_write_integer(0x100); + + struct fieldlist fields[] = { + FIELDLIST_OFFSET(0), + FIELDLIST_NAMESTR("VDID", 32), + FIELDLIST_OFFSET(CNVI_DEV_CAP), + FIELDLIST_RESERVED(28), + FIELDLIST_NAMESTR("WFLR", 1), + FIELDLIST_OFFSET(CNVI_DEV_CONTROL), + FIELDLIST_RESERVED(15), + FIELDLIST_NAMESTR("WIFR", 1), + FIELDLIST_OFFSET(CNVI_POWER_STATUS), + FIELDLIST_NAMESTR("WPMS", 32), + }; + acpigen_write_field("CWAR", fields, ARRAY_SIZE(fields), + FIELD_WORDACC | FIELD_NOLOCK | FIELD_PRESERVE); + + acpigen_write_scope_end(); +} + static struct device_operations cnvi_wifi_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -19,7 +78,7 @@ static struct device_operations cnvi_wifi_ops = { .ops_pci = &pci_dev_ops_pci, .scan_bus = scan_static_bus, .acpi_name = cnvi_wifi_acpi_name, - .acpi_fill_ssdt = acpi_device_write_pci_dev, + .acpi_fill_ssdt = cnvw_fill_ssdt, }; static const unsigned short wifi_pci_device_ids[] = { |