]> Git Repo - qemu.git/commitdiff
Add the ability to select a different PHY for each i.MX6UL FEC interface
authorJean-Christophe Dubois <[email protected]>
Fri, 3 Jul 2020 15:59:41 +0000 (16:59 +0100)
committerPeter Maydell <[email protected]>
Fri, 3 Jul 2020 15:59:41 +0000 (16:59 +0100)
Add properties to the i.MX6UL processor to be able to select a
particular PHY on the MDIO bus for each FEC device.

Signed-off-by: Jean-Christophe Dubois <[email protected]>
Message-id: ea1d604198b6b73ea6521676e45bacfc597aba53.1593296112[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/arm/fsl-imx6ul.c
include/hw/arm/fsl-imx6ul.h

index 6446034711efe30ec0d45e6784207c352d7a8e67..51b2f256ec863ec9b6ebc70e32be1d151bf035ac 100644 (file)
@@ -427,6 +427,9 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
             FSL_IMX6UL_ENET2_TIMER_IRQ,
         };
 
+        object_property_set_uint(OBJECT(&s->eth[i]),
+                                 s->phy_num[i],
+                                 "phy-num", &error_abort);
         object_property_set_uint(OBJECT(&s->eth[i]),
                                  FSL_IMX6UL_ETH_NUM_TX_RINGS,
                                  "tx-ring-num", &error_abort);
@@ -607,10 +610,17 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
                                 FSL_IMX6UL_OCRAM_ALIAS_ADDR, &s->ocram_alias);
 }
 
+static Property fsl_imx6ul_properties[] = {
+    DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0),
+    DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx6ul_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx6ul_properties);
     dc->realize = fsl_imx6ul_realize;
     dc->desc = "i.MX6UL SOC";
     /* Reason: Uses serial_hds and nd_table in realize() directly */
index 37c89cc5f92f6f2d50b621ccfc1ab107c34459b7..fcbaf3dc861d47214af1baf63bf5c27b1c3800ca 100644 (file)
@@ -87,6 +87,8 @@ typedef struct FslIMX6ULState {
     MemoryRegion       caam;
     MemoryRegion       ocram;
     MemoryRegion       ocram_alias;
+
+    uint32_t           phy_num[FSL_IMX6UL_NUM_ETHS];
 } FslIMX6ULState;
 
 enum FslIMX6ULMemoryMap {
This page took 0.028695 seconds and 4 git commands to generate.