From patchwork Fri Sep 9 09:51:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Schneider, Kolja" X-Patchwork-Id: 114038 X-Patchwork-Delegate: dzu@denx.de 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 6977AB6FA5 for ; Fri, 9 Sep 2011 19:52:11 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0102C2823D; Fri, 9 Sep 2011 11:52:09 +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 gzJolsxoauEi; Fri, 9 Sep 2011 11:52:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EAE5828220; Fri, 9 Sep 2011 11:52:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 93FC428220 for ; Fri, 9 Sep 2011 11:52:04 +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 vW63GO46ia-l for ; Fri, 9 Sep 2011 11:52:03 +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 mail194.messagelabs.com (mail194.messagelabs.com [85.158.140.211]) by theia.denx.de (Postfix) with ESMTPS id 5297228218 for ; Fri, 9 Sep 2011 11:52:01 +0200 (CEST) X-Env-Sender: Kolja.Schneider@men.de X-Msg-Ref: server-10.tower-194.messagelabs.com!1315561902!48041584!1 X-Originating-IP: [83.171.138.125] X-StarScan-Version: 6.3.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27205 invoked from network); 9 Sep 2011 09:51:42 -0000 Received: from unknown (HELO keys.men.de) (83.171.138.125) by server-10.tower-194.messagelabs.com with AES128-SHA encrypted SMTP; 9 Sep 2011 09:51:42 -0000 Received: from men-exch1.intra.men.de ([192.168.1.1]) by keys.men.de (PGP Universal service); Fri, 09 Sep 2011 11:52:00 +0200 X-PGP-Universal: processed; by keys.men.de on Fri, 09 Sep 2011 11:52:00 +0200 Received: from MEN-EX1.intra.men.de ([192.168.1.2]) by men-exch1.intra.men.de with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 Sep 2011 11:51:59 +0200 Received: from MEN-EX2.intra.men.de ([fe80::cd66:369a:26d7:be00]) by MEN-EX1.intra.men.de ([fe80::116c:94db:44e4:2cfa%13]) with mapi id 14.01.0289.001; Fri, 9 Sep 2011 11:51:59 +0200 From: "Schneider, Kolja" To: "u-boot@lists.denx.de" Thread-Topic: MPC512x FEC/MII Thread-Index: Acxu1fgEYDKNvCFaTNykx8/uztZeIw== Date: Fri, 9 Sep 2011 09:51:58 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.3.72] MIME-Version: 1.0 X-OriginalArrivalTime: 09 Sep 2011 09:51:59.0653 (UTC) FILETIME=[1E40ED50:01CC6ED6] Subject: [U-Boot] MPC512x FEC/MII 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hi all, I have recently updated the U-Boot on one of our MPC512x-based boards from 2009.11 (+some patches) to a current u-boot build and noticed that the git commit 525856d59910c72687ab6201f39cdf1c04cfc15 apparenty broke the mii commands (see below) on this board. The patch moved PHY initialization from probe into init routine. The mii read commands return zero values regardless of previous FEC usage. Has anyone else come across similar behavior? Thanks a lot, Kolja /* with git commit 525856d59910c72687ab6201f39cdf1c04cfc15 */ EM10A=> mii i PHY 0x00: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX PHY 0x01: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX PHY 0x02: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX PHY 0x03: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX /* snip */ /* without git commit 525856d59910c72687ab6201f39cdf1c04cfc15 */ EM10A=> mii i PHY 0x00: OUI = 0x0885, Model = 0x11, Rev = 0x03, 100baseT, FDX PHY 0x01: OUI = 0x0885, Model = 0x11, Rev = 0x03, 100baseT, FDX Kolja Schneider, Software Design MEN Mikro Elektronik GmbH Neuwieder Straße 5-7 90411 Nürnberg, Germany Phone +49-911-99 33 5-251 Fax +49-911-99 33 5-910 Kolja.Schneider@men.de www.men.de MEN Mikro Elektronik GmbH - Manfred Schmitz (CTO), Udo Fuchs (CFO) - Handelsregister/Trade Register AG Nürnberg HRB 5540 Please consider the environment before printing this e-mail === modified file 'drivers/net/mpc512x_fec.c' --- drivers/net/mpc512x_fec.c 2010-05-03 21:52:48 +0000 +++ drivers/net/mpc512x_fec.c 2010-05-03 21:52:48 +0000 @@ -160,7 +160,7 @@ } /********************************************************************/ -static void mpc512x_fec_set_hwaddr (mpc512x_fec_priv *fec, char *mac) +static void mpc512x_fec_set_hwaddr (mpc512x_fec_priv *fec, unsigned char *mac) { u8 currByte; /* byte for which to compute the CRC */ int byte; /* loop - counter */ @@ -226,6 +226,12 @@ printf ("mpc512x_fec_init... Begin\n"); #endif + mpc512x_fec_set_hwaddr (fec, dev->enetaddr); + out_be32(&fec->eth->gaddr1, 0x00000000); + out_be32(&fec->eth->gaddr2, 0x00000000); + + mpc512x_fec_init_phy (dev, bis); + /* Set interrupt mask register */ out_be32(&fec->eth->imask, 0x00000000); @@ -611,8 +617,6 @@ volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; mpc512x_fec_priv *fec; struct eth_device *dev; - int i; - char *tmp, *end, env_enetaddr[6]; void * bd; fec = (mpc512x_fec_priv *) malloc (sizeof(*fec)); @@ -663,25 +667,6 @@ */ out_be32(&fec->eth->ievent, 0xffffffff); - /* - * Try to set the mac address now. The fec mac address is - * a garbage after reset. When not using fec for booting - * the Linux fec driver will try to work with this garbage. - */ - tmp = getenv ("ethaddr"); - if (tmp) { - for (i=0; i<6; i++) { - env_enetaddr[i] = tmp ? simple_strtoul (tmp, &end, 16) : 0; - if (tmp) - tmp = (*end) ? end+1 : end; - } - mpc512x_fec_set_hwaddr (fec, env_enetaddr); - out_be32(&fec->eth->gaddr1, 0x00000000); - out_be32(&fec->eth->gaddr2, 0x00000000); - } - - mpc512x_fec_init_phy (dev, bis); - return 1; }