2 * Copyright 2009-2011 Freescale Semiconductor, Inc.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
27 #include <asm/fsl_serdes.h>
28 #include <asm/immap_85xx.h>
30 #include <asm/processor.h>
31 #include <asm/fsl_law.h>
32 #include <asm/errno.h>
33 #include "fsl_corenet_serdes.h"
36 * The work-arounds for erratum SERDES8 and SERDES-A001 are linked together.
37 * The code is already very complicated as it is, and separating the two
38 * completely would just make things worse. We try to keep them as separate
39 * as possible, but for now we require SERDES8 if SERDES_A001 is defined.
41 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
42 #ifndef CONFIG_SYS_P4080_ERRATUM_SERDES8
43 #error "CONFIG_SYS_P4080_ERRATUM_SERDES_A001 requires CONFIG_SYS_P4080_ERRATUM_SERDES8"
47 static u32 serdes_prtcl_map;
49 #define HWCONFIG_BUFFER_SIZE 128
52 static const char *serdes_prtcl_str[] = {
62 [SGMII_FM1_DTSEC1] = "SGMII_FM1_DTSEC1",
63 [SGMII_FM1_DTSEC2] = "SGMII_FM1_DTSEC2",
64 [SGMII_FM1_DTSEC3] = "SGMII_FM1_DTSEC3",
65 [SGMII_FM1_DTSEC4] = "SGMII_FM1_DTSEC4",
66 [SGMII_FM1_DTSEC5] = "SGMII_FM1_DTSEC5",
67 [SGMII_FM2_DTSEC1] = "SGMII_FM2_DTSEC1",
68 [SGMII_FM2_DTSEC2] = "SGMII_FM2_DTSEC2",
69 [SGMII_FM2_DTSEC3] = "SGMII_FM2_DTSEC3",
70 [SGMII_FM2_DTSEC4] = "SGMII_FM2_DTSEC4",
71 [SGMII_FM2_DTSEC5] = "SGMII_FM2_DTSEC5",
72 [XAUI_FM1] = "XAUI_FM1",
73 [XAUI_FM2] = "XAUI_FM2",
80 unsigned int lpd; /* RCW lane powerdown bit */
82 } lanes[SRDS_MAX_LANES] = {
83 { 0, 152, FSL_SRDS_BANK_1 },
84 { 1, 153, FSL_SRDS_BANK_1 },
85 { 2, 154, FSL_SRDS_BANK_1 },
86 { 3, 155, FSL_SRDS_BANK_1 },
87 { 4, 156, FSL_SRDS_BANK_1 },
88 { 5, 157, FSL_SRDS_BANK_1 },
89 { 6, 158, FSL_SRDS_BANK_1 },
90 { 7, 159, FSL_SRDS_BANK_1 },
91 { 8, 160, FSL_SRDS_BANK_1 },
92 { 9, 161, FSL_SRDS_BANK_1 },
93 { 16, 162, FSL_SRDS_BANK_2 },
94 { 17, 163, FSL_SRDS_BANK_2 },
95 { 18, 164, FSL_SRDS_BANK_2 },
96 { 19, 165, FSL_SRDS_BANK_2 },
97 { 20, 170, FSL_SRDS_BANK_3 },
98 { 21, 171, FSL_SRDS_BANK_3 },
99 { 22, 172, FSL_SRDS_BANK_3 },
100 { 23, 173, FSL_SRDS_BANK_3 },
103 int serdes_get_lane_idx(int lane)
105 return lanes[lane].idx;
108 int serdes_get_bank_by_lane(int lane)
110 return lanes[lane].bank;
113 int serdes_lane_enabled(int lane)
115 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
116 serdes_corenet_t *regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
118 int bank = lanes[lane].bank;
119 int word = lanes[lane].lpd / 32;
120 int bit = lanes[lane].lpd % 32;
122 if (in_be32(®s->bank[bank].rstctl) & SRDS_RSTCTL_SDPD)
125 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
127 * For banks two and three, use the srds_lpd_b[] array instead of the
128 * RCW, because this array contains the real values of SRDS_LPD_B2 and
132 return !(srds_lpd_b[bank] & (8 >> (lane - (6 + 4 * bank))));
135 return !(in_be32(&gur->rcwsr[word]) & (0x80000000 >> bit));
138 int is_serdes_configured(enum srds_prtcl device)
140 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
142 /* Is serdes enabled at all? */
143 if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN))
146 return (1 << device) & serdes_prtcl_map;
149 static int __serdes_get_first_lane(uint32_t prtcl, enum srds_prtcl device)
153 for (i = 0; i < SRDS_MAX_LANES; i++) {
154 if (serdes_get_prtcl(prtcl, i) == device)
162 * Returns the SERDES lane (0..SRDS_MAX_LANES-1) that routes to the given
163 * device. This depends on the current SERDES protocol, as defined in the RCW.
165 * Returns a negative error code if SERDES is disabled or the given device is
166 * not supported in the current SERDES protocol.
168 int serdes_get_first_lane(enum srds_prtcl device)
171 const ccsr_gur_t *gur;
173 gur = (typeof(gur))CONFIG_SYS_MPC85xx_GUTS_ADDR;
175 /* Is serdes enabled at all? */
176 if (unlikely((in_be32(&gur->rcwsr[5]) & 0x2000) == 0))
179 prtcl = (in_be32(&gur->rcwsr[4]) & FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
181 return __serdes_get_first_lane(prtcl, device);
184 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
186 * Returns the SERDES bank (1, 2, or 3) that a given device is on for a given
189 * Returns a negative error code if the given device is not supported for the
190 * given SERDES protocol.
192 static int serdes_get_bank_by_device(uint32_t prtcl, enum srds_prtcl device)
196 lane = __serdes_get_first_lane(prtcl, device);
197 if (unlikely(lane < 0))
200 return serdes_get_bank_by_lane(lane);
203 static uint32_t __serdes_get_lane_count(uint32_t prtcl, enum srds_prtcl device,
208 for (lane = first; lane < SRDS_MAX_LANES; lane++) {
209 if (serdes_get_prtcl(prtcl, lane) != device)
216 static void __serdes_reset_rx(serdes_corenet_t *regs,
218 enum srds_prtcl device)
220 int lane, idx, first, last;
222 lane = __serdes_get_first_lane(prtcl, device);
223 if (unlikely(lane < 0))
225 first = serdes_get_lane_idx(lane);
226 last = first + __serdes_get_lane_count(prtcl, device, lane);
229 * Set BnGCRy0[RRST] = 0 for each lane in the each bank that is
230 * selected as XAUI to place the lane into reset.
232 for (idx = first; idx < last; idx++)
233 clrbits_be32(®s->lane[idx].gcr0, SRDS_GCR0_RRST);
235 /* Wait at least 250 ns */
239 * Set BnGCRy0[RRST] = 1 for each lane in the each bank that is
240 * selected as XAUI to bring the lane out of reset.
242 for (idx = first; idx < last; idx++)
243 setbits_be32(®s->lane[idx].gcr0, SRDS_GCR0_RRST);
246 void serdes_reset_rx(enum srds_prtcl device)
249 const ccsr_gur_t *gur;
250 serdes_corenet_t *regs;
252 if (unlikely(device == NONE))
255 gur = (typeof(gur))CONFIG_SYS_MPC85xx_GUTS_ADDR;
257 /* Is serdes enabled at all? */
258 if (unlikely((in_be32(&gur->rcwsr[5]) & 0x2000) == 0))
261 regs = (typeof(regs))CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
262 prtcl = (in_be32(&gur->rcwsr[4]) & FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
264 __serdes_reset_rx(regs, prtcl, device);
268 #ifndef CONFIG_SYS_DCSRBAR_PHYS
269 #define CONFIG_SYS_DCSRBAR_PHYS 0x80000000 /* Must be 1GB-aligned for rev1.0 */
270 #define CONFIG_SYS_DCSRBAR 0x80000000
271 #define __DCSR_NOT_DEFINED_BY_CONFIG
274 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
276 * Enable a SERDES bank that was disabled via the RCW
278 * We only call this function for SERDES8 and SERDES-A001 in cases we really
279 * want to enable the bank, whether we actually want to use the lanes or not,
280 * so make sure at least one lane is enabled. We're only enabling this one
281 * lane to satisfy errata requirements that the bank be enabled.
283 * We use a local variable instead of srds_lpd_b[] because we want drivers to
284 * think that the lanes actually are disabled.
286 static void enable_bank(ccsr_gur_t *gur, int bank)
289 u32 temp_lpd_b = srds_lpd_b[bank];
292 * If we're asked to disable all lanes, just pretend we're doing
295 if (temp_lpd_b == 0xF)
299 * Enable the lanes SRDS_LPD_Bn. The RCW bits are read-only in
300 * CCSR, and read/write in DSCR.
302 rcw5 = in_be32(gur->rcwsr + 5);
303 if (bank == FSL_SRDS_BANK_2) {
304 rcw5 &= ~FSL_CORENET_RCWSRn_SRDS_LPD_B2;
305 rcw5 |= temp_lpd_b << 26;
306 } else if (bank == FSL_SRDS_BANK_3) {
307 rcw5 &= ~FSL_CORENET_RCWSRn_SRDS_LPD_B3;
308 rcw5 |= temp_lpd_b << 18;
310 printf("SERDES: enable_bank: bad bank %d\n", bank + 1);
314 /* See similar code in cpu/mpc85xx/cpu_init.c for an explanation
315 * of the DCSR mapping.
318 #ifdef __DCSR_NOT_DEFINED_BY_CONFIG
319 struct law_entry law = find_law(CONFIG_SYS_DCSRBAR_PHYS);
322 law_index = set_next_law(CONFIG_SYS_DCSRBAR_PHYS,
323 LAW_SIZE_1M, LAW_TRGT_IF_DCSR);
325 set_law(law.index, CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_1M,
328 u32 *p = (void *)CONFIG_SYS_DCSRBAR + 0x20114;
330 #ifdef __DCSR_NOT_DEFINED_BY_CONFIG
332 disable_law(law_index);
334 set_law(law.index, law.addr, law.size, law.trgt_id);
340 * To avoid problems with clock jitter, rev 2 p4080 uses the pll from
341 * bank 3 to clock banks 2 and 3, as well as a limited selection of
342 * protocol configurations. This requires that banks 2 and 3's lanes be
343 * disabled in the RCW, and enabled with some fixup here to re-enable
344 * them, and to configure bank 2's clock parameters in bank 3's pll in
345 * cases where they differ.
347 static void p4080_erratum_serdes8(serdes_corenet_t *regs, ccsr_gur_t *gur,
348 u32 devdisr, u32 devdisr2, int cfg)
354 * The disabled lanes of bank 2 will cause the associated
355 * logic blocks to be disabled in DEVDISR. We reverse that here.
357 * Note that normally it is not permitted to clear DEVDISR bits
358 * once the device has been disabled, but the hardware people
359 * say that this special case is OK.
361 clrbits_be32(&gur->devdisr, devdisr);
362 clrbits_be32(&gur->devdisr2, devdisr2);
365 * Some protocols require special handling. There are a few
366 * additional protocol configurations that can be used, which are
367 * not listed here. See app note 4065 for supported protocol
373 * Bank 2 has PCIe which wants BWSEL -- tell bank 3's PLL.
374 * SGMII on bank 3 should still be usable.
376 setbits_be32(®s->bank[FSL_SRDS_BANK_3].pllcr1,
377 SRDS_PLLCR1_PLL_BWSEL);
383 * Banks 2 (XAUI) and 3 (SGMII) have different clocking
384 * requirements in these configurations. Bank 3 cannot
385 * be used and should have its lanes (but not the bank
386 * itself) disabled in the RCW. We set up bank 3's pll
387 * for bank 2's needs here.
389 srds_ratio_b2 = (in_be32(&gur->rcwsr[4]) >> 13) & 7;
391 /* Determine refclock from XAUI ratio */
392 switch (srds_ratio_b2) {
394 rfck_sel = SRDS_PLLCR0_RFCK_SEL_156_25;
397 rfck_sel = SRDS_PLLCR0_RFCK_SEL_125;
400 printf("SERDES: bad SRDS_RATIO_B2 %d\n",
405 clrsetbits_be32(®s->bank[FSL_SRDS_BANK_3].pllcr0,
406 SRDS_PLLCR0_RFCK_SEL_MASK, rfck_sel);
408 clrsetbits_be32(®s->bank[FSL_SRDS_BANK_3].pllcr0,
409 SRDS_PLLCR0_FRATE_SEL_MASK,
410 SRDS_PLLCR0_FRATE_SEL_6_25);
414 enable_bank(gur, FSL_SRDS_BANK_3);
418 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A005
420 * If PCIe is not selected as a protocol for any lanes driven by a given PLL,
421 * that PLL should have SRDSBnPLLCR1[PLLBW_SEL] = 0.
423 static void p4080_erratum_serdes_a005(serdes_corenet_t *regs, unsigned int cfg)
425 enum srds_prtcl device;
431 * If SRDS_PRTCL = 0x13 or 0x16, set SRDSB1PLLCR1[PLLBW_SEL]
434 clrbits_be32(®s->bank[FSL_SRDS_BANK_1].pllcr1,
435 SRDS_PLLCR1_PLL_BWSEL);
439 * If SRDS_PRTCL = 0x19, set SRDSB1PLLCR1[PLLBW_SEL] to 0 and
440 * SRDSB3PLLCR1[PLLBW_SEL] to 1.
442 clrbits_be32(®s->bank[FSL_SRDS_BANK_1].pllcr1,
443 SRDS_PLLCR1_PLL_BWSEL);
444 setbits_be32(®s->bank[FSL_SRDS_BANK_3].pllcr1,
445 SRDS_PLLCR1_PLL_BWSEL);
450 * Set SRDSBnPLLCR1[PLLBW_SEL] to 0 for each bank that selects XAUI
451 * before XAUI is initialized.
453 for (device = XAUI_FM1; device <= XAUI_FM2; device++) {
454 if (is_serdes_configured(device)) {
455 int bank = serdes_get_bank_by_device(cfg, device);
457 clrbits_be32(®s->bank[bank].pllcr1,
458 SRDS_PLLCR1_PLL_BWSEL);
465 * Wait for the RSTDONE bit to get set, or a one-second timeout.
467 static void wait_for_rstdone(unsigned int bank)
469 serdes_corenet_t *srds_regs =
470 (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
471 unsigned long long end_tick;
474 /* wait for reset complete or 1-second timeout */
475 end_tick = usec2ticks(1000000) + get_ticks();
477 rstctl = in_be32(&srds_regs->bank[bank].rstctl);
478 if (rstctl & SRDS_RSTCTL_RSTDONE)
480 } while (end_tick > get_ticks());
482 if (!(rstctl & SRDS_RSTCTL_RSTDONE))
483 printf("SERDES: timeout resetting bank %u\n", bank + 1);
487 void __soc_serdes_init(void)
489 /* Allow for SoC-specific initialization in <SOC>_serdes.c */
491 void soc_serdes_init(void) __attribute__((weak, alias("__soc_serdes_init")));
493 void fsl_serdes_init(void)
495 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
497 serdes_corenet_t *srds_regs;
499 int have_bank[SRDS_MAX_BANK] = {};
500 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
501 u32 serdes8_devdisr = 0;
502 u32 serdes8_devdisr2 = 0;
503 char srds_lpd_opt[16];
504 const char *srds_lpd_arg;
507 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
508 int need_serdes_a001; /* TRUE == need work-around for SERDES A001 */
510 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
511 char buffer[HWCONFIG_BUFFER_SIZE];
515 * Extract hwconfig from environment since we have not properly setup
516 * the environment but need it for ddr config params
518 if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
522 /* Is serdes enabled at all? */
523 if (!(in_be32(&gur->rcwsr[5]) & FSL_CORENET_RCWSR5_SRDS_EN))
526 srds_regs = (void *)(CONFIG_SYS_FSL_CORENET_SERDES_ADDR);
527 cfg = (in_be32(&gur->rcwsr[4]) & FSL_CORENET_RCWSR4_SRDS_PRTCL) >> 26;
528 debug("Using SERDES configuration 0x%x, lane settings:\n", cfg);
530 if (!is_serdes_prtcl_valid(cfg)) {
531 printf("SERDES[PRTCL] = 0x%x is not valid\n", cfg);
535 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
537 * Display a warning if banks two and three are not disabled in the RCW,
538 * since our work-around for SERDES8 depends on these banks being
539 * disabled at power-on.
541 #define B2_B3 (FSL_CORENET_RCWSRn_SRDS_LPD_B2 | FSL_CORENET_RCWSRn_SRDS_LPD_B3)
542 if ((in_be32(&gur->rcwsr[5]) & B2_B3) != B2_B3) {
543 printf("Warning: SERDES8 requires banks two and "
544 "three to be disabled in the RCW\n");
548 * Store the values of the fsl_srds_lpd_b2 and fsl_srds_lpd_b3
549 * hwconfig options into the srds_lpd_b[] array. See README.p4080ds
550 * for a description of these options.
552 for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) {
553 sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1);
555 hwconfig_subarg_f("serdes", srds_lpd_opt, &arglen, buf);
558 simple_strtoul(srds_lpd_arg, NULL, 0) & 0xf;
561 if ((cfg == 0xf) || (cfg == 0x10)) {
563 * For SERDES protocols 0xF and 0x10, force bank 3 to be
564 * disabled, because it is not supported.
566 srds_lpd_b[FSL_SRDS_BANK_3] = 0xF;
570 /* Look for banks with all lanes disabled, and power down the bank. */
571 for (lane = 0; lane < SRDS_MAX_LANES; lane++) {
572 enum srds_prtcl lane_prtcl = serdes_get_prtcl(cfg, lane);
573 if (serdes_lane_enabled(lane)) {
574 have_bank[serdes_get_bank_by_lane(lane)] = 1;
575 serdes_prtcl_map |= (1 << lane_prtcl);
581 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
583 * Bank two uses the clock from bank three, so if bank two is enabled,
584 * then bank three must also be enabled.
586 if (have_bank[FSL_SRDS_BANK_2])
587 have_bank[FSL_SRDS_BANK_3] = 1;
590 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
592 * The work-aroud for erratum SERDES-A001 is needed only if bank two
593 * is disabled and bank three is enabled. The converse is also true,
594 * but SERDES8 ensures that bank 3 is always enabled if bank 2 is
595 * enabled, so there's no point in complicating the code to handle
599 !have_bank[FSL_SRDS_BANK_2] && have_bank[FSL_SRDS_BANK_3];
602 /* Power down the banks we're not interested in */
603 for (bank = 0; bank < SRDS_MAX_BANK; bank++) {
604 if (!have_bank[bank]) {
605 printf("SERDES: bank %d disabled\n", bank + 1);
606 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
608 * Erratum SERDES-A001 says bank two needs to be powered
609 * down after bank three is powered up, so don't power
610 * down bank two here.
612 if (!need_serdes_a001 || (bank != FSL_SRDS_BANK_2))
613 setbits_be32(&srds_regs->bank[bank].rstctl,
616 setbits_be32(&srds_regs->bank[bank].rstctl,
622 #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES8) || defined (CONFIG_SYS_P4080_ERRATUM_SERDES9)
623 for (lane = 0; lane < SRDS_MAX_LANES; lane++) {
624 enum srds_prtcl lane_prtcl;
626 idx = serdes_get_lane_idx(lane);
627 lane_prtcl = serdes_get_prtcl(cfg, lane);
644 printf("%s ", serdes_prtcl_str[lane_prtcl]);
647 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
649 * Set BnTTLCRy0[FLT_SEL] = 000011 and set BnTTLCRy0[17] = 1 for
650 * each of the SerDes lanes selected as SGMII, XAUI, SRIO, or
651 * AURORA before the device is initialized.
653 switch (lane_prtcl) {
654 case SGMII_FM1_DTSEC1:
655 case SGMII_FM1_DTSEC2:
656 case SGMII_FM1_DTSEC3:
657 case SGMII_FM1_DTSEC4:
658 case SGMII_FM2_DTSEC1:
659 case SGMII_FM2_DTSEC2:
660 case SGMII_FM2_DTSEC3:
661 case SGMII_FM2_DTSEC4:
662 case SGMII_FM2_DTSEC5:
668 clrsetbits_be32(&srds_regs->lane[idx].ttlcr0,
669 SRDS_TTLCR0_FLT_SEL_MASK,
670 SRDS_TTLCR0_FLT_SEL_750PPM |
677 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
678 switch (lane_prtcl) {
682 serdes8_devdisr |= FSL_CORENET_DEVDISR_PCIE1 >>
683 (lane_prtcl - PCIE1);
687 serdes8_devdisr |= FSL_CORENET_DEVDISR_SRIO1 >>
688 (lane_prtcl - SRIO1);
690 case SGMII_FM1_DTSEC1:
691 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1 |
692 FSL_CORENET_DEVDISR2_DTSEC1_1;
694 case SGMII_FM1_DTSEC2:
695 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1 |
696 FSL_CORENET_DEVDISR2_DTSEC1_2;
698 case SGMII_FM1_DTSEC3:
699 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1 |
700 FSL_CORENET_DEVDISR2_DTSEC1_3;
702 case SGMII_FM1_DTSEC4:
703 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1 |
704 FSL_CORENET_DEVDISR2_DTSEC1_4;
706 case SGMII_FM2_DTSEC1:
707 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2 |
708 FSL_CORENET_DEVDISR2_DTSEC2_1;
710 case SGMII_FM2_DTSEC2:
711 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2 |
712 FSL_CORENET_DEVDISR2_DTSEC2_2;
714 case SGMII_FM2_DTSEC3:
715 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2 |
716 FSL_CORENET_DEVDISR2_DTSEC2_3;
718 case SGMII_FM2_DTSEC4:
719 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2 |
720 FSL_CORENET_DEVDISR2_DTSEC2_4;
722 case SGMII_FM2_DTSEC5:
723 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2 |
724 FSL_CORENET_DEVDISR2_DTSEC2_5;
727 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM1 |
728 FSL_CORENET_DEVDISR2_10GEC1;
731 serdes8_devdisr2 |= FSL_CORENET_DEVDISR2_FM2 |
732 FSL_CORENET_DEVDISR2_10GEC2;
748 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A005
749 p4080_erratum_serdes_a005(srds_regs, cfg);
752 for (idx = 0; idx < SRDS_MAX_BANK; idx++) {
755 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
757 * Change bank init order to 0, 2, 1, so that the third bank's
758 * PLL is established before we start the second bank. The
759 * second bank uses the third bank's PLL.
763 bank = FSL_SRDS_BANK_3;
765 bank = FSL_SRDS_BANK_2;
768 /* Skip disabled banks */
769 if (!have_bank[bank])
772 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
775 * Re-enable devices on banks two and three that were
776 * disabled by the RCW, and then enable bank three. The
777 * devices need to be enabled before either bank is
780 p4080_erratum_serdes8(srds_regs, gur, serdes8_devdisr,
781 serdes8_devdisr2, cfg);
782 } else if (idx == 2) {
783 /* Enable bank two now that bank three is enabled. */
784 enable_bank(gur, FSL_SRDS_BANK_2);
788 wait_for_rstdone(bank);
791 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
792 if (need_serdes_a001) {
793 /* Bank 3 has been enabled, so now we can disable bank 2 */
794 setbits_be32(&srds_regs->bank[FSL_SRDS_BANK_2].rstctl,