1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef __UCC_H__
16#define __UCC_H__
17
18#include <soc/fsl/qe/immap_qe.h>
19#include <soc/fsl/qe/qe.h>
20
21#define STATISTICS
22
23#define UCC_MAX_NUM 8
24
25
26
27enum ucc_speed_type {
28 UCC_SPEED_TYPE_FAST = UCC_GUEMR_MODE_FAST_RX | UCC_GUEMR_MODE_FAST_TX,
29 UCC_SPEED_TYPE_SLOW = UCC_GUEMR_MODE_SLOW_RX | UCC_GUEMR_MODE_SLOW_TX
30};
31
32
33
34
35
36
37
38int ucc_set_type(unsigned int ucc_num, enum ucc_speed_type speed);
39
40int ucc_set_qe_mux_mii_mng(unsigned int ucc_num);
41
42int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
43 enum comm_dir mode);
44int ucc_set_tdm_rxtx_clk(unsigned int tdm_num, enum qe_clock clock,
45 enum comm_dir mode);
46int ucc_set_tdm_rxtx_sync(unsigned int tdm_num, enum qe_clock clock,
47 enum comm_dir mode);
48
49int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask);
50
51
52
53static inline int ucc_set_qe_mux_grant(unsigned int ucc_num, int set)
54{
55 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_GRANT);
56}
57
58static inline int ucc_set_qe_mux_tsa(unsigned int ucc_num, int set)
59{
60 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_TSA);
61}
62
63static inline int ucc_set_qe_mux_bkpt(unsigned int ucc_num, int set)
64{
65 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_BKPT);
66}
67
68#endif
69