mirror of https://github.com/xemu-project/xemu.git
fsl-imx6ul: Add fec[12]-phy-connected properties
Add fec[12]-phy-connected properties and use it to set phy-connected and phy-consumer properties for imx_fec. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Message-id: 20230315145248.1639364-3-linux@roeck-us.net Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
df3f5efe10
commit
bc14018c2d
|
@ -407,7 +407,23 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ethernet
|
* Ethernet
|
||||||
|
*
|
||||||
|
* We must use two loops since phy_connected affects the other interface
|
||||||
|
* and we have to set all properties before calling sysbus_realize().
|
||||||
*/
|
*/
|
||||||
|
for (i = 0; i < FSL_IMX6UL_NUM_ETHS; i++) {
|
||||||
|
object_property_set_bool(OBJECT(&s->eth[i]), "phy-connected",
|
||||||
|
s->phy_connected[i], &error_abort);
|
||||||
|
/*
|
||||||
|
* If the MDIO bus on this controller is not connected, assume the
|
||||||
|
* other controller provides support for it.
|
||||||
|
*/
|
||||||
|
if (!s->phy_connected[i]) {
|
||||||
|
object_property_set_link(OBJECT(&s->eth[1 - i]), "phy-consumer",
|
||||||
|
OBJECT(&s->eth[i]), &error_abort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < FSL_IMX6UL_NUM_ETHS; i++) {
|
for (i = 0; i < FSL_IMX6UL_NUM_ETHS; i++) {
|
||||||
static const hwaddr FSL_IMX6UL_ENETn_ADDR[FSL_IMX6UL_NUM_ETHS] = {
|
static const hwaddr FSL_IMX6UL_ENETn_ADDR[FSL_IMX6UL_NUM_ETHS] = {
|
||||||
FSL_IMX6UL_ENET1_ADDR,
|
FSL_IMX6UL_ENET1_ADDR,
|
||||||
|
@ -620,6 +636,10 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
|
||||||
static Property fsl_imx6ul_properties[] = {
|
static Property fsl_imx6ul_properties[] = {
|
||||||
DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0),
|
DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0),
|
||||||
DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1),
|
DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1),
|
||||||
|
DEFINE_PROP_BOOL("fec1-phy-connected", FslIMX6ULState, phy_connected[0],
|
||||||
|
true),
|
||||||
|
DEFINE_PROP_BOOL("fec2-phy-connected", FslIMX6ULState, phy_connected[1],
|
||||||
|
true),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ struct FslIMX6ULState {
|
||||||
MemoryRegion ocram_alias;
|
MemoryRegion ocram_alias;
|
||||||
|
|
||||||
uint32_t phy_num[FSL_IMX6UL_NUM_ETHS];
|
uint32_t phy_num[FSL_IMX6UL_NUM_ETHS];
|
||||||
|
bool phy_connected[FSL_IMX6UL_NUM_ETHS];
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FslIMX6ULMemoryMap {
|
enum FslIMX6ULMemoryMap {
|
||||||
|
|
Loading…
Reference in New Issue