1 /***********************license start***************
2 * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * * Neither the name of Cavium Networks nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29 * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
42 #ifndef __CVMX_IXF18201_H__
43 #define __CVMX_IXF18201_H__
50 * Initialize the IXF18201 SPI<->XAUI MAC.
51 * @return 1 on success
54 int cvmx_ixf18201_init(void);
57 * Read a 16 bit register from the IXF18201
59 * @param reg_addr Register address
61 * @return 16 bit register value
63 uint16_t cvmx_ixf18201_read16(uint16_t reg_addr);
65 * Write a 16 bit IXF18201 register
67 * @param reg_addr Register address
68 * @param data Value to write
71 void cvmx_ixf18201_write16(uint16_t reg_addr, uint16_t data);
73 * Write a 16 bit IXF18201 register
75 * @param reg_addr Register address (must be 4 byte aligned)
77 * @return 32 bit register value
79 uint32_t cvmx_ixf18201_read32(uint16_t reg_addr);
81 * Write a 32 bit IXF18201 register
83 * @param reg_addr Register address (must be 4 byte aligned)
84 * @param data Value to write
87 void cvmx_ixf18201_write32(uint16_t reg_addr, uint32_t data);
90 * Performs an MII clause 45 write using the MII block in IXF18201.
92 * @param mii_addr Device MII address
93 * @param mmd MMD address (block within device)
94 * @param reg Register address
95 * @param val Value to write
97 void cvmx_ixf18201_mii_write(int mii_addr, int mmd, uint16_t reg, uint16_t val);
99 * Performs an MII clause 45 read using the MII block in IXF18201.
101 * @param mii_addr Device MII address
102 * @param mmd MMD address (block within device)
103 * @param reg Register address
104 * @return register value read from device
106 int cvmx_ixf18201_mii_read(int mii_addr, int mmd, uint16_t reg);
112 #endif /* __CVMX_IXF18201_H__ */