]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
Add the ability to change the FEC PHY MDIO device number on i.MX25 processor
authorJean-Christophe Dubois <jcd@tribudubois.net>
Mon, 13 Jul 2020 13:36:07 +0000 (14:36 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Jul 2020 13:36:07 +0000 (14:36 +0100)
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
Message-id: 9f8923ecd974160ae8f634c275b1100c2cbe66d7.1593806826.git.jcd@tribudubois.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: updated for object_property_set_uint() argument reordering]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/fsl-imx25.c
include/hw/arm/fsl-imx25.h

index b4ddceae45a16c889477aac38de30586545cc6c7..08a98f828fc8b7b411d971323d97be1a73109387 100644 (file)
@@ -171,6 +171,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
                                             epit_table[i].irq));
     }
 
+    object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err);
     qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
 
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) {
@@ -315,10 +316,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";
     /*
index 9e228daceae30bf14dbf103628666f398557b9c4..54ee1bfd78021f1dd55cf9f476f2614dd43a8631 100644 (file)
@@ -65,6 +65,7 @@ typedef struct FslIMX25State {
     MemoryRegion   rom[2];
     MemoryRegion   iram;
     MemoryRegion   iram_alias;
+    uint32_t       phy_num;
 } FslIMX25State;
 
 /**