Maulik V Vaghela has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30611
Change subject: soc/intel/cannonlake: Add support to disable PCIe WLAN dynamically
......................................................................
soc/intel/cannonlake: Add support to disable PCIe WLAN dynamically
Ideally we should disable PCIe WLAN if CNVi is enabled and out of reset.
This code adds support to achieve this. SoC code will check if CNVi is
up or not and if is enabled, it'll disable PCIe WLAN.
PCI WLAN device and function are board dependent and mainboard must
implement function which returns PCI_DEVFN for WLAN.
BUG=none
BRANCH=none
TEST=none
Change-Id: Ief1896b3d915018edca136c26f4e834e0c9003ac
Signed-off-by: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
---
M src/soc/intel/cannonlake/fsp_params.c
1 file changed, 44 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/30611/1
diff --git a/src/soc/intel/cannonlake/fsp_params.c b/src/soc/intel/cannonlake/fsp_params.c
index 8166dea..4225471 100644
--- a/src/soc/intel/cannonlake/fsp_params.c
+++ b/src/soc/intel/cannonlake/fsp_params.c
@@ -17,6 +17,8 @@
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
+#include <device/pci_def.h>
+#include <device/pci_ops.h>
#include <fsp/api.h>
#include <fsp/util.h>
#include <intelblocks/xdci.h>
@@ -25,6 +27,42 @@
#include <soc/ramstage.h>
#include <string.h>
+static bool is_cnvi_held_in_reset(void)
+{
+ struct device *dev = dev_find_slot(0, PCH_DEVFN_CNVI);
+ uint32_t reg = pci_read_config32(dev, PCI_VENDOR_ID);
+
+ /*
+ * If vendor/device ID for CNVi reads as 0xffffffff, then it is safe to
+ * assume that it is being held in reset.
+ */
+ if (reg == 0xffffffff)
+ return true;
+
+ return false;
+}
+
+/*
+ * Check if CNVi PCI device is released from reset. If yes, then the system is
+ * booting with CNVi module. In this case, the PCIe device for WiFi needs to
+ * be disabled. If CNVi device is held in reset, then disable it.
+ */
+static void wifi_device_update(void)
+{
+ struct device *dev;
+ unsigned int devfn;
+
+ if (is_cnvi_held_in_reset())
+ devfn = PCH_DEVFN_CNVI;
+ else
+ devfn = mainboard_get_wifi_device();
+
+ if (devfn != 0) {
+ dev = dev_find_slot(0, devfn);
+ dev->enabled = 0;
+ }
+}
+
static void parse_devicetree(FSP_S_CONFIG *params)
{
struct device *dev = SA_DEV_ROOT;
@@ -86,6 +124,7 @@
}
mainboard_silicon_init_params(params);
+ wifi_device_update ();
/* Unlock upper 8 bytes of RTC RAM */
params->PchLockDownRtcMemoryLock = 0;
@@ -236,3 +275,8 @@
{
printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
}
+
+__weak uint32_t mainboard_get_wifi_device(void)
+{
+ return 0;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/30611
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ief1896b3d915018edca136c26f4e834e0c9003ac
Gerrit-Change-Number: 30611
Gerrit-PatchSet: 1
Gerrit-Owner: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30420
Change subject: Makefile.inc: Make sure the BIOS region is 64K aligned
......................................................................
Makefile.inc: Make sure the BIOS region is 64K aligned
If a non aligned CONFIG_CBFS_SIZE is used the region RW_MRC_CACHE and
CONSOLE could end up non aligned. Currently this is only possible if
the user messes with CONFIG_CBFS_SIZE in menuconfig, but better be
safe than sorry.
Change-Id: Ieb7e3c7112bd4b3f9733c36af21b1d59b3836811
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M Makefile.inc
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/30420/1
diff --git a/Makefile.inc b/Makefile.inc
index 85aa19e..8af291f 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -146,6 +146,7 @@
int-gt=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) \> $(call _toint,$(word 2,$1))))
int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))
int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) )
+int-align-down=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A - \( $$A % $$B \) )
file-size=$(strip $(shell cat $1 | wc -c))
tolower=$(shell echo '$1' | tr '[:upper:]' '[:lower:]')
toupper=$(shell echo '$1' | tr '[:lower:]' '[:upper:]')
@@ -835,8 +836,8 @@
FMAP_ROM_SIZE := $(CONFIG_ROM_SIZE)
# entire "BIOS" region (everything directly of concern to the host system)
# relative to ROM_BASE
-FMAP_BIOS_BASE := $(call int-subtract, $(CONFIG_ROM_SIZE) $(CONFIG_CBFS_SIZE))
-FMAP_BIOS_SIZE := $(shell echo $(CONFIG_CBFS_SIZE) | tr A-F a-f)
+FMAP_BIOS_BASE := $(call int-align, $(call int-subtract, $(CONFIG_ROM_SIZE) $(CONFIG_CBFS_SIZE)), 0x10000)
+FMAP_BIOS_SIZE := $(call int-align-down, $(shell echo $(CONFIG_CBFS_SIZE) | tr A-F a-f), 0x10000)
# position and size of flashmap, relative to BIOS_BASE
#
--
To view, visit https://review.coreboot.org/c/coreboot/+/30420
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ieb7e3c7112bd4b3f9733c36af21b1d59b3836811
Gerrit-Change-Number: 30420
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange