From patchwork Tue Oct 23 02:40:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 193313 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 354082C0176 for ; Tue, 23 Oct 2012 13:41:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61ADE4A28D; Tue, 23 Oct 2012 04:41: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 nN5hkFzKQraR; Tue, 23 Oct 2012 04:41:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 745D74A225; Tue, 23 Oct 2012 04:41:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C6FA24A235 for ; Tue, 23 Oct 2012 04:40:59 +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 tdC47Y-y3bvP for ; Tue, 23 Oct 2012 04:40:56 +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-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by theia.denx.de (Postfix) with ESMTPS id 6449B4A21C for ; Tue, 23 Oct 2012 04:40:54 +0200 (CEST) Received: by mail-pa0-f44.google.com with SMTP id fb11so2233563pad.3 for ; Mon, 22 Oct 2012 19:40:52 -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=rRwiPaLhr7kPyMkerpQ+Jk9AQmGUTEYDbAVKfelD/RA=; b=jxcTDwhS61uUtg+uxov7+JxlLA7Q0b8CUpOfPYe0dOUPj8KQvSFqQRiHb9HLcNjlRR /gSBxgu4WFbES9FP6sxMnGpAtSmxWtVyqdlfg97q12drP0gBmNZjbOJtrdBtosOd7SxE 7W4U+j1ocLM5y7dfGYGMlcXm1ZeahANh+qDF6ovN3sy0Fas5JuuWeuORrkRTzburVE4L qTm3RKGfoLPw9LCI+juw1VihEwl7l5FSrGFFJkZ+BVDGpMjnLj70GD2Bj+yvbA/azRE5 UMz8EvazHgAT3LiH1Z90PK8f4+PH5woXfpBO15URDi+LEpaLFXSPg5fqlQeS0mcbfrtp Aaaw== Received: by 10.66.89.138 with SMTP id bo10mr31305684pab.0.1350960052600; Mon, 22 Oct 2012 19:40:52 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPS id k4sm6875747pax.7.2012.10.22.19.40.49 (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 1TQUQi-00066N-Vg; 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:41 -0700 Message-Id: <1350960047-23404-4-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: ALoCoQmhBmiu2YZpSerY2v+KaVnG8XVREH8dc6pd0ihmFOVUZn2d00xmM56CuUHKZkJVAKBv0CWZ Cc: afleming@gmail.com Subject: [U-Boot] [PATCH V3 3/9] net: fec_mxc: change fec_mii_setspeed parameter 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 Only the hardware ethernet registers are needed for this function, so don't pass the more general structure. I'm trying to separate MII and fec. This also fixes MX28 fec_mii_setspeed use on secondary ethernet port This was found by inspection of the code and should be checked on real hardware. Signed-off-by: Troy Kisky --- drivers/net/fec_mxc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 6596ceb..eb89e57 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -135,15 +135,15 @@ static int fec_mdio_read(struct ethernet_regs *eth, uint8_t phyAddr, return val; } -static void fec_mii_setspeed(struct fec_priv *fec) +static void fec_mii_setspeed(struct ethernet_regs *eth) { /* * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock * and do not drop the Preamble. */ writel((((imx_get_fecclk() / 1000000) + 2) / 5) << 1, - &fec->eth->mii_speed); - debug("%s: mii_speed %08x\n", __func__, readl(&fec->eth->mii_speed)); + ð->mii_speed); + debug("%s: mii_speed %08x\n", __func__, readl(ð->mii_speed)); } static int fec_mdio_write(struct ethernet_regs *eth, uint8_t phyAddr, @@ -611,7 +611,7 @@ static int fec_init(struct eth_device *dev, bd_t* bd) fec_reg_setup(fec); if (fec->xcv_type != SEVENWIRE) - fec_mii_setspeed(fec); + fec_mii_setspeed(fec->bus->priv); /* * Set Opcode/Pause Duration Register @@ -966,7 +966,6 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) } fec_reg_setup(fec); - fec_mii_setspeed(fec); if (dev_id == -1) { sprintf(edev->name, "FEC"); @@ -995,6 +994,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) #else bus->priv = fec->eth; #endif + fec_mii_setspeed(bus->priv); ret = mdio_register(bus); if (ret) { printf("mdio_register failed\n");