From patchwork Thu Mar 31 08:49:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 89045 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 11D95B6F7B for ; Thu, 31 Mar 2011 19:49:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4FC64280F1; Thu, 31 Mar 2011 10:49:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YP7RiXfcCThQ; Thu, 31 Mar 2011 10:49:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2120A28104; Thu, 31 Mar 2011 10:49:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 051C6280E6 for ; Thu, 31 Mar 2011 10:49:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0tfDuXvUNlLj for ; Thu, 31 Mar 2011 10:49:07 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by theia.denx.de (Postfix) with ESMTPS id 067F2280E4 for ; Thu, 31 Mar 2011 10:49:05 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id p2V8n28q027323; Thu, 31 Mar 2011 03:49:02 -0500 From: Kumar Gala To: u-boot@lists.denx.de Date: Thu, 31 Mar 2011 03:49:01 -0500 Message-Id: <1301561341-14495-2-git-send-email-galak@kernel.crashing.org> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1301561341-14495-1-git-send-email-galak@kernel.crashing.org> References: <1301561341-14495-1-git-send-email-galak@kernel.crashing.org> Cc: Timur Tabi Subject: [U-Boot] [PATCH 2/2] p4080ds: remove rev1-specific code for the SERDES8 erratum X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Timur Tabi Remove the SERDES8 erratum work-around code that only applied to P4080 rev1, which is not supported by this version of U-Boot. Signed-off-by: Timur Tabi Signed-off-by: Kumar Gala --- arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c | 106 +++++++++++-------------- 1 files changed, 47 insertions(+), 59 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c index 7fc00d8..f58d6d6 100644 --- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c @@ -109,10 +109,13 @@ int serdes_lane_enabled(int lane) return 0; #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8 - if (!IS_SVR_REV(get_svr(), 1, 0)) - if (bank > 0) - return !(srds_lpd_b[bank] & - (8 >> (lane - (6 + 4 * bank)))); + /* + * For banks two and three, use the srds_lpd_b[] array instead of the + * RCW, because this array contains the real values of SRDS_LPD_B2 and + * SRDS_LPD_B3. + */ + if (bank > 0) + return !(srds_lpd_b[bank] & (8 >> (lane - (6 + 4 * bank)))); #endif return !(in_be32(&gur->rcwsr[word]) & (0x80000000 >> bit)); @@ -303,15 +306,19 @@ void fsl_serdes_init(void) } #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8 - if (!IS_SVR_REV(get_svr(), 1, 0)) - for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) { - sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1); - srds_lpd_arg = hwconfig_subarg_f("serdes", srds_lpd_opt, - &arglen, buf); - if (srds_lpd_arg) - srds_lpd_b[bank] = simple_strtoul(srds_lpd_arg, - NULL, 0); - } + /* + * Store the values of the fsl_srds_lpd_b2 and fsl_srds_lpd_b3 + * hwconfig options into the srds_lpd_b[] array. See README.p4080ds + * for a description of these options. + */ + for (bank = 1; bank < ARRAY_SIZE(srds_lpd_b); bank++) { + sprintf(srds_lpd_opt, "fsl_srds_lpd_b%u", bank + 1); + srds_lpd_arg = + hwconfig_subarg_f("serdes", srds_lpd_opt, &arglen, buf); + if (srds_lpd_arg) + srds_lpd_b[bank] = + simple_strtoul(srds_lpd_arg, NULL, 0) & 0xf; + } #endif /* Look for banks with all lanes disabled, and power down the bank. */ @@ -324,32 +331,12 @@ void fsl_serdes_init(void) } #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8 - if (IS_SVR_REV(get_svr(), 1, 0)) { - /* At least one bank must be disabled due to SERDES8. If - * no bank is found to be disabled based on lane - * disables, disable bank 3 because we can't turn off its - * lanes in the RCW without disabling MDIO due to erratum - * GEN8. - * - * This means that if you are relying on bank 3 being - * disabled to avoid SERDES8, in some cases you cannot - * also disable all lanes of another bank, or else bank - * 3 won't be disabled, leaving you with a configuration - * that isn't valid according to SERDES8 (e.g. if banks - * 2 and 3 have the same clock, and bank 1 is disabled - * instead of 3). - */ - for (bank = 0; bank < SRDS_MAX_BANK; bank++) { - if (!have_bank[bank]) - break; - } - - if (bank == SRDS_MAX_BANK) - have_bank[FSL_SRDS_BANK_3] = 0; - } else { - if (have_bank[FSL_SRDS_BANK_2]) - have_bank[FSL_SRDS_BANK_3] = 1; - } + /* + * Bank two uses the clock from bank three, so if bank two is enabled, + * then bank three must also be enabled. + */ + if (have_bank[FSL_SRDS_BANK_2]) + have_bank[FSL_SRDS_BANK_3] = 1; #endif for (bank = 0; bank < SRDS_MAX_BANK; bank++) { @@ -455,19 +442,16 @@ void fsl_serdes_init(void) bank = idx; #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8 - if (!IS_SVR_REV(get_svr(), 1, 0)) { - /* - * Change bank init order to 0, 2, 1, so that the - * third bank's PLL is established before we - * start the second bank which shares the third - * bank's PLL. - */ + /* + * Change bank init order to 0, 2, 1, so that the third bank's + * PLL is established before we start the second bank. The + * second bank uses the third bank's PLL. + */ - if (idx == 1) - bank = FSL_SRDS_BANK_3; - else if (idx == 2) - bank = FSL_SRDS_BANK_2; - } + if (idx == 1) + bank = FSL_SRDS_BANK_3; + else if (idx == 2) + bank = FSL_SRDS_BANK_2; #endif /* Skip disabled banks */ @@ -475,14 +459,18 @@ void fsl_serdes_init(void) continue; #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8 - if (!IS_SVR_REV(get_svr(), 1, 0)) { - if (idx == 1) { - p4080_erratum_serdes8(srds_regs, gur, - serdes8_devdisr, - serdes8_devdisr2, cfg); - } else if (idx == 2) { - enable_bank(gur, FSL_SRDS_BANK_2); - } + if (idx == 1) { + /* + * Re-enable devices on banks two and three that were + * disabled by the RCW, and then enable bank three. The + * devices need to be enabled before either bank is + * powered up. + */ + p4080_erratum_serdes8(srds_regs, gur, serdes8_devdisr, + serdes8_devdisr2, cfg); + } else if (idx == 2) { + /* Eable bank two now that bank three is enabled. */ + enable_bank(gur, FSL_SRDS_BANK_2); } #endif