Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2012 Freescale Semiconductor, Inc. |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <asm/fsl_serdes.h> |
| 8 | #include <asm/processor.h> |
| 9 | #include <asm/io.h> |
| 10 | #include "fsl_corenet2_serdes.h" |
| 11 | |
| 12 | struct serdes_config { |
| 13 | u32 protocol; |
| 14 | u8 lanes[SRDS_MAX_LANES]; |
| 15 | }; |
| 16 | |
York Sun | 0fad326 | 2016-11-21 13:35:41 -0800 | [diff] [blame] | 17 | #ifdef CONFIG_ARCH_T4240 |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 18 | static const struct serdes_config serdes1_cfg_tbl[] = { |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 19 | /* SerDes 1 */ |
| 20 | {1, {XAUI_FM1_MAC9, XAUI_FM1_MAC9, |
| 21 | XAUI_FM1_MAC9, XAUI_FM1_MAC9, |
| 22 | XAUI_FM1_MAC10, XAUI_FM1_MAC10, |
| 23 | XAUI_FM1_MAC10, XAUI_FM1_MAC10}}, |
| 24 | {2, {HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, |
| 25 | HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, |
| 26 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10, |
| 27 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10}}, |
| 28 | {4, {HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, |
| 29 | HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, |
| 30 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10, |
| 31 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 32 | {27, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 33 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 34 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 35 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 36 | {28, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 37 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 38 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 39 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 40 | {35, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 41 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 42 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 43 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 44 | {36, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 45 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 46 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 47 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 48 | {37, {NONE, NONE, QSGMII_FM1_B, NONE, |
| 49 | NONE, NONE, QSGMII_FM1_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 50 | {38, {NONE, NONE, QSGMII_FM1_B, NONE, |
| 51 | NONE, NONE, QSGMII_FM1_A, NONE}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 52 | {39, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 53 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 54 | NONE, NONE, QSGMII_FM1_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 55 | {40, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 56 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 57 | NONE, NONE, QSGMII_FM1_A, NONE}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 58 | {45, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 59 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 60 | NONE, NONE, QSGMII_FM1_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 61 | {46, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 62 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 63 | NONE, NONE, QSGMII_FM1_A, NONE}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 64 | {47, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 65 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 66 | NONE, NONE, QSGMII_FM1_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 67 | {48, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, |
| 68 | SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, |
| 69 | NONE, NONE, QSGMII_FM1_A, NONE}}, |
| 70 | {} |
| 71 | }; |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 72 | static const struct serdes_config serdes2_cfg_tbl[] = { |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 73 | /* SerDes 2 */ |
| 74 | {1, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 75 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 76 | XAUI_FM2_MAC10, XAUI_FM2_MAC10, |
| 77 | XAUI_FM2_MAC10, XAUI_FM2_MAC10}}, |
| 78 | {2, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 79 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 80 | HIGIG_FM2_MAC10, HIGIG_FM2_MAC10, |
| 81 | HIGIG_FM2_MAC10, HIGIG_FM2_MAC10}}, |
| 82 | {4, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 83 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 84 | HIGIG_FM2_MAC10, HIGIG_FM2_MAC10, |
| 85 | HIGIG_FM2_MAC10, HIGIG_FM2_MAC10}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 86 | {6, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 87 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 88 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 89 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 90 | {7, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 91 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 92 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 93 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 94 | {12, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 95 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 96 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 97 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 98 | {13, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 99 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 100 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 101 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
| 102 | {14, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 103 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 104 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 105 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 106 | {15, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 107 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 108 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 109 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 110 | {16, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 111 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 112 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 113 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 114 | {21, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 115 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 116 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 117 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 118 | {22, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 119 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 120 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 121 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
| 122 | {23, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 123 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 124 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 125 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 126 | {24, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 127 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 128 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 129 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 130 | {25, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 131 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 132 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 133 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
| 134 | {26, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 135 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 136 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 137 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 138 | {27, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 139 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 140 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 141 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 142 | {28, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 143 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 144 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 145 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 146 | {35, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 147 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 148 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 149 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 150 | {36, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 151 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 152 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 153 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 154 | {37, {NONE, NONE, QSGMII_FM2_B, NONE, |
| 155 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 156 | {38, {NONE, NONE, QSGMII_FM2_B, NONE, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 157 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 158 | {39, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 159 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 160 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 161 | {40, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 162 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 163 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 164 | {45, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 165 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 166 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 167 | {46, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 168 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 169 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 170 | {47, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 171 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 172 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 173 | {48, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 174 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 175 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 176 | {49, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 177 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 178 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 179 | {50, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 180 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 181 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 182 | {51, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 183 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 184 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 185 | {52, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 186 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 187 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 188 | {53, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 189 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 190 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 191 | {54, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 192 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
Shaohui Xie | c218d29 | 2013-08-19 18:58:52 +0800 | [diff] [blame] | 193 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 194 | {55, {XFI_FM1_MAC9, XFI_FM1_MAC10, |
| 195 | XFI_FM2_MAC10, XFI_FM2_MAC9, |
| 196 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 197 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 198 | {56, {XFI_FM1_MAC9, XFI_FM1_MAC10, |
| 199 | XFI_FM2_MAC10, XFI_FM2_MAC9, |
| 200 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 201 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
| 202 | {57, {XFI_FM1_MAC9, XFI_FM1_MAC10, |
| 203 | XFI_FM2_MAC10, XFI_FM2_MAC9, |
| 204 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 205 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}}, |
| 206 | {} |
| 207 | }; |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 208 | static const struct serdes_config serdes3_cfg_tbl[] = { |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 209 | /* SerDes 3 */ |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 210 | {1, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 211 | {2, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 212 | {3, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE2, PCIE2, PCIE2, PCIE2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 213 | {4, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE2, PCIE2, PCIE2, PCIE2}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 214 | {5, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 215 | {6, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1}}, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 216 | {7, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
| 217 | {8, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 218 | {9, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 219 | INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN}}, |
| 220 | {10, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 221 | INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 222 | {11, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 223 | PCIE2, PCIE2, PCIE2, PCIE2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 224 | {12, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 225 | PCIE2, PCIE2, PCIE2, PCIE2}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 226 | {13, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 227 | PCIE2, PCIE2, PCIE2, PCIE2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 228 | {14, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 229 | PCIE2, PCIE2, PCIE2, PCIE2}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 230 | {15, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 231 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 232 | {16, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 233 | SRIO1, SRIO1, SRIO1, SRIO1}}, |
| 234 | {17, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 235 | SRIO1, SRIO1, SRIO1, SRIO1}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 236 | {18, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 237 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 238 | {19, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 239 | SRIO1, SRIO1, SRIO1, SRIO1}}, |
| 240 | {20, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 241 | SRIO1, SRIO1, SRIO1, SRIO1}}, |
| 242 | {} |
| 243 | }; |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 244 | static const struct serdes_config serdes4_cfg_tbl[] = { |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 245 | /* SerDes 4 */ |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 246 | {1, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 247 | {2, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 248 | {3, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, PCIE4, PCIE4} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 249 | {4, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, PCIE4, PCIE4}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 250 | {5, {PCIE3, PCIE3, PCIE3, PCIE3, SRIO2, SRIO2, SRIO2, SRIO2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 251 | {6, {PCIE3, PCIE3, PCIE3, PCIE3, SRIO2, SRIO2, SRIO2, SRIO2}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 252 | {7, {PCIE3, PCIE3, PCIE3, PCIE3, SRIO2, SRIO2, SRIO2, SRIO2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 253 | {8, {PCIE3, PCIE3, PCIE3, PCIE3, SRIO2, SRIO2, SRIO2, SRIO2}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 254 | {9, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SATA1, SATA2} }, |
Roy Zang | cc117ce | 2013-03-25 07:33:18 +0000 | [diff] [blame] | 255 | {10, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SATA1, SATA2} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 256 | {11, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SATA1, SATA2} }, |
Roy Zang | cc117ce | 2013-03-25 07:33:18 +0000 | [diff] [blame] | 257 | {12, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SATA1, SATA2} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 258 | {13, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SRIO2, SRIO2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 259 | {14, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SRIO2, SRIO2}}, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 260 | {15, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SRIO2, SRIO2} }, |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 261 | {16, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SRIO2, SRIO2}}, |
| 262 | {18, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, AURORA, AURORA}}, |
| 263 | {} |
| 264 | }; |
York Sun | c184503 | 2016-11-21 13:41:30 -0800 | [diff] [blame] | 265 | #elif defined(CONFIG_ARCH_T4160) |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 266 | static const struct serdes_config serdes1_cfg_tbl[] = { |
| 267 | /* SerDes 1 */ |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 268 | {1, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 269 | XAUI_FM1_MAC10, XAUI_FM1_MAC10, |
| 270 | XAUI_FM1_MAC10, XAUI_FM1_MAC10} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 271 | {2, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 272 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10, |
| 273 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 274 | {4, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 275 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10, |
| 276 | HIGIG_FM1_MAC10, HIGIG_FM1_MAC10} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 277 | {27, {NONE, NONE, NONE, NONE, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 278 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 279 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 280 | {28, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 281 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 282 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 283 | {35, {NONE, NONE, NONE, NONE, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 284 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 285 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 286 | {36, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 287 | SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, |
| 288 | SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 289 | {37, {NONE, NONE, NONE, NONE, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 290 | NONE, NONE, QSGMII_FM1_A, NONE} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 291 | {38, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 292 | NONE, NONE, QSGMII_FM1_A, NONE} }, |
| 293 | {} |
| 294 | }; |
| 295 | static const struct serdes_config serdes2_cfg_tbl[] = { |
| 296 | /* SerDes 2 */ |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 297 | {6, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 298 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 299 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 300 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 301 | {7, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 302 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 303 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 304 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 305 | {12, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 306 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 307 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 308 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 309 | {13, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 310 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 311 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 312 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 313 | {15, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 314 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 315 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 316 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 317 | {16, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 318 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 319 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 320 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 321 | {21, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 322 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 323 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 324 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 325 | {22, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 326 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 327 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 328 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 329 | {24, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 330 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 331 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 332 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 333 | {25, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 334 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 335 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 336 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
| 337 | {26, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 338 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 339 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 340 | NONE, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 341 | {27, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 342 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 343 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 344 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 345 | {28, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 346 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 347 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 348 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 349 | {35, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 350 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 351 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 352 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 353 | {36, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 354 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
| 355 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 356 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 357 | {37, {NONE, NONE, QSGMII_FM2_B, NONE, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 358 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 359 | {38, {NONE, NONE, QSGMII_FM2_B, NONE, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 360 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 361 | {39, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 362 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 363 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 364 | {40, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 365 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 366 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 367 | {45, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 368 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 369 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 370 | {46, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 371 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 372 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 373 | {47, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 374 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 375 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 376 | {48, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, |
| 377 | SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 378 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 379 | {49, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 380 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 381 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 382 | {50, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
| 383 | XAUI_FM2_MAC9, XAUI_FM2_MAC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 384 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 385 | {51, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 386 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 387 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 388 | {52, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 389 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 390 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 391 | {53, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 392 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 393 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 394 | {54, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
| 395 | HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 396 | NONE, NONE, QSGMII_FM2_A, NONE} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 397 | {55, {NONE, XFI_FM1_MAC10, |
| 398 | XFI_FM2_MAC10, NONE, |
| 399 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 400 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 401 | {56, {NONE, XFI_FM1_MAC10, |
| 402 | XFI_FM2_MAC10, NONE, |
| 403 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 404 | SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, |
| 405 | {57, {NONE, XFI_FM1_MAC10, |
| 406 | XFI_FM2_MAC10, NONE, |
| 407 | SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, |
| 408 | NONE, NONE} }, |
| 409 | {} |
| 410 | }; |
| 411 | static const struct serdes_config serdes3_cfg_tbl[] = { |
| 412 | /* SerDes 3 */ |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 413 | {1, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 414 | {2, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 415 | {3, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE2, PCIE2, PCIE2, PCIE2} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 416 | {4, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE2, PCIE2, PCIE2, PCIE2} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 417 | {5, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 418 | {6, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 419 | {7, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
| 420 | {8, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 421 | {9, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 422 | INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN} }, |
| 423 | {10, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 424 | INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 425 | {11, {NONE, NONE, NONE, NONE, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 426 | PCIE2, PCIE2, PCIE2, PCIE2} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 427 | {12, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 428 | PCIE2, PCIE2, PCIE2, PCIE2} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 429 | {13, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 430 | PCIE2, PCIE2, PCIE2, PCIE2} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 431 | {14, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 432 | PCIE2, PCIE2, PCIE2, PCIE2} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 433 | {15, {NONE, NONE, NONE, NONE, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 434 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 435 | {16, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 436 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 437 | {17, {NONE, NONE, NONE, NONE, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 438 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
Shaohui Xie | d9a1d83 | 2014-05-16 10:52:33 +0800 | [diff] [blame] | 439 | {18, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 440 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 441 | {19, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
| 442 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
| 443 | {20, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 444 | SRIO1, SRIO1, SRIO1, SRIO1} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 445 | {} |
| 446 | }; |
| 447 | static const struct serdes_config serdes4_cfg_tbl[] = { |
| 448 | /* SerDes 4 */ |
Shaohui Xie | 0a8a397 | 2015-07-29 11:28:36 +0800 | [diff] [blame] | 449 | {3, {NONE, NONE, NONE, NONE, PCIE4, PCIE4, PCIE4, PCIE4} }, |
| 450 | {4, {NONE, NONE, NONE, NONE, PCIE4, PCIE4, PCIE4, PCIE4} }, |
| 451 | {5, {NONE, NONE, NONE, NONE, SRIO2, SRIO2, SRIO2, SRIO2} }, |
| 452 | {6, {NONE, NONE, NONE, NONE, SRIO2, SRIO2, SRIO2, SRIO2} }, |
| 453 | {7, {NONE, NONE, NONE, NONE, SRIO2, SRIO2, SRIO2, SRIO2} }, |
| 454 | {8, {NONE, NONE, NONE, NONE, SRIO2, SRIO2, SRIO2, SRIO2} }, |
| 455 | {9, {NONE, NONE, NONE, NONE, PCIE4, PCIE4, SATA1, SATA2} }, |
| 456 | {10, {NONE, NONE, NONE, NONE, PCIE4, PCIE4, SATA1, SATA2} }, |
| 457 | {11, {NONE, NONE, NONE, NONE, AURORA, AURORA, SATA1, SATA2} }, |
| 458 | {12, {NONE, NONE, NONE, NONE, AURORA, AURORA, SATA1, SATA2} }, |
| 459 | {13, {NONE, NONE, NONE, NONE, AURORA, AURORA, SRIO2, SRIO2} }, |
| 460 | {14, {NONE, NONE, NONE, NONE, AURORA, AURORA, SRIO2, SRIO2} }, |
| 461 | {15, {NONE, NONE, NONE, NONE, AURORA, AURORA, SRIO2, SRIO2} }, |
| 462 | {16, {NONE, NONE, NONE, NONE, AURORA, AURORA, SRIO2, SRIO2} }, |
| 463 | {18, {NONE, NONE, NONE, NONE, AURORA, AURORA, AURORA, AURORA} }, |
York Sun | fb5137a | 2013-03-25 07:33:29 +0000 | [diff] [blame] | 464 | {} |
| 465 | } |
| 466 | ; |
| 467 | #else |
| 468 | #error "Need to define SerDes protocol" |
| 469 | #endif |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 470 | static const struct serdes_config *serdes_cfg_tbl[] = { |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 471 | serdes1_cfg_tbl, |
| 472 | serdes2_cfg_tbl, |
| 473 | serdes3_cfg_tbl, |
| 474 | serdes4_cfg_tbl, |
| 475 | }; |
| 476 | |
| 477 | enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane) |
| 478 | { |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 479 | const struct serdes_config *ptr; |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 480 | |
| 481 | if (serdes >= ARRAY_SIZE(serdes_cfg_tbl)) |
| 482 | return 0; |
| 483 | |
| 484 | ptr = serdes_cfg_tbl[serdes]; |
| 485 | while (ptr->protocol) { |
| 486 | if (ptr->protocol == cfg) |
| 487 | return ptr->lanes[lane]; |
| 488 | ptr++; |
| 489 | } |
| 490 | return 0; |
| 491 | } |
| 492 | |
| 493 | int is_serdes_prtcl_valid(int serdes, u32 prtcl) |
| 494 | { |
| 495 | int i; |
York Sun | 85e660f | 2013-03-25 07:33:28 +0000 | [diff] [blame] | 496 | const struct serdes_config *ptr; |
York Sun | 9941a22 | 2012-10-08 07:44:19 +0000 | [diff] [blame] | 497 | |
| 498 | if (serdes >= ARRAY_SIZE(serdes_cfg_tbl)) |
| 499 | return 0; |
| 500 | |
| 501 | ptr = serdes_cfg_tbl[serdes]; |
| 502 | while (ptr->protocol) { |
| 503 | if (ptr->protocol == prtcl) |
| 504 | break; |
| 505 | ptr++; |
| 506 | } |
| 507 | |
| 508 | if (!ptr->protocol) |
| 509 | return 0; |
| 510 | |
| 511 | for (i = 0; i < SRDS_MAX_LANES; i++) { |
| 512 | if (ptr->lanes[i] != NONE) |
| 513 | return 1; |
| 514 | } |
| 515 | |
| 516 | return 0; |
| 517 | } |