[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] Add the ability to change the FEC PHY MDIO device number on
From: |
Jean-Christophe Dubois |
Subject: |
[PATCH 1/3] Add the ability to change the FEC PHY MDIO device number on i.MX25 processor |
Date: |
Fri, 3 Jul 2020 22:15:15 +0200 |
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
---
hw/arm/fsl-imx25.c | 7 +++++++
include/hw/arm/fsl-imx25.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index 7ab5c98fbe1..35874aac00b 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -183,6 +183,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error
**errp)
epit_table[i].irq));
}
+ object_property_set_uint(OBJECT(&s->fec), s->phy_num, "phy-num", &err);
qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
sysbus_realize(SYS_BUS_DEVICE(&s->fec), &err);
@@ -339,10 +340,16 @@ static void fsl_imx25_realize(DeviceState *dev, Error
**errp)
&s->iram_alias);
}
+static Property fsl_imx25_properties[] = {
+ DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void fsl_imx25_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ device_class_set_props(dc, fsl_imx25_properties);
dc->realize = fsl_imx25_realize;
dc->desc = "i.MX25 SOC";
/*
diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h
index 9e228daceae..54ee1bfd780 100644
--- a/include/hw/arm/fsl-imx25.h
+++ b/include/hw/arm/fsl-imx25.h
@@ -65,6 +65,7 @@ typedef struct FslIMX25State {
MemoryRegion rom[2];
MemoryRegion iram;
MemoryRegion iram_alias;
+ uint32_t phy_num;
} FslIMX25State;
/**
--
2.25.1