2 * Copyright (C) 2013 Realtek Semiconductor Corp.
5 * Unless you and Realtek execute a separate written software license
6 * agreement governing use of this software, this software is licensed
7 * to you under the terms of the GNU General Public License version 2,
8 * available at https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
10 * Purpose : RTL8367C switch low-level function for access register
11 * Feature : SMI related functions
18 #include <rtk_types.h>
19 #include "rtk_error.h"
21 #define MDC_MDIO_CTRL0_REG 31
22 #define MDC_MDIO_START_REG 29
23 #define MDC_MDIO_CTRL1_REG 21
24 #define MDC_MDIO_ADDRESS_REG 23
25 #define MDC_MDIO_DATA_WRITE_REG 24
26 #define MDC_MDIO_DATA_READ_REG 25
27 #define MDC_MDIO_PREAMBLE_LEN 32
29 #define MDC_MDIO_START_OP 0xFFFF
30 #define MDC_MDIO_ADDR_OP 0x000E
31 #define MDC_MDIO_READ_OP 0x0001
32 #define MDC_MDIO_WRITE_OP 0x0003
34 #define SPI_READ_OP 0x3
35 #define SPI_WRITE_OP 0x2
36 #define SPI_READ_OP_LEN 0x8
37 #define SPI_WRITE_OP_LEN 0x8
38 #define SPI_REG_LEN 16
39 #define SPI_DATA_LEN 16
42 #define GPIO_DIR_OUT 0
47 #define CLK_DURATION(clk) { int i; for(i=0; i<clk; i++); }
49 rtk_int32
smi_read(rtk_uint32 mAddrs
, rtk_uint32
*rData
);
50 rtk_int32
smi_write(rtk_uint32 mAddrs
, rtk_uint32 rData
);
52 #endif /* __SMI_H__ */