From patchwork Tue Oct 23 02:40:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 193318 X-Patchwork-Delegate: sbabic@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 0B81A2C0168 for ; Tue, 23 Oct 2012 13:42:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D4394A28E; Tue, 23 Oct 2012 04:42: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 uopquyB4Ck7G; Tue, 23 Oct 2012 04:42:09 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE9664A292; Tue, 23 Oct 2012 04:41:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 88A4B4A225 for ; Tue, 23 Oct 2012 04:41:05 +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 POTAl3zptFKA for ; Tue, 23 Oct 2012 04:41:04 +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 mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 786904A22F for ; Tue, 23 Oct 2012 04:40:55 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id ro8so84648pbb.3 for ; Mon, 22 Oct 2012 19:40:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Wfg1eYJ39S7VpzSONLYn9pEWMQQ384W2qhJ/A8htq6k=; b=fHR5zXw/8KHi5jQ2jer1NgaIBKk/E15t9Ayg/m15Oh2F11NhC7fAZsy4vQpGogQYLf XUgZHwe/Le5o9EWCHO/foLiWDs1XZfW5jVtuxhmUhQvcDhHt4BPIM3CpsFms3eWqQ5br Jo1uoz/T29nP3WYaRRoiMeMuShult/iNOloeE5JdO9sDRNbbnuAXAvb/OMIqcB74BF6p nAZTE96zYYbXB98V3bIB3r2LMkp4VV3MRW1VFiGhOskXQylvacNKj0vyIg2oC6yucKqO P9MxHSwVzsN44Tbo9ojZwz60bOUbpjF4gBx6b4muJfgGfM5eAZrKEalLlEffkI8zGMwg S3lA== Received: by 10.68.217.67 with SMTP id ow3mr35912144pbc.26.1350960053579; Mon, 22 Oct 2012 19:40:53 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPS id a10sm6873318paw.17.2012.10.22.19.40.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Oct 2012 19:40:51 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.76) (envelope-from ) id 1TQUQj-00066Z-Jd; Mon, 22 Oct 2012 19:41:21 -0700 From: Troy Kisky To: u-boot@lists.denx.de, Joe Hershberger , sbabic@denx.de, dirk.behme@googlemail.com Date: Mon, 22 Oct 2012 19:40:47 -0700 Message-Id: <1350960047-23404-10-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350960047-23404-1-git-send-email-troy.kisky@boundarydevices.com> References: <1345502918-18305-1-git-send-email-troy.kisky@boundarydevices.com> <1350960047-23404-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQlxXPQBX4DO1gN14bnQCiAAkDxaf2AUnCyUFboJwKwOWfJLEN8BNd0YyxZcBCSzUrSPx/OE Cc: afleming@gmail.com Subject: [U-Boot] [PATCH V3 9/9] mx6qsabrelite: search mii phy address 4-7 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Signed-off-by: Troy Kisky --- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index af6f917..f010d0c 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -338,14 +339,31 @@ int board_phy_config(struct phy_device *phydev) int board_eth_init(bd_t *bis) { + uint32_t base = IMX_FEC_BASE; + struct mii_dev *bus = NULL; + struct phy_device *phydev = NULL; int ret; setup_iomux_enet(); - ret = cpu_eth_init(bis); - if (ret) +#ifdef CONFIG_FEC_MXC + bus = fec_get_miibus(base, -1); + if (!bus) + return 0; + /* scan phy 4,5,6,7 */ + phydev = phy_find_by_mask(bus, (0xf << 4), PHY_INTERFACE_MODE_RGMII); + if (!phydev) { + free(bus); + return 0; + } + printf("using phy at %d\n", phydev->addr); + ret = fec_probe(bis, -1, base, bus, phydev); + if (ret) { printf("FEC MXC: %s:failed\n", __func__); - + free(phydev); + free(bus); + } +#endif return 0; }