From patchwork Thu Sep 18 21:46:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 390983 X-Patchwork-Delegate: andreas.biessmann@googlemail.com 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 670A7140088 for ; Fri, 19 Sep 2014 07:47:39 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A1183A7475; Thu, 18 Sep 2014 23:47:31 +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 NC1aJEQhuFAY; Thu, 18 Sep 2014 23:47:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE48DA7476; Thu, 18 Sep 2014 23:47:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A5BFAA744D for ; Thu, 18 Sep 2014 23:47:21 +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 KkRhcUWJP+Ax for ; Thu, 18 Sep 2014 23:47:18 +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-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by theia.denx.de (Postfix) with ESMTPS id 1FA22A745F for ; Thu, 18 Sep 2014 23:47:13 +0200 (CEST) Received: by mail-we0-f180.google.com with SMTP id q59so1596977wes.39 for ; Thu, 18 Sep 2014 14:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=NUob9yQELErXqt/j3fCFgWAzd+pyN5Z5VdCLhyzXX3s=; b=eOd0Ib3DQNX4DHWf5WDcOdzAeOh9t8OmS15MNxQUGTxVF4snloWdxTr/I1OlntNNTs PzFIFzIzeRm3Vmx5UVKkc7tRFDmluYPx2gpt2GiUt4DZYQDY8qQIIrE7GH+NyEVNRCz3 2q7/FCpBRsoE6w/IgbZ7SMw8TnA7S9JpzjuH6ITDxt6GSbGHZnKOlK0TBAygj74jYRqC db9pLZ6eJYhzz5lOve5vDK4xAnv6a7IYd0JGtf2vmRlbC5fc/Z1+dVeCNeMQwiaI70Bp +WZlTbU1tns0ywo5hLSXnnHOJsscdyAw0IamSS9xU0bAKw5jcVtXJfHY7GFIK8rNgSRk WdmQ== X-Received: by 10.180.73.115 with SMTP id k19mr1921516wiv.35.1411076833482; Thu, 18 Sep 2014 14:47:13 -0700 (PDT) Received: from localhost (dockstar.er.biessmann.org. [2a01:198:47b:1::10]) by mx.google.com with ESMTPSA id pk9sm57462wjb.16.2014.09.18.14.47.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Sep 2014 14:47:12 -0700 (PDT) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: u-boot@lists.denx.de Date: Thu, 18 Sep 2014 23:46:49 +0200 Message-Id: <1411076809-10191-3-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1411076809-10191-1-git-send-email-andreas.devel@googlemail.com> References: <1411076809-10191-1-git-send-email-andreas.devel@googlemail.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 2/2] sama5d3xek: run PHY's config 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Andreas Bießmann Cc: Bo Shen --- board/atmel/sama5d3xek/sama5d3xek.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index f53754b..ca4f79d 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -273,15 +274,25 @@ int dram_init(void) int board_phy_config(struct phy_device *phydev) { - /* rx data delay */ - ksz9021_phy_extended_write(phydev, - MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW, 0x2222); - /* tx data delay */ - ksz9021_phy_extended_write(phydev, - MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW, 0x2222); - /* rx/tx clock delay */ - ksz9021_phy_extended_write(phydev, - MII_KSZ9021_EXT_RGMII_CLOCK_SKEW, 0xf2f4); + /* board specific timings for GMAC */ + if (has_gmac()) { + /* rx data delay */ + ksz9021_phy_extended_write(phydev, + MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW, + 0x2222); + /* tx data delay */ + ksz9021_phy_extended_write(phydev, + MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW, + 0x2222); + /* rx/tx clock delay */ + ksz9021_phy_extended_write(phydev, + MII_KSZ9021_EXT_RGMII_CLOCK_SKEW, + 0xf2f4); + } + + /* always run the PHY's config routine */ + if (phydev->drv->config) + return phydev->drv->config(phydev); return 0; }