Mario Scheithauer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/64024 )
Change subject: drivers/phy/m88e1512: Add new driver for Marvell PHY 88E1512 ......................................................................
drivers/phy/m88e1512: Add new driver for Marvell PHY 88E1512
This driver enables the usage of an external Marvell PHY 88E1512 which should be connected to a SOC internal MAC controller. In a first step it is only the framework of the driver. Functionality will follow with a second patch. To be able to use the driver, it is necessary to activate the scan bus operation in the corresponding SOC TSN GbE driver. One can change parameters in device tree so that the used setup can be adapted in device tree to match the configuration of the device on the mainboard.
Link to the Marvell PHY 88E1512 datasheet: https://www.marvell.com/content/dam/marvell/en/public-collateral/ transceivers/marvell-phys-transceivers-alaska-88e151x-datasheet.pdf
Change-Id: Iabe1aef2217dfaee4b5a4bd83782ab588d4be642 Signed-off-by: Mario Scheithauer mario.scheithauer@siemens.com --- A src/drivers/phy/m88e1512/Kconfig A src/drivers/phy/m88e1512/Makefile.inc A src/drivers/phy/m88e1512/chip.h A src/drivers/phy/m88e1512/m88e1512.c M src/soc/intel/elkhartlake/tsn_gbe.c 5 files changed, 42 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/64024/1
diff --git a/src/drivers/phy/m88e1512/Kconfig b/src/drivers/phy/m88e1512/Kconfig new file mode 100644 index 0000000..8e9a2d9 --- /dev/null +++ b/src/drivers/phy/m88e1512/Kconfig @@ -0,0 +1,5 @@ +config DRIVERS_PHY_M88E1512 + bool + default n + help + Enable support for external Marvell PHY chip 88E1512. diff --git a/src/drivers/phy/m88e1512/Makefile.inc b/src/drivers/phy/m88e1512/Makefile.inc new file mode 100644 index 0000000..0d38051 --- /dev/null +++ b/src/drivers/phy/m88e1512/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_DRIVERS_PHY_M88E1512) += m88e1512.c diff --git a/src/drivers/phy/m88e1512/chip.h b/src/drivers/phy/m88e1512/chip.h new file mode 100644 index 0000000..d3ca3b5 --- /dev/null +++ b/src/drivers/phy/m88e1512/chip.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct drivers_phy_m88e1512_config { + uint8_t device_index; +}; diff --git a/src/drivers/phy/m88e1512/m88e1512.c b/src/drivers/phy/m88e1512/m88e1512.c new file mode 100644 index 0000000..c3ceb2c --- /dev/null +++ b/src/drivers/phy/m88e1512/m88e1512.c @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <device/device.h> +#include "chip.h" + +static void m88e1512_final(struct device *dev) +{ + struct drivers_phy_m88e1512_config *config = dev->chip_info; + + printk(BIOS_INFO, "%s: device index %x / pnp port %x\n", dev->chip_ops->name, + config->device_index, dev->path.pnp.port); +} + +static struct device_operations m88e1512_ops = { + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, + .final = m88e1512_final, +}; + +static void m88e1512_enable(struct device *dev) +{ + dev->ops = &m88e1512_ops; +} + +struct chip_operations drivers_phy_m88e1512_ops = { + CHIP_NAME("88E1512") + .enable_dev = m88e1512_enable +}; diff --git a/src/soc/intel/elkhartlake/tsn_gbe.c b/src/soc/intel/elkhartlake/tsn_gbe.c index bab5c1c..208ad83 100644 --- a/src/soc/intel/elkhartlake/tsn_gbe.c +++ b/src/soc/intel/elkhartlake/tsn_gbe.c @@ -120,6 +120,8 @@ .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, + .scan_bus = scan_generic_bus, + .ops_pci = &pci_dev_ops_pci, .final = gbe_tsn_final, };