From patchwork Fri Sep 21 02:40:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 185546 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 873DF2C0089 for ; Fri, 21 Sep 2012 12:42:55 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEtAJ-0007MI-36; Fri, 21 Sep 2012 02:40:27 +0000 Received: from mail-out.m-online.net ([212.18.0.10]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TEtAD-0007Lq-8j for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2012 02:40:24 +0000 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XNJv454rZz3hhxN; Fri, 21 Sep 2012 04:40:16 +0200 (CEST) X-Auth-Info: 7UaSVkzRTzWySuU72VHxprIlYNwJO/IyfP9f+wd8ZNM= Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3XNJv43zlhzbbfp; Fri, 21 Sep 2012 04:40:16 +0200 (CEST) From: Marek Vasut To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: mx28: Skip OCOTP FEC MAC setup if in DT Date: Fri, 21 Sep 2012 04:40:14 +0200 Message-Id: <1348195214-26633-1-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.18.0.10 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Marek Vasut , Fabio Estevam , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Currently, the kernel unconditionally adds "local-mac-address" and "mac-address" properties under both FEC ethernet DT nodes in case the update_fec_mac_prop() function is called. These properties are loaded with MAC address compiled from vendors OUI and a per-device NIC saved in OCOTP storage. Some more advanced bootloaders do augment the DT passed to the kernel by these properties already. In such case, it is wrong for kernel to override these values. Adjust the FEC MAC address loading so that in case the DT properties are already present in the DT passed from the bootloader, skip the loading from OCOTP altogether. If the DT properties are not present, load them from OCOTP. Note that the later case will lead to zeroed out MAC address if OCOTP is not programmed. This will lead to FEC not working at all. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Shawn Guo --- arch/arm/mach-mxs/mach-mxs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 71d47f5..3f29a52 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -175,6 +175,10 @@ static void __init update_fec_mac_prop(enum mac_oui oui) np = of_find_compatible_node(from, NULL, "fsl,imx28-fec"); if (!np) return; + + if (of_get_property(np, "local-mac-address", NULL)) + continue; + from = np; newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);