[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/34] Add the ability to select a different PHY for each i.MX6UL
From: |
Peter Maydell |
Subject: |
[PULL 02/34] Add the ability to select a different PHY for each i.MX6UL FEC interface |
Date: |
Fri, 3 Jul 2020 17:53:33 +0100 |
From: Jean-Christophe Dubois <jcd@tribudubois.net>
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 <jcd@tribudubois.net>
Message-id:
ea1d604198b6b73ea6521676e45bacfc597aba53.1593296112.git.jcd@tribudubois.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/arm/fsl-imx6ul.h | 2 ++
hw/arm/fsl-imx6ul.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
index 37c89cc5f92..fcbaf3dc861 100644
--- a/include/hw/arm/fsl-imx6ul.h
+++ b/include/hw/arm/fsl-imx6ul.h
@@ -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 {
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
index 6446034711e..51b2f256ec8 100644
--- a/hw/arm/fsl-imx6ul.c
+++ b/hw/arm/fsl-imx6ul.c
@@ -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 */
--
2.20.1
- [PULL 00/34] target-arm queue, Peter Maydell, 2020/07/03
- [PULL 01/34] Add a phy-num property to the i.MX FEC emulator, Peter Maydell, 2020/07/03
- [PULL 03/34] Select MDIO device 2 and 1 as PHY devices for i.MX6UL EVK board., Peter Maydell, 2020/07/03
- [PULL 02/34] Add the ability to select a different PHY for each i.MX6UL FEC interface,
Peter Maydell <=
- [PULL 04/34] qdev: Introduce DEFINE_PROP_RESERVED_REGION, Peter Maydell, 2020/07/03
- [PULL 05/34] virtio-iommu: Implement RESV_MEM probe request, Peter Maydell, 2020/07/03
- [PULL 06/34] virtio-iommu: Handle reserved regions in the translation process, Peter Maydell, 2020/07/03
- [PULL 08/34] hw/arm/virt: Let the virtio-iommu bypass MSIs, Peter Maydell, 2020/07/03
- [PULL 07/34] virtio-iommu-pci: Add array of Interval properties, Peter Maydell, 2020/07/03
- [PULL 09/34] target/arm: kvm: Handle DABT with no valid ISS, Peter Maydell, 2020/07/03
- [PULL 10/34] target/arm: kvm: Handle misconfigured dabt injection, Peter Maydell, 2020/07/03
- [PULL 12/34] tests/acpi: virt: allow DSDT acpi table changes, Peter Maydell, 2020/07/03