[U-Boot] [PATCH v1 13/41] net: mvpp2: add hw_version field in "struct mvpp2"

Stefan Roese sr at denx.de
Tue Mar 21 14:27:34 UTC 2017


From: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>

In preparation to the introduction for the support of PPv2.2 in the
mvpp2 driver, this commit adds a hw_version field to the struct
mvpp2, and uses the .data field of the DT match table to fill it in.

Having the MVPP21 and MVPP22 definitions available will allow to start
adding the necessary conditional code to support PPv2.2.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Signed-off-by: Stefan Roese <sr at denx.de>
---

 drivers/net/mvpp2.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index d8b0cf9be9..d8a115c98f 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -707,6 +707,9 @@ struct mvpp2 {
 	/* Tclk value */
 	u32 tclk;
 
+	/* HW version */
+	enum { MVPP21, MVPP22 } hw_version;
+
 	struct mii_dev *bus;
 };
 
@@ -4134,6 +4137,9 @@ static int mvpp2_base_probe(struct udevice *dev)
 	u32 size = 0;
 	int i;
 
+	/* Save hw-version */
+	priv->hw_version = dev_get_driver_data(dev);
+
 	/*
 	 * U-Boot special buffer handling:
 	 *
@@ -4236,7 +4242,10 @@ static int mvpp2_base_bind(struct udevice *parent)
 }
 
 static const struct udevice_id mvpp2_ids[] = {
-	{ .compatible = "marvell,armada-375-pp2" },
+	{
+		.compatible = "marvell,armada-375-pp2",
+		.data = MVPP21,
+	},
 	{ }
 };
 
-- 
2.12.0



More information about the U-Boot mailing list