From patchwork Fri Jun 29 07:37:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 168012 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7E1F9B7023 for ; Fri, 29 Jun 2012 17:39:22 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7410C280AA; Fri, 29 Jun 2012 09:38:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pWyctuUW6+W7; Fri, 29 Jun 2012 09:38:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C7701280CE; Fri, 29 Jun 2012 09:38:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 294E82809E for ; Fri, 29 Jun 2012 09:38:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E1eeh-418Dx2 for ; Fri, 29 Jun 2012 09:38:15 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ey0-f172.google.com (mail-ey0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id 0D4FA280A5 for ; Fri, 29 Jun 2012 09:38:08 +0200 (CEST) Received: by mail-ey0-f172.google.com with SMTP id q13so1276123eaa.3 for ; Fri, 29 Jun 2012 00:38:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=aSiS2TeNhjE0S+S544OWwdHDl2S/Xu3oHnKsiQ/sP24=; b=bjMzPas4zewXuPLJ+sEUHHysiF2qhe5CUqcYABhmvzNfH1oOEb4J4kCITRv2p7YUAZ CGjgMHbGydExpj+n+5FVYT0ETVPkfSlp1KzGVZm9ETffdgHg6qC+o1K+GpgX6Cn+OtQA oPTG4gRGT9OAMqdkjliC9AUfZ6baUXEEtjM3WOVr2dAvH3P03Mn73TAFFG6XdVEDHmp6 pnyVAd2rbPv+UeKSyz94eMm8dGYqVt+57dzZN7HCRUF4uoKJ4xD/MwhsmX/Ag4zTTg9l 4LafCrmV1Mlro0J3i17nCFxtXXfJlaI5Dez36wb/NHzJpGQm3SELynJSE87JdzvymRBO dStA== Received: by 10.216.133.71 with SMTP id p49mr205838wei.107.1340955488324; Fri, 29 Jun 2012 00:38:08 -0700 (PDT) Received: from localhost (11.161.broadband5.iol.cz. [88.100.161.11]) by mx.google.com with ESMTPS id f10sm7008082wiw.1.2012.06.29.00.38.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jun 2012 00:38:07 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Fri, 29 Jun 2012 09:37:57 +0200 Message-Id: <1340955478-22251-4-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1340955478-22251-1-git-send-email-monstr@monstr.eu> References: <1340955478-22251-1-git-send-email-monstr@monstr.eu> X-Gm-Message-State: ALoCoQlTDhpwFjby2DC/69X4++kbFc7dUywGuf9mU6muefhYTjgfKmb2XmSyd9lAT2BPmUqQ3Zzl Subject: [U-Boot] [PATCH 4/5] net: emaclite: Support OF initialization X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Support new CONFIG_OF_CONTROL option where device probing is done based on device tree description. Signed-off-by: Michal Simek CC: Joe Hershberger --- drivers/net/xilinx_emaclite.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index d5bd737..d890d60 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -28,6 +28,9 @@ #include #include #include +#include + +DECLARE_GLOBAL_DATA_PTR; #undef DEBUG @@ -375,3 +378,30 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, return 1; } + +#ifdef CONFIG_OF_CONTROL +int xilinx_emaclite_init(bd_t *bis) +{ + int offset = 0; + u32 ret = 0; + u32 reg; + + do { + offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset, + "xlnx,xps-ethernetlite-1.00.a"); + if (offset != -1) { + reg = fdtdec_get_addr(gd->fdt_blob, offset, "reg"); + if (reg != FDT_ADDR_T_NONE) { + u32 rxpp = fdtdec_get_int(gd->fdt_blob, offset, + "xlnx,rx-ping-pong", 0); + u32 txpp = fdtdec_get_int(gd->fdt_blob, offset, + "xlnx,tx-ping-pong", 0); + ret |= xilinx_emaclite_initialize(bis, reg, + txpp, rxpp); + } + } + } while (offset != -1); + + return ret; +} +#endif