From eda66c313b5c5491738a0a5e884caba14c07731f Mon Sep 17 00:00:00 2001 From: Mario Scheithauer Date: Tue, 26 Apr 2022 13:50:52 +0200 Subject: soc/intel/elkhartlake: Implement TSN GbE driver To be able to make EHL Ethernet GbE-TSN Controller configurable, a driver is required. Functionality comes in following patches. Change-Id: I7522914c56b74486bb088280d2686acf7027d1d3 Signed-off-by: Mario Scheithauer Reviewed-on: https://review.coreboot.org/c/coreboot/+/63861 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh --- src/soc/intel/elkhartlake/Kconfig | 7 +++++++ src/soc/intel/elkhartlake/Makefile.inc | 1 + src/soc/intel/elkhartlake/include/soc/tsn_gbe.h | 6 ++++++ src/soc/intel/elkhartlake/tsn_gbe.c | 20 ++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 src/soc/intel/elkhartlake/include/soc/tsn_gbe.h create mode 100644 src/soc/intel/elkhartlake/tsn_gbe.c diff --git a/src/soc/intel/elkhartlake/Kconfig b/src/soc/intel/elkhartlake/Kconfig index 26b8fe3162..467662946d 100644 --- a/src/soc/intel/elkhartlake/Kconfig +++ b/src/soc/intel/elkhartlake/Kconfig @@ -236,6 +236,13 @@ config PSE_CONFIG_BUFFER_SIZE_KIB data (FSP will append PSE config data to memory region right after PSE FW memory region). +config EHL_TSN_DRIVER + bool + default n + help + Enable TSN GbE driver to provide board specific settings in the GBE MAC. + As an example of a possible change, the MAC address could be adjusted. + config SOC_INTEL_ELKHARTLAKE_DEBUG_CONSENT int "Debug Consent for EHL" # USB DBC is more common for developers so make this default to 3 if diff --git a/src/soc/intel/elkhartlake/Makefile.inc b/src/soc/intel/elkhartlake/Makefile.inc index ce93e46e79..2c613e0168 100644 --- a/src/soc/intel/elkhartlake/Makefile.inc +++ b/src/soc/intel/elkhartlake/Makefile.inc @@ -36,6 +36,7 @@ ramstage-y += pmc.c ramstage-y += reset.c ramstage-y += systemagent.c ramstage-y += sd.c +ramstage-$(CONFIG_EHL_TSN_DRIVER) += tsn_gbe.c ramstage-y += me.c smm-y += gpio.c diff --git a/src/soc/intel/elkhartlake/include/soc/tsn_gbe.h b/src/soc/intel/elkhartlake/include/soc/tsn_gbe.h new file mode 100644 index 0000000000..d006ef252b --- /dev/null +++ b/src/soc/intel/elkhartlake/include/soc/tsn_gbe.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _SOC_ELKHARTLAKE_TSN_GBE_H_ +#define _SOC_ELKHARTLAKE_TSN_GBE_H_ + +#endif /* _SOC_ELKHARTLAKE_TSN_GBE_H_ */ diff --git a/src/soc/intel/elkhartlake/tsn_gbe.c b/src/soc/intel/elkhartlake/tsn_gbe.c new file mode 100644 index 0000000000..c96e88b972 --- /dev/null +++ b/src/soc/intel/elkhartlake/tsn_gbe.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +static struct device_operations gbe_tsn_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, +}; + +static const unsigned short gbe_tsn_device_ids[] = { 0x4b32, 0x4ba0, 0x4bb0, 0 }; + +static const struct pci_driver gbe_tsn_driver __pci_driver = { + .ops = &gbe_tsn_ops, + .vendor = PCI_VID_INTEL, + .devices = gbe_tsn_device_ids, +}; -- cgit v1.2.3