From patchwork Fri Jan 3 10:10:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3430831 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 34DD09F295 for ; Fri, 3 Jan 2014 10:12:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E1F4200D6 for ; Fri, 3 Jan 2014 10:12:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29283200CC for ; Fri, 3 Jan 2014 10:12:20 +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 1Vz1jN-00070n-Gz; Fri, 03 Jan 2014 10:11:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vz1jG-0003Bx-Pe; Fri, 03 Jan 2014 10:11:46 +0000 Received: from mail-ee0-f41.google.com ([74.125.83.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vz1j7-00039Z-5W for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2014 10:11:38 +0000 Received: by mail-ee0-f41.google.com with SMTP id t10so6708769eei.0 for ; Fri, 03 Jan 2014 02:11:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=RhsNJqc+NiCs6a2mCwchBaQDUMNia0bfUH8TO0aODRw=; b=DU3EsAzGgaeXzl24jeSbZB9NzDb712qNx8CyxK057elOL+QU1++D+92mKWQvcZ61Uj Tx0VTg5f27qcDaU1uLe1VMN/4z6iCjJEb7hRiDhYG+Dgr9u2I45UDs75/Rf4clODkkQl cDb4voKUXdiHSSQ3/q7ldfZGJ2NNumZFgJi+FbdmX1jqtcST2mQUS0xwX5NYE5Ix/dzr yMzWNQSUM8Q06hF6La9oALFQc7yZKHCHRZU8KfTTTYFLvF0bZR+DeDffWI8rzLA1Wg4a 5HZ6182f12J+1PzDAdLoaaHMtsnWJvW1Kr3rPmx6tZQQNWDKWkWzl1Wh8L6ymLPp5GOq xwjA== X-Gm-Message-State: ALoCoQkUjjovUmEt2pI5Il5dvXQIK4pJKbFR5eae+ht8il2K5kIO4++VfAnyPVILboh5J8/ovRS2 X-Received: by 10.14.4.67 with SMTP id 43mr1439144eei.70.1388743875464; Fri, 03 Jan 2014 02:11:15 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id n1sm143594219eep.20.2014.01.03.02.11.13 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 03 Jan 2014 02:11:14 -0800 (PST) From: Michal Simek To: Michal Simek , u-boot@lists.denx.de, Joe Hershberger , linux-arm-kernel@lists.infradead.org, Albert Aribaud , Tom Rini Subject: [PATCH v1 01/24] net: emaclite: Fix OF initialization Date: Fri, 3 Jan 2014 11:10:46 +0100 Message-Id: X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140103_051137_375681_9FF31E97 X-CRM114-Status: GOOD ( 14.38 ) X-Spam-Score: -1.9 (-) 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=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=unavailable 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 - Add xilinx_emaclite_of_init to netdev.h - Remove global data pointer from the driver - Add better handling for error state. Signed-off-by: Michal Simek --- Changes in v1: None drivers/net/xilinx_emaclite.c | 15 ++++++++------- include/netdev.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) -- 1.8.2.3 diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 0a5209d..a607098 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -14,8 +14,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - #undef DEBUG #define ENET_ADDR_LENGTH 6 @@ -364,24 +362,27 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, } #ifdef CONFIG_OF_CONTROL -int xilinx_emaclite_init(bd_t *bis) +int xilinx_emaclite_of_init(const void *blob) { int offset = 0; u32 ret = 0; u32 reg; do { - offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset, + offset = fdt_node_offset_by_compatible(blob, offset, "xlnx,xps-ethernetlite-1.00.a"); if (offset != -1) { - reg = fdtdec_get_addr(gd->fdt_blob, offset, "reg"); + reg = fdtdec_get_addr(blob, offset, "reg"); if (reg != FDT_ADDR_T_NONE) { - u32 rxpp = fdtdec_get_int(gd->fdt_blob, offset, + u32 rxpp = fdtdec_get_int(blob, offset, "xlnx,rx-ping-pong", 0); - u32 txpp = fdtdec_get_int(gd->fdt_blob, offset, + u32 txpp = fdtdec_get_int(blob, offset, "xlnx,tx-ping-pong", 0); ret |= xilinx_emaclite_initialize(bis, reg, txpp, rxpp); + } else { + debug("EMACLITE: Can't get base address\n"); + return -1; } } } while (offset != -1); diff --git a/include/netdev.h b/include/netdev.h index 47fa80d..25d1e46 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -86,6 +86,7 @@ int uli526x_initialize(bd_t *bis); int armada100_fec_register(unsigned long base_addr); int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, unsigned long dma_addr); +int xilinx_emaclite_of_init(const void *blob); int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, int txpp, int rxpp); int xilinx_ll_temac_eth_init(bd_t *bis, unsigned long base_addr, int flags,