Lines Matching +full:3 +full:- +full:c22
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2009-2016 Cavium, Inc.
11 #include "mdio-cavium.h"
18 if (m == p->mode) in cavium_mdiobus_set_mode()
21 smi_clk.u64 = oct_mdio_readq(p->register_base + SMI_CLK); in cavium_mdiobus_set_mode()
24 oct_mdio_writeq(smi_clk.u64, p->register_base + SMI_CLK); in cavium_mdiobus_set_mode()
25 p->mode = m; in cavium_mdiobus_set_mode()
39 oct_mdio_writeq(smi_wr.u64, p->register_base + SMI_WR_DAT); in cavium_mdiobus_c45_addr()
45 oct_mdio_writeq(smi_cmd.u64, p->register_base + SMI_CMD); in cavium_mdiobus_c45_addr()
52 smi_wr.u64 = oct_mdio_readq(p->register_base + SMI_WR_DAT); in cavium_mdiobus_c45_addr()
53 } while (smi_wr.s.pending && --timeout); in cavium_mdiobus_c45_addr()
56 return -EIO; in cavium_mdiobus_c45_addr()
62 struct cavium_mdiobus *p = bus->priv; in cavium_mdiobus_read_c22()
67 cavium_mdiobus_set_mode(p, C22); in cavium_mdiobus_read_c22()
73 oct_mdio_writeq(smi_cmd.u64, p->register_base + SMI_CMD); in cavium_mdiobus_read_c22()
80 smi_rd.u64 = oct_mdio_readq(p->register_base + SMI_RD_DAT); in cavium_mdiobus_read_c22()
81 } while (smi_rd.s.pending && --timeout); in cavium_mdiobus_read_c22()
86 return -EIO; in cavium_mdiobus_read_c22()
93 struct cavium_mdiobus *p = bus->priv; in cavium_mdiobus_read_c45()
104 smi_cmd.s.phy_op = 3; /* MDIO_CLAUSE_45_READ */ in cavium_mdiobus_read_c45()
107 oct_mdio_writeq(smi_cmd.u64, p->register_base + SMI_CMD); in cavium_mdiobus_read_c45()
114 smi_rd.u64 = oct_mdio_readq(p->register_base + SMI_RD_DAT); in cavium_mdiobus_read_c45()
115 } while (smi_rd.s.pending && --timeout); in cavium_mdiobus_read_c45()
120 return -EIO; in cavium_mdiobus_read_c45()
127 struct cavium_mdiobus *p = bus->priv; in cavium_mdiobus_write_c22()
132 cavium_mdiobus_set_mode(p, C22); in cavium_mdiobus_write_c22()
136 oct_mdio_writeq(smi_wr.u64, p->register_base + SMI_WR_DAT); in cavium_mdiobus_write_c22()
142 oct_mdio_writeq(smi_cmd.u64, p->register_base + SMI_CMD); in cavium_mdiobus_write_c22()
149 smi_wr.u64 = oct_mdio_readq(p->register_base + SMI_WR_DAT); in cavium_mdiobus_write_c22()
150 } while (smi_wr.s.pending && --timeout); in cavium_mdiobus_write_c22()
153 return -EIO; in cavium_mdiobus_write_c22()
162 struct cavium_mdiobus *p = bus->priv; in cavium_mdiobus_write_c45()
174 oct_mdio_writeq(smi_wr.u64, p->register_base + SMI_WR_DAT); in cavium_mdiobus_write_c45()
180 oct_mdio_writeq(smi_cmd.u64, p->register_base + SMI_CMD); in cavium_mdiobus_write_c45()
187 smi_wr.u64 = oct_mdio_readq(p->register_base + SMI_WR_DAT); in cavium_mdiobus_write_c45()
188 } while (smi_wr.s.pending && --timeout); in cavium_mdiobus_write_c45()
191 return -EIO; in cavium_mdiobus_write_c45()