From patchwork Fri Oct 4 10:13:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 2987731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 92E829F245 for ; Fri, 4 Oct 2013 10:14:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5BAB320459 for ; Fri, 4 Oct 2013 10:14:51 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CAB32045A for ; Fri, 4 Oct 2013 10:14:50 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VS2PG-00044O-On; Fri, 04 Oct 2013 10:14:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VS2PE-00078r-CT; Fri, 04 Oct 2013 10:14:44 +0000 Received: from mail-bk0-x22b.google.com ([2a00:1450:4008:c01::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VS2PA-000780-PD for linux-arm-kernel@lists.infradead.org; Fri, 04 Oct 2013 10:14:41 +0000 Received: by mail-bk0-f43.google.com with SMTP id mz13so1418415bkb.2 for ; Fri, 04 Oct 2013 03:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lCaXyjWut7MTEfzXCMq+zXuZ8TEqLnegYnp8XQNRktI=; b=dBHTav+geQ6lRKe3LhuTsQWcpbNLQ+fylf1b9B7R379zgw9cpd1EWDiM8Qmm4a1m1C wMV2Lb9dKfsdYbkTJEjBZ9ASIeAsA1nVn4DQ84uGtB+H/xSapaXk36cjSHgH0Vcdx9qs 0OmkIs+iIJTCTri9nh/+p8PyKqjI5r0AKoIBE6bOsE5MZY796BoBXVXB1h2jDJaadOBl kXaJnFfueJfU2SRnSSjXDaHb7LjjNmUJc+X/RXAEBt+jMpYPb5qVdJiCGWIgW1a4MgUR Sw6plfv2Gy3aVaodKA+t1IY+tCBFtOVW59Gf2Wb3A9e3TymQngFShGorN75gKUMBNJpP zxLQ== X-Received: by 10.205.10.200 with SMTP id pb8mr12405488bkb.16.1380881658703; Fri, 04 Oct 2013 03:14:18 -0700 (PDT) Received: from topkick.lan (dslc-082-083-247-252.pools.arcor-ip.net. [82.83.247.252]) by mx.google.com with ESMTPSA id no2sm7566815bkb.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Oct 2013 03:14:17 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH v3] ARM: kirkwood: remove ethernet clock gate workaround Date: Fri, 4 Oct 2013 12:13:50 +0200 Message-Id: <1380881630-24439-1-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1380826568-18587-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1380826568-18587-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131004_061441_063387_932879C3 X-CRM114-Status: GOOD ( 12.06 ) X-Spam-Score: 1.4 (+) Cc: Andrew Lunn , Russell King , Jason Cooper , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Jason Gunthorpe , Ezequiel Garcia , Grant Likely , Mike Turquette , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With a proper fix for Kirkwood ethernet IP MAC address clock gating issue, we can now remove the clock gating workaround that always enabled ethernet clocks. Signed-off-by: Sebastian Hesselbarth --- Changelog: v2->v3: - make use of new public clk_is_enabled, adds dependency to [1] - add warning about gated clock && missing MAC property (Suggested by Jason Gunthorpe) v1->v2: - check for gated clock before accessing eth registers (Suggested by Andrew Lunn) [1] http://www.spinics.net/lists/arm-kernel/msg277392.html Cc: Jason Cooper Cc: Andrew Lunn Cc: Russell King Cc: Grant Likely Cc: Benjamin Herrenschmidt Cc: Jason Gunthorpe Cc: Ezequiel Garcia Cc: Mike Turquette Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-kirkwood/board-dt.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 28e952b..6925de8 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -41,7 +41,6 @@ static void __init kirkwood_legacy_clk_init(void) struct device_node *np = of_find_compatible_node( NULL, NULL, "marvell,kirkwood-gating-clock"); struct of_phandle_args clkspec; - struct clk *clk; clkspec.np = np; clkspec.args_count = 1; @@ -53,19 +52,6 @@ static void __init kirkwood_legacy_clk_init(void) clkspec.args[0] = CGC_BIT_PEX1; orion_clkdev_add("1", "pcie", of_clk_get_from_provider(&clkspec)); - - /* - * The ethernet interfaces forget the MAC address assigned by - * u-boot if the clocks are turned off. Until proper DT support - * is available we always enable them for now. - */ - clkspec.args[0] = CGC_BIT_GE0; - clk = of_clk_get_from_provider(&clkspec); - clk_prepare_enable(clk); - - clkspec.args[0] = CGC_BIT_GE1; - clk = of_clk_get_from_provider(&clkspec); - clk_prepare_enable(clk); } #define MV643XX_ETH_MAC_ADDR_LOW 0x0414