From patchwork Mon Jan 14 14:17:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1024607 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43dbX702Mkz9s4s for ; Tue, 15 Jan 2019 01:32:06 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9E2C4C21F93; Mon, 14 Jan 2019 14:24:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3179AC21F3A; Mon, 14 Jan 2019 14:24:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6FC98C21F24; Mon, 14 Jan 2019 14:19:22 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id BE0ADC21F5B for ; Mon, 14 Jan 2019 14:19:18 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 43dbFL45rpz1qwfM; Mon, 14 Jan 2019 15:19:18 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 43dbFL3P0Bz1qsmp; Mon, 14 Jan 2019 15:19:18 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id vZmQzXbgj9Ll; Mon, 14 Jan 2019 15:19:15 +0100 (CET) X-Auth-Info: aGPGADykF1aapPo7klmZ+Qf/v4Jd1YAPj31tuEhyJc0= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 14 Jan 2019 15:19:15 +0100 (CET) From: Lukasz Majewski To: Stefano Babic , u-boot@lists.denx.de, Fabio Estevam , Fabio Estevam , Stefan Agner Date: Mon, 14 Jan 2019 15:17:40 +0100 Message-Id: <20190114141740.20429-22-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190114141740.20429-1-lukma@denx.de> References: <20190114141740.20429-1-lukma@denx.de> Cc: "Albert ARIBAUD \(3ADEV\)" Subject: [U-Boot] [PATCH v1 21/21] pcm052: bk4: Add board_phy_config() for BK4 to setup ksz8081 phy X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" BK4 requires setup of 50MHz reference clock for its KSZ8081 PHY devices. Signed-off-by: Lukasz Majewski --- board/phytec/pcm052/pcm052.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c index 1e443a5850..c30df5df9d 100644 --- a/board/phytec/pcm052/pcm052.c +++ b/board/phytec/pcm052/pcm052.c @@ -15,6 +15,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -382,6 +383,21 @@ int board_late_init(void) return 0; } + +/** + * KSZ8081 + */ +#define MII_KSZ8081_REFERENCE_CLOCK_SELECT 0x1f +#define RMII_50MHz_CLOCK 0x8180 + +int board_phy_config(struct phy_device *phydev) +{ + /* Set 50 MHz reference clock */ + phy_write(phydev, MDIO_DEVAD_NONE, MII_KSZ8081_REFERENCE_CLOCK_SELECT, + RMII_50MHz_CLOCK); + + return genphy_config(phydev); +} #endif /* CONFIG_TARGET_BK4R1 */ int checkboard(void)