phy-comphy-cp110.h 2.21 KB
Newer Older
1
2
3
4
5
6
7
/*
 * Copyright (C) 2018 Marvell International Ltd.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 * https://spdx.org/licenses
 */

8
9
/* Those are parameters for xfi mode, which need to be tune for each board type.
 * For known DB boards the parameters was already calibrated and placed under
10
 * the plat/marvell/armada/a8k/<board_type>/board/phy-porting-layer.h
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 */
struct xfi_params {
	uint8_t g1_ffe_res_sel;
	uint8_t g1_ffe_cap_sel;
	uint8_t align90;
	uint8_t g1_dfe_res;
	uint8_t g1_amp;
	uint8_t g1_emph;
	uint8_t g1_emph_en;
	uint8_t g1_tx_amp_adj;
	uint8_t g1_tx_emph_en;
	uint8_t g1_tx_emph;
	uint8_t g1_rx_selmuff;
	uint8_t g1_rx_selmufi;
	uint8_t g1_rx_selmupf;
	uint8_t g1_rx_selmupi;
	_Bool valid;
};

struct sata_params {
	uint8_t g1_amp;
	uint8_t g2_amp;
	uint8_t g3_amp;

	uint8_t g1_emph;
	uint8_t g2_emph;
	uint8_t g3_emph;

	uint8_t g1_emph_en;
	uint8_t g2_emph_en;
	uint8_t g3_emph_en;

	uint8_t g1_tx_amp_adj;
	uint8_t g2_tx_amp_adj;
	uint8_t g3_tx_amp_adj;

	uint8_t g1_tx_emph_en;
	uint8_t g2_tx_emph_en;
	uint8_t g3_tx_emph_en;

	uint8_t g1_tx_emph;
	uint8_t g2_tx_emph;
	uint8_t g3_tx_emph;

	uint8_t g3_dfe_res;

	uint8_t g3_ffe_res_sel;

	uint8_t g3_ffe_cap_sel;

	uint8_t align90;

	uint8_t g1_rx_selmuff;
	uint8_t g2_rx_selmuff;
	uint8_t g3_rx_selmuff;

	uint8_t g1_rx_selmufi;
	uint8_t g2_rx_selmufi;
	uint8_t g3_rx_selmufi;

	uint8_t g1_rx_selmupf;
	uint8_t g2_rx_selmupf;
	uint8_t g3_rx_selmupf;

	uint8_t g1_rx_selmupi;
	uint8_t g2_rx_selmupi;
	uint8_t g3_rx_selmupi;

79
80
	uint8_t polarity_invert;

81
82
	_Bool valid;
};
83

84
85
86
87
struct usb_params {
	uint8_t polarity_invert;
};

88
int mvebu_cp110_comphy_is_pll_locked(uint64_t comphy_base,
89
				     uint8_t comphy_index);
90
int mvebu_cp110_comphy_power_off(uint64_t comphy_base,
91
				 uint8_t comphy_index, uint64_t comphy_mode);
92
93
94
int mvebu_cp110_comphy_power_on(uint64_t comphy_base, uint8_t comphy_index,
				uint64_t comphy_mode,
				uint64_t comphy_train_base);
95
96
97
98
int mvebu_cp110_comphy_xfi_rx_training(uint64_t comphy_base,
				       uint8_t comphy_index);
int mvebu_cp110_comphy_digital_reset(uint64_t comphy_base, uint8_t comphy_index,
				     uint32_t comphy_mode, uint32_t command);
99
100
101
102

#define COMPHY_POLARITY_NO_INVERT	0
#define COMPHY_POLARITY_TXD_INVERT	1
#define COMPHY_POLARITY_RXD_INVERT	2