From patchwork Tue Aug 7 14:34:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Molton X-Patchwork-Id: 1285991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 2C6873FC23 for ; Tue, 7 Aug 2012 14:39:01 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Syksz-0006Sf-AJ; Tue, 07 Aug 2012 14:35:53 +0000 Received: from ducie-dc1.codethink.co.uk ([37.128.190.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SyksG-0006DU-S8 for linux-arm-kernel@lists.infradead.org; Tue, 07 Aug 2012 14:35:13 +0000 Received: from snark.dyn.ducie.codethink.co.uk (snark.dyn.ducie.codethink.co.uk [192.168.24.147]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPA id 97C73460B5F; Tue, 7 Aug 2012 15:35:06 +0100 (BST) From: Ian Molton To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 4/7] kirkwood: Add fixups for DT based mv643xx ethernet. Date: Tue, 7 Aug 2012 15:34:49 +0100 Message-Id: <1344350092-24050-5-git-send-email-ian.molton@codethink.co.uk> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344350092-24050-1-git-send-email-ian.molton@codethink.co.uk> References: <1344350092-24050-1-git-send-email-ian.molton@codethink.co.uk> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: thomas.petazzoni@free-electrons.com, andrew@lunn.ch, ben.dooks@codethink.co.uk, arnd@arndb.de, netdev@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds auxdata for kirkwood ethernet and an ethernet clock setup helper function allowing the mv643xx clock to be kept enabled after boot so that the MAC address(es) are not lost. Signed-off-by: Ian Molton --- arch/arm/mach-kirkwood/board-dt.c | 7 +++++++ arch/arm/mach-kirkwood/common.c | 22 ++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 3 +++ 3 files changed, 32 insertions(+) diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 7679f7f..aa213b6 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,10 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), + OF_DEV_AUXDATA("marvell,mv643xx", 0xf1072000, "mv643xx_eth_port.0", + NULL), + OF_DEV_AUXDATA("marvell,mv643xx", 0xf1076000, "mv643xx_eth_port.1", + NULL), {}, }; @@ -92,6 +97,8 @@ static void __init kirkwood_dt_init(void) of_platform_populate(NULL, kirkwood_dt_match_table, kirkwood_auxdata_lookup, NULL); + + kirkwood_eth_clock_fixup(); } static const char *kirkwood_dt_board_compat[] = { diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index c4b64ad..57b91cf 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -293,6 +294,27 @@ void __init kirkwood_ehci_init(void) orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB, EHCI_PHY_NA); } +/* Fixup ethernet clocks for DT based kirkwood platforms. + * This is required because if the clock is not kept running, the + * Interface will forget its MAC address. + */ +#ifdef CONFIG_OF +void __init kirkwood_eth_clock_fixup(void) +{ + struct device_node *np; + + np = of_find_node_by_name(NULL, "egiga0"); + if (np && of_device_is_available(np)) + clk_prepare_enable(ge0); + of_node_put(np); + + np = of_find_node_by_name(NULL, "egiga1"); + if (np && of_device_is_available(np)) + clk_prepare_enable(ge1); + of_node_put(np); + +} +#endif /***************************************************************************** * GE00 diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 8aab1ae..7183718 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -36,6 +36,9 @@ void kirkwood_enable_pcie(void); void kirkwood_pcie_id(u32 *dev, u32 *rev); void kirkwood_ehci_init(void); +#ifdef CONFIG_OF +void kirkwood_eth_clock_fixup(void); +#endif void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data); void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data); void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);