Lines Matching +full:ast2600 +full:- +full:mdio
1 // SPDX-License-Identifier: GPL-2.0-or-later
8 #include <linux/mdio.h>
15 #define DRV_NAME "mdio-aspeed"
51 struct aspeed_mdio *ctx = bus->priv; in aspeed_mdio_op()
54 dev_dbg(&bus->dev, "%s: st: %u op: %u, phyad: %u, regad: %u, data: %u\n", in aspeed_mdio_op()
64 iowrite32(ctrl, ctx->base + ASPEED_MDIO_CTRL); in aspeed_mdio_op()
66 return readl_poll_timeout(ctx->base + ASPEED_MDIO_CTRL, ctrl, in aspeed_mdio_op()
74 struct aspeed_mdio *ctx = bus->priv; in aspeed_mdio_get_data()
78 rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_DATA, data, in aspeed_mdio_get_data()
145 bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*ctx)); in aspeed_mdio_probe()
147 return -ENOMEM; in aspeed_mdio_probe()
149 ctx = bus->priv; in aspeed_mdio_probe()
150 ctx->base = devm_platform_ioremap_resource(pdev, 0); in aspeed_mdio_probe()
151 if (IS_ERR(ctx->base)) in aspeed_mdio_probe()
152 return PTR_ERR(ctx->base); in aspeed_mdio_probe()
154 ctx->reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); in aspeed_mdio_probe()
155 if (IS_ERR(ctx->reset)) in aspeed_mdio_probe()
156 return PTR_ERR(ctx->reset); in aspeed_mdio_probe()
158 reset_control_deassert(ctx->reset); in aspeed_mdio_probe()
160 bus->name = DRV_NAME; in aspeed_mdio_probe()
161 snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); in aspeed_mdio_probe()
162 bus->parent = &pdev->dev; in aspeed_mdio_probe()
163 bus->read = aspeed_mdio_read_c22; in aspeed_mdio_probe()
164 bus->write = aspeed_mdio_write_c22; in aspeed_mdio_probe()
165 bus->read_c45 = aspeed_mdio_read_c45; in aspeed_mdio_probe()
166 bus->write_c45 = aspeed_mdio_write_c45; in aspeed_mdio_probe()
168 rc = of_mdiobus_register(bus, pdev->dev.of_node); in aspeed_mdio_probe()
170 dev_err(&pdev->dev, "Cannot register MDIO bus!\n"); in aspeed_mdio_probe()
171 reset_control_assert(ctx->reset); in aspeed_mdio_probe()
183 struct aspeed_mdio *ctx = bus->priv; in aspeed_mdio_remove()
185 reset_control_assert(ctx->reset); in aspeed_mdio_remove()
190 { .compatible = "aspeed,ast2600-mdio", },
208 MODULE_DESCRIPTION("ASPEED MDIO bus controller");