12 #include <linux/module.h>
21 #define DRV_VERSION "1.0"
22 #define DRV_DESCRIPTION "Cavium Networks Octeon SMI/MDIO driver"
25 #define SMI_WR_DAT 0x8
26 #define SMI_RD_DAT 0x10
48 smi_cmd.
s.reg_adr = regnum;
58 }
while (smi_rd.
s.pending && --timeout);
66 static int octeon_mdiobus_write(
struct mii_bus *bus,
int phy_id,
81 smi_cmd.
s.reg_adr = regnum;
91 }
while (smi_wr.s.pending && --timeout);
112 if (res_mem ==
NULL) {
113 dev_err(&pdev->
dev,
"found no memory resource\n");
118 bus->
regsize = resource_size(res_mem);
121 dev_err(&pdev->
dev,
"request_mem_region failed\n");
127 bus->
mii_bus = mdiobus_alloc();
138 bus->
mii_bus->name =
"mdio-octeon";
142 bus->
mii_bus->read = octeon_mdiobus_read;
143 bus->
mii_bus->write = octeon_mdiobus_write;
172 cvmx_write_csr(bus->register_base +
SMI_EN, smi_en.u64);
178 .compatible =
"cavium,octeon-3860-mdio",
186 .name =
"mdio-octeon",
188 .of_match_table = octeon_mdiobus_match,
190 .probe = octeon_mdiobus_probe,
200 static int __init octeon_mdiobus_mod_init(
void)
205 static void __exit octeon_mdiobus_mod_exit(
void)