drivers/wifi,soc/intel/adl: Move CnviDdrRfim property to drivers
Some non-SoC code might want to know whether or not the CNVi DDR RFIM feature is enabled. Also note that future SoCs may also support this feature. To make the CnviDdrRfim property generic, move it from soc/intel/alderlake to drivers/wifi/generic instead. Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: Idf9fba0a79d1f431269be5851b026ed966600160 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61638 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rizwan Qureshi <rizwan.qureshi@intel.com> Reviewed-by: Varshit B Pandya <varshit.b.pandya@intel.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
ifeq ($(CONFIG_DRIVERS_WIFI_GENERIC),y)
|
||||
|
||||
romstage-y += generic.c
|
||||
|
||||
ramstage-y += generic.c
|
||||
ramstage-$(CONFIG_GENERATE_SMBIOS_TABLES) += smbios.c
|
||||
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
|
||||
|
@@ -12,6 +12,13 @@ struct drivers_wifi_generic_config {
|
||||
/* When set to true, this will add a _DSD which contains a single
|
||||
property, `DmaProperty`, set to 1, under the ACPI Device. */
|
||||
bool is_untrusted;
|
||||
|
||||
/*
|
||||
* Applicable for Intel chipsets that use CNVi WiFi only. Set this to 1
|
||||
* to enable CNVi DDR RFIM (radio frequency interference mitigation);
|
||||
* SoC code propagates this value the applicable FSP UPD.
|
||||
*/
|
||||
bool enable_cnvi_ddr_rfim;
|
||||
};
|
||||
|
||||
#endif /* _GENERIC_WIFI_H_ */
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include <elog.h>
|
||||
#include "chip.h"
|
||||
#include "wifi_private.h"
|
||||
#include "wifi.h"
|
||||
|
||||
static void wifi_pci_dev_init(struct device *dev)
|
||||
{
|
||||
@@ -40,17 +41,39 @@ struct device_operations wifi_cnvi_ops = {
|
||||
#endif
|
||||
};
|
||||
|
||||
static bool is_cnvi(const struct device *dev)
|
||||
{
|
||||
#if !DEVTREE_EARLY
|
||||
return dev && dev->ops == &wifi_cnvi_ops;
|
||||
#else
|
||||
return dev && dev->path.type != DEVICE_PATH_PCI;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wifi_generic_cnvi_ddr_rfim_enabled(const struct device *dev)
|
||||
{
|
||||
const struct drivers_wifi_generic_config *config;
|
||||
|
||||
if (!dev || !is_cnvi(dev) || !dev->chip_info)
|
||||
return false;
|
||||
|
||||
config = dev->chip_info;
|
||||
return config->enable_cnvi_ddr_rfim;
|
||||
}
|
||||
|
||||
static void wifi_generic_enable(struct device *dev)
|
||||
{
|
||||
struct drivers_wifi_generic_config *config = dev ? dev->chip_info : NULL;
|
||||
DEVTREE_CONST struct drivers_wifi_generic_config *config = dev ? dev->chip_info : NULL;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
if (dev->path.type == DEVICE_PATH_PCI)
|
||||
dev->ops = &wifi_pcie_ops;
|
||||
else
|
||||
#if !DEVTREE_EARLY
|
||||
if (is_cnvi(dev))
|
||||
dev->ops = &wifi_cnvi_ops;
|
||||
else
|
||||
dev->ops = &wifi_pcie_ops;
|
||||
#endif
|
||||
}
|
||||
|
||||
struct chip_operations drivers_wifi_generic_ops = {
|
||||
|
10
src/drivers/wifi/generic/wifi.h
Normal file
10
src/drivers/wifi/generic/wifi.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <device/device.h>
|
||||
|
||||
#ifndef _WIFI_GENERIC_WIFI_H_
|
||||
#define _WIFI_GENERIC_WIFI_H_
|
||||
|
||||
bool wifi_generic_cnvi_ddr_rfim_enabled(const struct device *dev);
|
||||
|
||||
#endif /* _WIFI_GENERIC_WIFI_H_ */
|
Reference in New Issue
Block a user