kernel: add missing config symbols for 5.15
[openwrt/openwrt.git] / target / linux / mediatek / files-5.10 / drivers / net / phy / rtk / rtl8367c / include / smi.h
1 /*
2 * Copyright (C) 2013 Realtek Semiconductor Corp.
3 * All Rights Reserved.
4 *
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
9 *
10 * Purpose : RTL8367C switch low-level function for access register
11 * Feature : SMI related functions
12 *
13 */
14
15 #ifndef __SMI_H__
16 #define __SMI_H__
17
18 #include <rtk_types.h>
19 #include "rtk_error.h"
20
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
28
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
33
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
40
41 #define GPIO_DIR_IN 1
42 #define GPIO_DIR_OUT 0
43
44 #define ack_timer 5
45
46 #define DELAY 10000
47 #define CLK_DURATION(clk) { int i; for(i=0; i<clk; i++); }
48
49 rtk_int32 smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData);
50 rtk_int32 smi_write(rtk_uint32 mAddrs, rtk_uint32 rData);
51
52 #endif /* __SMI_H__ */
53
54