coreboot/src/drivers
David Ruth ea8330ed81 drivers/wifi: Add MTCL function to ACPI SSDT
The MTCL function provides a country list to the Linux kernel via an
ACPI function in SSDT for MediaTek WiFi chipsets that are capable of
operating on the 6GHz band. The country list is used to selectively
disable 6GHz and 5.9GHz operation based on the country the device is
operating in.

The function needs to read a binary file and send it as a package via
the MTCL method in SSDT for PCIe WiFi with MediaTek chipsets.

Change Summary:
* Add src/drivers/wifi/generic/mtcl.c to abstract functionaltity related
  to MTCL
  * Add write_mtcl_aml function to convert the byte data into the format
    expected by the MTCL functionality in the Linux kernel.
  * Add validate_mtcl function to validate that the byte data read in
    from a file is in the expected format.
  * Add write_mtcl_function function to read a binary file called
    "wifi_mtcl".bin" from cbfs, then call validate_mtcl to verify that
    it is in an expected format, and if so write the aml via acpigen
* Add config flag DRIVERS_MTK_WIFI to src/drivers/wifi/generic in order
  to include MediaTek WiFi specific functionality
  * Add config flag USE_MTCL which depends on DRIVERS_MTK_WIFI and
    enables including the specific ACPI function defined in SSDT
  * Add config flag CONFIG_MTCL_CBFS_FILEPATH which depends on
    DRIVERS_MTK_WIFI which enables configuring the file to add as
    "wifi_mtcl.bin"
* Add a call to write_mtcl_function to src/drivers/wifi/generic/acpi.c
  to include the MTCL function in SSDT for MTK WiFi devices when
  USE_MTCL is enabled.
* Add MediaTek VID to src/include/device/pci_ids.h.

BUG=b:295544553
TEST=Add Kconfig entry USE_MTCL for pujjo
TEST=Add wifi_mtcl_defaults.bin blob to cbfs
TEST=Build coreboot for pujjo `emerge-nissa coreboot chromeos-bootimage`
TEST=Verify that MTCL defined in the file is present:
TEST=`acpidump -b`
TEST=`iasl ssdt.dat`
TEST=`less ssdt.dsl`
TEST=Search for MTCL

Signed-off-by: David Ruth <druth@chromium.org>
Change-Id: I9b5e7312a44e114270e664b983626faa6cfee350
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80170
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-02-06 03:37:19 +00:00
..
acpi/thermal_zone include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
amd include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
ams driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
analogix/anx7625 driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
asmedia driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
aspeed driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
broadcom driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
camera driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
crb include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
efi driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
elog lib: Move IP checksum to commonlib 2024-02-02 22:48:27 +00:00
emulation/qemu driver/acpi to /driver/gfx: Rename Makefiles from .inc to .mk 2024-01-24 10:03:39 +00:00
generic include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
genesyslogic include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
gfx/generic include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
i2c device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00
intel drivers/intel/fsp2_0: Remove unused function fsp_write_line 2024-02-05 14:07:27 +00:00
ipmi include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
lenovo include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
maxim driver/intel to /driver/ocp: Rename Makefiles from .inc to .mk 2024-01-24 10:04:10 +00:00
mipi drivers/mipi: Fine tune VFP, CLK and init code for IVO_T109NW41 panel 2024-01-24 11:16:36 +00:00
mrc_cache driver/intel to /driver/ocp: Rename Makefiles from .inc to .mk 2024-01-24 10:04:10 +00:00
net lib: Move IP checksum to commonlib 2024-02-02 22:48:27 +00:00
nxp/uwb device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00
ocp driver/intel to /driver/ocp: Rename Makefiles from .inc to .mk 2024-01-24 10:04:10 +00:00
parade driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
pc80 include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
pcie device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00
ricoh/rce822 include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
secunet/dmi include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
siemens/nc_fpga driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
sil/3114 driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
smbus driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
smmstore driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
sof include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
soundwire include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
spi device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00
ti driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
tpm driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
uart include/device/device.h: Remove CHIP_NAME() macro 2024-01-31 09:51:58 +00:00
usb device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00
vpd driver/parade to /driver/wwan: Rename Makefiles from .inc to .mk 2024-01-24 10:04:33 +00:00
wifi/generic drivers/wifi: Add MTCL function to ACPI SSDT 2024-02-06 03:37:19 +00:00
wwan/fm device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00