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 <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63861
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
diff --git a/src/soc/intel/elkhartlake/Kconfig b/src/soc/intel/elkhartlake/Kconfig
index 26b8fe3..4676629 100644
--- a/src/soc/intel/elkhartlake/Kconfig
+++ b/src/soc/intel/elkhartlake/Kconfig
@@ -236,6 +236,13 @@
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 ce93e46..2c613e0 100644
--- a/src/soc/intel/elkhartlake/Makefile.inc
+++ b/src/soc/intel/elkhartlake/Makefile.inc
@@ -36,6 +36,7 @@
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 0000000..d006ef2
--- /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 0000000..c96e88b
--- /dev/null
+++ b/src/soc/intel/elkhartlake/tsn_gbe.c
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <device/pci.h>
+#include <device/pci_ids.h>
+#include <soc/tsn_gbe.h>
+
+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,
+};