[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/25] Add the ability to change the FEC PHY MDIO devices numbers
From: |
Peter Maydell |
Subject: |
[PULL 05/25] Add the ability to change the FEC PHY MDIO devices numbers on i.MX7 processor |
Date: |
Mon, 13 Jul 2020 15:10:44 +0100 |
From: Jean-Christophe Dubois <jcd@tribudubois.net>
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
Message-id:
c850187322be9930e47c8b234c385a7d0da245cb.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>
---
include/hw/arm/fsl-imx7.h | 1 +
hw/arm/fsl-imx7.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
index da977f9ffb4..ad889237077 100644
--- a/include/hw/arm/fsl-imx7.h
+++ b/include/hw/arm/fsl-imx7.h
@@ -81,6 +81,7 @@ typedef struct FslIMX7State {
IMX7GPRState gpr;
ChipideaState usb[FSL_IMX7_NUM_USBS];
DesignwarePCIEHost pcie;
+ uint32_t phy_num[FSL_IMX7_NUM_ETHS];
} FslIMX7State;
enum FslIMX7MemoryMap {
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
index fad637d3288..2ff2cab9246 100644
--- a/hw/arm/fsl-imx7.c
+++ b/hw/arm/fsl-imx7.c
@@ -363,6 +363,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
FSL_IMX7_ENET2_ADDR,
};
+ object_property_set_uint(OBJECT(&s->eth[i]), "phy-num",
+ s->phy_num[i], &error_abort);
object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort);
qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
@@ -550,10 +552,17 @@ static void fsl_imx7_realize(DeviceState *dev, Error
**errp)
FSL_IMX7_PCIE_PHY_SIZE);
}
+static Property fsl_imx7_properties[] = {
+ DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0),
+ DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void fsl_imx7_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ device_class_set_props(dc, fsl_imx7_properties);
dc->realize = fsl_imx7_realize;
/* Reason: Uses serial_hds and nd_table in realize() directly */
--
2.20.1
- [PULL 00/25] target-arm queue, Peter Maydell, 2020/07/13
- [PULL 01/25] hw/arm/bcm2836: Remove unused 'cpu_type' field, Peter Maydell, 2020/07/13
- [PULL 02/25] target/arm: Fix mtedesc for do_mem_zpz, Peter Maydell, 2020/07/13
- [PULL 03/25] Add the ability to change the FEC PHY MDIO device number on i.MX25 processor, Peter Maydell, 2020/07/13
- [PULL 04/25] Add the ability to change the FEC PHY MDIO device number on i.MX6 processor, Peter Maydell, 2020/07/13
- [PULL 06/25] target/arm: Don't do raw writes for PMINTENCLR, Peter Maydell, 2020/07/13
- [PULL 05/25] Add the ability to change the FEC PHY MDIO devices numbers on i.MX7 processor,
Peter Maydell <=
- [PULL 07/25] virtio-iommu: Fix coverity issue in virtio_iommu_handle_command(), Peter Maydell, 2020/07/13
- [PULL 08/25] build: Enable BSD symbols for Haiku, Peter Maydell, 2020/07/13
- [PULL 09/25] util/qemu-openpty.c: Don't assume pty.h is glibc-only, Peter Maydell, 2020/07/13
- [PULL 10/25] build: Check that mlockall() exists, Peter Maydell, 2020/07/13
- [PULL 11/25] osdep.h: Always include <sys/signal.h> if it exists, Peter Maydell, 2020/07/13
- [PULL 12/25] osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL, Peter Maydell, 2020/07/13
- [PULL 14/25] util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFD, Peter Maydell, 2020/07/13
- [PULL 13/25] bswap.h: Include <endian.h> on Haiku for bswap operations, Peter Maydell, 2020/07/13
- [PULL 15/25] util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku, Peter Maydell, 2020/07/13
- [PULL 16/25] util/drm: make portable by avoiding struct dirent d_type, Peter Maydell, 2020/07/13